:root {
    --lw-blue: #0b3d91;
    --lw-blue-dark: #072a65;
    --lw-blue-light: #1c56b8;
    --lw-accent: #2fb6c7;
    --lw-bg: #f4f7fb;
    --lw-bg-alt: #eef3fa;
    --lw-text: #1a2340;
    --lw-muted: #5a6782;
    --lw-muted-light: #8a95ad;
    --lw-card: #ffffff;
    --lw-border: #e3e9f2;
    --lw-border-strong: #cbd6e5;
    --lw-danger: #dc2626;
    --lw-danger-bg: #fee2e2;
    --lw-success: #16a34a;
    --lw-success-bg: #dcfce7;
    --lw-warning: #d97706;
    --lw-warning-bg: #fef3c7;
    --lw-info: #2563eb;
    --lw-info-bg: #dbeafe;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 8px 24px rgba(11, 61, 145, 0.08);
    --shadow-lg: 0 20px 60px rgba(11, 61, 145, 0.12);
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--lw-text);
    background: var(--lw-bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--lw-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 0.5rem; font-weight: 700; color: var(--lw-blue-dark); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }

/* ---------------- Login layout ---------------- */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(1000px 600px at 10% 10%, rgba(47, 182, 199, 0.14), transparent 60%),
        radial-gradient(900px 500px at 90% 90%, rgba(11, 61, 145, 0.14), transparent 60%),
        linear-gradient(135deg, #eaf2fb 0%, #f4f7fb 50%, #e6f4f6 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--lw-card);
    border: 1px solid var(--lw-border);
    border-radius: 18px;
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow-lg);
}

.login-card .logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.login-card .logo-wrap img {
    max-width: 160px;
    max-height: 120px;
    width: auto;
    height: auto;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 0.35rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--lw-muted);
    margin-bottom: 2rem;
}

.login-error {
    background: var(--lw-danger-bg);
    color: var(--lw-danger);
    border: 1px solid rgba(220, 38, 38, 0.25);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

/* ---------------- Form controls ---------------- */
.field { margin-bottom: 1rem; }
.field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--lw-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.input, .select, .textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--lw-border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--lw-text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--lw-blue);
    box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.05s, background-color 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--lw-blue);
    color: #fff;
}
.btn-primary:hover { background: var(--lw-blue-dark); }

.btn-secondary {
    background: #fff;
    color: var(--lw-text);
    border-color: var(--lw-border-strong);
}
.btn-secondary:hover { background: var(--lw-bg-alt); }

.btn-ghost {
    background: transparent;
    color: var(--lw-muted);
    border-color: transparent;
}
.btn-ghost:hover { color: var(--lw-text); background: var(--lw-bg-alt); }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.btn-block { width: 100%; }

.btn-success {
    background: var(--lw-success);
    color: #fff;
    border-color: var(--lw-success);
}
.btn-success:hover { filter: brightness(1.05); color: #fff; }

.btn-danger {
    background: var(--lw-danger);
    color: #fff;
    border-color: var(--lw-danger);
}
.btn-danger:hover { filter: brightness(1.05); color: #fff; }

/* ---------------- App layout (sidebar + main) ---------------- */
.app-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #072a65 0%, #0b3d91 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem 1rem;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 1rem;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    padding: 4px;
}

.brand-title { font-size: 1rem; font-weight: 700; }
.brand-subtitle { font-size: 0.75rem; color: rgba(255, 255, 255, 0.7); }

.app-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item-active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.sidebar-sync-status {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.78rem;
    line-height: 1.4;
}

.sidebar-sync-status__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.sidebar-sync-status__label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #fff;
}

.sidebar-sync-status__badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.sidebar-sync-status__badge--complete {
    background: rgba(34, 197, 94, 0.25);
    color: #bbf7d0;
}

.sidebar-sync-status__badge--warn {
    background: rgba(251, 191, 36, 0.25);
    color: #fde68a;
}

.sidebar-sync-status__counts {
    font-weight: 500;
    margin-bottom: 0.45rem;
}

.sidebar-sync-status__bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
    margin-bottom: 0.45rem;
}

.sidebar-sync-status__bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #93c5fd);
    transition: width 0.3s ease;
}

.sidebar-sync-status__meta {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.72rem;
}

.sidebar-footer {
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem;
    color: #fff;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lw-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #072a65;
}

