:root {
    color-scheme: light;
    --primary-navy: #0b2b5b;
    --primary-blue: #174ea6;
    --interactive-blue: #2563eb;
    --brand-gold: #f5b800;
    --soft-gold: #fff7d6;
    --page-bg: #f6f8fc;
    --card-bg: #ffffff;
    --primary-text: #111827;
    --secondary-text: #64748b;
    --muted-text: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --shadow-card: 0 4px 18px rgba(15, 23, 42, 0.06);
    --shadow-menu: 0 20px 46px rgba(15, 23, 42, 0.14);
    --radius-card: 16px;
    --radius-input: 12px;
    --radius-button: 10px;
    --sidebar-width: 264px;
    --font-sans: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #0f172a;
    --card-bg: #111827;
    --primary-text: #f8fafc;
    --secondary-text: #cbd5e1;
    --muted-text: #94a3b8;
    --border: rgba(148, 163, 184, 0.22);
    --border-strong: rgba(148, 163, 184, 0.34);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.26);
    --shadow-menu: 0 22px 54px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--primary-text);
    font-family: var(--font-sans);
    line-height: 1.5;
    background: var(--page-bg);
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
summary {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
}

svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

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

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    color: var(--primary-text);
    font-size: clamp(26px, 2.4vw, 32px);
    font-weight: 650;
    line-height: 1.15;
}

.section-title {
    margin: 0;
    color: var(--primary-text);
    font-size: 19px;
    font-weight: 650;
    line-height: 1.25;
}

.helper-text {
    margin: 4px 0 0;
    color: var(--secondary-text);
    font-size: 13px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 14px;
    overflow-y: auto;
    color: #ffffff;
    background: #08234d;
    border-right: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 6px;
    border-radius: 12px;
    background: #ffffff;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy strong {
    display: block;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.2;
}

.brand-copy span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
}

.workspace-summary {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.workspace-summary span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-summary strong {
    font-size: 13px;
    font-weight: 650;
}

.nav-group {
    display: grid;
    gap: 6px;
}

.nav-section-label {
    padding: 10px 12px 3px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
    font-weight: 600;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: #ffffff;
    background: rgba(245, 184, 0, 0.13);
    box-shadow: inset 3px 0 0 var(--brand-gold);
}

.nav-link svg {
    width: 17px;
    height: 17px;
    color: var(--brand-gold);
    flex: 0 0 auto;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-user strong,
.sidebar-user span {
    display: block;
}

.sidebar-user strong {
    max-width: 160px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
}

.main-shell {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 520px) auto;
    gap: 16px;
    align-items: center;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

html[data-theme="dark"] .topbar {
    background: rgba(17, 24, 39, 0.88);
}

.title-cluster {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu {
    display: none;
}

.page-kicker {
    display: block;
    color: var(--secondary-text);
    font-size: 12px;
    font-weight: 650;
}

.topbar h1 {
    margin: 0;
    overflow: hidden;
    color: var(--primary-text);
    font-size: 24px;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
}

.searchbar svg {
    color: var(--secondary-text);
}

.searchbar input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--primary-text);
    background: transparent;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.top-actions .sidebar-user {
    min-height: 40px;
    color: var(--primary-text);
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.top-actions .sidebar-user:hover {
    border-color: var(--border-strong);
}

.top-actions .sidebar-user span span {
    color: var(--secondary-text);
}

.top-actions .avatar {
    color: var(--primary-navy);
    background: var(--soft-gold);
    border: 1px solid rgba(245, 184, 0, 0.72);
}

.top-actions .icon-button {
    color: var(--primary-text);
}

.content {
    flex: 1 0 auto;
    padding: 26px 28px 78px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--secondary-text);
    font-size: 13px;
    font-weight: 600;
}

.breadcrumb a {
    color: var(--primary-blue);
}

.footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: var(--sidebar-width);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 28px;
    color: var(--secondary-text);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

html[data-theme="dark"] .footer {
    background: rgba(17, 24, 39, 0.9);
}

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

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.card-interactive {
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.card-interactive:hover {
    border-color: rgba(37, 99, 235, 0.36);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
    transform: translateY(-1px);
}

.panel {
    padding: 22px;
}

.toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.toolbar-actions,
.table-tools,
.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
    padding: 24px;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, #0b2b5b, #174ea6);
    border-radius: 18px;
    box-shadow: 0 18px 38px rgba(11, 43, 91, 0.2);
}

.hero-panel p {
    max-width: 760px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.78);
}

.hero-panel .eyebrow {
    color: var(--soft-gold);
}

.hero-panel .page-title {
    margin-top: 8px;
    color: #ffffff;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

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

.hero-metric {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

.hero-metric span {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 600;
}

.hero-metric strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

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

.stat {
    min-height: 140px;
    display: grid;
    align-content: space-between;
    gap: 18px;
    padding: 18px;
}

.stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.stat-label {
    display: block;
    color: var(--secondary-text);
    font-size: 13px;
    font-weight: 650;
}

.stat-value {
    display: block;
    margin-top: 10px;
    color: var(--primary-text);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.stat-caption {
    display: block;
    margin-top: 8px;
    color: var(--secondary-text);
    font-size: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: var(--primary-blue);
    background: #eff6ff;
}

.stat-link {
    color: var(--primary-blue);
    font-size: 13px;
    font-weight: 650;
}

.analytics-grid,
.dashboard-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    margin-top: 18px;
}

.chart-bars {
    display: grid;
    grid-auto-flow: column;
    align-items: end;
    gap: 12px;
    min-height: 240px;
    padding: 18px 4px 0;
}

.chart-bar {
    display: grid;
    align-content: end;
    gap: 8px;
    min-width: 42px;
}

.chart-bar-track {
    position: relative;
    height: 180px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

html[data-theme="dark"] .chart-bar-track {
    background: rgba(148, 163, 184, 0.14);
}

.chart-bar-fill {
    width: 100%;
    min-height: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--interactive-blue), var(--primary-blue));
}

.chart-bar-label,
.chart-bar-value {
    overflow: hidden;
    color: var(--secondary-text);
    font-size: 12px;
    font-weight: 650;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.progress-row {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr) 44px;
    gap: 12px;
    align-items: center;
    color: var(--secondary-text);
    font-size: 13px;
    font-weight: 600;
}

.progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

html[data-theme="dark"] .progress-track {
    background: rgba(148, 163, 184, 0.16);
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--interactive-blue);
}

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

.timeline-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.timeline-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--primary-blue);
    background: #eff6ff;
    font-weight: 700;
}

