:root {
    --primary: #a1115d;
    --secondary: #318ea2;
    --ink: #20303b;
    --muted: #6b7a86;
    --line: #dbe5ea;
    --soft: #f6f9fb;
    --white: #ffffff;
    --danger: #bd2d3b;
    --success: #147a55;
    --warning: #b16900;
    --shadow-soft: 0 12px 32px rgba(32, 48, 59, 0.08);
    --focus-ring: 0 0 0 4px rgba(49, 142, 162, 0.14);
}

html[data-theme="dark"] {
    --ink: #e9f1f5;
    --muted: #aebdc7;
    --line: #344650;
    --soft: #111b22;
    --white: #17232b;
    --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.quality-check-panel {
    background: linear-gradient(180deg, #fff 0%, #f8fbfc 100%);
    display: grid;
    gap: 14px;
    overflow: hidden;
}

.quality-summary-card {
    align-items: center;
    background:
        radial-gradient(circle at top left, rgba(161, 17, 93, 0.12), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 248, 250, 0.95));
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 16px;
    grid-template-columns: auto minmax(0, 1fr) minmax(190px, auto);
    padding: 14px 16px;
}

.quality-score {
    align-items: center;
    background: #fff;
    border: 6px solid rgba(161, 17, 93, 0.16);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(49, 142, 162, 0.12), 0 14px 28px rgba(32, 48, 59, 0.08);
    display: flex;
    flex-direction: column;
    height: 94px;
    justify-content: center;
    width: 94px;
}

.quality-score span {
    color: var(--ink);
    font-size: 26px;
    font-weight: 800;
}

.quality-score small,
.quality-meta span,
.quality-item span {
    color: var(--muted);
}

.quality-meta {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 5px;
    min-width: 210px;
    padding: 10px 12px;
}

.quality-metric-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quality-metric-grid div {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(32, 48, 59, 0.04);
    padding: 9px 11px;
}

.quality-metric-grid strong {
    display: block;
    font-size: 22px;
}

.quality-metric-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.quality-tabs {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(32, 48, 59, 0.06);
    overflow: hidden;
}

.quality-tab-buttons {
    background: #fbfdfe;
    border-bottom: 1px solid var(--line);
    gap: 6px;
    padding: 8px;
}

.quality-tab-buttons button {
    border-radius: 8px;
    color: #52616b;
    padding: 8px 12px;
}

.quality-tab-buttons button.active,
.quality-tab-buttons button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.quality-tab-panel {
    display: block;
    padding: 12px;
}

.quality-tabs.tabs-ready .quality-tab-panel {
    display: none;
}

.quality-tabs.tabs-ready .quality-tab-panel.active {
    display: block;
}

.quality-section {
    background: #fff;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    padding: 0;
}

.quality-section h3,
.quality-history summary {
    margin: 0;
}

.quality-section h3 {
    font-size: 16px;
    margin: 0;
}

.quality-section-title {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.quality-section-title span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.quality-list,
.quality-compact-list {
    display: grid;
    gap: 7px;
}

.quality-item {
    background: #fbfdfe;
    border: 1px solid var(--line);
    border-left: 4px solid var(--muted);
    border-radius: 12px;
    padding: 13px 14px;
}

.quality-compact-row {
    align-items: start;
    background: #fbfdfe;
    border: 1px solid var(--line);
    border-left: 3px solid var(--muted);
    border-radius: 10px;
    display: grid;
    gap: 3px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 10px;
}

.quality-compact-row strong,
.quality-compact-row span {
    display: block;
}

.quality-compact-row span {
    color: var(--muted);
    font-size: 12px;
}

.quality-compact-row em {
    background: #eef6f8;
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    padding: 3px 8px;
}

.quality-compact-row p {
    color: var(--muted);
    grid-column: 1 / -1;
    margin: 0;
    line-height: 1.35;
}

.quality-item strong,
.quality-item span {
    display: block;
}

.quality-item p {
    margin: 7px 0 0;
}

.quality-missing,
.quality-warning {
    border-left-color: #d97706;
}

.quality-missing {
    background: #fff8f0;
}

.quality-warning {
    background: #fffbeb;
}

.quality-success {
    background: #f0fdf4;
    border-left-color: #059669;
}

.quality-info {
    background: #f0f9fb;
    border-left-color: #2f8d9b;
}

.quality-danger {
    background: #fff5f5;
    border-left-color: var(--danger);
}

.quality-empty-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    color: var(--success);
    font-weight: 800;
    margin: 0;
    padding: 8px 10px;
}

.quality-readiness-summary {
    background: #fbfdfe;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-top: 10px;
    padding: 10px 12px;
}

.quality-readiness-summary p {
    color: var(--muted);
    margin: 3px 0 0;
}

.quality-single-recommendation .quality-compact-row {
    background: #fff7fb;
    border-color: rgba(161, 17, 93, 0.18);
    border-left-color: var(--primary);
}

.quality-document-table {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.quality-document-head,
.quality-document-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(210px, 1.7fr) 105px minmax(210px, 1.2fr) minmax(170px, 0.9fr);
    padding: 8px 10px;
}

.quality-document-head {
    background: var(--soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.quality-document-row {
    background: #fff;
    border-top: 1px solid var(--line);
    min-height: 42px;
}

.quality-document-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.quality-document-row strong {
    display: block;
    overflow-wrap: anywhere;
}

.quality-document-row span[data-label="Uploaded"] {
    color: var(--muted);
    font-size: 13px;
    white-space: normal;
}

.quality-history-table {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: auto;
}

.quality-history-table table {
    margin: 0;
}

.quality-history-table th,
.quality-history-table td {
    padding: 8px 10px;
    white-space: nowrap;
}

.quality-history {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.quality-history summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-weight: 800;
    justify-content: space-between;
    list-style: none;
    padding: 11px 13px;
}

.quality-history summary::-webkit-details-marker {
    display: none;
}

.quality-history summary::after {
    color: var(--primary);
    content: "+";
    font-size: 20px;
    line-height: 1;
}

.quality-history[open] summary::after {
    content: "-";
}

.quality-history small {
    color: var(--muted);
    font-weight: 700;
    margin-left: auto;
    margin-right: 12px;
}

.quality-history .table-wrap {
    border-top: 1px solid var(--line);
}

.quality-history th,
.quality-history td {
    padding: 8px 10px;
}

.quality-public-card {
    align-items: start;
    background: #f6fbfc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 18px;
    padding: 18px;
}

.quality-progress {
    background: #e8eff1;
    border-radius: 999px;
    height: 10px;
    margin: 12px 0;
    overflow: hidden;
}

.quality-progress span {
    background: linear-gradient(90deg, var(--primary), #2f8d9b);
    display: block;
    height: 100%;
}

.quality-public-actions {
    grid-column: 1 / -1;
}

.quality-public-actions article {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 4px;
    margin-top: 8px;
    padding: 12px;
}

.mini-action-list {
    color: var(--muted);
    display: grid;
    font-size: 12px;
    gap: 3px;
    margin-top: 8px;
}

.mini-action-list span::before {
    content: "- ";
}

@media (max-width: 900px) {
    .quality-summary-card,
    .quality-public-card {
        grid-template-columns: 1fr;
    }

    .quality-score {
        height: 108px;
        width: 108px;
    }

    .quality-metric-grid {
        grid-template-columns: 1fr;
    }

    .quality-tab-buttons {
        overflow-x: auto;
    }

    .quality-tab-buttons button {
        flex: 0 0 auto;
    }

    .quality-document-head {
        display: none;
    }

    .quality-document-row {
        gap: 6px;
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .quality-document-row > span {
        align-items: baseline;
        display: flex;
        gap: 10px;
        justify-content: space-between;
    }

    .quality-document-row > span::before {
        color: var(--muted);
        content: attr(data-label);
        flex: 0 0 112px;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

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

    .quality-compact-row em {
        justify-self: start;
    }

    .declaration-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .declaration-header span {
        white-space: normal;
    }

    .declaration-box {
        align-items: start;
        grid-template-columns: auto minmax(0, 1fr);
        padding: 12px;
    }

    .declaration-accept {
        grid-column: 2;
        justify-self: start;
    }

    .footer {
        gap: 10px;
        padding: 16px 18px;
    }

    .footer-links {
        grid-template-columns: minmax(0, 1fr);
        max-width: 320px;
    }

    .footer-links a {
        border-radius: 10px;
        min-height: 30px;
        padding: 6px 8px;
        width: 100%;
    }

    .footer-credit {
        max-width: 300px;
        font-size: 12px;
    }
}

@media (max-width: 1180px) and (min-width: 901px) {
    .quality-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(180deg, #f8fbfc 0, #ffffff 280px);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

html[data-theme="dark"] body {
    background: linear-gradient(180deg, #0f171d 0, #121c23 280px);
}

[hidden] {
    display: none !important;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.topbar {
    align-items: center;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 14px clamp(18px, 4vw, 56px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.theme-toggle {
    align-items: center;
    background: #f4fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    min-height: 34px;
    padding: 0;
    width: 34px;
}

.theme-toggle svg {
    fill: none;
    height: 15px;
    max-height: 15px;
    max-width: 15px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 15px;
}

.theme-icon {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
}

.brand img {
    display: block;
    height: 46px;
    max-width: 210px;
    object-fit: contain;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
}

.nav a {
    color: var(--ink);
    font-weight: 700;
}

.topbar-icons {
    align-items: center;
    display: inline-flex;
    gap: 10px;
}

.icon-link {
    align-items: center;
    background: #f4fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    position: relative;
    width: 34px;
}

.icon-link b {
    align-items: center;
    background: var(--danger);
    border-radius: 999px;
    color: var(--white);
    display: inline-flex;
    font-size: 10px;
    height: 18px;
    justify-content: center;
    min-width: 18px;
    padding: 0 5px;
    position: absolute;
    right: -7px;
    top: -7px;
}

.help-trigger {
    border: 1px solid var(--line);
    cursor: pointer;
    font-family: inherit;
}

.sr-only {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.help-widget {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(32, 48, 59, 0.18);
    max-height: calc(100vh - 110px);
    max-width: calc(100vw - 28px);
    overflow: hidden;
    position: fixed;
    right: clamp(14px, 3vw, 46px);
    top: 82px;
    width: 390px;
    z-index: 70;
}

.help-head {
    align-items: center;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
}

.help-head strong,
.help-head span {
    display: block;
}

.help-head span {
    font-size: 13px;
    opacity: 0.9;
}

.help-head button {
    background: transparent;
    border: 0;
    color: var(--white);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.help-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding: 14px;
}

.help-message {
    border-radius: 10px;
    padding: 10px 12px;
}

.help-message p {
    margin: 5px 0 0;
}

.help-message.bot {
    background: #f4fafc;
    border: 1px solid var(--line);
}

.help-message.user {
    align-self: flex-end;
    background: var(--primary);
    color: var(--white);
    max-width: 85%;
}

.help-chips {
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px 0;
}

.help-chip {
    background: #eef7fa;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 7px 10px;
}

.help-chip.category {
    background: #fff2f8;
    border-color: rgba(161, 17, 93, 0.18);
    color: var(--primary);
}

.help-chip:focus-visible,
.help-form input:focus-visible,
.help-form button:focus-visible,
.help-head button:focus-visible {
    outline: 3px solid rgba(49, 142, 162, 0.28);
    outline-offset: 2px;
}

.help-chip:hover {
    border-color: var(--secondary);
    color: var(--primary);
}

.help-form {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr auto;
    padding: 12px 14px 14px;
}

.help-form input {
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    padding: 10px 12px;
    width: 100%;
}

.help-form button {
    background: var(--primary);
    border: 0;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    font-weight: 900;
    padding: 10px 14px;
}

.profile-menu {
    position: relative;
}

.profile-menu summary {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    gap: 8px;
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu > div,
.action-menu > div {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(32, 48, 59, 0.16);
    min-width: 190px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 520;
}

.profile-menu a,
.action-menu a,
.menu-form button {
    color: var(--ink);
    display: block;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}

.profile-menu a:hover,
.action-menu a:hover,
.menu-form button:hover {
    background: #f4fafc;
    border-radius: 7px;
    color: var(--primary);
}

.menu-form button:disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.55;
}

.avatar {
    align-items: center;
    background: #eef7fa;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 38px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.avatar.small {
    flex-basis: 30px;
    height: 30px;
    width: 30px;
}

.avatar.large {
    flex-basis: 76px;
    font-size: 28px;
    height: 76px;
    width: 76px;
}

.admin-subnav {
    align-items: center;
    background: #f4fafc;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px clamp(18px, 4vw, 56px);
}

.admin-subnav a {
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--ink);
    font-weight: 800;
    padding: 8px 12px;
}

.admin-subnav a:hover,
.admin-subnav a.active {
    background: var(--white);
    border-color: var(--line);
    color: var(--primary);
}

main {
    margin: 0 auto;
    max-width: 1180px;
    padding: 34px 18px 60px;
}

.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    margin: -34px -18px 34px;
    padding: 56px clamp(18px, 5vw, 72px);
}

.hero h1 {
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.05;
    margin: 0 0 14px;
}

.hero p {
    font-size: 18px;
    max-width: 760px;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.span-two {
    grid-column: span 2;
}

.panel,
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(32, 48, 59, 0.03);
    padding: 22px;
}

.panel h2,
.panel h3,
.card h3 {
    margin-top: 0;
}

.form-section {
    border-top: 4px solid var(--secondary);
    margin-bottom: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}

.form-submit-field {
    justify-content: flex-start;
}

.form-submit-field .button {
    align-self: flex-start;
    min-height: 46px;
    width: auto;
}

label,
legend {
    color: #2c3d47;
    font-weight: 700;
}

input,
select,
textarea {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    min-height: 48px;
    padding: 12px 13px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--secondary);
    box-shadow: var(--focus-ring);
    outline: none;
}

.iti {
    width: 100%;
}

.iti input.phone-input {
    padding-left: 92px !important;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.radio-row,
.choice-grid,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.agreement-download-actions,
.agreement-history-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.agreement-history-actions {
    margin-top: 10px;
}

.agreement-history-actions .button {
    padding: 8px 12px;
}

.agreement-history-actions form {
    margin: 0;
}

.admin-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(104px, 1fr));
    max-width: 640px;
}

.admin-dashboard-panel {
    display: grid;
    gap: 22px;
}

.dashboard-heading h1 {
    margin-bottom: 8px;
}

.dashboard-actions {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    max-width: none;
}

.dashboard-filter {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.agent-filter-form {
    align-items: end;
    margin-top: 18px;
}

.agent-filter-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
    margin-top: -4px;
}

.agent-filter-actions .button {
    min-height: 46px;
    width: auto;
}

.agent-identity {
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
    margin: 4px 0 10px;
}

.agent-profile-head {
    align-items: center;
}

.agent-profile-media {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}

.agent-media-card {
    align-items: center;
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    min-width: 230px;
    padding: 12px;
}

.agent-media-card img {
    border: 1px solid var(--line);
    border-radius: 8px;
    height: 76px;
    object-fit: cover;
    width: 76px;
}

.agent-media-card .image-fallback {
    display: none;
}

.agent-list-profile {
    align-items: center;
    display: flex;
    gap: 12px;
}

.agent-list-profile > div {
    min-width: 0;
}

.agent-list-image,
.agent-header-media img {
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

.agent-list-image {
    height: 42px;
    width: 42px;
}

.agent-header-media {
    align-items: center;
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 116px;
    padding: 12px;
    text-align: center;
}

.agent-header-media img {
    height: 76px;
    width: 76px;
}

.agent-header-media > span:last-child {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.image-fallback {
    display: none;
}

.admin-action {
    align-items: flex-start;
    background: #eef7fa;
    border: 1px solid #d8e9ef;
    border-radius: 8px;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 96px;
    padding: 13px;
}

.admin-action:hover {
    border-color: var(--secondary);
}

.admin-action-icon {
    align-items: center;
    background: var(--white);
    border-radius: 8px;
    color: var(--primary);
    display: inline-flex;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.admin-action-icon svg {
    fill: none;
    flex: 0 0 20px;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 20px;
}

.admin-action span:not(.admin-action-icon) {
    font-weight: 800;
}

.admin-action small {
    color: var(--muted);
    font-weight: 700;
}

.inline-control {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr auto;
}

.radio-pill {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    padding: 11px 13px;
}

.course-choice-panel {
    border-top-color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.course-choice-panel h2 {
    margin-bottom: 16px;
}

.course-choice-grid {
    gap: 16px 18px;
}

.course-choice-panel .field {
    margin-bottom: 0;
}

.course-select-field {
    grid-column: 1 / -1;
}

.course-select-field select {
    min-height: 54px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-select-field option {
    white-space: normal;
}

.route-choice-field {
    grid-column: 1 / -1;
}

.route-choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-choice-card {
    background: #f8fbfc;
    cursor: pointer;
    min-height: 58px;
    padding: 14px 16px;
    position: relative;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.route-choice-card input {
    flex: 0 0 auto;
    width: auto;
}

.route-choice-card span {
    font-weight: 800;
}

.route-choice-card:hover {
    border-color: rgba(49, 142, 162, 0.55);
    box-shadow: 0 8px 18px rgba(32, 48, 59, 0.07);
    transform: translateY(-1px);
}

.route-choice-card:has(input:checked) {
    background: #fff7fb;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(161, 17, 93, 0.11);
}

.route-info-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.route-info-card {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(32, 48, 59, 0.04);
    padding: 12px 14px;
}

.route-info-card strong {
    color: var(--ink);
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
}

.route-info-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

.agent-application-form {
    box-shadow: var(--shadow-soft);
}

.agent-application-form .form-section {
    border-top-color: var(--primary);
    padding-top: 18px;
}

.recruiter-scope-section > label {
    display: block;
    margin-bottom: 12px;
}

.recruiter-details-grid {
    align-items: start;
}

.multi-select-field {
    background: #fbfdfe;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
}

.multi-select-field select[multiple] {
    min-height: 190px;
    padding: 8px;
}

.multi-select-field select[multiple] option {
    border-radius: 6px;
    padding: 8px 10px;
}

.multi-select-field select[multiple] option:checked {
    background: linear-gradient(0deg, var(--primary), var(--primary));
    color: var(--white);
}

.multi-select-field.is-disabled {
    background: #f2f6f8;
    opacity: 0.72;
}

.agent-local-note {
    background: #eef7fa;
    border-left: 4px solid var(--secondary);
    border-radius: 8px;
    margin: 12px 0 0;
    padding: 12px 14px;
}

.agent-declaration-box {
    background: #fbfdfe;
    border-radius: 10px;
    padding: 18px;
}

.choice-card {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex: 1 1 230px;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 86px;
    padding: 18px;
}

.choice-card.is-disabled {
    background: #f2f6f8;
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.62;
}

.choice-card.is-disabled .choice-icon {
    filter: grayscale(1);
}

.choice-card input {
    width: auto;
}

.choice-card:has(input:checked) {
    background: #fff7fb;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(161, 17, 93, 0.11);
}

.choice-icon {
    align-items: center;
    background: #eef7fa;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 48px;
    font-size: 26px;
    height: 48px;
    justify-content: center;
    line-height: 1;
    width: 48px;
}

.choice-card .choice-label {
    font-size: 18px;
    font-weight: 800;
}

.choice-card .choice-icon {
    font-size: 26px;
}

.choice-icon.uk-flag {
    background:
        linear-gradient(27deg, transparent 42%, #ffffff 42%, #ffffff 47%, #c8102e 47%, #c8102e 53%, #ffffff 53%, #ffffff 58%, transparent 58%),
        linear-gradient(153deg, transparent 42%, #ffffff 42%, #ffffff 47%, #c8102e 47%, #c8102e 53%, #ffffff 53%, #ffffff 58%, transparent 58%),
        linear-gradient(90deg, transparent 39%, #ffffff 39%, #ffffff 45%, #c8102e 45%, #c8102e 55%, #ffffff 55%, #ffffff 61%, transparent 61%),
        linear-gradient(0deg, transparent 34%, #ffffff 34%, #ffffff 42%, #c8102e 42%, #c8102e 58%, #ffffff 58%, #ffffff 66%, transparent 66%),
        #012169;
    color: transparent;
}

.choice-icon.eu-flag {
    background: #003399;
    color: #ffcc00;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0;
    position: relative;
}

.choice-icon.eu-flag::before,
.choice-icon.eu-flag::after {
    color: #ffcc00;
    content: "★ ★ ★";
    font-size: 8px;
    left: 8px;
    letter-spacing: 1px;
    position: absolute;
}

.choice-icon.eu-flag::before {
    top: 7px;
}

.choice-icon.eu-flag::after {
    bottom: 7px;
}

.choice-icon.international-icon::before {
    content: "🌐";
}

.location-rule-box {
    background: #eef8fb;
    border: 1px solid rgba(49, 142, 162, 0.28);
    border-left: 4px solid var(--secondary);
    border-radius: 10px;
    color: var(--ink);
    font-weight: 700;
    margin: 12px 0 16px;
    padding: 12px 14px;
}

.location-rule-box.soft {
    background: #fff8ed;
    border-color: rgba(177, 105, 0, 0.28);
    border-left-color: var(--warning);
}

.location-rule-box.warning {
    background: #fff8ed;
    border-color: rgba(177, 105, 0, 0.3);
    border-left-color: var(--warning);
}

.student-type-guidance-box {
    background: #f8fbfc;
    border: 1px solid rgba(49, 142, 162, 0.18);
    border-radius: 10px;
    color: var(--ink);
    margin-top: 16px;
    padding: 14px 16px;
}

.student-type-guidance-box p {
    margin: 0 0 8px;
}

.student-type-guidance-box p:last-child {
    margin-bottom: 0;
}

.recommended-badge {
    background: #e7f7f1;
    border: 1px solid rgba(14, 125, 76, 0.16);
    border-radius: 999px;
    color: #0e7d4c;
    font-size: 12px !important;
    font-weight: 800;
    margin-left: auto;
    padding: 5px 10px;
    text-transform: uppercase;
}

.ip-mismatch-confirm {
    margin-top: 14px;
}

.declaration-panel {
    background:
        radial-gradient(circle at top right, rgba(161, 17, 93, 0.08), transparent 30%),
        #fff;
}

.declaration-header {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 14px;
}

.declaration-header h2 {
    margin: 0;
}

.declaration-header span {
    background: #fff2f8;
    border: 1px solid rgba(161, 17, 93, 0.14);
    border-radius: 999px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    padding: 6px 11px;
    white-space: nowrap;
}

.declaration-intro {
    color: var(--muted);
    font-size: 15px;
    margin: 0 0 14px;
    max-width: 980px;
}

.declaration-list {
    display: grid;
    gap: 10px;
}

.declaration-box {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(32, 48, 59, 0.04);
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin: 0;
    padding: 13px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.declaration-box:hover,
.declaration-box:focus-within {
    border-color: rgba(161, 17, 93, 0.24);
    box-shadow: 0 12px 26px rgba(32, 48, 59, 0.08);
    transform: translateY(-1px);
}

.declaration-box input[type="checkbox"] {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.declaration-check {
    align-items: center;
    background: #fff;
    border: 2px solid #cfd8dc;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.declaration-check::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    height: 10px;
    opacity: 0;
    transform: rotate(45deg) translateY(-1px);
    width: 5px;
}

.declaration-copy {
    display: grid;
    gap: 4px;
}

.declaration-copy strong {
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.25;
}

.declaration-copy small {
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.declaration-accept {
    background: #fff2f8;
    border: 1px solid rgba(161, 17, 93, 0.18);
    border-radius: 999px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    min-width: 88px;
    padding: 7px 12px;
    text-align: center;
}

.declaration-accept .accept-done {
    display: none;
}

.declaration-box input[type="checkbox"]:checked + .declaration-check {
    background: var(--primary);
    border-color: var(--primary);
}

.declaration-box input[type="checkbox"]:checked + .declaration-check::after {
    opacity: 1;
}

.declaration-box:has(input[type="checkbox"]:checked) {
    background: linear-gradient(180deg, #fff 0%, #fff7fb 100%);
    border-color: rgba(161, 17, 93, 0.24);
}

.declaration-box input[type="checkbox"]:checked ~ .declaration-accept {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.declaration-box input[type="checkbox"]:checked ~ .declaration-accept .accept-default {
    display: none;
}

.declaration-box input[type="checkbox"]:checked ~ .declaration-accept .accept-done {
    display: inline;
}

.declaration-box input[type="checkbox"]:focus-visible + .declaration-check {
    box-shadow: var(--focus-ring);
}

.declaration-signature-grid {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-top: 14px;
    padding: 14px;
}

.button {
    background: var(--primary);
    border: 0;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.button:hover {
    box-shadow: 0 8px 18px rgba(161, 17, 93, 0.18);
    transform: translateY(-1px);
}

.button.secondary {
    background: var(--secondary);
}

.button.light {
    background: #eef5f7;
    color: var(--ink);
}

.button.danger-button {
    background: var(--danger);
}

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

.back-link {
    color: var(--secondary);
    display: inline-flex;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 8px;
}

.back-link::before {
    content: "<";
    margin-right: 7px;
}

.application-header {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.application-summary-panel,
.application-details-panel,
.documents-panel,
.office-work {
    margin-bottom: 18px;
}

.office-work h2,
.office-work h3 {
    margin-top: 0;
}

.office-tabs {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.tab-buttons {
    background: #f4fafc;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
}

.tab-buttons button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 10px 13px;
}

.tab-buttons button.active,
.tab-buttons button:hover {
    background: var(--white);
    border-color: var(--line);
    color: var(--primary);
}

.tab-panel {
    display: none;
    padding: 18px;
}

.tab-panel.active {
    display: block;
}

.student-hero {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.student-hero h1 {
    margin-bottom: 8px;
}

.student-status-stack {
    align-items: flex-end;
    display: grid;
    gap: 8px;
    min-width: 180px;
    text-align: right;
}

.student-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 22px;
}

.student-summary-grid .card {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 112px;
    padding: 16px;
}

.student-summary-grid strong {
    color: var(--muted);
    display: block;
    font-size: 12px;
    text-transform: uppercase;
}

.student-summary-grid span {
    display: block;
    font-size: 18px;
    font-weight: 900;
    margin-top: 12px;
}

.student-summary-grid small {
    color: var(--muted);
    display: block;
    margin-top: 6px;
}

.student-summary-grid .student-intake {
    color: var(--ink);
    font-weight: 900;
}

.student-summary-grid span.student-summary-note {
    font-size: 15px;
    line-height: 1.35;
}

.status-note {
    background: #f4fafc;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    margin-top: 18px;
    padding: 12px 14px;
}

.student-portal-tabs .tab-panel h2 {
    margin-top: 0;
}

.student-timeline {
    display: grid;
    gap: 14px;
}

.student-timeline article {
    display: grid;
    gap: 12px;
    grid-template-columns: 18px 1fr;
}

.student-timeline article > span {
    background: var(--primary);
    border-radius: 999px;
    box-shadow: 0 0 0 5px #f7e8f1;
    height: 10px;
    margin: 7px 0 0 4px;
    width: 10px;
}

.student-timeline article div,
.conversation article {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
}

.student-timeline p,
.conversation p {
    margin: 5px 0 0;
}

.conversation {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.conversation article {
    max-width: 820px;
}

.conversation article.mine {
    background: #f7e8f1;
    justify-self: end;
}

.conversation span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-top: 8px;
}

.student-message-form {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.compact-office-form textarea {
    min-height: 86px;
}

.record-editor {
    background: #fbfdfe;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 14px 0;
}

.record-editor summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-weight: 800;
    list-style: none;
    padding: 14px 16px;
}

.record-editor summary::-webkit-details-marker {
    display: none;
}

.record-editor summary::before {
    color: var(--brand);
    content: "+";
    font-size: 20px;
    line-height: 1;
}

.record-editor[open] summary::before {
    content: "-";
}

.record-editor form,
.record-editor .detail-list {
    border-top: 1px solid var(--line);
    padding: 16px;
}

.record-editor.mini-editor {
    min-width: 360px;
}

.university-record-list {
    margin-top: 14px;
}

.compact-feed {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.compact-feed p {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
    padding: 10px 12px;
}

.print-title {
    display: none;
}

.student-profile-row {
    align-items: flex-start;
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr auto;
}

.student-profile-row h2 {
    margin: 0 0 4px;
}

.summary-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}

.summary-strip div {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 86px;
    padding: 12px;
}

.summary-strip strong {
    color: var(--muted);
    display: block;
    font-size: 12px;
    text-transform: uppercase;
}

.summary-strip span {
    display: block;
    font-weight: 800;
    margin-top: 8px;
}

.student-photo-card {
    background: #f4fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    flex: 0 0 170px;
    font-size: 12px;
    font-weight: 800;
    padding: 10px;
    text-align: center;
}

.student-photo-card img,
.student-photo-empty {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    height: 150px;
    justify-content: center;
    margin-bottom: 8px;
    object-fit: cover;
    width: 150px;
}

.student-photo-empty {
    align-items: center;
    padding: 10px;
}

.detail-group {
    border-top: 1px solid var(--line);
    padding: 18px 0 4px;
}

.detail-group:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.detail-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.detail-list div {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
}

.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.inline-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.compact-select {
    min-width: 130px;
    padding: 9px 10px;
}

.bulk-action-bar {
    align-items: center;
    background: #f4fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(32, 48, 59, 0.07);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 12px;
    padding: 12px;
    position: sticky;
    top: 76px;
    z-index: 5;
}

.bulk-action-bar .button {
    width: auto;
}

.select-all-inline {
    align-items: center;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-flex;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
}

.select-all-inline input {
    width: auto;
}

.table-input {
    border: 1px solid var(--line);
    border-radius: 7px;
    min-width: 150px;
    padding: 9px 10px;
    width: 100%;
}

.table-input.narrow {
    min-width: 95px;
}

.course-filter-form {
    background: #fbfdfe;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-top: 18px;
    padding: 14px;
}

.course-management-filter {
    align-items: end;
}

.course-card-list {
    display: grid;
    gap: 14px;
}

.course-admin-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(32, 48, 59, 0.06);
    display: grid;
    gap: 14px;
    grid-template-columns: auto 1fr;
    padding: 16px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.course-admin-card:hover {
    border-color: rgba(49, 142, 162, 0.35);
    box-shadow: 0 12px 28px rgba(32, 48, 59, 0.09);
}

.course-card-select {
    padding-top: 8px;
}

.course-card-select input {
    height: 20px;
    width: 20px;
}

.course-card-main {
    min-width: 0;
}

.course-card-header {
    align-items: flex-start;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.course-card-header h2 {
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.25;
    margin: 0;
    overflow-wrap: anywhere;
}

.course-card-header p {
    color: var(--muted);
    font-weight: 700;
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}

.course-card-badges {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    max-width: 520px;
}

.course-card-fields {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
    padding-top: 14px;
}

.course-card-fields .field {
    margin-bottom: 0;
}

.course-card-fields .compact-select,
.course-card-fields .table-input {
    min-width: 0;
    width: 100%;
}

.empty-state {
    background: #f8fbfc;
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--muted);
    font-weight: 700;
    padding: 18px;
    text-align: center;
}

.table-wrap {
    overflow-x: auto;
}

.users-table-wrap {
    overflow: visible;
}

.users-table {
    border-spacing: 0;
}

.users-table th {
    background: #f4fafc;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.users-table th:first-child {
    border-radius: 8px 0 0 8px;
}

.users-table th:last-child {
    border-radius: 0 8px 8px 0;
}

.users-table tbody tr {
    transition: background 0.16s ease;
}

.users-table tbody tr:hover {
    background: #fbfdfe;
}

.agent-applications-table {
    table-layout: fixed;
}

.agent-applications-table th:nth-child(1) { width: 25%; }
.agent-applications-table th:nth-child(2) { width: 18%; }
.agent-applications-table th:nth-child(3) { width: 15%; }
.agent-applications-table th:nth-child(4) { width: 10%; }
.agent-applications-table th:nth-child(5) { width: 22%; }
.agent-applications-table th:nth-child(6) { width: 10%; }

.agent-applications-table td {
    overflow-wrap: anywhere;
}

.agent-applications-table td > .muted,
.agent-applications-table td > strong {
    display: block;
}

.agent-row-actions {
    align-items: center;
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
}

.agent-row-actions .button {
    align-items: center;
    line-height: 1.2;
    min-height: 38px;
    padding: 8px 10px;
    white-space: normal;
    width: auto;
}

.agent-actions-row td {
    border-bottom: 2px solid var(--line);
    padding-top: 0;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 10px;
}

.badge.info { background: #e7f3f8; color: #145b70; }
.badge.warning { background: #fff3df; color: var(--warning); }
.badge.danger { background: #fdebed; color: var(--danger); }
.badge.success { background: #e6f5ef; color: var(--success); }
.badge.muted { background: #eef1f3; color: var(--muted); }

.flash {
    align-items: flex-start;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(32, 48, 59, 0.14);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    max-width: 1180px;
    padding: 13px 18px;
    position: fixed;
    right: 18px;
    top: 82px;
    width: min(440px, calc(100% - 36px));
    z-index: 30;
}

.flash-close {
    background: transparent;
    border: 0;
    color: currentColor;
    cursor: pointer;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    padding: 0;
}

.flash.success {
    background: #e6f5ef;
    color: var(--success);
}

.flash.error {
    background: #fdebed;
    color: var(--danger);
}

.muted {
    color: var(--muted);
}

.footer {
    align-items: center;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, #fff 0%, #f7fbfc 100%);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px clamp(18px, 4vw, 56px);
    text-align: center;
}

.footer-brand {
    display: grid;
    gap: 3px;
    justify-items: center;
}

.footer-brand a {
    color: var(--primary);
    font-size: 16px;
    font-weight: 900;
    text-decoration: none;
}

.footer-brand a:hover {
    text-decoration: underline;
}

.footer-brand span,
.footer-credit {
    color: var(--muted);
    font-size: 13px;
}

.footer-links {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 760px;
    width: 100%;
}

.footer-links a {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    gap: 6px;
    justify-content: flex-start;
    min-height: 32px;
    padding: 6px 9px;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.footer-links a > span:not(.footer-icon) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-label-mobile {
    display: none;
}

.footer-links a:hover {
    border-color: rgba(161, 17, 93, 0.28);
    box-shadow: 0 8px 18px rgba(32, 48, 59, 0.08);
    color: var(--primary);
}

.footer-icon {
    align-items: center;
    background: #fff2f8;
    border: 1px solid rgba(161, 17, 93, 0.14);
    border-radius: 8px;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 20px;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.footer-icon svg {
    fill: none;
    height: 13px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 13px;
}

.footer-icon-letter {
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.footer-link-website .footer-icon {
    background: linear-gradient(135deg, rgba(49, 142, 162, 0.12), rgba(161, 17, 93, 0.12));
    border-color: rgba(49, 142, 162, 0.22);
    color: #8f1664;
}

.footer-link-whatsapp .footer-icon {
    background: #e9fbf1;
    border-color: rgba(18, 140, 76, 0.18);
    color: #128c4c;
}

.footer-link-email .footer-icon {
    background: #ecfbff;
    border-color: rgba(49, 142, 162, 0.18);
    color: #1f7f93;
}

.footer-link-facebook .footer-icon {
    background: #edf4ff;
    border-color: rgba(24, 119, 242, 0.18);
    color: #1877f2;
}

.footer-link-instagram .footer-icon {
    background: linear-gradient(135deg, #fff1f5, #f5edff);
    border-color: rgba(180, 36, 134, 0.18);
    color: #c0268f;
}

.footer-link-tiktok .footer-icon {
    background: #f3f4f6;
    border-color: rgba(17, 24, 39, 0.16);
    color: #111827;
    box-shadow: inset 2px 0 0 rgba(37, 244, 238, 0.45);
}

.footer-credit {
    color: var(--muted);
    max-width: 520px;
    text-align: center;
}

.footer-cookie-button {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    padding: 7px 12px;
}

.back-to-top {
    align-items: center;
    background: var(--primary);
    border: 0;
    border-radius: 999px;
    bottom: 22px;
    box-shadow: 0 14px 30px rgba(32, 48, 59, 0.18);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    right: 22px;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    width: 42px;
    z-index: 60;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top svg {
    fill: none;
    height: 20px;
    max-height: 20px;
    max-width: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 20px;
}

.cookie-modal {
    align-items: center;
    background: rgba(17, 27, 34, 0.48);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 600;
}

.cookie-banner {
    align-items: center;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    bottom: 18px;
    box-shadow: 0 18px 45px rgba(32, 48, 59, 0.18);
    color: var(--ink);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    left: 18px;
    max-width: 760px;
    padding: 16px;
    position: fixed;
    right: 76px;
    z-index: 590;
}

.cookie-banner strong,
.cookie-banner p {
    display: block;
    margin: 0;
}

.cookie-banner p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.cookie-banner-actions .button {
    min-height: 36px;
    padding: 8px 12px;
}

.cookie-panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    max-width: 520px;
    padding: 22px;
    position: relative;
    width: 100%;
}

.cookie-panel h2 {
    margin-top: 0;
}

.cookie-close {
    background: #f4fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
    font-size: 22px;
    height: 34px;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 34px;
}

.compact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .admin-subnav,
html[data-theme="dark"] .help-widget,
html[data-theme="dark"] .profile-menu > div,
html[data-theme="dark"] .action-menu > div,
html[data-theme="dark"] .quality-check-panel,
html[data-theme="dark"] .quality-summary-card,
html[data-theme="dark"] .quality-score,
html[data-theme="dark"] .quality-meta,
html[data-theme="dark"] .quality-metric-grid div,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .footer-links a,
html[data-theme="dark"] .footer-cookie-button,
html[data-theme="dark"] .cookie-banner,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: var(--white);
    color: var(--ink);
}

html[data-theme="dark"] .help-message.bot,
html[data-theme="dark"] .help-chip,
html[data-theme="dark"] .button.light,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .icon-link,
html[data-theme="dark"] .cookie-close {
    background: #22313a;
    color: var(--ink);
}

html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
    border-color: var(--line);
    color: var(--ink);
}

@media (max-width: 900px) {
    .footer {
        gap: 10px;
        padding: 16px 18px;
    }

    .footer-brand {
        gap: 4px;
    }

    .footer-links {
        gap: 8px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 420px;
    }

    .footer-links a {
        border-radius: 10px;
        font-size: 11px;
        justify-content: center;
        min-height: 34px;
        padding: 7px 6px;
        width: 100%;
    }

    .footer-label-desktop {
        display: none;
    }

    .footer-label-mobile {
        display: inline;
    }

    .footer-credit {
        max-width: 320px;
        font-size: 12px;
    }

    .back-to-top {
        bottom: 16px;
        right: 14px;
    }

    .cookie-panel {
        padding: 18px;
    }

    .cookie-banner {
        bottom: 12px;
        grid-template-columns: 1fr;
        left: 12px;
        right: 12px;
    }

    .cookie-banner-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 360px) {
    .footer-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 300px;
    }
}

.tips {
    background: #f0f8fa;
    border-left: 4px solid var(--secondary);
    border-radius: 8px;
    margin: 16px 0;
    padding: 16px 18px;
}

.compact-tips {
    margin-top: 0;
    padding: 12px 14px;
}

.compact-tips p {
    margin: 6px 0 0;
}

.tips ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.validation-summary {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 18px 0;
    padding: 18px;
}

.validation-summary.success {
    background: #f2fbf7;
    border-color: #b9e4d2;
}

.validation-summary.error {
    background: #fff5f6;
    border-color: #f0b7bf;
}

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

.setting-toggle {
    align-items: flex-start;
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 3px 8px;
    grid-template-columns: auto 1fr;
    padding: 11px;
}

.setting-toggle input {
    grid-row: span 2;
    margin-top: 4px;
    width: auto;
}

.setting-toggle span {
    font-weight: 900;
}

.setting-toggle small {
    color: var(--muted);
    font-weight: 600;
}

.g-recaptcha {
    margin: 4px 0 12px;
}

.letter-preview {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    white-space: pre-wrap;
}

.permission-list,
.template-card {
    display: grid;
    gap: 16px;
}

.permission-card,
.template-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.permission-card h3 {
    margin: 0 0 4px;
}

.permission-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 14px 0;
}

.permission-check {
    align-items: center;
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: flex;
    font-weight: 700;
    gap: 8px;
    padding: 10px;
}

.permission-check input {
    width: auto;
}

.compact-field {
    max-width: 220px;
}

.users-hero {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.eyebrow {
    color: var(--primary);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.user-filter-bar {
    align-items: end;
    background: #fbfdfe;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 14px;
    grid-template-columns: 2fr 1fr 1fr auto;
    margin-bottom: 18px;
    padding: 14px;
}

.users-table td {
    padding-bottom: 14px;
    padding-top: 14px;
    vertical-align: middle;
}

.users-table input[type="checkbox"] {
    width: auto;
}

.user-cell {
    align-items: center;
    display: flex;
    gap: 12px;
}

.action-cell {
    overflow: visible;
    position: relative;
    text-align: right;
}

.action-menu {
    display: inline-block;
    position: relative;
    z-index: 20;
}

.action-menu summary {
    align-items: center;
    background: #eef5f7;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-size: 22px;
    font-weight: 900;
    height: 40px;
    justify-content: center;
    list-style: none;
    padding: 4px 10px;
    transition: background 0.16s ease, color 0.16s ease;
    width: 44px;
}

.action-menu summary:hover,
.action-menu[open] summary {
    background: #f7e7f0;
    color: var(--primary);
}

.action-menu summary::-webkit-details-marker {
    display: none;
}

.action-menu[open] {
    z-index: 500;
}

.action-menu.open-up > div {
    bottom: calc(100% + 10px);
    top: auto;
}

.user-profile-head {
    align-items: center;
    display: flex;
    gap: 18px;
}

.modal {
    align-items: center;
    background: rgba(32, 48, 59, 0.42);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 50;
}

.modal-card {
    background: var(--white);
    border-radius: 8px;
    max-width: 860px;
    padding: 22px;
    width: 100%;
}

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

.document-card {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: 86px 1fr;
    padding: 12px;
}

.document-card h3,
.document-card p {
    margin: 0 0 6px;
}

.document-review-form {
    margin-top: 10px;
}

.document-thumb,
.document-file-icon {
    align-items: center;
    background: #eef5f7;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    height: 76px;
    justify-content: center;
    object-fit: cover;
    width: 76px;
}

.document-file-icon {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .help-widget {
        left: 12px;
        right: 12px;
        top: 92px;
        width: auto;
    }

    .users-hero,
    .user-profile-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-filter-bar {
        grid-template-columns: 1fr;
    }

    .users-table-wrap {
        overflow-x: auto;
        overflow-y: visible;
    }

    .users-table {
        min-width: 820px;
    }

    .course-management-filter {
        grid-template-columns: 1fr;
    }

    .course-admin-card,
    .course-card-header,
    .course-card-fields {
        grid-template-columns: 1fr;
    }

    .course-card-select {
        padding-top: 0;
    }

    .course-card-badges {
        justify-content: flex-start;
        max-width: none;
    }

    .bulk-action-bar {
        align-items: stretch;
        position: static;
    }

    .bulk-action-bar .button,
    .select-all-inline {
        width: 100%;
    }

    .grid.two,
    .grid.three,
    .grid.four,
    .grid.five {
        grid-template-columns: 1fr;
    }

    .span-two {
        grid-column: auto;
    }

    .admin-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
        width: 100%;
    }

    .dashboard-actions {
        grid-template-columns: 1fr;
    }

    .agent-filter-actions {
        grid-column: auto;
        margin-top: 0;
    }

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

    .route-info-grid {
        grid-template-columns: 1fr;
    }

    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .document-card {
        grid-template-columns: 1fr;
    }

    .student-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .student-status-stack {
        align-items: flex-start;
        text-align: left;
    }

    .student-summary-grid {
        grid-template-columns: 1fr;
    }

    .permission-grid {
        grid-template-columns: 1fr;
    }

    .setting-toggle-grid {
        grid-template-columns: 1fr;
    }

    .application-header {
        flex-direction: column;
    }

    .student-profile-row,
    .summary-strip {
        grid-template-columns: 1fr;
    }

    .student-photo-card {
        flex-basis: auto;
        width: 100%;
    }

    .student-photo-card img,
    .student-photo-empty {
        margin-left: auto;
        margin-right: auto;
    }

    .detail-list {
        grid-template-columns: 1fr;
    }

    .document-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        margin: 10mm;
        size: A4;
    }

    body {
        background: #fff;
        color: #111;
        font-size: 10px;
    }

    .topbar,
    .admin-subnav,
    .help-widget,
    .footer,
    .no-print,
    .flash,
    .office-work {
        display: none !important;
    }

    main {
        max-width: none;
        padding: 0;
    }

    .panel,
    .card {
        border-color: #cfd8dc;
        box-shadow: none;
        padding: 10px;
    }

    .application-summary-panel,
    .application-details-panel,
    .documents-panel {
        margin-bottom: 8px;
        page-break-inside: avoid;
    }

    .print-title {
        border-bottom: 1px solid #cfd8dc;
        display: block;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .print-title h1,
    .student-profile-row h2,
    .panel h2 {
        margin: 0 0 4px;
    }

    .student-profile-row {
        grid-template-columns: 1fr 96px;
    }

    .summary-strip {
        gap: 5px;
        grid-template-columns: repeat(4, 1fr);
        margin-top: 8px;
    }

    .summary-strip div,
    .detail-list div {
        min-height: 0;
        padding: 3px 5px;
    }

    .detail-empty {
        display: none !important;
    }

    .student-photo-card {
        border: 0;
        flex-basis: 96px;
        padding: 0;
    }

    .student-photo-card img,
    .student-photo-empty {
        height: 92px;
        width: 92px;
    }

    .detail-group {
        padding: 8px 0 0;
    }

    .detail-group h3 {
        font-size: 11px;
        margin: 0 0 5px;
    }

    .detail-list {
        gap: 3px;
        grid-template-columns: repeat(4, 1fr);
    }

    .detail-list dt {
        font-size: 8px;
    }

    .detail-list dd {
        margin-top: 2px;
    }

    .documents-panel {
        page-break-before: auto;
    }

    .document-grid {
        gap: 3px;
        grid-template-columns: repeat(2, 1fr);
    }

    .document-card {
        gap: 0;
        grid-template-columns: 1fr;
        padding: 3px 5px;
    }

    .document-thumb,
    .document-file-icon {
        display: none;
    }

    .document-card h3,
    .document-card p {
        margin: 0;
    }

    .document-card h3 {
        font-size: 9px;
    }
}