.user-name { font-size: 0.88rem; font-weight: 600; }
.user-role { font-size: 0.72rem; color: rgba(255, 255, 255, 0.7); }

.logout-form .btn {
    color: rgba(255, 255, 255, 0.85);
}
.logout-form .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    padding: 1.25rem 2rem;
    background: #fff;
    border-bottom: 1px solid var(--lw-border);
    position: sticky;
    top: 0;
    z-index: 5;
}

.page-title { margin: 0; color: var(--lw-blue-dark); font-size: 1.35rem; }

.app-content {
    padding: 1.75rem 2rem 3rem;
    max-width: 1400px;
    width: 100%;
}

/* ---------------- Card ---------------- */
.card {
    background: var(--lw-card);
    border: 1px solid var(--lw-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--lw-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.card-title {
    margin: 0;
    font-size: 1rem;
    color: var(--lw-blue-dark);
}

.card-body { padding: 1.25rem; }

.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    background: var(--lw-card);
    border: 1px solid var(--lw-border);
    box-shadow: var(--shadow-sm);
}
.report-tabs a {
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--lw-muted);
    font-weight: 500;
}
.report-tabs a:hover {
    background: var(--lw-bg-alt);
    color: var(--lw-blue);
}
.report-tabs a.is-active {
    background: rgba(47, 182, 199, 0.12);
    color: var(--lw-blue-dark);
}

/* Admin submission detail — tabbed sections */
.admin-detail-tabs {
    margin-top: 1rem;
    margin-bottom: 0;
}
.admin-detail-body {
    margin-top: 1rem;
}
.admin-detail-body .review-panel {
    margin-top: 0;
}