.profile-card {
    display: grid;
    gap: 16px;
}

.profile-cover {
    min-height: 86px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-navy), var(--primary-blue));
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: -42px;
    padding: 0 10px;
}

.avatar,
.profile-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--primary-navy);
    background: var(--soft-gold);
    font-weight: 750;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.profile-avatar {
    width: 68px;
    height: 68px;
    border: 4px solid var(--card-bg);
    border-radius: 18px;
    font-size: 24px;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 32px 18px;
    color: var(--secondary-text);
    text-align: center;
}

.empty-state-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--primary-blue);
    background: #eff6ff;
}

.empty-state strong {
    color: var(--primary-text);
    font-size: 15px;
}

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

.module-header h2 {
    margin: 4px 0 6px;
    font-size: 28px;
    font-weight: 650;
}

.module-header p {
    max-width: 760px;
    margin: 0;
    color: var(--secondary-text);
}

.module-search {
    min-width: min(640px, 100%);
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.6fr) 100px 110px auto;
    gap: 10px;
}

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

.field {
    display: grid;
    gap: 7px;
}

.field-label {
    color: var(--primary-text);
    font-size: 13px;
    font-weight: 650;
    text-transform: capitalize;
}

.field-help,
.field-error {
    font-size: 12px;
}

.field-help {
    color: var(--secondary-text);
}

.field-error {
    color: var(--danger);
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    padding: 11px 12px;
    color: var(--primary-text);
    background: var(--card-bg);
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--interactive-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

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

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--primary-text);
    background: var(--card-bg);
    font-size: 13px;
    font-weight: 650;
}

.checkbox-field input {
    width: auto;
}

.btn,
button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    padding: 9px 14px;
    color: #ffffff;
    background: var(--primary-blue);
    font-size: 14px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.btn:hover,
button:hover {
    background: var(--interactive-blue);
}

.btn:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.btn.secondary {
    color: var(--primary-text);
    background: var(--card-bg);
    border-color: var(--border);
}

