:root {
    --ink: #20172b;
    --muted: #756b82;
    --line: #e2d9ec;
    --bg: #f7f5fb;
    --panel: #ffffff;
    --primary: #6517c8;
    --primary-2: #431086;
    --accent: #f4e52a;
    --accent-2: #d6c414;
    --error: #a33a2a;
    --surface: #fbf8ff;
    --surface-2: #fffcef;
    --shadow: 0 14px 34px rgba(72, 28, 137, 0.10);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    gap: 10px;
    min-height: 92px;
    padding: 10px 18px 8px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 3px solid var(--accent);
    box-shadow: 0 8px 24px rgba(67, 16, 134, 0.08);
}
.topbar-app {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 112px;
    padding: 0 32px 0 22px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 3px solid var(--accent);
    box-shadow: 0 4px 18px rgba(67, 16, 134, 0.06);
    overflow: visible;
}
.topbar-login {
    display: grid;
    gap: 0;
    min-height: 0;
    padding: 24px 0 0;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
}
.topbar-login .site-banner {
    width: min(1000px, calc(100vw - 32px));
    margin: 0 auto;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 30px;
    color: var(--ink);
    min-width: 0;
    flex: 1 1 auto;
    height: 112px;
}
.brand img {
    width: 138px;
    height: 146px;
    object-fit: contain;
    object-position: center;
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: 10px;
    padding: 12px;
    background: #fff;
    border: 3px solid #f0bd00;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(67, 16, 134, 0.10);
}
.brand span {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.brand strong {
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: .01em;
    white-space: nowrap;
}
.brand small {
    display: none;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
}
.site-banner {
    display: grid;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #2b2140;
}
.site-banner-image {
    width: 100%;
    height: auto;
    display: block;
    background: #fff;
}
.site-banner-system {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: linear-gradient(90deg, #5a1dc4, #3f118e);
    color: #fff;
}
.site-banner-system strong {
    font-size: 17px;
    line-height: 1.1;
    letter-spacing: .02em;
    text-align: center;
}
nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; flex: 0 0 auto; }
nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--primary-2);
    font-weight: 700;
}
nav a:hover {
    background: #f2ecfb;
    border-color: #dac7f5;
}
.container { width: min(1180px, calc(100% - 32px)); margin: 28px auto; }
.container-login { width: 100%; margin: 0; }
.topbar-login { padding-bottom: 0; }
.footer { padding: 24px; color: var(--muted); text-align: center; font-size: 13px; }
.auth-shell {
    display: grid;
    align-items: start;
    justify-items: center;
    min-height: 100vh;
    padding: 263px clamp(16px, 3vw, 30px) clamp(16px, 3vw, 30px);
}
.auth-hero {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06)), url('login-campus.jpg');
    background-size: cover;
    background-position: center top;
    margin-top: 0;
    border-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.auth-dual-card {
    width: min(1000px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 56px rgba(20, 9, 38, 0.30);
    background: rgba(255, 255, 255, 0.96);
}
.auth-left {
    display: grid;
    gap: 12px;
    padding: 34px 34px 30px;
    color: #fff;
    background: linear-gradient(165deg, rgba(67, 16, 134, 0.94), rgba(101, 23, 200, 0.82));
    align-content: start;
    grid-auto-rows: min-content;
    justify-items: start;
}
.auth-chip {
    display: inline-block;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    justify-self: start;
    align-self: start;
}
.auth-left h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1.05;
}
.auth-left-lede {
    margin: 0;
    color: rgba(255, 255, 255, 0.93);
    font-size: 16px;
}
.auth-points {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}
.auth-points li {
    position: relative;
    padding-left: 18px;
    line-height: 1.45;
}
.auth-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
}
.auth-left .button.secondary {
    width: fit-content;
    background: #f4e52a;
    color: #2b2140;
    border-color: #d6c414;
    font-weight: 700;
}
.auth-left .button.secondary:hover {
    background: #ffef4c;
    color: #1f1630;
    border-color: #c9b70f;
}
.auth-doc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.auth-doc-actions .button.secondary {
    width: auto;
}
.auth-right {
    display: grid;
    gap: 14px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.97);
}
.auth-right label { font-weight: 600; color: #20172b; }
.auth-right input { min-height: 38px; }
.auth-right button {
    width: 100%;
    background: var(--primary);
    border-color: var(--primary);
}
.auth-right button:hover { background: var(--primary-2); border-color: var(--primary-2); }
.auth-right hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 0; }
.auth-right .auth-title { text-align: left; margin-bottom: 4px; }
.auth-right .auth-title h1 { font-size: 34px; margin-bottom: 8px; }
.auth-right .auth-title p { color: #7f7492; }
.login-card {
    display: contents;
}
.auth-title { text-align: center; margin-bottom: 6px; }
.auth-title h1 { font-size: 20px; margin-bottom: 12px; }
.auth-title p { margin: 0; color: #8b8fa8; }
.login-card input { min-height: 36px; font-size: 15px; }
.login-card button { width: 100%; background: var(--primary); border-color: var(--primary); }
.login-card button:hover { background: var(--primary-2); border-color: var(--primary-2); }
.login-card hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 0; }
.form-switch { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.form-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    margin-top: 4px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    color: var(--primary);
    font-weight: 500;
    background: #fff;
}
.form-switch a:hover {
    background: #f7f0ff;
}
h1, h2, h3 { margin: 0 0 14px; line-height: 1.15; }
h1 { font-size: clamp(30px, 4vw, 54px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.lede { color: var(--muted); font-size: 18px; max-width: 650px; }
.small-lede { font-size: 14px; margin-top: 0; }
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    box-shadow: var(--shadow);
    position: relative;
}
.panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    border-radius: 8px 0 0 8px;
    background: var(--accent);
}
.section-title { margin-top: 8px; }
.nested-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: var(--surface);
}
.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.check-line input { width: auto; min-height: auto; }
.segmented {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.segmented label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-2);
}
.segmented input { width: auto; min-height: auto; }
.doc-missing {
    display: inline-flex;
    color: #d1352b;
    font-weight: 800;
    font-size: 18px;
}
.dropzone {
    position: relative;
    display: grid;
    gap: 3px;
    justify-items: center;
    min-height: 92px;
    padding: 14px 12px;
    border: 2px dashed #b99bea;
    border-radius: 8px;
    background: var(--surface);
    color: var(--primary-2);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.dropzone::before {
    content: "+";
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--primary-2);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}
.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: #f0e6ff;
    transform: translateY(-1px);
}
.dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.dropzone-title {
    font-weight: 800;
    font-size: 14px;
}
.dropzone-text {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}
.dropzone-file {
    max-width: 220px;
    color: #5d4e00;
    background: #fff9bd;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.extra-doc-row {
    align-items: end;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.page-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.wide-left { grid-template-columns: 1.5fr 0.8fr; }
.grid.review-layout { grid-template-columns: 0.9fr 1.6fr; align-items: start; }
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.stats div,
.stats a.stat-card {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.stats a.stat-card {
    display: block;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.stats a.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(101, 23, 200, 0.16);
    border-color: #c9afe9;
}
.stats strong { display: block; font-size: 34px; color: var(--primary); }
.stats span { color: var(--muted); }
.workflow { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.workflow span, .badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f2ecfb;
    color: var(--primary-2);
    font-size: 13px;
    font-weight: 700;
}
.badge.info { background: #fff9bd; color: #5d4e00; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 18px; background: #f5efff; border: 1px solid #d7c2f5; box-shadow: 0 8px 18px rgba(72, 28, 137, 0.08); }
.alert.error { background: #fff1ef; border-color: #f0c0b8; color: var(--error); }
label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
input, select, textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input[type="radio"],
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    padding: 0;
    margin: 0;
    accent-color: var(--primary);
}
input:hover, select:hover, textarea:hover {
    border-color: #c9afe9;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(101, 23, 200, 0.14);
}
textarea { min-height: 96px; resize: vertical; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(101, 23, 200, 0.18);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
button:hover, .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(101, 23, 200, 0.22);
}
button.secondary, .button.secondary {
    background: #fff;
    color: var(--primary);
    box-shadow: none;
}
button.danger, .button.danger {
    background: #fff1ef;
    border-color: #d1352b;
    color: #9d2119;
    box-shadow: none;
}
.button.compact { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.doc-delete { margin-top: 8px; }
.doc-download { margin-top: 8px; }
.doc-instruction {
    max-width: 360px;
    margin-top: 6px;
    color: var(--primary-2);
    background: #fff9bd;
    border-left: 3px solid var(--accent-2);
    padding: 6px 8px;
    border-radius: 6px;
}
.hidden-form { display: none; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.full { grid-column: 1 / -1; }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checks input { width: auto; min-height: auto; }
.docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
small { display: block; color: var(--muted); font-weight: 400; }
.required-mark { color: #d1352b; font-weight: 700; margin-right: 2px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; }
.actions.left { justify-content: flex-start; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--primary-2); background: #f5efff; font-size: 13px; }
tbody tr:nth-child(even) td { background: #fdfbff; }
tbody tr:hover td { background: var(--surface-2); }
td small { margin-top: 2px; }
.compact-table th,
.compact-table td {
    padding: 8px 8px;
    font-size: 12px;
    line-height: 1.2;
}
.compact-table .button.compact {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 12px;
}
.compact-table td small {
    font-size: 11px;
    margin-top: 1px;
}
.facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 18px;
}
.facts div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.facts dd { margin: 3px 0 0; font-weight: 700; }
.inline-form {
    display: grid;
    grid-template-columns: 130px 130px 1fr auto;
    gap: 10px;
    margin-top: 14px;
}
.intake-form {
    grid-template-columns: minmax(220px, 1fr) 170px 190px auto;
    align-items: center;
    margin-bottom: 16px;
}
.staff-filter-two-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
}
.staff-filter-two-row .staff-filter-row2 {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
}
.staff-filter-two-row .staff-filter-row2 label {
    min-width: 130px;
}
.table-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.table-form input[type="text"],
.table-form input:not([type]) {
    max-width: 220px;
}
.user-search {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 170px 150px auto auto;
    gap: 8px;
    align-items: center;
    margin: 0;
}
.user-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.user-toolbar > .button {
    flex: 0 0 auto;
}
.user-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.user-pages {
    margin-top: 14px;
}
.form-modal {
    width: min(720px, 96vw);
    height: auto;
    max-height: 90vh;
    overflow: auto;
}
.modal-form {
    padding: 16px;
    align-content: start;
}
.modal-form.form-grid {
    grid-auto-rows: min-content;
}
.modal-form .actions {
    justify-content: flex-end;
    margin-top: 6px;
}
.modal-open { overflow: hidden; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(32, 23, 43, 0.64);
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
    display: grid;
    grid-template-rows: auto 1fr;
    width: min(980px, 96vw);
    height: min(780px, 88vh);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(32, 23, 43, 0.32);
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbf8ff;
}
.modal-head h2 {
    margin: 0;
    font-size: 18px;
}
.modal-card iframe,
.modal-card object {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}
.doc-preview-card {
    width: min(98vw, 1500px);
    height: min(94vh, 980px);
    grid-template-rows: auto 1fr auto;
}
.doc-preview-card iframe,
.doc-preview-card object {
    min-height: 0;
    height: 100%;
}
.doc-preview-card .modal-foot {
    display: flex;
    gap: 10px;
    align-items: end;
    justify-content: space-between;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--line);
    background: #fff;
    position: sticky;
    bottom: 0;
    z-index: 1;
}
.doc-preview-card .modal-foot input {
    min-height: 36px;
}

@media (max-width: 760px) {
    .auth-shell, .grid.two, .grid.wide-left, .grid.review-layout, .form-grid, .docs, .facts, .stats { grid-template-columns: 1fr; }
    .auth-shell { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 136px 12px 16px; justify-items: center; }
    .auth-hero { min-height: 100vh; background-position: center top; align-items: start; }
    .auth-dual-card {
        width: calc(100vw - 24px);
        max-width: 560px;
        grid-template-columns: 1fr;
        border-radius: 14px;
        overflow: hidden;
        position: relative;
        z-index: 2;
    }
    .auth-left, .auth-right { padding: 18px; display: grid; }
    .auth-left h2 { font-size: 28px; }
    .auth-right .auth-title h1 { font-size: 30px; }
    .topbar {
        gap: 8px;
        padding: 10px 10px 0;
        min-height: 0;
    }
    .topbar-login {
        padding: 10px 0 0;
    }
    .topbar-app {
        display: flex;
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        min-height: 0;
        padding: 10px 14px 0;
    }
    .brand {
        width: 100%;
        height: auto;
        gap: 12px;
        align-items: center;
    }
    .brand img {
        width: 74px;
        height: 78px;
        margin-top: 0;
        padding: 7px;
        border-radius: 14px;
        border-width: 2px;
    }
    .brand strong {
        display: block;
        font-size: 14px;
        line-height: 1.25;
        white-space: normal;
    }
    .brand small { font-size: 11px; }
    .site-banner-system {
        padding: 7px 10px;
    }
    .site-banner-system strong { font-size: 13px; }
    .topbar-login .site-banner {
        width: calc(100vw - 24px);
    }
    nav {
        display: flex;
        width: 100%;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 2px 10px;
        margin: 0;
        max-width: 100%;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    nav::-webkit-scrollbar { display: none; }
    nav a {
        flex: 0 0 auto;
        min-height: 32px;
        padding: 6px 10px;
        font-size: 13px;
        white-space: nowrap;
        background: #f7f0ff;
        border-color: #e0cff5;
    }
    .page-head { flex-direction: column; }
    .user-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .user-toolbar > .button { width: 100%; }
    .user-search { grid-template-columns: 1fr; }
    .inline-form { grid-template-columns: 1fr; }
    .intake-form { grid-template-columns: 1fr; }
    table { display: block; overflow-x: auto; }
    .modal-backdrop { padding: 10px; }
    .modal-card {
        width: 100%;
        height: 86vh;
    }
    .doc-preview-card {
        width: 100%;
        height: 92vh;
    }
    .doc-preview-card iframe,
    .doc-preview-card object {
        min-height: 72vh;
    }
    .modal-head {
        align-items: stretch;
        flex-direction: column;
    }
    .modal-head .button { width: 100%; }
}
