/**
 * AGOOD Clinic - Staff Management Style Suite
 * Logic: Sequential horizontal rows (Registration Style)
 * Fix: Table-layout fixed, 2-column Matrix, removed IP styles.
 */

/* --- 1. Table Structural Fix (Prevents Jump) --- */
.agc-directory-table {
    table-layout: fixed !important; 
    width: 100% !important;
    border-collapse: collapse;
}

/* Explicitly set column widths so they never shift */
.agc-directory-table th:nth-child(1), 
.agc-directory-table td:nth-child(1) { width: auto; } 

.agc-directory-table th:nth-child(2), 
.agc-directory-table td:nth-child(2) { width: 180px; } 

.agc-directory-table th:nth-child(3), 
.agc-directory-table td:nth-child(3) { width: 140px; } 

.agc-directory-table th:nth-child(4), 
.agc-directory-table td:nth-child(4) { width: 160px; } /* Slightly narrower for "Manage" */

/* --- 2. Top Level Directory UI --- */

/* Company Name: Normal weight only */
.agc-company-label {
    font-weight: 400 !important; 
    font-size: 1rem;
    color: #1e293b;
}

/* Manage Button: Professional Dashboard Style */
.agc-manage-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.agc-manage-btn:hover {
    background: #ffffff;
    border-color: var(--agc-primary);
    color: var(--agc-primary);
}

.btn-arrow {
    font-size: 0.9rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

/* Highlight button and flip arrow when drawer is open */
.is-expanded .agc-manage-btn {
    background: var(--agc-primary);
    color: #ffffff;
    border-color: var(--agc-primary);
}

.is-expanded .agc-manage-btn .btn-arrow {
    transform: rotate(180deg);
    color: #ffffff;
}

/* --- 3. Sequential Management Drawer --- */

.agc-mgmt-cell {
    padding: 50px !important;
    background: #f8fafc !important; 
    border-bottom: 3px solid #e2e8f0 !important;
    overflow: hidden;
}

.mgmt-sequential-container {
    display: flex;
    flex-direction: column;
    gap: 35px;
    max-width: 100% !important;
    margin: 0 auto;
}

.mgmt-section-block {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.block-header {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #1e293b;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.block-header::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 22px;
    background: var(--agc-primary);
    margin-right: 15px;
    border-radius: 10px;
}

.field-row-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.field-row label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-row input, .field-row select, .field-row textarea {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
}

/* --- 4. Medical Coverage (Fixed 2-Column) --- */

.matrix-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* Strict focus: 2 columns */
    gap: 20px;
}

.matrix-item {
    background: #fcfdfe;
    padding: 18px;
    border: 1.5px solid #f1f5f9;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.m-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
}

.eligibility-flex {
    display: flex;
    flex-direction: row;
    justify-content: space-around; /* Spreads the 3 items evenly across the box */
    align-items: center;
    padding: 25px 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.eligibility-flex label {
    display: flex;
    flex-direction: column; /* This stacks the checkbox ABOVE the text */
    align-items: center;    /* Centers them perfectly */
    gap: 12px;              /* Space between checkbox and text */
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;         /* Slate blue color matching your image */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin: 0 !important;
}

.eligibility-flex input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--agc-primary); /* Ensures checkmark is your brand teal */
}

/* Custom Dropdown Arrow SVG */
.agc-styled-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 14px !important;
    padding-right: 45px !important;
}

/* --- 5. Audit Footer (Cleaned IP styles) --- */

.mgmt-audit-footer {
    background: #1e293b;
    padding: 28px 40px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    color: #fff;
}

.audit-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-width: 0;
}

.audit-row-top {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.audit-row-sig {
    margin-top: 14px;
}

.audit-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.audit-signatory-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.audit-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: #94a3b8;
}

.sig-pill {
    font-size: 0.8rem;
    background: rgba(0, 194, 168, 0.2);
    color: #00c2a8;
    padding: 6px 15px;
    border-radius: 50px;
    font-weight: 700;
}

.agc-save-btn {
    border: none;
    color: #fff;
    padding: 16px 60px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
/* --- PDF Section --- */
.agc-pdf-section .block-header {
    margin-bottom: 16px;
}

.agc-pdf-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.agc-pdf-info p {
    margin: 0 0 6px;
    font-size: 14px;
    color: #475569;
}

.agc-pdf-meta {
    font-size: 12px !important;
    color: #94a3b8 !important;
}

.agc-pdf-actions {
    flex-shrink: 0;
}

.agc-pdf-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: #0056b3;
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.25);
}

.agc-pdf-btn:hover {
    background: #004494;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.agc-pdf-btn:active {
    transform: translateY(0);
}

.agc-pdf-unavailable {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
}