@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg: #f3f6f9;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #0f766e;
    --brand-dark: #0d5f59;
    --brand-soft: #ccfbf1;
    --blue: #0369a1;
    --blue-soft: #e0f2fe;
    --amber: #b45309;
    --amber-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --ok: #15803d;
    --ok-soft: #dcfce7;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --radius: 14px;
    --sidebar-w: 260px;
    --sidebar-bg: #0b3d3a;
    --sidebar-bg-2: #0f766e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body, .app-body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== App shell + Sidebar ===== */
.app-body {
    display: block;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0a4f4a 55%, var(--sidebar-bg-2) 100%);
    color: #fff;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    box-shadow: 8px 0 30px rgba(11, 61, 58, 0.2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 16px;
}

.sidebar-brand strong {
    display: block;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.sidebar-brand small {
    display: block;
    font-size: 0.72rem;
    opacity: 0.75;
    margin-top: 2px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.16);
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.15rem;
}

.sidebar-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.55;
    padding: 0 12px 8px;
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: rgba(255,255,255,0.82);
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.nav-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255,255,255,0.1);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.sidebar-nav a.active .nav-ico {
    background: rgba(255,255,255,0.22);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.18);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.sidebar-user strong {
    display: block;
    font-size: 0.88rem;
}

.sidebar-user small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(220, 38, 38, 0.22);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
}

.sidebar-logout:hover {
    background: rgba(220, 38, 38, 0.4);
}

.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-title {
    flex: 1;
    min-width: 0;
}

.topbar-title h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.topbar-title p {
    font-size: 0.75rem;
    color: var(--muted);
}

.topbar-cta {
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    background: #f1f5f9;
    border: 1px solid var(--line);
    color: var(--ink);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    place-items: center;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 150;
}

.sidebar-backdrop.show { display: block; }

.content {
    flex: 1;
    padding: 22px;
    max-width: 1200px;
    width: 100%;
}

/* Vemosa logo */
.brand-logo {
    background: #fff;
    padding: 4px;
    overflow: hidden;
}
.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.brand-logo-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 12px;
    box-shadow: 0 8px 22px rgba(15, 118, 110, 0.18);
}

.app-footer {
    text-align: center;
    padding: 18px;
    color: var(--muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,0.5);
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.stat-card.has-ico {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--brand);
}

.stat-card.blue::before { background: var(--blue); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.danger::before { background: var(--danger); }

.stat-ico {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.stat-card.blue .stat-ico { background: var(--blue-soft); color: var(--blue); }
.stat-card.amber .stat-ico { background: var(--amber-soft); color: var(--amber); }
.stat-card.danger .stat-ico { background: var(--danger-soft); color: var(--danger); }

.stat-card .label {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card .value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 6px;
    color: var(--brand);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.stat-card.blue .value { color: var(--blue); }
.stat-card.amber .value { color: var(--amber); }
.stat-card.danger .value { color: var(--danger); }

a.stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}
a.stat-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.report-tab {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}
.report-tab.active,
.report-tab:hover {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: #99f6e4;
}
.report-filter {
    align-items: flex-end;
    gap: 10px;
}
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}
.csv-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    margin: 0;
}
.csv-form .filter-field input[type="date"] {
    padding: 6px 8px;
}
.filter-field input[type="date"] {
    min-width: 150px;
}
.report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px;
}
.filter-field small {
    font-weight: 500;
    color: var(--muted);
    text-transform: none;
}

.stat-card .sub {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fee summary on student profile */
.fee-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

.fee-summary .stat-card {
    display: block;
    padding: 14px 16px 14px 18px;
}

.fee-summary .stat-card .value {
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

/* Dashboard polish */
.dash-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px 22px;
    border-radius: 16px;
    margin-bottom: 16px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15,118,110,0.95), rgba(14,116,144,0.92)),
        radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 45%);
    box-shadow: 0 10px 28px rgba(15, 118, 110, 0.25);
}

.dash-kicker {
    font-size: 0.78rem;
    opacity: 0.85;
    margin-bottom: 4px;
}

.dash-hero h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dash-hero-text p:last-child {
    margin-top: 4px;
    opacity: 0.9;
    font-size: 0.9rem;
}

.dash-hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-outline-light {
    background: rgba(255,255,255,0.14);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.35);
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.25);
}

.dash-mini {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.mini-chip {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.mini-chip span {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
}

.mini-chip strong {
    display: block;
    font-size: 1.2rem;
    margin-top: 4px;
}

.mini-chip small {
    color: var(--muted);
    font-size: 0.75rem;
}

.mini-link {
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #f0fdfa, #fff);
    border-color: #99f6e4;
}

.mini-link:hover {
    border-color: var(--brand);
}

.dash-panel .panel-sub {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
    margin-top: 2px;
}

.dash-panel-danger {
    border-top: 3px solid var(--danger);
}

.dash-panel-amber {
    border-top: 3px solid var(--amber);
}

.dash-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fafbfc;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.dash-item:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.dash-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--danger-soft);
    color: var(--danger);
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

.dash-avatar.amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.dash-item-main {
    flex: 1;
    min-width: 0;
}

.dash-item-main strong {
    display: block;
    font-size: 0.95rem;
}

.dash-item-main small {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

.dash-date {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--amber);
}

.overdue-date { color: var(--danger); }

.dash-item-right {
    text-align: right;
    flex-shrink: 0;
}

.dash-go {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--brand);
    font-weight: 600;
}