.audit-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}
.audit-badge--submit { background: rgba(47, 182, 199, 0.15); color: var(--lw-blue-dark); }
.audit-badge--review { background: rgba(108, 92, 231, 0.12); color: #5b4cc4; }
.audit-badge--email { background: rgba(39, 174, 96, 0.12); color: #1e8449; }
.audit-badge--edit { background: rgba(243, 156, 18, 0.15); color: #b9770e; }
.audit-badge--delete { background: rgba(192, 57, 43, 0.12); color: #c0392b; }
.submission-history-table td { vertical-align: top; }

/* Staff ↔ student submission thread */
.tab-badge {
    display: inline-block;
    min-width: 1.1rem;
    padding: 0 0.35rem;
    margin-left: 0.25rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.35;
    background: var(--lw-danger, #c0392b);
    color: #fff;
    vertical-align: middle;
}
.thread-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.thread-item {
    border: 1px solid var(--lw-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    background: var(--lw-card);
}
.thread-item--staff {
    border-left: 4px solid var(--lw-blue);
}
.thread-item--student {
    border-left: 4px solid #6c5ce7;
}
.thread-item__meta {
    font-size: 0.8rem;
    color: var(--lw-muted, #5a6478);
    margin-bottom: 0.35rem;
}
.thread-item__body {
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
.thread-item__files {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}
.thread-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-right: 0.35rem;
}
.thread-badge--staff {
    background: rgba(47, 182, 199, 0.15);
    color: var(--lw-blue-dark);
}
.thread-badge--student {
    background: rgba(108, 92, 231, 0.12);
    color: #5b4cc4;
}
.thread-reply-panel,
.thread-confirm-panel {
    border: 1px solid var(--lw-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    background: var(--lw-bg-alt, #f4f6fb);
}
.thread-detail-card .card-header {
    padding-bottom: 0.5rem;
}
.track-approved-docs {
    border: 1px solid rgba(39, 174, 96, 0.35);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    background: rgba(39, 174, 96, 0.06);
}
.track-approved-docs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.track-approved-docs__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
/* Department staff — system guide */
.staff-guide__title {
    font-size: 1.1rem;
}
.staff-guide__body p {
    margin: 0 0 0.65rem;
    line-height: 1.55;
    color: var(--lw-text, #1a2340);
}
.staff-guide__body p:last-of-type {
    margin-bottom: 0;
}
.staff-guide__list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    line-height: 1.55;
}
.staff-guide__list li {
    margin-bottom: 0.35rem;
}
.staff-guide__note {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.85rem;
    border-left: 3px solid var(--lw-blue);
    background: rgba(47, 182, 199, 0.08);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.92rem;
}
.staff-guide-teaser {
    border: 1px solid rgba(47, 182, 199, 0.25);
    background: linear-gradient(135deg, rgba(47, 182, 199, 0.06) 0%, var(--lw-card) 60%);
}

/* Public portal — student guide */
.student-guide__title {
    font-size: 1.1rem;
}
.student-guide__body p {
    margin: 0 0 0.65rem;
    line-height: 1.55;
    color: var(--lw-text, #1a2340);
}
.student-guide__body p:last-of-type {
    margin-bottom: 0;
}
.student-guide__list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    line-height: 1.55;
}
.student-guide__list li {
    margin-bottom: 0.35rem;
}
.student-guide__list--links a {
    font-weight: 500;
    color: var(--lw-blue, #2fb6c7);
    text-decoration: none;
}
.student-guide__list--links a:hover {
    text-decoration: underline;
}
.student-guide__note {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.85rem;
    border-left: 3px solid var(--lw-blue);
    background: rgba(47, 182, 199, 0.08);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.92rem;
}

.track-docs-badge {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: rgba(39, 174, 96, 0.15);
    color: #1e8449;
    vertical-align: middle;
}

/**
 * Pending Assignments: real buttons (same as Apply / Export) — overrides generic `.report-tabs a`.
 */
.report-tabs.report-tabs--btn-group {
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    flex-wrap: wrap;
}
.report-tabs.report-tabs--btn-group > a.btn {
    margin: 0;
    text-decoration: none !important;
    box-shadow: var(--shadow-sm);
}
.report-tabs.report-tabs--btn-group > a.btn:hover {
    text-decoration: none !important;
}
.report-tabs.report-tabs--btn-group > a.btn:focus-visible {
    outline: 2px solid var(--lw-accent);
    outline-offset: 2px;
}
.report-tabs.report-tabs--btn-group > a.btn-secondary {
    background: #fff;
    color: var(--lw-text);
    border-color: var(--lw-border-strong);
}
.report-tabs.report-tabs--btn-group > a.btn-secondary:hover {
    background: var(--lw-bg-alt);
    color: var(--lw-text);
    border-color: var(--lw-border-strong);
}
.report-tabs.report-tabs--btn-group > a.btn-primary {
    background: var(--lw-blue);
    color: #fff;
    border-color: var(--lw-blue);
}
.report-tabs.report-tabs--btn-group > a.btn-primary:hover {
    background: var(--lw-blue-dark);
    color: #fff;
    border-color: var(--lw-blue-dark);
}

.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;
}

/* ---------------- forms.livingwater.education (department shells) ---------------- */
.dept-placeholder {
    border: 1px dashed var(--lw-border-strong);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.35rem;
    background: var(--lw-bg-alt);
    color: var(--lw-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}
.dept-placeholder strong {
    color: var(--lw-text);
}
.dept-placeholder code {
    font-size: 0.84rem;
    color: var(--lw-blue);
    background: rgba(11, 61, 145, 0.06);
    padding: 0.12rem 0.35rem;
    border-radius: 4px;
}
.dept-meta {
    font-size: 0.88rem;
    color: var(--lw-muted);
    margin: 0 0 1rem;
}

/* ISO CPT form */
.iso-cpt-form .iso-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--lw-border);
}
.iso-cpt-form .iso-section:last-of-type {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}
.iso-cpt-form .iso-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--lw-blue-dark);
}
.iso-cpt-form .field-hint {
    font-size: 0.82rem;
    color: var(--lw-muted);
    margin: -0.35rem 0 0.65rem;
    line-height: 1.45;
}
.iso-cpt-form .choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}
.iso-cpt-form .choice-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--lw-text);
    cursor: pointer;
}
.iso-cpt-form .ack-list label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0.65rem;
    cursor: pointer;
    line-height: 1.45;
}
.iso-cpt-form .ack-list input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.iso-cpt-form .hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Public form letterhead (matches CPT / Horizon PDF style) */
.portal-form-letterhead {
    text-align: center;
    margin: 0 0 1.5rem;
    padding: 0 0 1.25rem;
    border-bottom: 2px solid #b8860b;
}
.portal-form-letterhead__logo {
    max-height: 52px;
    width: auto;
    display: inline-block;
    margin-bottom: 0.5rem;
}
.portal-form-letterhead__contact {
    font-size: 0.82rem;
    color: var(--lw-muted);
    line-height: 1.45;
    margin: 0 0 0.75rem;
}
.portal-form-letterhead__contact a {
    color: var(--lw-blue);
    font-weight: 600;
}
.portal-form-letterhead__title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--lw-blue-dark);
    letter-spacing: 0.01em;
}
.portal-form-letterhead__subtitle {
    margin: 0 0 0.5rem;
    font-size: 0.88rem;
    color: var(--lw-muted);
    line-height: 1.45;
}
.portal-form-letterhead__email {
    margin: 0;
    font-size: 0.84rem;
    color: var(--lw-text);
    padding: 0.5rem 0.75rem;
    background: rgba(11, 61, 145, 0.06);
    border: 1px solid rgba(11, 61, 145, 0.12);
    border-radius: var(--radius-sm);
    display: inline-block;
}
.portal-form-letterhead__email a {
    color: var(--lw-blue);
    font-weight: 600;
}

