/**
 * FOIA Request Manager Styles
 * 
 * @package FOIA_Request_Manager
 * @since 1.1.0
 */

/* Reset & Base */
.foia-dashboard,
.foia-detail,
.foia-login-form,
.foia-register-form,
#foia-pdf-form {
    font-family: 'Arial', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Focus Styles for ADA Compliance */
.foia-dashboard a:focus,
.foia-dashboard button:focus,
.foia-dashboard input:focus,
.foia-dashboard select:focus,
.foia-dashboard textarea:focus,
.foia-detail a:focus,
.foia-detail button:focus,
.foia-detail input:focus,
.foia-detail select:focus,
.foia-detail textarea:focus,
#foia-pdf-form a:focus,
#foia-pdf-form button:focus,
#foia-pdf-form input:focus,
#foia-pdf-form select:focus,
#foia-pdf-form textarea:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

/* Skip Link */
.foia-skip-link {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.foia-skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    background: #005fcc;
    color: #fff;
    padding: 10px 20px;
    z-index: 100000;
    border-radius: 4px;
    font-weight: bold;
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Messages */
.foia-message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 16px;
}

.foia-message p {
    margin: 0;
}

.foia-message ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.foia-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.foia-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.foia-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.foia-info {
    background-color: #e0f2fe;
    color: #075985;
    border: 1px solid #7dd3fc;
}

/* Status Badges */
.foia-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.foia-status-submitted {
    background-color: #fef3c7;
    color: #92400e;
}

.foia-status-in-progress {
    background-color: #dbeafe;
    color: #1e40af;
}