.btn.secondary:hover {
    border-color: var(--border-strong);
    background: #f8fafc;
}

html[data-theme="dark"] .btn.secondary:hover {
    background: rgba(148, 163, 184, 0.1);
}

.btn.ghost {
    color: var(--primary-blue);
    background: transparent;
    border-color: transparent;
}

.btn.ghost:hover {
    background: rgba(37, 99, 235, 0.08);
}

.btn.danger {
    color: #ffffff;
    background: var(--danger);
}

.btn.danger:hover {
    background: #b91c1c;
}

.btn.warning {
    color: #ffffff;
    background: var(--warning);
}

.btn.muted-action {
    color: var(--secondary-text);
    background: #f8fafc;
    border-color: var(--border);
}

html[data-theme="dark"] .btn.muted-action {
    background: rgba(148, 163, 184, 0.1);
}

.icon-button {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    padding: 0;
    color: var(--primary-text);
    background: var(--card-bg);
    border-color: var(--border);
}

.icon-button:hover {
    color: var(--primary-blue);
    background: #f8fafc;
}

html[data-theme="dark"] .icon-button:hover {
    background: rgba(148, 163, 184, 0.1);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    width: fit-content;
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--primary-blue);
    background: #eff6ff;
    border: 1px solid #dbeafe;
    font-size: 12px;
    font-weight: 650;
    text-transform: capitalize;
}

.badge::before,
.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}

.status-success,
.badge.success {
    color: var(--success);
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.status-warning,
.badge.warning {
    color: var(--warning);
    background: #fffbeb;
    border-color: #fde68a;
}

.status-danger,
.badge.danger {
    color: var(--danger);
    background: #fef2f2;
    border-color: #fecaca;
}

.status-info,
.badge.blue {
    color: var(--info);
    background: #f0f9ff;
    border-color: #bae6fd;
}

.badge.neutral {
    color: var(--secondary-text);
    background: #f8fafc;
    border-color: var(--border);
}

.notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    color: var(--primary-blue);
    background: #eff6ff;
    font-size: 14px;
    font-weight: 600;
}

.notice.error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--card-bg);
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--secondary-text);
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

html[data-theme="dark"] thead th {
    background: #0f172a;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--primary-text);
    font-size: 13px;
    vertical-align: middle;
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.035);
}

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

.empty-row {
    padding: 28px;
    color: var(--secondary-text);
    text-align: center;
}

.pagination {
    margin-top: 16px;
}

.pagination nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.pagination span,
.pagination a {
    color: var(--secondary-text);
    font-size: 13px;
}

.dropdown {
    position: relative;
}

.dropdown summary {
    list-style: none;
    cursor: pointer;
}

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

.dropdown-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 50;
    width: min(360px, calc(100vw - 32px));
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: var(--shadow-menu);
}

.notification-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.notification-item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

html[data-theme="dark"] .notification-item {
    background: rgba(148, 163, 184, 0.08);
}

.notification-dot {
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 999px;
    background: var(--interactive-blue);
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--danger);
    font-size: 11px;
    font-weight: 700;
}

.profile-menu .dropdown-panel {
    width: min(280px, calc(100vw - 32px));
}

.profile-menu-list {
    display: grid;
    gap: 4px;
}

.profile-menu-list a,
.profile-menu-list button {
    justify-content: flex-start;
    width: 100%;
}

.modal {
    width: min(640px, calc(100vw - 32px));
    max-height: min(820px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    color: var(--primary-text);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-menu);
}

.modal.modal-sm {
    width: min(440px, calc(100vw - 32px));
}

.modal.modal-lg {
    width: min(920px, calc(100vw - 32px));
}

.modal::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
}

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

.modal-footer {
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

html[data-theme="dark"] .modal-footer {
    background: rgba(148, 163, 184, 0.08);
}

.modal-body {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 20px;
}

.modal-title {
    margin: 0;
    font-size: 19px;
    font-weight: 650;
}

.modal-description {
    margin: 4px 0 0;
    color: var(--secondary-text);
    font-size: 13px;
}

body.modal-open {
    overflow: hidden;
}

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

.detail-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

html[data-theme="dark"] .detail-item {
    background: rgba(148, 163, 184, 0.08);
}

.detail-item span {
    display: block;
    color: var(--secondary-text);
    font-size: 12px;
    font-weight: 650;
    text-transform: capitalize;
}

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

.toast-region {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100;
    width: min(420px, calc(100vw - 32px));
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.toast {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: var(--shadow-menu);
    pointer-events: auto;
}

.toast-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--primary-blue);
    background: #eff6ff;
}