/* ---------------- Flash messages ---------------- */
.flash {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: 0.9rem;
}
.flash-success { background: var(--lw-success-bg); color: #14532d; border-color: #bbf7d0; }
.flash-error   { background: var(--lw-danger-bg);  color: #7f1d1d; border-color: #fecaca; }
.flash-info    { background: var(--lw-info-bg);    color: #1e3a8a; border-color: #bfdbfe; }
.flash-warning { background: var(--lw-warning-bg); color: #78350f; border-color: #fde68a; }

/* ---------------- Dashboard grid ---------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--lw-card);
    border: 1px solid var(--lw-border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--lw-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.4rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--lw-blue-dark);
}

.stat-hint { font-size: 0.75rem; color: var(--lw-muted); margin-top: 0.25rem; }

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.report-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--lw-card);
    border: 1px solid var(--lw-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--lw-border-strong);
    text-decoration: none;
}

.report-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--lw-info-bg);
    color: var(--lw-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.9rem;
}

.report-card-icon svg { width: 22px; height: 22px; }

.report-card h3 { margin: 0 0 0.25rem; color: var(--lw-blue-dark); }
.report-card p { margin: 0; color: var(--lw-muted); font-size: 0.88rem; }

/* ---------------- Filters ---------------- */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.filters .actions {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

/* ---------------- Table ---------------- */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
}

table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

table.table th, table.table td {
    text-align: left;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--lw-border);
    vertical-align: top;
}

table.table thead th {
    background: var(--lw-bg-alt);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--lw-muted);
    font-weight: 700;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--lw-border-strong);
    position: sticky;
    top: 0;
}

table.table tbody tr:hover { background: #fafcff; }

/* Enrollments report: stacked courses inside one student row */
.enrollment-course-stack-item {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--lw-border);
}

.cell-muted { color: var(--lw-muted); font-size: 0.82rem; }
.cell-mono  { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.82rem; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}
.badge-green  { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-blue   { background: #dbeafe; color: #1e3a8a; border-color: #bfdbfe; }
.badge-red    { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge-gray   { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-amber  { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-violet { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.badge-cyan   { background: #cffafe; color: #155e75; border-color: #a5f3fc; }

/* ---------------- Pagination ---------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--lw-muted);
}

.pagination .pager { display: flex; gap: 0.35rem; }
.pagination .pager a, .pagination .pager span {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--lw-border-strong);
    border-radius: 6px;
    color: var(--lw-text);
    text-decoration: none;
    font-weight: 500;
}
.pagination .pager a:hover { background: var(--lw-bg-alt); text-decoration: none; }
.pagination .pager .current { background: var(--lw-blue); color: #fff; border-color: var(--lw-blue); }
.pagination .pager .disabled { color: var(--lw-muted-light); cursor: not-allowed; }

/* ---------------- Diff ---------------- */
.diff { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.diff .from, .diff .to {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
    font-size: 0.78rem;
    max-width: 260px;
    overflow-wrap: anywhere;
}
.diff .from { background: #fee2e2; color: #7f1d1d; text-decoration: line-through; }
.diff .to   { background: #dcfce7; color: #166534; }
.diff .arrow { color: var(--lw-muted); font-weight: 700; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--lw-muted);
}

.empty-state h3 { margin-bottom: 0.25rem; color: var(--lw-text); }

/* ---------------- People autocomplete ---------------- */
.people-ac {
    position: relative;
}
.people-ac .people-ac-input {
    width: 100%;
    padding-right: 2rem;
}
.people-ac.is-filled .people-ac-input {
    background: #eef6f7;
    border-color: var(--lw-accent);
}
.people-ac-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--lw-border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 50;
    padding: 0.25rem 0;
}
.people-ac-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--lw-text);
}
.people-ac-item:hover,
.people-ac-item.is-active {
    background: var(--lw-bg-alt);
}
.people-ac-item mark {
    background: #fef3c7;
    color: inherit;
    padding: 0 0.1rem;
    border-radius: 2px;
}
.people-ac-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    overflow: hidden;
}
.people-ac-sub {
    color: var(--lw-muted);
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.people-ac-id {
    color: var(--lw-muted);
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
    font-size: 0.75rem;
}
.people-ac-empty {
    padding: 0.6rem 0.75rem;
    color: var(--lw-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* ---------------- Checkbox row ---------------- */
.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--lw-text);
    margin-right: 1rem;
    margin-bottom: 0.35rem;
    cursor: pointer;
    user-select: none;
}
.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--lw-blue);
    cursor: pointer;
}

/* ---------------- Inline dropdown forms (details/summary) ---------------- */
.inline-form { display: inline-block; position: relative; }
.inline-form > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.inline-form > summary::-webkit-details-marker { display: none; }
.inline-form[open] > summary { background: var(--lw-bg-alt); }

/* ---------------- Staff admin — submission review pipeline ---------------- */
.submission-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: var(--lw-bg-alt);
    border: 1px solid var(--lw-border);
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
}
.submission-toolbar__row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.submission-toolbar__row--filters {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}
.submission-toolbar__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lw-muted);
}
.submission-toolbar__search {
    max-width: 420px;
}
.submission-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.submission-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.submission-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--lw-text);
    background: var(--lw-card);
    border: 1px solid var(--lw-border-strong);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.submission-filter-chip:hover {
    border-color: var(--lw-blue-light);
    color: var(--lw-blue);
}
.submission-filter-chip.is-active {
    background: var(--lw-blue);
    border-color: var(--lw-blue);
    color: #fff;
}

.review-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.review-badge--pending {
    background: var(--lw-warning-bg);
    color: var(--lw-warning);
}
.review-badge--approved {
    background: var(--lw-success-bg);
    color: var(--lw-success);
}
.review-badge--declined {
    background: var(--lw-danger-bg);
    color: var(--lw-danger);
}

.submission-notes-preview {
    max-width: 14rem;
    font-size: 0.82rem;
    color: var(--lw-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-panel .card-header {
    border-bottom: 1px solid var(--lw-border);
    padding: 1rem 1.1rem 0.75rem;
}
.review-panel .card-body {
    padding: 0 1.1rem 1.1rem;
}
.review-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

/* ---------------- Admission — application type selector (Populi) ---------------- */
.card-body .lwu-selection-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    font-family: inherit;
}

.lwu-selection-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1.75rem 2.25rem;
    background: var(--lw-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    font-family: inherit;
}

.lwu-logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0 1.25rem;
    border-bottom: 3px solid var(--lw-blue);
}

.lwu-logo-container img {
    max-width: 220px;
    height: auto;
    display: inline-block;
}

.lwu-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.lwu-header h1 {
    color: var(--lw-blue);
    font-size: 1.65rem;
    margin: 0 0 0.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.lwu-header p {
    color: var(--lw-muted);
    font-size: 1rem;
    margin: 0;
}

.lwu-info-box {
    background: var(--lw-info-bg);
    border-left: 4px solid var(--lw-blue);
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.lwu-info-box p {
    color: var(--lw-text);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
}

.lwu-warning-box {
    background: var(--lw-danger-bg);
    border-left: 4px solid var(--lw-danger);
    color: #7f1d1d;
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.55;
}

.lwu-warning-box p {
    margin: 0 0 0.6rem;
}

.lwu-warning-box p:last-child {
    margin-bottom: 0;
}

.lwu-warning-box a {
    color: var(--lw-danger);
    font-weight: 700;
    text-decoration: underline;
}

.lwu-form-group {
    margin-bottom: 1.5rem;
}

.lwu-form-group label {
    display: block;
    color: var(--lw-text);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.lwu-form-group select {
    width: 100%;
    padding: 0.85rem 2.75rem 0.85rem 0.85rem;
    font-size: 0.95rem;
    border: 2px solid var(--lw-border-strong);
    border-radius: 10px;
    background-color: var(--lw-card);
    color: var(--lw-text);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    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='%235a6782' 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");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    font-family: inherit;
}

.lwu-form-group select:hover {
    border-color: var(--lw-blue-light);
}

.lwu-form-group select:focus {
    outline: none;
    border-color: var(--lw-blue);
    box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.12);
}

.lwu-price-display,
.lwu-desc-display {
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 0.9rem;
    animation: lwuSlideIn 0.25s ease-in;
}

.lwu-price-display {
    background: linear-gradient(135deg, var(--lw-info-bg) 0%, #bfdbfe 100%);
    border: 2px solid var(--lw-info);
    text-align: center;
}

.lwu-desc-display {
    background: var(--lw-bg-alt);
    border: 1px solid var(--lw-border);
    color: var(--lw-text);
    font-size: 0.88rem;
    line-height: 1.55;
}

@keyframes lwuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lwu-price-label {
    color: var(--lw-blue);
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lwu-price-amount {
    color: var(--lw-blue);
    font-size: 1.85rem;
    font-weight: 800;
}

.lwu-btn-submit {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--lw-blue-dark) 0%, var(--lw-blue) 45%, var(--lw-blue-light) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(11, 61, 145, 0.35);
    font-family: inherit;
}

.lwu-btn-submit:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow: 0 6px 18px rgba(11, 61, 145, 0.45);
}

.lwu-btn-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.lwu-guideline-box {
    background: #e0f2fe;
    border-left: 4px solid #0284c7;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.lwu-guideline-box p {
    margin: 0 0 0.5rem;
}

.lwu-guideline-box p:last-child {
    margin-bottom: 0;
}

.lwu-guideline-box a {
    color: var(--lw-blue);
    font-weight: 700;
    text-decoration: underline;
}

.lwu-confirm-group label {
    font-weight: 500;
    font-size: 0.88rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    line-height: 1.45;
    color: var(--lw-text);
}

.lwu-confirm-group label a {
    color: var(--lw-blue);
    font-weight: 700;
}

.lwu-confirm-group input[type="checkbox"] {
    margin-top: 0.2rem;
    min-width: 16px;
    min-height: 16px;
    accent-color: var(--lw-blue);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .lwu-selection-container {
        padding: 1.25rem 1rem 1.5rem;
    }
    .lwu-logo-container img {
        max-width: 180px;
    }
    .lwu-header h1 {
        font-size: 1.35rem;
    }
    .lwu-price-amount {
        font-size: 1.5rem;
    }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
    .app-body { flex-direction: column; }
    .app-sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        align-items: center;
    }
    .brand { border: none; margin: 0; padding: 0; }
    .app-nav { flex-direction: row; overflow-x: auto; gap: 0.25rem; }
    .nav-item { padding: 0.45rem 0.65rem; }
    .nav-item span { display: none; }
    .sidebar-sync-status {
        width: 100%;
        order: 10;
        margin-top: 0;
    }
    .sidebar-footer { margin-left: auto; flex-direction: row; align-items: center; border: none; padding: 0; }
    .user-chip { padding: 0; }
    .app-topbar, .app-content { padding-left: 1rem; padding-right: 1rem; }
}

/* ---------------- Populi student gate ---------------- */
.populi-student-gate {
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(184, 134, 11, 0.35);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.95), rgba(255, 255, 255, 0.98));
}
.populi-student-gate__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.populi-student-gate__badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--lw-gold, #b8860b);
    color: #fff;
}
.populi-student-gate__text {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    color: var(--text-muted, #5c6578);
    line-height: 1.45;
}
.populi-student-gate__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}
.populi-student-gate__status {
    font-size: 0.88rem;
    color: var(--text-muted, #5c6578);
}
.populi-student-gate__status.is-loading { color: var(--lw-blue, #1e4b7a); }
.populi-student-gate__status.is-success { color: #166534; font-weight: 500; }
.populi-student-gate__status.is-error { color: #b91c1c; font-weight: 500; }
.portal-form--populi-gated input[data-populi-filled="1"] {
    background: rgba(240, 253, 244, 0.65);
}
.portal-form--populi-gated input[data-populi-locked="1"],
.portal-form--populi-gated textarea[data-populi-locked="1"] {
    background: #f1f5f9;
    color: var(--text, #1e293b);
    cursor: not-allowed;
    border-color: rgba(30, 75, 122, 0.22);
}

.populi-email-step {
    max-width: 32rem;
    margin: 0.5rem auto 1.5rem;
}
.populi-email-step__card {
    padding: 1.35rem 1.4rem 1.25rem;
    border: 1px solid rgba(30, 75, 122, 0.18);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.populi-email-step__step {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lw-blue, #1e4b7a);
}
.populi-email-step__title {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
    line-height: 1.3;
}
.populi-email-step__lead {
    margin: 0 0 1rem;
    color: var(--text-muted, #5c6578);
    line-height: 1.5;
    font-size: 0.94rem;
}
.populi-email-step__actions {
    margin-top: 0.25rem;
}
.populi-email-step__note {
    margin: 1rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted, #5c6578);
    line-height: 1.45;
}
.populi-verified-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    margin: 0 0 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: rgba(240, 253, 244, 0.9);
    border: 1px solid rgba(22, 101, 52, 0.22);
    font-size: 0.88rem;
}
.populi-verified-bar__label {
    font-weight: 600;
    color: #166534;
}
.populi-verified-bar__detail {
    color: #14532d;
}
.populi-verified-bar__change {
    margin-left: auto;
    font-size: 0.84rem;
}
.populi-verified-bar__hint {
    flex: 1 1 100%;
    font-size: 0.82rem;
    color: #166534;
}

/* Full-page wait overlay while a public form POST is in flight */
.form-submit-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.form-submit-overlay[hidden] {
    display: none !important;
}
.form-submit-overlay__panel {
    max-width: 22rem;
    width: 100%;
    padding: 1.75rem 1.5rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2);
    text-align: center;
}
.form-submit-overlay__spinner {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 1rem;
    border: 3px solid rgba(30, 75, 122, 0.2);
    border-top-color: var(--lw-blue, #1e4b7a);
    border-radius: 50%;
    animation: form-submit-spin 0.85s linear infinite;
}
@keyframes form-submit-spin {
    to { transform: rotate(360deg); }
}
.form-submit-overlay__title {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--lw-blue-dark, #163a5c);
}
.form-submit-overlay__desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-muted, #5c6578);
}
body.form-submit-overlay-open {
    overflow: hidden;
}
.form-submit-guarded button[type="submit"]:disabled,
.form-submit-guarded input[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ---------------- Student documents portal ---------------- */
.muted { color: var(--lw-muted); }

.student-verified-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(22, 163, 74, 0.25);
    border-radius: var(--radius-sm);
    background: var(--lw-success-bg);
    color: #14532d;
}

.doc-section-card + .doc-section-card { margin-top: 0; }
.doc-section-body { display: flex; flex-direction: column; gap: 1.25rem; }

.doc-slot {
    border: 1px solid var(--lw-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    background: var(--lw-bg-alt);
}

.doc-slot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.doc-slot__title {
    margin: 0;
    font-size: 0.98rem;
    color: var(--lw-blue-dark);
}

.doc-slot__badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--lw-muted);
    background: #fff;
    border: 1px solid var(--lw-border);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
}
.doc-slot__badge--populi {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}
.doc-slot--populi-satisfied {
    border-color: #93c5fd;
}
.doc-populi-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
}
.doc-populi-notice p {
    margin: 0 0 0.35rem;
    color: #1e3a8a;
    font-size: 0.92rem;
}
.doc-populi-hint {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
}

.doc-slot--missing {
    border-color: #fcd34d;
    background: #fffbeb;
}

.doc-slot__badge--required {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.doc-slot__hint {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--lw-text);
}

.doc-complete-banner {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
}

.doc-complete-banner--compact {
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.doc-complete-banner__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: #059669;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.doc-complete-banner__title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    color: #065f46;
}

.doc-complete-banner__text {
    margin: 0;
    color: #047857;
    font-size: 0.95rem;
}

.doc-owed-alert {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    box-shadow: 0 1px 3px rgba(180, 83, 9, 0.08);
}

.doc-owed-alert__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: #d97706;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    flex-shrink: 0;
    line-height: 1;
}

.doc-owed-alert__title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    color: #92400e;
}

.doc-owed-alert__text {
    margin: 0;
    color: #78350f;
    font-size: 0.95rem;
    line-height: 1.55;
}

.doc-owed-alert__text strong {
    color: #92400e;
}

.immigration-question-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.immigration-question-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.immigration-option {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border: 1px solid var(--lw-border);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
}

.immigration-option input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.immigration-option span {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.immigration-answer-summary {
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.dependents-count-wrap {
    margin-top: 0.25rem;
}

.doc-owed-alert--compact {
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.doc-owed-alert--compact .doc-owed-alert__icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.95rem;
}

.doc-owed-alert--compact .doc-owed-alert__title {
    display: none;
}

.doc-dropzone {
    position: relative;
    border: 2px dashed var(--lw-border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    transition: border-color 0.15s, background-color 0.15s;
}

.doc-dropzone.is-dragover {
    border-color: var(--lw-blue);
    background: rgba(11, 61, 145, 0.04);
}

.doc-dropzone__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.doc-dropzone__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.35rem 1rem;
    cursor: pointer;
    text-align: center;
}

.doc-dropzone__icon svg {
    width: 28px;
    height: 28px;
    color: var(--lw-blue);
}

.doc-dropzone__text {
    font-weight: 600;
    color: var(--lw-blue-dark);
}

.doc-dropzone__limit {
    font-size: 0.78rem;
    color: var(--lw-muted-light);
}

.doc-dropzone__chosen {
    font-size: 0.82rem;
}

.doc-upload-actions {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.doc-file-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.doc-file-item {
    background: #fff;
    border: 1px solid var(--lw-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.doc-file-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem 1rem;
    margin: 0;
}

.doc-file-meta dt {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lw-muted);
}

.doc-file-meta dd {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    word-break: break-word;
}

.doc-file-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.doc-delete-form { margin: 0; }
.doc-delete-btn { color: var(--lw-danger) !important; }

.dependent-add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem 1rem;
    align-items: end;
}

.dependent-add-action .btn { width: 100%; }

.doc-category-preview {
    margin: 0.75rem 0 0;
    padding-left: 1.1rem;
    color: var(--lw-muted);
}

.admin-search-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-search-form .input {
    flex: 1;
    min-width: 220px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--lw-border);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lw-muted);
    background: var(--lw-bg-alt);
}

.data-table tr:last-child td { border-bottom: none; }

@media (max-width: 900px) {
    .dependent-add-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-body { flex-direction: column; }
    .app-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .app-content { padding: 1rem; }
}

/* Registrar admin — document compliance */
.compliance-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}
.compliance-badge--complete {
    background: var(--lw-success-bg);
    color: #14532d;
}
.compliance-badge--incomplete {
    background: var(--lw-warning-bg);
    color: #78350f;
}
.compliance-badge--populi {
    background: #dbeafe;
    color: #1e3a8a;
}
.compliance-row--missing td {
    background: rgba(217, 119, 6, 0.06);
}
.compliance-checklist td,
.compliance-checklist th {
    vertical-align: middle;
}

/* ---------------- Admin document review ---------------- */
.doc-review-table td:last-child {
    white-space: nowrap;
}

.doc-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-start;
}