.foia-status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.foia-status-denied {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Buttons.
   Convention: background AND text color declared together in EVERY
   state (default / visited / hover / focus / active / disabled), each
   pair contrast-verified. LVHA order: :link, :visited, :hover, :active. */
.foia-btn,
.foia-dashboard a.button,
.foia-detail button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #005fcc; /* white on #005fcc: 5.6:1 */
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.foia-btn:link,
.foia-dashboard a.button:link {
    background-color: #005fcc;
    color: #fff;
}

.foia-btn:visited,
.foia-dashboard a.button:visited {
    background-color: #005fcc;
    color: #fff;
}

.foia-btn:hover,
.foia-btn:visited:hover,
.foia-dashboard a.button:hover,
.foia-dashboard a.button:visited:hover,
.foia-detail button:hover {
    background-color: #004499; /* white on #004499: 8.6:1 */
    color: #fff;
}

.foia-btn:focus,
.foia-dashboard a.button:focus,
.foia-detail button:focus {
    background-color: #004499;
    color: #fff;
}

.foia-btn:active,
.foia-dashboard a.button:active,
.foia-detail button:active {
    background-color: #003377; /* white on #003377: 11.4:1 */
    color: #fff;
}

.foia-btn:disabled,
.foia-btn[aria-disabled="true"],
.foia-detail button:disabled {
    background-color: #9ca3af; /* #1f2937 on #9ca3af: 4.6:1 */
    color: #1f2937;
    cursor: not-allowed;
}

.foia-btn-secondary,
.foia-btn-secondary:link,
.foia-btn-secondary:visited {
    background-color: #4b5563; /* white on #4b5563: 7.6:1 */
    color: #fff;
}

.foia-btn-secondary:hover,
.foia-btn-secondary:visited:hover,
.foia-btn-secondary:focus {
    background-color: #374151; /* white on #374151: 10.3:1 */
    color: #fff;
}

.foia-btn-secondary:active {
    background-color: #1f2937; /* white on #1f2937: 14.7:1 */
    color: #fff;
}

.foia-btn-secondary:disabled {
    background-color: #9ca3af;
    color: #1f2937;
}

.foia-btn-danger,
.foia-btn-danger:link,
.foia-btn-danger:visited {
    background-color: #b91c1c; /* white on #b91c1c: 6.3:1 */
    color: #fff;
}

.foia-btn-danger:hover,
.foia-btn-danger:visited:hover,
.foia-btn-danger:focus {
    background-color: #991b1b; /* white on #991b1b: 7.7:1 */
    color: #fff;
}

.foia-btn-danger:active {
    background-color: #7f1d1d; /* white on #7f1d1d: 9.6:1 */
    color: #fff;
}

.foia-btn-danger:disabled {
    background-color: #9ca3af;
    color: #1f2937;
}

/* External link confirmation modal (ADA / municipal requirement:
   all outbound links show a confirmation with the destination URL). */
.foia-extlink-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.foia-extlink-modal {
    background: #fff;
    color: #111827;
    max-width: 480px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden; /* clip children to border-radius */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.foia-extlink-modal h2 {
    margin: 0;
    padding: 16px 24px;
    background: #005fcc;
    color: #fff;
    font-size: 18px;
}

.foia-extlink-body {
    padding: 20px 24px;
}

.foia-extlink-url {
    display: block;
    margin-top: 10px;
    padding: 10px 12px;
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    word-break: break-all;
    font-family: monospace;
    font-size: 13px;
}

.foia-extlink-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* Form Elements */
.foia-dashboard input[type="text"],
.foia-dashboard input[type="email"],
.foia-dashboard input[type="date"],
.foia-dashboard input[type="number"],
.foia-dashboard select,
.foia-dashboard textarea,
.foia-detail input[type="text"],
.foia-detail input[type="email"],
.foia-detail input[type="date"],
.foia-detail input[type="number"],
.foia-detail select,
.foia-detail textarea {
    padding: 10px 12px;
    border: 2px solid #333;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.foia-dashboard input:hover,
.foia-dashboard select:hover,
.foia-dashboard textarea:hover,
.foia-detail input:hover,
.foia-detail select:hover,
.foia-detail textarea:hover {
    border-color: #005fcc;
}

/* Tables */
.foia-dashboard table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.foia-dashboard table th,
.foia-dashboard table td {
    padding: 12px 10px;
    text-align: left;
    border: 1px solid #e5e7eb;
}

.foia-dashboard table th {
    background-color: #1f2937;
    color: #fff;
    font-weight: 600;
}

.foia-dashboard table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.foia-dashboard table tbody tr:hover {
    background-color: #e0f2fe;
}

/* Pagination */
.foia-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.foia-pagination a,
.foia-pagination span {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    text-decoration: none;
    color: #374151;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.foia-pagination a:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.foia-pagination .current {
    background-color: #005fcc;
    color: #fff;
    border-color: #005fcc;
}

/* Notes Section */
.notes-section {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.notes-section .note {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.notes-section .note:last-child {
    margin-bottom: 0;
}

.notes-section .note.staff {
    border-left: 4px solid #1e40af;
    background-color: #eff6ff;
}

.notes-section .note.requester {
    border-left: 4px solid #d97706;
    background-color: #fffbeb;
}

.notes-section .note p {
    margin: 0 0 5px;
}

.notes-section .note p:last-child {
    margin-bottom: 0;
}

/* Add Note Section */
.add-note {
    margin-top: 20px;
    padding: 20px;
    background: #f3f4f6;
    border-radius: 8px;
}

.add-note h3 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #374151;
}

.add-note textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.add-note button {
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .foia-dashboard table {
        font-size: 14px;
    }

    .foia-dashboard table th,
    .foia-dashboard table td {
        padding: 8px 6px;
    }

    .foia-pagination {
        gap: 3px;
    }

    .foia-pagination a,
    .foia-pagination span {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .foia-status,
    .foia-message {
        border-width: 2px;
    }

    .foia-dashboard table th,
    .foia-dashboard table td {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .foia-btn,
    .foia-dashboard a.button,
    .foia-detail button,
    .foia-dashboard input,
    .foia-dashboard select,
    .foia-dashboard textarea,
    .foia-pagination a {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .foia-dashboard,
    .foia-detail {
        border: none;
        box-shadow: none;
    }

    .add-note,
    .foia-pagination,
    .foia-filters,
    button,
    .button {
        display: none !important;
    }
}

/* ------------------------------------------------------------------
   Statutory Compliance panel + Response Documents (2.0.0)
   ------------------------------------------------------------------ */

.foia-compliance-panel {
    border: 2px solid #333;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 30px;
    background: #fff;
}

.foia-compliance-panel select,
.foia-compliance-panel input[type="text"],
.foia-compliance-panel textarea {
    max-width: 100%;
    margin: 4px 0 10px;
    display: block;
}

.foia-exemption-fieldset {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 10px;
    max-height: 260px;
    overflow-y: auto;
    background: #f9fafb;
    color: #111827;
}

.foia-threshold-met {
    display: block;
    margin-top: 6px;
    color: #991b1b;
}

.foia-letter-links .foia-btn {
    margin: 0 8px 8px 0;
    font-size: 13px;
}

.foia-compliance-log {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #f9fafb;
    color: #111827;
}

.foia-compliance-log li {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.foia-compliance-log li:last-child {
    border-bottom: none;
}

.foia-response-docs {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 30px;
    background: #fff;
}

.foia-response-doc-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.foia-response-doc-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.foia-response-doc-list li:last-child {
    border-bottom: none;
}

.foia-doc-meta {
    display: inline-block;
    font-size: 13px;
    color: #4b5563; /* on #fff: 7.6:1 */
}

.foia-response-upload {
    border-top: 1px solid #e5e7eb;
    padding-top: 14px;
    margin-top: 8px;
}

.foia-response-upload input[type="file"] {
    display: block;
    margin: 6px 0;
}

/* ------------------------------------------------------------------
   Fees panel + Public FOIA Log (2.1.0)
   ------------------------------------------------------------------ */

.foia-fee-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 160px;
    gap: 6px 14px;
    align-items: center;
    max-width: 640px;
}

.foia-fee-grid label {
    font-weight: normal;
}

.foia-fee-grid textarea,
.foia-fee-grid select {
    grid-column: 2 / 3;
    width: 100%;
}

.foia-fee-total {
    margin: 12px 0;
    font-size: 16px;
}

.foia-payment-record {
    display: inline-flex;
    gap: 8px;
    margin-left: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.foia-payment-record input {
    max-width: 170px;
}

@media (max-width: 640px) {
    .foia-fee-grid {
        grid-template-columns: 1fr;
    }
    .foia-fee-grid textarea,
    .foia-fee-grid select {
        grid-column: auto;
    }
}

.foia-log-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.foia-log-table th,
.foia-log-table td {
    border: 1px solid #d1d5db;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.foia-log-table thead th {
    background: #111827; /* white on #111827: 17.4:1 */
    color: #fff;
}

.foia-log-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.foia-log-pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.foia-log-page,
.foia-log-page:link,
.foia-log-page:visited {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #005fcc;
    border-radius: 4px;
    background: #fff;   /* #005fcc on #fff: 5.6:1 */
    color: #005fcc;
    text-decoration: none;
}

.foia-log-page:hover,
.foia-log-page:visited:hover,
.foia-log-page:focus {
    background: #005fcc;
    color: #fff;
}

.foia-log-page:active {
    background: #004499;
    color: #fff;
}

.foia-log-page.current {
    background: #005fcc;
    color: #fff;
    font-weight: 700;
}

/* ==================================================================
   v2.3.0 DESIGN SYSTEM - professional pass
   ------------------------------------------------------------------
   Modern, ADA/WCAG AA+ component layer. Loaded last so it overrides
   the legacy rules above at equal specificity; button and control
   selectors are deliberately hardened (doubled class = 0,2,0) so
   theme rules like `.entry-content button` (0,1,1) cannot bleed in.
   Contrast pairs verified: #fff on #1d4289 (AAA 9.8:1), #fff on
   #16326b (12.9:1), #fff on #4b5563 (7.6:1), #fff on #991b1b (7.7:1),
   #111827 on #fff (17.4:1), #374151 on #fff (10.3:1), border #6b7280
   on #fff (4.6:1 - exceeds the 3:1 non-text minimum).
   ================================================================== */

.foia-dashboard,
.foia-detail,
.foia-login-form,
.foia-register-form,
.foia-public-log,
.foia-health-panel,
#foia-pdf-form {
    --foia-primary:        #1d4289;
    --foia-primary-hover:  #16326b;
    --foia-primary-active: #102550;
    --foia-secondary:      #4b5563;
    --foia-secondary-hov:  #374151;
    --foia-secondary-act:  #1f2937;
    --foia-danger:         #991b1b;
    --foia-danger-hover:   #7f1d1d;
    --foia-danger-active:  #641616;
    --foia-ink:            #111827;
    --foia-ink-soft:       #374151;
    --foia-ink-muted:      #4b5563;
    --foia-border:         #6b7280;
    --foia-border-soft:    #d1d5db;
    --foia-surface:        #ffffff;
    --foia-surface-alt:    #f9fafb;
    --foia-focus:          #1d4289;
    --foia-radius:         10px;
    --foia-radius-sm:      8px;
    --foia-shadow:         0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
    --foia-shadow-lift:    0 4px 10px rgba(16, 24, 40, 0.12);
    color: var(--foia-ink);
}

/* ------------------------------------------------------------------
   Buttons - hardened, full state pairs, 44px touch targets
   ------------------------------------------------------------------ */

.foia-btn.foia-btn,
.foia-dashboard a.button,
.foia-detail button:not(.foia-extlink-modal button) {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 22px;
    background-color: var(--foia-primary, #1d4289);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    border: 2px solid transparent;
    border-radius: var(--foia-radius-sm, 8px);
    box-shadow: var(--foia-shadow);
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.foia-btn.foia-btn:link,
.foia-btn.foia-btn:visited {
    background-color: var(--foia-primary, #1d4289);
    color: #ffffff;
}

.foia-btn.foia-btn:hover,
.foia-btn.foia-btn:visited:hover,
.foia-dashboard a.button:hover,
.foia-detail button:hover {
    background-color: var(--foia-primary-hover, #16326b);
    color: #ffffff;
    box-shadow: var(--foia-shadow-lift);
    text-decoration: none;
}

.foia-btn.foia-btn:focus-visible,
.foia-dashboard a.button:focus-visible,
.foia-detail button:focus-visible {
    background-color: var(--foia-primary-hover, #16326b);
    color: #ffffff;
    outline: 3px solid var(--foia-focus, #1d4289);
    outline-offset: 3px;
}

.foia-btn.foia-btn:active,
.foia-dashboard a.button:active,
.foia-detail button:active {
    background-color: var(--foia-primary-active, #102550);
    color: #ffffff;
    transform: translateY(1px);
    box-shadow: var(--foia-shadow);
}

.foia-btn.foia-btn:disabled,
.foia-btn.foia-btn[aria-disabled="true"] {
    background-color: #9ca3af;
    color: #1f2937;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Secondary: solid gray keeps AA in every state */
.foia-btn.foia-btn-secondary,
.foia-btn.foia-btn-secondary:link,
.foia-btn.foia-btn-secondary:visited {
    background-color: var(--foia-secondary, #4b5563);
    color: #ffffff;
}

.foia-btn.foia-btn-secondary:hover,
.foia-btn.foia-btn-secondary:visited:hover,
.foia-btn.foia-btn-secondary:focus-visible {
    background-color: var(--foia-secondary-hov, #374151);
    color: #ffffff;
}

.foia-btn.foia-btn-secondary:active {
    background-color: var(--foia-secondary-act, #1f2937);
    color: #ffffff;
}

.foia-btn.foia-btn-secondary:disabled {
    background-color: #9ca3af;
    color: #1f2937;
}

/* Danger */
.foia-btn.foia-btn-danger,
.foia-btn.foia-btn-danger:link,
.foia-btn.foia-btn-danger:visited {
    background-color: var(--foia-danger, #991b1b);
    color: #ffffff;
}

.foia-btn.foia-btn-danger:hover,
.foia-btn.foia-btn-danger:visited:hover,
.foia-btn.foia-btn-danger:focus-visible {
    background-color: var(--foia-danger-hover, #7f1d1d);
    color: #ffffff;
}

.foia-btn.foia-btn-danger:active {
    background-color: var(--foia-danger-active, #641616);
    color: #ffffff;
}

.foia-btn.foia-btn-danger:disabled {
    background-color: #9ca3af;
    color: #1f2937;
}

/* ------------------------------------------------------------------
   Form controls - consistent, 44px, visible borders (>=3:1)
   ------------------------------------------------------------------ */

.foia-health-panel input[type="text"],
.foia-health-panel input[type="email"],
.foia-health-panel input[type="number"],
.foia-health-panel input[type="password"],
.foia-health-panel select,
.foia-health-panel textarea,
.foia-compliance-panel input[type="text"],
.foia-compliance-panel input[type="number"],
.foia-compliance-panel select,
.foia-compliance-panel textarea,
#foia-pdf-form input[type="text"],
#foia-pdf-form input[type="email"],
#foia-pdf-form input[type="tel"],
#foia-pdf-form textarea,
.foia-login-form input,
.foia-register-form input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 16px; /* prevents iOS zoom */
    color: var(--foia-ink, #111827);
    background-color: var(--foia-surface, #fff);
    border: 1.5px solid var(--foia-border, #6b7280);
    border-radius: var(--foia-radius-sm, 8px);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.foia-health-panel input:focus-visible,
.foia-health-panel select:focus-visible,
.foia-health-panel textarea:focus-visible,
.foia-compliance-panel input:focus-visible,
.foia-compliance-panel select:focus-visible,
.foia-compliance-panel textarea:focus-visible,
#foia-pdf-form input:focus-visible,
#foia-pdf-form textarea:focus-visible,
.foia-login-form input:focus-visible,
.foia-register-form input:focus-visible {
    outline: 3px solid var(--foia-focus, #1d4289);
    outline-offset: 2px;
    border-color: var(--foia-focus, #1d4289);
}

.foia-health-panel input[type="checkbox"],
.foia-compliance-panel input[type="checkbox"],
#foia-pdf-form input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
    accent-color: var(--foia-primary, #1d4289);
    border-radius: 4px;
    flex-shrink: 0;
    cursor: pointer;
}

.foia-health-panel label,
.foia-compliance-panel label {
    font-weight: 600;
    color: var(--foia-ink-soft, #374151);
    font-size: 14px;
}

/* ------------------------------------------------------------------
   Panels - card design matching the admin sections
   ------------------------------------------------------------------ */

.foia-health-panel {
    background: var(--foia-surface, #fff);
    border: 1px solid var(--foia-border-soft, #d1d5db);
    border-radius: 14px;
    box-shadow: var(--foia-shadow);
    padding: 28px 32px;
    margin: 28px 0;
}

.foia-health-panel h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    padding: 0 0 14px;
    font-size: 22px;
    font-weight: 700;
    color: var(--foia-ink, #111827);
    border-bottom: 1px solid #e5e7eb;
}

.foia-health-panel h2::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 24px;
    border-radius: 3px;
    background: var(--foia-primary, #1d4289);
}

.foia-health-panel h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--foia-ink-soft, #374151);
    margin: 22px 0 8px;
}

.foia-health-panel > p,
.foia-health-panel form p {
    color: var(--foia-ink-muted, #4b5563);
    font-size: 15px;
    line-height: 1.65;
}

.foia-health-panel code {
    display: inline-block;
    padding: 3px 8px;
    background: var(--foia-surface-alt, #f9fafb);
    border: 1px solid var(--foia-border-soft, #d1d5db);
    border-radius: 6px;
    font-size: 13.5px;
    color: var(--foia-ink, #111827);
    word-break: break-all;
}

.foia-health-panel form {
    margin-top: 14px;
}

/* Status pills in panels */
.foia-health-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.02em;
}

.foia-health-ok    { background: #d1fae5; color: #065f46; }  /* 5.7:1 */
.foia-health-fixed { background: #fef3c7; color: #92400e; }  /* 6.2:1 */
.foia-health-fail  { background: #fee2e2; color: #991b1b; }  /* 6.6:1 */

/* Panel tables */
.foia-health-results {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 18px;
    border: 1px solid var(--foia-border-soft, #d1d5db);
    border-radius: var(--foia-radius, 10px);
    overflow: hidden;
}

.foia-health-results th,
.foia-health-results td {
    padding: 12px 16px;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14.5px;
}

.foia-health-results thead th {
    background: var(--foia-ink, #111827);
    color: #ffffff;
    font-weight: 600;
}

.foia-health-results tbody tr:last-child td {
    border-bottom: 0;
}

.foia-health-results tbody tr:nth-child(even) {
    background: var(--foia-surface-alt, #f9fafb);
}

/* ------------------------------------------------------------------
   Public log - modern table, stacked cards on small screens
   ------------------------------------------------------------------ */

.foia-public-log h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--foia-ink, #111827);
}

.foia-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.foia-log-table {
    border: 1px solid var(--foia-border-soft, #d1d5db);
    border-radius: var(--foia-radius, 10px);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.foia-log-table th,
.foia-log-table td {
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
}

.foia-log-table tbody tr:last-child th,
.foia-log-table tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 640px) {
    .foia-log-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .foia-log-table,
    .foia-log-table tbody,
    .foia-log-table tr,
    .foia-log-table th,
    .foia-log-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .foia-log-table tr {
        border-bottom: 8px solid var(--foia-surface-alt, #f9fafb);
        padding: 6px 0;
    }

    .foia-log-table td::before,
    .foia-log-table tbody th::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--foia-ink-muted, #4b5563);
        margin-bottom: 2px;
    }
}

/* ------------------------------------------------------------------
   Compliance + fees + response docs refinements
   ------------------------------------------------------------------ */

.foia-compliance-panel,
.foia-response-docs {
    border: 1px solid var(--foia-border-soft, #d1d5db);
    border-radius: 14px;
    box-shadow: var(--foia-shadow);
    background: var(--foia-surface, #fff);
    padding: 24px 28px;
}

.foia-exemption-fieldset {
    border-radius: var(--foia-radius, 10px);
}

.foia-compliance-log {
    border-radius: var(--foia-radius, 10px);
}

/* ------------------------------------------------------------------
   Signature pad + request form polish
   ------------------------------------------------------------------ */

#foia-pdf-form .signature-pad-container,
#foia-pdf-form .signature-pad,
#foia-pdf-form #signature-pad {
    border-radius: var(--foia-radius, 10px);
    border: 1.5px dashed var(--foia-border, #6b7280);
    background: var(--foia-surface-alt, #f9fafb);
}

#foia-pdf-form .form-group {
    margin-bottom: 22px;
}

#foia-pdf-form label {
    font-weight: 600;
    color: var(--foia-ink-soft, #374151);
    margin-bottom: 6px;
    display: inline-block;
}

#foia-pdf-form fieldset.foia-commercial-fieldset {
    border: 1.5px solid var(--foia-border-soft, #d1d5db);
    border-radius: var(--foia-radius, 10px);
    background: var(--foia-surface-alt, #f9fafb);
    padding: 16px 20px;
}

#foia-pdf-form fieldset.foia-commercial-fieldset legend {
    font-weight: 700;
    color: var(--foia-ink, #111827);
    padding: 0 8px;
}

/* ------------------------------------------------------------------
   Mobile + motion + print
   ------------------------------------------------------------------ */

@media (max-width: 782px) {
    .foia-health-panel {
        padding: 20px 18px;
        border-radius: 12px;
    }

    .foia-health-panel .foia-btn,
    .foia-health-panel button.foia-btn {
        width: 100%;
    }

    .foia-payment-record {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }

    .foia-payment-record input {
        max-width: 100%;
    }

    .foia-letter-links .foia-btn {
        width: 100%;
        margin-right: 0;
    }

    .foia-response-doc-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .foia-compliance-panel,
    .foia-response-docs {
        padding: 18px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .foia-btn.foia-btn,
    .foia-health-panel input,
    .foia-health-panel select,
    .foia-health-panel textarea,
    #foia-pdf-form input,
    #foia-pdf-form textarea {
        transition: none;
    }

    .foia-btn.foia-btn:active {
        transform: none;
    }
}

@media print {
    .foia-btn.foia-btn,
    .foia-extlink-overlay {
        display: none;
    }
}

/* Status badges in the public log (AA-verified pairs) */
.foia-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #e5e7eb;
    color: #1f2937;              /* 12.6:1 */
}

.foia-status-badge.foia-status-submitted   { background: #dbeafe; color: #1e40af; } /* 7.6:1 */
.foia-status-badge.foia-status-in-progress { background: #fef3c7; color: #92400e; } /* 6.2:1 */
.foia-status-badge.foia-status-completed   { background: #d1fae5; color: #065f46; } /* 5.7:1 */
.foia-status-badge.foia-status-denied      { background: #fee2e2; color: #991b1b; } /* 6.6:1 */