.dash-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--muted);
    background: #f8fafc;
    border-radius: 12px;
}

.dash-empty.ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.dash-empty p {
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.card h2 {
    font-size: 1.05rem;
    font-weight: 700;
}

.card h2 span {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin: 8px 0 12px;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.toolbar input,
.toolbar select {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #f8fafc;
    flex: 1;
    min-width: 120px;
}

/* Forms */
.form-row { margin-bottom: 14px; }

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.82rem;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-row textarea { min-height: 80px; resize: vertical; }

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
    background: #fff;
}

.form-row input[readonly] {
    background: #f1f5f9;
    color: var(--brand);
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--brand);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    min-height: 42px;
}

.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(0.98); }

.btn-secondary { background: #64748b; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 7px 10px; font-size: 0.78rem; min-height: 34px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-outline {
    background: transparent;
    color: var(--brand) !important;
    border: 1.5px solid var(--brand);
}
.btn-outline:hover { background: var(--brand-soft); }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Icon action buttons */
.icon-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-btn:hover { transform: none; }
.icon-view { color: var(--brand); border-color: #99f6e4; }
.icon-view:hover { background: var(--brand-soft); }
.icon-pdf { color: #b91c1c; border-color: #fecaca; }
.icon-pdf:hover { background: #fef2f2; }
.icon-pay { color: #fff; background: var(--brand); border-color: var(--brand); }
.icon-pay:hover { background: var(--brand-dark); }
.icon-edit { color: #475569; border-color: #cbd5e1; }
.icon-edit:hover { background: #f1f5f9; }

.status-toggle {
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.3;
}
.status-toggle.is-active {
    background: var(--ok-soft);
    color: var(--ok);
}
.status-toggle.is-inactive {
    background: var(--danger-soft);
    color: #991b1b;
}

.row-inactive {
    opacity: 0.72;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}
.modal-overlay[hidden] { display: none !important; }

.modal-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.modal-card h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

/* Alerts */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.88rem;
    font-weight: 500;
}
.alert-success { background: var(--ok-soft); color: var(--ok); border: 1px solid #bbf7d0; }
.alert-error { background: var(--danger-soft); color: #991b1b; border: 1px solid #fecaca; }

/* Table desktop */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

table th, table td {
    padding: 11px 8px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table th {
    background: #f1f5f9;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

table tbody tr:hover { background: #f8fafc; }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.badge-due { background: var(--amber-soft); color: var(--amber); }
.badge-overdue { background: var(--danger-soft); color: var(--danger); }
.badge-paid { background: var(--ok-soft); color: var(--ok); }
.badge-plan { background: var(--blue-soft); color: var(--blue); }

.amount { font-weight: 700; color: var(--brand); white-space: nowrap; }
.amount-due { color: var(--amber); }
.amount-overdue { color: var(--danger); }

.empty {
    text-align: center;
    color: var(--muted);
    padding: 36px 16px;
}
.empty a { color: var(--brand); font-weight: 600; }

/* Mobile cards for lists */
.mobile-list { display: none; }

.m-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    background: #fafbfc;
}

.m-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.m-card-top strong {
    font-size: 1rem;
}

.m-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.82rem;
    margin-bottom: 12px;
}

.m-meta span {
    display: block;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.m-card .actions { margin-top: 4px; }

/* Detail */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}

.detail-item label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
}

.detail-item p { font-size: 0.98rem; font-weight: 500; margin-top: 2px; }
.detail-item.full { grid-column: 1 / -1; }

.confirm-box { text-align: center; padding: 16px 8px; }
.confirm-box p { margin: 12px 0 20px; color: var(--muted); }

/* Split panels on dashboard */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.88rem;
}

.list-row:last-child { border-bottom: none; }

.list-row .left { min-width: 0; }
.list-row .left strong { display: block; }
.list-row .left small { color: var(--muted); font-size: 0.75rem; }

/* Schedule preview */
.schedule-box {
    margin-top: 8px;
    padding: 14px;
    border: 1px dashed var(--brand);
    border-radius: 12px;
    background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
}

.schedule-box table th {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(ellipse 70% 50% at 20% 20%, #ccfbf1 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 90% 10%, #e0f2fe 0%, transparent 45%),
        var(--bg);
}

.login-wrap { width: 100%; max-width: 400px; }

.login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 22px;
    box-shadow: var(--shadow);
}

.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .brand-mark {
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #0f766e, #0e7490);
    color: #fff;
}
.login-brand .brand-logo-lg {
    background: #fff;
    color: inherit;
}
.login-brand h1 { font-size: 1.3rem; }
.login-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* Responsive */
@media (max-width: 980px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .fee-summary { grid-template-columns: 1fr 1fr; }
    .dash-mini { grid-template-columns: 1fr 1fr; }
    .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform 0.22s ease;
    }
    .sidebar.open { transform: translateX(0); }

    .app-main { margin-left: 0; }
    .nav-toggle { display: grid; }
    .content { padding: 16px; }
    .topbar { padding: 12px 14px; }
    .topbar-cta { display: none; }
}

@media (max-width: 720px) {
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card .value { font-size: 1.15rem; }

    .form-grid, .detail-grid { grid-template-columns: 1fr; }

    .desktop-only { display: none !important; }
    .mobile-list { display: block; }

    .card { padding: 14px; }
    .form-actions .btn { flex: 1; }
}

@media (max-width: 400px) {
    .stats { grid-template-columns: 1fr; }
    .fee-summary { grid-template-columns: 1fr; }
}