.doc-review-inline-form {
    display: inline;
    margin: 0;
}

.doc-review-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.doc-review-badge--pending {
    background: #fef3c7;
    color: #92400e;
}

.doc-review-badge--approved {
    background: #dcfce7;
    color: #166534;
}

.doc-review-badge--rejected {
    background: #fee2e2;
    color: #991b1b;
}

.doc-review-reject {
    display: inline-block;
}

.doc-review-reject summary {
    list-style: none;
    cursor: pointer;
}

.doc-review-reject summary::-webkit-details-marker {
    display: none;
}

.doc-review-reject-form {
    margin-top: 0.5rem;
    padding: 0.65rem;
    border: 1px solid var(--lw-border);
    border-radius: var(--radius-sm);
    background: #fafafa;
    min-width: 220px;
}

.doc-review-reject-form textarea {
    width: 100%;
    margin: 0.35rem 0 0.5rem;
    font: inherit;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--lw-border);
    border-radius: var(--radius-sm);
    resize: vertical;
}

.doc-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.doc-preview-modal[hidden] {
    display: none !important;
}

.doc-preview-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.doc-preview-modal__panel {
    position: relative;
    z-index: 1;
    width: min(960px, 96vw);
    height: min(85vh, 900px);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.doc-preview-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--lw-border);
}

.doc-preview-modal__head h3 {
    margin: 0;
    font-size: 1rem;
}

.doc-preview-modal__body {
    flex: 1;
    min-height: 0;
    background: #f8fafc;
}

.doc-preview-modal__body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

body.doc-preview-open {
    overflow: hidden;
}