.toast strong {
    display: block;
    font-size: 14px;
}

.toast p {
    margin: 2px 0 0;
    color: var(--secondary-text);
    font-size: 13px;
}

.toast.success .toast-icon {
    color: var(--success);
    background: #ecfdf5;
}

.toast.error .toast-icon {
    color: var(--danger);
    background: #fef2f2;
}

.toast.warning .toast-icon {
    color: var(--warning);
    background: #fffbeb;
}

.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--interactive-blue);
    transform-origin: left center;
    animation: toast-progress 5s linear forwards;
}

.toast:hover .toast-progress {
    animation-play-state: paused;
}

@keyframes toast-progress {
    to {
        transform: scaleX(0);
    }
}

.toast-close {
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    color: var(--secondary-text);
    background: transparent;
    border: 0;
}

.toast-close:hover {
    color: var(--primary-text);
    background: rgba(148, 163, 184, 0.12);
}

.auth-body {
    display: grid;
    place-items: center;
    padding: 28px;
    background: linear-gradient(135deg, #f6f8fc 0%, #eef4ff 100%);
}

.auth-shell {
    width: min(1120px, 100%);
    min-height: 640px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: var(--card-bg);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 52px;
    color: #ffffff;
    background: linear-gradient(135deg, #0b2b5b 0%, #174ea6 100%);
}

.auth-logo {
    width: min(250px, 100%);
    padding: 10px 12px;
    border-radius: 14px;
    background: #ffffff;
}

.auth-brand h1 {
    max-width: 580px;
    margin: 22px 0 14px;
    font-size: clamp(34px, 5vw, 48px);
    font-weight: 700;
    line-height: 1.05;
}

.auth-brand p {
    max-width: 540px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
}

.auth-visual {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 34px;
}

.auth-visual-card {
    min-height: 104px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-visual-card span {
    display: block;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    font-weight: 650;
}

.auth-visual-card strong {
    display: block;
    margin-top: 10px;
    font-size: 24px;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    padding: 52px;
}

.auth-card {
    width: 100%;
}

.auth-card h2 {
    margin: 8px 0 8px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.12;
}

.auth-card p {
    margin: 0 0 24px;
    color: var(--secondary-text);
}

.password-shell {
    position: relative;
}

.password-shell input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    width: auto;
    min-width: 44px;
    padding: 0 9px;
    font-size: 12px;
    transform: translateY(-50%);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.secure-note {
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--secondary-text);
    background: #f8fafc;
    font-size: 13px;
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 22px;
}

.forgot-link {
    color: var(--primary-blue);
    font-size: 13px;
    font-weight: 650;
}

.sidebar-overlay {
    display: none;
    padding: 0;
    border: 0;
    border-radius: 0;
}

@media (max-width: 1280px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .top-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1080px) {
    .hero-panel,
    .analytics-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .module-header {
        display: grid;
    }

    .module-search {
        min-width: 0;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(320px, 88vw);
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 25;
        display: block;
        pointer-events: none;
        background: rgba(15, 23, 42, 0);
        transition: background 180ms ease;
    }

    body.sidebar-open .sidebar-overlay {
        pointer-events: auto;
        background: rgba(15, 23, 42, 0.48);
    }

    .mobile-menu {
        display: inline-flex;
    }

    .content {
        padding: 20px 16px 96px;
    }

    .topbar {
        position: relative;
        padding: 14px 16px;
    }

    .footer {
        left: 0;
        padding: 10px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .auth-body {
        padding: 14px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 360px;
        padding: 34px;
    }

    .auth-form-panel {
        padding: 34px;
    }

    .auth-visual {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .stats,
    .hero-metrics,
    .form-grid,
    .record-details,
    .module-search {
        grid-template-columns: 1fr;
    }

    .toolbar {
        display: grid;
    }

    .actions .btn {
        flex: 1 1 auto;
    }

    .modal {
        width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        max-height: calc(100vh - 150px);
    }

    .toast-region {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
    }
}
