:root {
    --ink: #101828;
    --muted: #667085;
    --subtle: #98a2b3;
    --line: #e4e7ec;
    --line-strong: #d0d5dd;
    --surface: #ffffff;
    --canvas: #f5f7fa;
    --field: #f7f8fa;
    --blue: #0877f9;
    --blue-dark: #0563d6;
    --blue-soft: #eaf4ff;
    --success: #087443;
    --success-bg: #ecfdf3;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --warning: #93370d;
    --warning-bg: #fffaeb;
    --shadow: 0 8px 24px rgba(16, 24, 40, .045);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

button,
input,
select {
    font: inherit;
}

a {
    color: inherit;
}

.app-header {
    position: sticky;
    z-index: 50;
    top: 0;
    height: 64px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid #eef0f3;
    background: rgba(255, 255, 255, .98);
}

.wordmark {
    display: flex;
    width: 112px;
    height: 44px;
    align-items: center;
    text-decoration: none;
}

.wordmark img {
    display: block;
    width: 100%;
    max-height: 42px;
    object-fit: contain;
    object-position: left center;
    filter: brightness(0) saturate(100%) invert(17%) sepia(25%) saturate(1515%) hue-rotate(169deg) brightness(89%) contrast(93%);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-link {
    min-height: 34px;
    padding: 7px 11px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: #344054;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.header-link:hover {
    border-color: #b9d7ff;
    color: var(--blue-dark);
}

.app-layout {
    width: min(1480px, 100%);
    min-height: calc(100vh - 64px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
}

.side-navigation {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    padding: 26px 14px;
    border-right: 1px solid #eaecf0;
    background: #fff;
}

.side-navigation-title {
    margin: 0 10px 16px;
    color: var(--subtle);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.side-navigation-link {
    min-height: 42px;
    margin-bottom: 4px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 9px;
    color: #475467;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.side-navigation-link span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
    font-size: 11px;
}

.side-navigation-link.active {
    background: var(--blue-soft);
    color: var(--blue-dark);
}

.side-navigation-link.active span {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.page-content {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.intro-card,
.panel,
.stepper {
    border: 1px solid #edf0f3;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.intro-card {
    min-height: 146px;
    margin-bottom: 16px;
    padding: 30px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-radius: 16px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 6px;
    color: var(--blue-dark);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.18;
    letter-spacing: -.025em;
}

.intro-card > div > p:last-child {
    margin: 9px 0 0;
    color: var(--muted);
}

.status-badge {
    flex: 0 0 auto;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.status-badge.inactive {
    background: #fff4e5;
    color: #b54708;
}

.stepper {
    margin: 0 0 16px;
    padding: 0 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-radius: 14px;
    list-style: none;
}

.stepper li {
    position: relative;
    min-height: 58px;
    padding: 12px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-bottom: 2px solid transparent;
    color: var(--subtle);
    font-size: 13px;
    font-weight: 600;
}

.stepper li span {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
    font-size: 11px;
}

.stepper li.active {
    border-bottom-color: var(--blue);
    color: var(--blue-dark);
}

.stepper li.active span {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.panel {
    position: relative;
    margin-bottom: 16px;
    padding: 30px 34px;
    border-radius: 16px;
}

.panel.locked {
    min-height: 104px;
    box-shadow: none;
}

.panel.locked > :not(.panel-heading) {
    display: none;
}

.panel.locked .panel-heading {
    margin: 0;
    padding: 0;
    border: 0;
    opacity: .48;
}

.panel-heading {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
    letter-spacing: -.015em;
}

.panel-heading p:last-child,
.subsection-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 19px 20px;
}

.form-grid.compact {
    margin-top: 16px;
    gap: 14px;
}

.field {
    min-width: 0;
    display: grid;
    gap: 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 650;
}

.field-wide {
    grid-column: 1 / -1;
}

.field small {
    color: var(--subtle);
    font-size: 11px;
    font-weight: 500;
}

.field input,
.field select,
.mini-field input,
.mini-field select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field input[readonly],
.field input:disabled,
.field select:disabled {
    background: var(--field);
    color: #475467;
}

.field input:focus,
.field select:focus,
.mini-field input:focus,
.mini-field select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(8, 119, 249, .12);
}

.form-actions,
.sign-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button {
    min-height: 42px;
    padding: 9px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.button.primary {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.button.primary:hover:not(:disabled) {
    border-color: var(--blue-dark);
    background: var(--blue-dark);
}

.button.secondary {
    border-color: var(--line-strong);
    background: #fff;
    color: #344054;
}

.button.secondary:hover:not(:disabled) {
    background: var(--field);
}

.alert {
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid #fda29b;
    border-radius: 10px;
    background: var(--danger-bg);
    color: var(--danger);
}

.result-card {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid #abefc6;
    border-radius: 10px;
    background: var(--success-bg);
    color: var(--success);
}

.result-card strong {
    display: block;
    margin-bottom: 3px;
}

.result-card p {
    margin: 0;
}

.result-card .button {
    margin-top: 12px;
}

.hidden {
    display: none !important;
}

.service-dialog {
    width: min(570px, calc(100% - 30px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(16, 24, 40, .2);
}

.service-dialog::backdrop {
    background: rgba(16, 24, 40, .52);
}

.dialog-header,
.dialog-footer {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dialog-header {
    border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
    margin: 0;
    font-size: 20px;
}

.dialog-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 25px;
    cursor: pointer;
}

.dialog-body {
    padding: 22px;
}

.dialog-body p {
    margin: 0 0 10px;
}

.dialog-links {
    margin: 20px 0 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.instruction-link {
    color: var(--blue-dark);
    font-weight: 700;
}

.dialog-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    background: #fafafa;
}

.college-picker {
    position: relative;
}

.college-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 310px;
    padding: 6px;
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 32px rgba(16, 24, 40, .14);
}

.college-option {
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #344054;
    text-align: left;
    cursor: pointer;
}

.college-option:hover,
.college-option:focus {
    background: var(--blue-soft);
    color: var(--blue-dark);
    outline: none;
}

.college-option-empty {
    padding: 14px 11px;
    color: var(--muted);
    font-weight: 500;
}

.catalog-toolbar {
    margin: 22px 0 11px;
    display: flex;
    gap: 24px;
    color: var(--muted);
    font-size: 13px;
}

.catalog-toolbar strong {
    color: var(--ink);
}

.discipline-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    max-height: 470px;
    overflow: auto;
}

.discipline-card {
    min-width: 0;
    padding: 13px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.discipline-card:hover {
    border-color: #b9d7ff;
    background: #fbfdff;
}

.discipline-card.selected {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.discipline-card input {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--blue);
}

.discipline-card strong {
    display: block;
    font-size: 13px;
}

.discipline-meta {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 11px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 24px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    color: var(--muted);
    text-align: center;
}

.selected-details {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.subsection-heading h3,
.parent-box h3 {
    margin: 0;
    font-size: 16px;
}

.selected-table {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.selected-row {
    padding: 14px;
    display: grid;
    grid-template-columns: minmax(180px, 1.35fr) minmax(180px, 1fr) 90px 90px 135px;
    gap: 10px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbfc;
}

.selected-course {
    align-self: center;
}

.selected-course strong {
    display: block;
    font-size: 13px;
}

.selected-course span {
    color: var(--muted);
    font-size: 11px;
}

.mini-field {
    min-width: 0;
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.mini-field input,
.mini-field select {
    min-height: 38px;
    padding: 7px 9px;
    border-radius: 7px;
    font-size: 13px;
}

.parent-box {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid #fedf89;
    border-radius: 11px;
    background: var(--warning-bg);
}

.parent-box > p {
    margin: 5px 0 0;
    color: var(--warning);
    font-size: 13px;
}

.consent-row {
    margin: 23px 0 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #344054;
    cursor: pointer;
}

.consent-row input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--blue);
}

.application-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.summary-item {
    min-width: 0;
    padding: 14px;
    border-right: 1px solid var(--line);
}

.summary-item:last-child {
    border-right: 0;
}

.summary-item span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.summary-item strong {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.sign-actions {
    margin-top: 18px;
    flex-wrap: wrap;
}

.admin-layout {
    grid-template-columns: 220px minmax(0, 1fr);
}

.admin-content {
    max-width: 900px;
}

.admin-content-wide {
    max-width: 1180px;
}

.admin-navigation .side-navigation-link {
    align-items: flex-start;
}

.admin-summary {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.admin-summary-item {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbfc;
}

.admin-summary-item span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.admin-summary-item strong {
    display: block;
    margin-top: 4px;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.employee-access {
    max-width: 720px;
}

.applications-heading {
    align-items: flex-start;
    gap: 24px;
}

.applications-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.applications-summary {
    grid-template-columns: minmax(220px, 320px);
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.admin-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: #fff;
}

.admin-table th,
.admin-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}

.admin-table td {
    color: var(--text);
    font-size: 13px;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover {
    background: #f8fbff;
}

.iin-cell,
.date-cell,
.document-column {
    white-space: nowrap;
}

.compact-button {
    min-height: 32px;
    padding: 6px 10px;
}

.button.danger {
    border-color: #fecdca;
    background: #fff6f5;
    color: #b42318;
}

.button.danger:hover:not(:disabled) {
    border-color: #fda29b;
    background: #fee4e2;
}

.empty-table {
    padding: 34px 20px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.app-footer {
    min-height: 58px;
    padding: 18px 28px 18px 248px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid #eaecf0;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1120px) {
    .selected-row {
        grid-template-columns: minmax(180px, 1.3fr) minmax(180px, 1fr) 90px 90px;
    }

    .selected-row .mini-field:last-child {
        grid-column: 4;
    }
}

@media (max-width: 900px) {
    .app-layout,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .side-navigation {
        position: static;
        height: auto;
        padding: 12px;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .side-navigation-title {
        display: none;
    }

    .side-navigation-link {
        flex: 0 0 auto;
        margin: 0;
    }

    .page-content {
        width: min(100% - 28px, 1120px);
        padding-top: 18px;
    }

    .app-footer {
        padding-left: 22px;
    }

    .selected-row {
        grid-template-columns: 1fr 1fr;
    }

    .selected-course {
        grid-column: 1 / -1;
    }

    .selected-row .mini-field:last-child {
        grid-column: auto;
    }
}

@media (max-width: 680px) {
    .app-header {
        padding: 0 14px;
    }

    .header-link {
        display: none;
    }

    .intro-card {
        min-height: auto;
        padding: 23px 20px;
        align-items: flex-start;
        flex-direction: column;
    }

    .stepper {
        padding: 0 8px;
        overflow-x: auto;
    }

    .stepper li {
        min-width: 118px;
    }

    .panel {
        padding: 23px 18px;
    }

    .form-grid,
    .discipline-list,
    .application-summary,
    .selected-row,
    .admin-summary {
        grid-template-columns: 1fr;
    }

    .selected-course,
    .selected-row .mini-field:last-child {
        grid-column: auto;
    }

    .summary-item {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .summary-item:last-child {
        border-bottom: 0;
    }

    .form-actions,
    .sign-actions,
    .dialog-links,
    .applications-actions,
    .app-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .button {
        width: 100%;
    }
}
