:root {
    /* Design tokens — Figma "School Admin" mockups */
    --primary: #526D82;
    --primary-dark: #344D61;
    --primary-light: #8FA3B8;
    --primary-soft: #E9EFF3;
    --secondary: #14B8A6;
    --purple: #8B5CF6;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #0EA5E9;
    --bg: #F7F4EF;
    --card: #FFFFFF;
    --sidebar-bg: #FFFFFF;
    --sidebar-card: rgba(0,0,0,.05);
    --sidebar-w: 260px; /* changed by dragging the menu's edge */
    --text: #2D2D2D;
    --text-muted: #6B7280;
    --border: #E8E1D9;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: none;
    --shadow-lg: 0 16px 48px rgba(67,45,48,.08);
    --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
    font-size: .875rem;
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text); }
a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D6D1C9; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ============ LAYOUT ============ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-w);
}

.content-wrap {
    padding: 28px 32px 32px;
    flex: 1;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-w);
    position: fixed;
    inset: 0 auto 0 0;
    /* Figma 2339:8095: faint slate halo in the top-right corner */
    background: radial-gradient(circle at 100% 0, rgba(82,109,130,.07) 0 80px, transparent 81px), var(--sidebar-bg);
    color: rgba(0,0,0,.85);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px 24px; /* Figma sidebar: 24 top/bottom, 16 sides */
    z-index: 1040;
    transition: transform .3s ease;
}

/* Figma lockup-group (2028:2497): 169x40 box at the sidebar's padding edge, menu 24px below.
   The SVG is 169x51 because the petal mark overhangs the box by ~5.36px top and bottom. */
.sidebar-brand {
    display: flex;
    align-items: center;
    align-self: flex-start;
    margin: -5.36px 0 18.64px;
    color: var(--text);
    position: relative;
}
.sidebar-brand img.sidebar-logo { display: block; width: 169px; height: 51px; max-width: 100%; object-fit: contain; object-position: left center; }
.sidebar-brand:hover { color: var(--text); }

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 4px; }

.sidebar .nav { gap: 4px; flex-wrap: nowrap; }

.sidebar .nav-link {
    color: rgba(0,0,0,.85);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.3;
    transition: background .15s ease, color .15s ease;
}

.sidebar .nav-link i { font-size: 18px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar .nav-link .nav-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0,0,0,.08);
    color: rgba(0,0,0,.85);
    padding: 1px 8px;
    border-radius: 20px;
}

.sidebar .nav-link:hover { background: rgba(0,0,0,.04); color: #000; }

.sidebar .nav-link.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.sidebar .nav-link.active .nav-count { background: rgba(255,255,255,.25); color: #fff; }

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(0,0,0,.07);
}

.sidebar-user {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 0;
    border-radius: 12px;
    background: var(--sidebar-card);
    color: #000;
    text-align: left;
    transition: background .15s;
}
.sidebar-user:hover { background: rgba(0,0,0,.08); }
.sidebar-user .bi { color: rgba(0,0,0,.5); }
.sidebar-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary);
    color: #fff;
    display: grid; place-items: center;
    font-size: 13px; font-weight: 600;
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-user-name { font-size: 14px; font-weight: 600; color: #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }

/* Show / hide password button (added by layouts/app.blade.php to every password box) */
.pw-toggle-wrap { position: relative; }
.pw-toggle-wrap > input { padding-right: 2.75rem; }
.pw-toggle-btn {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent;
    color: var(--text-muted); display: grid; place-items: center; font-size: 1rem;
}
.pw-toggle-btn:hover, .pw-toggle-btn:focus-visible { color: var(--primary); background: rgba(82,109,130,.08); outline: none; }
.pw-toggle-wrap > input.is-invalid ~ .pw-toggle-btn { right: 30px; } /* clear Bootstrap's error icon */
.sidebar-close {
    position: absolute; top: 26px; right: 14px;
    width: 40px; height: 40px; border: 0; border-radius: 50%;
    background: rgba(0,0,0,.05); color: rgba(0,0,0,.72); font-size: 16px;
    display: grid; place-items: center;
}
.sidebar-close:hover, .sidebar-close:focus-visible { background: rgba(0,0,0,.1); }
@media (max-width: 991.98px) { body.sidebar-open { overflow: hidden; } }

/* Drag handle on the menu's right edge (desktop only) */
.sidebar-resizer {
    position: absolute; top: 0; right: -4px; bottom: 0; width: 8px;
    cursor: col-resize; z-index: 2; background: transparent; border: 0; padding: 0;
}
.sidebar-resizer::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px;
    background: transparent; transition: background .15s ease;
}
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after,
body.sidebar-resizing .sidebar-resizer::after { background: var(--primary); }
.sidebar-resizer:focus-visible { outline: none; }
body.sidebar-resizing { cursor: col-resize; user-select: none; }

@media (max-width: 991.98px) {
    .main-content { margin-left: 0; }
    .sidebar { width: 260px; }
    .sidebar-resizer { display: none; }
    .content-wrap { padding: 20px 16px 24px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
}

/* ============ TOP BAR ============ */
.topbar {
    display: flex;
    flex-wrap: wrap;                 /* narrow windows: actions drop under the title instead of crushing it */
    align-items: center;
    gap: 12px 16px;
    padding: 32px 32px 0;
}
.topbar-heading { flex: 1 1 320px; min-width: min(100%, 280px); }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-left: auto; min-width: 0; }
.topbar-actions .btn, .topbar-actions .ds-btn, .topbar-actions a { white-space: nowrap; }

.topbar .nav-icon-btn {
    width: 40px; height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    display: grid; place-items: center;
    font-size: 18px;
    position: relative;
    transition: border-color .15s, color .15s;
}
.topbar .nav-icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.nav-badge {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid; place-items: center;
    padding: 0 4px;
}
.nav-dot {
    position: absolute;
    top: 8px; right: 9px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 2px #fff;
}

.topbar .search-box {
    width: 260px;
    flex: 0 1 260px;
    min-width: 180px;
    position: relative;
    margin: 0;
}
.topbar .search-box i {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}
.topbar .search-box input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
    color: var(--text);
}
.topbar .search-box input::placeholder { color: var(--text-muted); }
.topbar .search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(82,109,130,.15);
}

.topbar-avatar {
    width: 40px; height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--primary);
    color: #fff;
    display: grid; place-items: center;
    font-size: 14px; font-weight: 600;
    flex-shrink: 0;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-avatar:hover { color: #fff; box-shadow: 0 0 0 2px var(--primary-soft); }

.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700;
    font-size: .9rem;
}

@media (max-width: 991.98px) {
    .topbar { padding: 16px 16px 0; }
}

/* Page heading inside the top bar (e.g. dashboard greeting) */
.page-greeting { font-size: 28px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.2; }
.page-greeting-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.page-greeting-sub .accent { color: var(--primary-dark); font-weight: 500; }

/* ============ CARDS ============ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    transition: box-shadow .25s ease, transform .25s ease;
}

.card.hoverable:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.card-body { padding: 22px; }

.card-title {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

.card.colored-top { position: relative; overflow: hidden; }
.card.colored-top::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--card-top, var(--primary));
}

/* ============ STAT CARDS ============ */
.stat-card {
    border-radius: var(--radius);
    padding: 22px;
    background: #fff;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all .25s ease;
    overflow: hidden;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    border-radius: 16px;
    display: grid;
    place-items: center;
}

.stat-card .stat-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: grid; place-items: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-card .stat-label { color: var(--text-muted); font-size: .78rem; font-weight: 600; }
.stat-card .stat-value { font-size: 36px; font-weight: 700; line-height: 1.1; }
.stat-card .stat-trend { font-size: .72rem; font-weight: 600; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

.stat-card .stat-mini {
    position: absolute;
    right: -20px; bottom: -20px;
    opacity: .08;
    font-size: 8rem;
    transform: rotate(-12deg);
}

/* gradient icon variants (legacy) */
.grad-indigo { background: linear-gradient(135deg, #4F46E5, #818CF8); }
.grad-cyan { background: linear-gradient(135deg, #06B6D4, #67E8F9); }
.grad-purple { background: linear-gradient(135deg, #8B5CF6, #C084FC); }
.grad-green { background: linear-gradient(135deg, #22C55E, #86EFAC); }
.grad-amber { background: linear-gradient(135deg, #F59E0B, #FCD34D); }
.grad-red { background: linear-gradient(135deg, #EF4444, #FCA5A5); }
.grad-pink { background: linear-gradient(135deg, #EC4899, #F9A8D4); }
.grad-blue { background: linear-gradient(135deg, #3B82F6, #93C5FD); }

/* Soft stat icon circles */
.soft-pink   { background: #FDE8E8; color: #E8646A; }
.soft-purple { background: #EDE9FE; color: #7C3AED; }
.soft-teal   { background: #CCFBF1; color: #0F766E; }
.soft-blue   { background: #DBEAFE; color: #1D4ED8; }
.soft-amber  { background: #FEF3C7; color: #D97706; }
.soft-green  { background: #DCFCE7; color: #15803D; }

.stat-card .stat-icon.soft {
    border-radius: 50%;
    width: 64px; height: 64px;
    font-size: 1.6rem;
}

/* Dashboard page header */
.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.dash-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9CA3AF;
    margin-bottom: 4px;
}
.dash-breadcrumb .dash-dot {
    width: 14px; height: 2px;
    background: var(--primary);
    border-radius: 2px;
    display: inline-block;
}
.dash-greeting { font-size: 1.7rem; font-weight: 800; color: #1A1A1A; margin: 0; }
.dash-greeting-sub { color: #9CA3AF; font-size: .85rem; margin: 2px 0 0; }

.dash-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.btn-export {
    display: flex; align-items: center; gap: 6px;
    border: 1.5px solid #E5E7EB;
    background: #fff;
    color: #374151;
    border-radius: 12px;
    padding: 9px 16px;
    font-size: .83rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all .18s;
}
.btn-export:hover { border-color: #D1D5DB; background: #F9F9F9; }
.btn-add-student {
    display: flex; align-items: center; gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 9px 18px;
    font-size: .83rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: all .18s;
}
.btn-add-student:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(82,109,130,.25); }

/* Dashboard recent payments */
.dash-section-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #F0F0EE;
    overflow: hidden;
}
.dash-section-head {
    padding: 20px 22px 16px;
    border-bottom: 1px solid #F5F5F3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.dash-section-title { font-size: 1rem; font-weight: 700; color: #1A1A1A; margin: 0; }
.dash-section-sub { font-size: .75rem; color: #9CA3AF; margin: 2px 0 0; }
.dash-view-all {
    display: flex; align-items: center; gap: 4px;
    font-size: .78rem;
    font-weight: 600;
    color: #6B7280;
    text-decoration: none;
    transition: color .15s;
    flex-shrink: 0;
}
.dash-view-all:hover { color: var(--primary-dark); }

/* Payment table */
.pay-table { width: 100%; border-collapse: collapse; }
.pay-table th {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #9CA3AF;
    padding: 10px 22px;
    border-bottom: 1px solid #F5F5F3;
    text-align: left;
    background: #FAFAFA;
}
.pay-table td { padding: 13px 22px; border-bottom: 1px solid #F5F5F3; vertical-align: middle; }
.pay-table tbody tr:last-child td { border-bottom: none; }
.pay-table tbody tr:hover td { background: #FAFAFA; }

.pay-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700;
    font-size: .8rem;
    color: #fff;
    flex-shrink: 0;
}
.pay-student-name { font-size: .85rem; font-weight: 600; color: #1A1A1A; }
.pay-student-id { font-size: .72rem; color: #9CA3AF; }
.pay-amount { font-size: .9rem; font-weight: 700; color: #0F766E; }
.pay-method { font-size: .82rem; color: #6B7280; }
.pay-date { font-size: .82rem; color: #9CA3AF; }

/* Notice board */
.notice-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 22px;
    border-bottom: 1px solid #F5F5F3;
    transition: background .15s;
}
.notice-row:last-child { border-bottom: none; }
.notice-row:hover { background: #FAFAFA; }
.notice-icon-wrap {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--primary-soft);
    display: grid; place-items: center;
    color: var(--primary);
    font-size: .95rem;
    flex-shrink: 0;
}
.notice-title { font-size: .85rem; font-weight: 600; color: #1A1A1A; }
.notice-date { font-size: .72rem; color: #9CA3AF; }
.notice-tag {
    font-size: .65rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.notice-tag.school  { background: #F5F5F3; color: #6B7280; }
.notice-tag.academic { background: #EDE9FE; color: #7C3AED; }
.notice-tag.event   { background: #DCFCE7; color: #15803D; }
.notice-tag.reminder { background: #FEF3C7; color: #D97706; }

.notice-updates-badge {
    background: var(--primary);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ============ BUTTONS ============ */
.btn {
    border-radius: 12px;
    font-weight: 600;
    font-size: .85rem;
    padding: 10px 18px;
    transition: all .22s ease;
    position: relative;
    overflow: hidden;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    border: none;
}

.btn-gradient:hover {
    color: #fff;
    box-shadow: 0 8px 20px rgba(79,70,229,.35);
    transform: translateY(-1px);
}

.btn-soft-primary { background: #EEF2FF; color: var(--primary); border: none; }
.btn-soft-primary:hover { background: #E0E7FF; color: var(--primary-dark); }
.btn-soft-success { background: #ECFDF5; color: #059669; border: none; }
.btn-soft-success:hover { background: #D1FAE5; }
.btn-soft-danger { background: #FEF2F2; color: #DC2626; border: none; }
.btn-soft-danger:hover { background: #FEE2E2; }
.btn-soft-warning { background: #FFFBEB; color: #D97706; border: none; }
.btn-soft-warning:hover { background: #FEF3C7; }

.btn .btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    transform: scale(0);
    animation: ripple .6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

.btn-icon {
    width: 38px; height: 38px;
    padding: 0;
    display: inline-grid; place-items: center;
    border-radius: 10px;
    font-size: .95rem;
}

/* action buttons in tables */
.btn-action { width: 32px; height: 32px; padding: 0; font-size: .85rem; border-radius: 9px; display: inline-grid; place-items: center; margin: 2px; border: none; transition: all .2s; }
.btn-action:hover { transform: translateY(-2px); }

/* ============ TABLES ============ */
.table-card .table-responsive { max-height: 560px; }

.data-table {
    width: 100%;
    font-size: .85rem;
}

.data-table thead th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 12px 14px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.data-table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #F9FAFB; }

.student-cell { display: flex; align-items: center; gap: 10px; }
.student-cell .student-avatar {
    width: 38px; height: 38px;
    border-radius: 12px;
    object-fit: cover;
    background: #EEF2FF;
    color: var(--primary);
    display: grid; place-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============ BADGES ============ */
.badge { font-weight: 600; padding: 5px 10px; border-radius: 8px; font-size: .72rem; }
.badge-soft-success { background: #ECFDF5; color: #059669; }
.badge-soft-danger { background: #FEF2F2; color: #DC2626; }
.badge-soft-warning { background: #FFFBEB; color: #D97706; }
.badge-soft-primary { background: #EEF2FF; color: var(--primary); }
.badge-soft-purple { background: #F5F3FF; color: #7C3AED; }
.badge-soft-cyan { background: #ECFEFF; color: #0891B2; }
.badge-soft-gray { background: #F3F4F6; color: #4B5563; }

/* ============ FORMS ============ */
.form-control, .form-select {
    border-radius: 12px;
    border: 1.5px solid var(--border);
    padding: 10px 14px;
    font-size: .875rem;
    font-family: var(--font);
    font-weight: 500;
    transition: all .2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}

.form-label { font-weight: 600; font-size: .78rem; color: var(--text); margin-bottom: 6px; }

.form-floating > .form-control, .form-floating > .form-select {
    border-radius: 12px;
    height: calc(3.2rem + 2px);
}

.form-floating > label { font-weight: 500; font-size: .8rem; color: var(--text-muted); }

.input-group-text {
    border-radius: 12px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}

/* ============ AUTH / LOGIN ============ */
/* Figma "Classly login — Approved" (2339:13267): top bar, photo benefits board,
   login card and footer bar on a warm cream page. Shared by sign-in, forgot and reset. */
.auth-body { background: var(--bg); }
.auth-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px;
    overflow: hidden;
}

/* Soft ambient shapes in the corners */
.auth-ambient { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; }
.auth-ambient.a1 { width: 420px; height: 420px; top: -120px; left: -120px; background: rgba(232,225,217,.55); }
.auth-ambient.a2 { width: 420px; height: 420px; top: -110px; right: -10px; background: rgba(82,109,130,.08); }
.auth-ambient.a3 { width: 360px; height: 360px; bottom: -60px; right: 80px; border: 1px solid rgba(82,109,130,.12); }
.auth-ambient.a4 { width: 95px; height: 95px; bottom: 64px; right: 106px; border-radius: 22px; background: rgba(82,109,130,.08); transform: rotate(-12deg); }
.auth-shell > :not(.auth-ambient) { position: relative; z-index: 1; }

/* Top bar */
.auth-bar {
    display: flex; align-items: center; justify-content: space-between;
    height: 72px; padding: 0 20px;
    background: #fff; border: 1px solid var(--border); border-radius: 20px;
    box-shadow: 0 10px 30px rgba(68,46,49,.04);
}
.auth-bar-logo img { display: block; width: 169px; height: 51px; }
.auth-help-btn {
    display: inline-flex; align-items: center; height: 36px; padding: 0 16px;
    border: 1px solid var(--border); border-radius: 999px; background: #fff;
    font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none;
    transition: border-color .15s, color .15s;
}
.auth-help-btn:hover { border-color: var(--primary); color: var(--primary-dark); }

/* Main area: benefits board + login stage */
.auth-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 760px) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.auth-board {
    position: relative;
    display: flex; flex-direction: column; justify-content: center; gap: 24px;
    padding: 32px;
    border: 1px solid var(--border); border-radius: 28px;
    background: #2D2D2D url('../images/login-benefits.jpg') center / cover no-repeat;
    box-shadow: 0 10px 30px rgba(68,46,49,.04);
    overflow: hidden;
}
.auth-board::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.2); pointer-events: none; }
.auth-board > * { position: relative; }

.auth-hero {
    display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
    min-height: 320px; padding: 28px;
    background: rgba(243,240,233,.8); border-radius: 24px;
    backdrop-filter: blur(2px);
}
.auth-hero-copy { display: flex; flex-direction: column; gap: 14px; }
.auth-eyebrow {
    display: flex; align-items: center; gap: 8px;
    font-family: 'Space Mono', monospace; font-weight: 700; font-size: 10px;
    text-transform: uppercase; color: var(--text-muted);
}
.auth-eyebrow::before { content: ''; width: 28px; height: 3px; border-radius: 999px; background: var(--primary-light); }
.auth-hero h1 { margin: 0; font-size: clamp(34px, 3.2vw, 54px); line-height: 1.11; font-weight: 700; color: var(--text); }
.auth-hero p { margin: 0; max-width: 573px; font-size: 18px; line-height: 28px; color: var(--text-muted); }
.auth-trust { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.auth-trust strong { display: block; font-weight: 600; color: var(--text); }
.auth-trust small { display: block; font-size: 14px; color: var(--text-muted); }
.auth-chip {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; background: #E8E1D9; color: var(--text); font-size: 18px;
}

.auth-feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.auth-feature {
    display: flex; flex-direction: column; gap: 14px;
    min-height: 148px; padding: 20px;
    background: rgba(255,255,255,.8); border: 1px solid var(--border); border-radius: 20px;
}
.auth-feature .auth-chip { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
.auth-feature strong { display: block; font-size: 16px; line-height: 21px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.auth-feature small { display: block; font-size: 14px; line-height: 20px; color: var(--text-muted); }

.auth-stage { display: flex; justify-content: center; min-width: 0; }
.auth-card {
    width: 100%;
    max-width: 640px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 40px;
    box-shadow: 0 18px 24px rgba(68,46,49,.08);
}

/* Card header (sign-in: left aligned eyebrow + title; forgot/reset: centred badge) */
.auth-card-eyebrow { display: block; font-family: 'Space Mono', monospace; font-weight: 700; font-size: 11px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.auth-card-title { font-size: 38px; line-height: 46px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.auth-card-sub { font-size: 16px; line-height: 24px; color: var(--text-muted); margin-bottom: 0; }
.auth-card-badge {
    width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.35rem;
    background: var(--primary-soft); color: var(--primary);
}
.text-center > .auth-card-title { font-size: 30px; line-height: 38px; }

/* Inputs */
.auth-field {
    display: flex; align-items: center; gap: 12px;
    min-height: 72px; padding: 0 16px;
    border: 1px solid var(--border); border-radius: 12px; background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.auth-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(82,109,130,.08); }
.auth-field-icon { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.auth-field-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.auth-field-body label { display: block; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-muted); margin: 0; }
.auth-field-body input {
    border: none; outline: none; padding: 0; width: 100%;
    font-family: var(--font); font-size: 16px; line-height: 22px; font-weight: 500;
    color: var(--text); background: transparent;
}
.auth-field-body input::placeholder { color: #B8B2AB; font-weight: 400; }
.auth-eye-btn {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--text-muted); font-size: 18px; display: grid; place-items: center; transition: color .15s;
}
.auth-eye-btn:hover { color: var(--text); }

/* Remember me + forgot */
.auth-check-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); cursor: pointer; user-select: none; margin: 0; }
.auth-check-label input[type="checkbox"] { display: none; }
.auth-checkmark {
    width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
    border: 1.5px solid #C9C2BA; display: grid; place-items: center; transition: all .15s;
}
.auth-check-label input:checked + .auth-checkmark { background: var(--primary); border-color: var(--primary); }
.auth-check-label input:checked + .auth-checkmark::after { content: '\F270'; font-family: 'bootstrap-icons'; color: #fff; font-size: .7rem; line-height: 1; }
.auth-forgot { font-size: 14px; font-weight: 600; color: var(--primary-dark); text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; color: var(--primary-dark); }

/* Submit */
.auth-submit-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 56px; padding: 0 24px;
    background: var(--primary); color: #fff; border: none; border-radius: 12px;
    font-family: var(--font); font-size: 17px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 6px rgba(82,109,130,.18);
    transition: background .2s, transform .2s, box-shadow .2s;
}
.auth-submit-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(82,109,130,.25); }
.auth-submit-btn:disabled { opacity: .75; cursor: wait; transform: none; box-shadow: none; }

/* "Quick access" divider */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Alert */
.auth-alert {
    display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
    padding: 12px 16px; border-radius: 12px;
    background: #FEF2F2; color: #DC2626; font-size: .83rem; font-weight: 500;
}
.auth-alert.success { background: #ECFDF5; color: #059669; }

.auth-hint { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .8rem; color: var(--text-muted); margin-bottom: 18px; }
.auth-back-link { font-size: .88rem; font-weight: 600; color: var(--primary-dark); text-decoration: none; }
.auth-back-link:hover { text-decoration: underline; color: var(--primary-dark); }
.auth-login-box { width: 100%; }

/* Footer bar */
.auth-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    min-height: 48px; padding: 0 20px;
    background: #fff; border: 1px solid var(--border); border-radius: 16px;
    font-size: 12px; color: var(--text-muted);
}
.auth-support-link { color: var(--text); font-weight: 500; text-decoration: none; margin-left: 4px; }
.auth-support-link:hover { text-decoration: underline; color: var(--primary-dark); }

@media (max-width: 1199.98px) {
    .auth-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .auth-hero { min-height: 0; }
}
@media (max-width: 991.98px) {
    .auth-shell { padding: 16px; gap: 16px; }
    .auth-main { grid-template-columns: minmax(0, 1fr); }
    .auth-board { display: none; }
    .auth-card { padding: 28px 20px; border-radius: 24px; }
    .auth-card-title { font-size: 28px; line-height: 36px; }
    .auth-bar { height: 64px; padding: 0 14px; }
    .auth-bar-logo img { width: 132px; height: auto; }
    .auth-help-btn { padding: 0 12px; font-size: 12px; }
}

/* ---- Quick access (demo) role cards ---- */
.demo-login-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.demo-login-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    height: 92px; padding: 0 6px;
    border: 1px solid var(--border); border-radius: 12px; background: #fff;
    cursor: pointer; transition: border-color .18s, background .18s, transform .18s;
}
.demo-login-btn .dlb-icon {
    width: 32px; height: 32px; border-radius: 8px; background: #FAF8F5;
    display: grid; place-items: center; font-size: 17px; color: var(--text-muted);
}
.demo-login-btn .dlb-label { font-size: 14px; line-height: 19px; font-weight: 500; color: var(--text-muted); text-align: center; }
.demo-login-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.demo-login-btn:hover .dlb-icon { color: var(--primary); }
.demo-login-btn.active { background: var(--primary-soft); border: 1.5px solid var(--primary); }
.demo-login-btn.active .dlb-icon { background: #fff; color: var(--primary-dark); }
.demo-login-btn.active .dlb-label { font-weight: 600; color: var(--primary-dark); }
@media (max-width: 575.98px) {
    .demo-login-grid { grid-template-columns: repeat(2, 1fr); }
    .demo-login-btn { height: 76px; }
}

/* ============ WELCOME CARD ============ */
.welcome-card {
    border-radius: var(--radius);
    background: linear-gradient(120deg, #4F46E5 0%, #8B5CF6 100%);
    color: #fff;
    padding: 26px 28px;
    position: relative;
    overflow: hidden;
}

.welcome-card::after {
    content: '\f14a';
    font-family: 'bootstrap-icons';
    position: absolute;
    right: 24px; bottom: -30px;
    font-size: 10rem;
    opacity: .12;
}

.welcome-card h3 { font-weight: 700; margin-bottom: 4px; }
.welcome-card p { color: rgba(255,255,255,.85); margin: 0; }

.quick-action-btn {
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: .78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .2s;
}

.quick-action-btn:hover { background: rgba(255,255,255,.25); color: #fff; transform: translateY(-2px); }

/* ============ CHARTS ============ */
.chart-box { height: 300px; position: relative; }
.chart-box-sm { height: 240px; }

/* ============ ACTIVITY TIMELINE ============ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 4px; bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-light), var(--purple));
    opacity: .3;
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px; top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
    box-shadow: 0 0 0 4px rgba(79,70,229,.15);
}
.timeline-item.success::before { border-color: var(--success); box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.timeline-item.warning::before { border-color: var(--warning); box-shadow: 0 0 0 4px rgba(245,158,11,.15); }
.timeline-item.purple::before { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(139,92,246,.15); }

.timeline-item h6 { font-size: .85rem; font-weight: 600; margin-bottom: 2px; }
.timeline-item p { font-size: .75rem; color: var(--text-muted); margin: 0; }
.timeline-item small { font-size: .68rem; color: var(--text-muted); }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}
.empty-state .empty-icon {
    width: 88px; height: 88px;
    border-radius: 28px;
    background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
    display: grid; place-items: center;
    margin: 0 auto 18px;
    font-size: 2.4rem;
    color: var(--primary);
}
.empty-state h5 { font-weight: 700; }
.empty-state p { color: var(--text-muted); font-size: .85rem; max-width: 340px; margin: 0 auto; }

/* ============ SKELETON ============ */
.skeleton {
    background: linear-gradient(90deg, #EEF2FF 25%, #F8FAFC 50%, #EEF2FF 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 10px;
}
@keyframes shimmer {
    to { background-position: -200% 0; }
}

/* ============ ANIMATIONS ============ */
.fade-in { animation: fadeIn .5s ease; }
.slide-up { animation: slideUp .5s ease; }
.scale-in { animation: scaleIn .35s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

.stagger > * { opacity: 0; animation: slideUp .5s ease forwards; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .1s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .2s; }
.stagger > *:nth-child(5) { animation-delay: .25s; }
.stagger > *:nth-child(6) { animation-delay: .3s; }

/* ============ PAGINATION ============ */
.pagination .page-link {
    border: none;
    color: var(--text);
    font-weight: 600;
    border-radius: 10px !important;
    margin: 0 3px;
    padding: 8px 14px;
    font-size: .8rem;
}
.pagination .page-item.active .page-link { background: linear-gradient(135deg, var(--primary), var(--purple)); color: #fff; }

/* ============ MODAL ============ */
.modal-content { border: none; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }

/* ============ MISC ============ */
.page-title { font-weight: 700; font-size: 28px; line-height: 1.2; color: var(--text); margin: 0; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }

.breadcrumb { margin: 0; font-size: .78rem; }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--primary-dark); font-weight: 600; }

.section-label { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; margin-bottom: 12px; }

.divider-gradient { height: 3px; border: 0; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--purple), var(--secondary)); opacity: .4; }

.filter-bar {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

@media (max-width: 576px) {
    .stat-card .stat-value { font-size: 26px; }
    .content-wrap { padding: 12px; }
    .topbar { padding: 0 12px; }
}

.book-cover {
    width: 56px;
    height: 72px;
    border-radius: 8px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 24px;
    overflow: hidden;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }

.notice-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #F3E8FF, #E9D5FF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple);
    font-size: 20px;
}

.download-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.report-card { transition: transform .2s ease, box-shadow .2s ease; cursor: pointer; border: 1px solid var(--border) !important; }
.report-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(79,70,229,.08); text-decoration: none; }
.report-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}


/* ============ STAT SUB TEXT ============ */
.stat-card .stat-sub { font-size: .7rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

/* ============ APP FOOTER ============ */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: .72rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--card);
}

/* ============ SIDEBAR CHEVRON ============ */
.school-chevron { margin-left: auto; font-size: .7rem; opacity: .5; }
.sidebar-help {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: .75rem;
    color: rgba(0,0,0,.72);
    border-top: 1px solid rgba(0,0,0,.07);
    transition: color .2s ease;
    text-decoration: none;
    margin-top: auto;
}
.sidebar-help:hover { color: #000; }

/* ============ TOPBAR SEARCH KBD ============ */
.kbd-hint { display: flex; gap: 3px; align-items: center; margin-left: 4px; }
.kbd-hint kbd {
    background: rgba(0,0,0,.06);
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 5px;
    padding: 1px 5px;
    font-size: .68rem;
    font-family: inherit;
    color: var(--text-muted);
    line-height: 1.6;
}

/* =====================================================================
   DESIGN SYSTEM — components from the Figma "School Admin" mockups.
   Reused by every redesigned page (prefix ds-).
   ===================================================================== */
.ds-stack { display:flex; flex-direction:column; gap:20px; }
.ds-card { background:#fff; border:1px solid var(--border); border-radius:16px; }
.ds-muted { color:var(--text-muted); }

/* KPI cards */
.ds-kpis { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:20px; }
.ds-kpi { padding:20px; display:flex; flex-direction:column; gap:16px; box-shadow:0 4px 6px rgba(0,0,0,.02); }
.ds-kpi-head { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:14px; font-weight:600; color:var(--text-muted); }
.ds-kpi-icon { width:36px; height:36px; border-radius:10px; display:grid; place-items:center; color:var(--primary); font-size:18px; flex-shrink:0; background:var(--primary-soft); }
.ds-kpi-value { font-size:28px; font-weight:700; color:var(--text); line-height:1.2; }
.ds-kpi-sub { margin-top:4px; font-size:12px; color:var(--text-muted); }
.ds-kpi-trend { display:flex; align-items:center; gap:6px; font-size:12px; }
.ds-kpi-trend strong { font-weight:600; }
.ds-up { color:#2ECC71; } .ds-down { color:#E74C3C; }

/* Sections */
.ds-section { padding:24px; display:flex; flex-direction:column; gap:16px; min-width:0; }
.ds-section h2, .ds-section-title { font-size:16px; font-weight:700; color:var(--text); margin:0; }
.ds-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.ds-section-sub { margin:4px 0 0; font-size:12px; color:var(--text-muted); }
.ds-link { font-size:12px; font-weight:600; color:var(--primary-dark); }
.ds-link:hover { color:var(--primary-dark); text-decoration:underline; }
.ds-empty { display:flex; flex-direction:column; align-items:center; gap:8px; padding:32px 12px; color:var(--text-muted); font-size:13px; text-align:center; }
.ds-empty i { font-size:26px; opacity:.6; }
.ds-split { display:grid; grid-template-columns:minmax(0,1fr) 420px; gap:20px; align-items:start; }

/* Tags / status pills */
.ds-tag { display:inline-block; padding:4px 8px; border-radius:6px; font-size:11px; font-weight:600; line-height:1.2; white-space:nowrap; }
.ds-tag-success { background:#EAF9EE; color:#27AE60; }
.ds-tag-warning { background:#FEF9E7; color:#D4AC0D; }
.ds-tag-danger  { background:#FDECEE; color:#E74C3C; }
.ds-tag-info    { background:#EBF5FB; color:#3498DB; }
.ds-tag-primary { background:#FDECEE; color:var(--primary); }
.ds-tag-neutral { background:#F4F6F7; color:var(--text-muted); }

/* Buttons */
.ds-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; height:40px; padding:0 16px; border-radius:8px; border:1px solid transparent;
    font-size:14px; font-weight:600; line-height:1; white-space:nowrap; cursor:pointer; transition:background .15s, border-color .15s, color .15s; }
.ds-btn-primary { background:var(--primary); color:#fff; }
.ds-btn-primary:hover { background:var(--primary-dark); color:#fff; }
.ds-btn-light { background:#fff; border-color:var(--border); color:var(--text); }
.ds-btn-light:hover { border-color:var(--text); color:var(--text); }
.ds-btn-outline { background:#fff; border:1.5px solid var(--primary); color:var(--primary); border-radius:10px; }
.ds-btn-outline:hover { background:var(--primary); color:#fff; }

/* Filter bar: "Label: Value" selects + search */
.ds-filters { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.ds-filter-group { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.ds-select { position:relative; display:inline-flex; align-items:center; gap:8px; height:34px; padding:0 34px 0 12px; background:#fff; border:1px solid var(--border); border-radius:8px; }
.ds-select:hover { border-color:#D6D1C9; }
.ds-select:focus-within { border-color:var(--primary); box-shadow:0 0 0 3px rgba(82,109,130,.15); }
/* Clicking anywhere on the pill opens the select (layouts/app.blade.php); the select also
   stretches over the arrow so that area is clickable too. Options stay left-aligned. */
.ds-select { cursor:pointer; }
.ds-select > span { font-size:12px; color:var(--text-muted); white-space:nowrap; }
.ds-select select { appearance:none; align-self:stretch; border:0; background:transparent; font:inherit; font-size:13px; font-weight:600; color:var(--text);
    padding:0 34px 0 0; margin-right:-34px; cursor:pointer; outline:none; max-width:220px; text-align:left; }
.ds-select select option { font-weight:400; color:var(--text); background:#fff; }
.ds-select.is-open { border-color:var(--primary); box-shadow:0 0 0 3px rgba(82,109,130,.15); }
.ds-select.is-open::after { transform:rotate(225deg); margin-top:-1px; }
/* Styled option menu for every single-choice dropdown (public/js/classly-select.js) */
select.is-open { border-color:var(--primary) !important; box-shadow:0 0 0 3px rgba(82,109,130,.15) !important; }
.ds-menu-group { padding:8px 10px 4px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; color:var(--text-muted); }
.ds-menu { position:fixed; z-index:1080; background:#fff; border:1px solid var(--border); border-radius:12px;
    box-shadow:0 12px 32px rgba(45,45,45,.12); padding:6px; overflow-y:auto; max-width:320px; animation:dsMenuIn .12s ease-out; }
.ds-menu button { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:8px 10px;
    border:0; border-radius:8px; background:transparent; font:inherit; font-size:13px; color:var(--text); text-align:left; white-space:nowrap; cursor:pointer; }
.ds-menu button:hover, .ds-menu button:focus-visible, .ds-menu button:focus { background:var(--primary-soft); outline:none; }
.ds-menu button[aria-selected="true"] { font-weight:600; color:var(--primary-dark); }
.ds-menu button i { font-size:15px; color:var(--primary); }
.ds-menu button:disabled { color:var(--text-muted); opacity:.6; cursor:default; }
@keyframes dsMenuIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.ds-select::after { content:""; position:absolute; right:13px; top:50%; width:7px; height:7px; margin-top:-5px; border-right:1.5px solid var(--text); border-bottom:1.5px solid var(--text); transform:rotate(45deg); pointer-events:none; }
.ds-search { position:relative; width:280px; max-width:100%; }
.ds-search i { position:absolute; left:12px; top:50%; transform:translateY(-50%); font-size:13px; color:var(--text-muted); }
.ds-search input { width:100%; height:34px; padding:0 12px 0 32px; background:var(--bg); border:1px solid var(--border); border-radius:8px; font-size:12px; color:var(--text); }
.ds-search input:focus { outline:none; border-color:var(--primary); background:#fff; box-shadow:0 0 0 3px rgba(82,109,130,.15); }

/* Tables */
.ds-table-wrap { border:1px solid var(--border); border-radius:8px; overflow-x:auto; }
.ds-table { width:100%; border-collapse:collapse; font-size:13px; }
.ds-table thead th { background:#F4F6F7; padding:12px; font-size:12px; font-weight:700; color:var(--text); text-align:left; white-space:nowrap; border-bottom:1px solid var(--border); }
.ds-table tbody td { padding:10px 12px; color:var(--text-muted); vertical-align:middle; border-bottom:1px solid var(--border); }
.ds-table tbody tr:nth-child(even) td { background:var(--bg); }
.ds-table tbody tr:last-child td { border-bottom:0; }
.ds-table tbody tr:hover td { background:#FDF6F6; }
.ds-table .ds-strong { font-weight:600; color:var(--text); }
.ds-person { display:flex; align-items:center; gap:10px; min-width:0; }
.ds-person a, .ds-person strong { font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ds-person a:hover { color:var(--primary-dark); }
.ds-avatar { width:28px; height:28px; border-radius:50%; object-fit:cover; flex-shrink:0; background:var(--primary-soft); color:var(--primary); display:grid; place-items:center; font-size:11px; font-weight:700; }
.ds-progress { display:flex; align-items:center; gap:8px; min-width:110px; }
.ds-progress-track { flex:1; height:6px; border-radius:3px; background:#F4F6F7; overflow:hidden; }
.ds-progress-track > span { display:block; height:100%; border-radius:3px; }
.ds-progress strong { width:36px; font-size:12px; font-weight:600; color:var(--text); }
.ds-row-actions { display:flex; align-items:center; justify-content:center; gap:4px; }
.ds-icon-btn { width:28px; height:28px; border:0; border-radius:6px; background:transparent; color:var(--text); display:inline-grid; place-items:center; font-size:14px; }
.ds-icon-btn:hover { background:var(--primary-soft); color:var(--primary); }

/* Pagination */
.ds-pager { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-top:4px; }
.ds-pager-info { font-size:13px; color:var(--text-muted); }
.ds-pager-links { display:flex; gap:8px; flex-wrap:wrap; }
.ds-pager-links a, .ds-pager-links span { min-width:30px; height:30px; padding:0 10px; display:inline-grid; place-items:center; border:1px solid var(--border); border-radius:6px; font-size:12px; font-weight:600; color:var(--text); background:#fff; }
.ds-pager-links .nav { color:var(--text-muted); }
.ds-pager-links a:hover { border-color:var(--primary); color:var(--primary); }
.ds-pager-links .current { background:var(--primary); border-color:var(--primary); color:#fff; }
.ds-pager-links .disabled { opacity:.5; }

/* Horizontal bars (distribution charts) */
.ds-bars { display:flex; flex-direction:column; gap:12px; }
.ds-bar-row { display:grid; grid-template-columns:72px minmax(0,1fr) 40px; align-items:center; gap:12px; font-size:13px; color:var(--text); }
.ds-bar-row a { color:var(--text); font-weight:500; }
.ds-bar-row a:hover { color:var(--primary-dark); }
.ds-bar-track { height:8px; border-radius:4px; background:#F4F6F7; overflow:hidden; }
.ds-bar-track > span { display:block; height:100%; border-radius:4px; }
.ds-bar-row strong { text-align:right; font-weight:600; }

@media (max-width: 1399.98px) { .ds-split { grid-template-columns:minmax(0,1fr) 360px; } }
@media (max-width: 1199.98px) {
    .ds-kpis { grid-template-columns:repeat(2, minmax(0,1fr)); }
    .ds-split { grid-template-columns:1fr; }
}
@media (max-width: 575.98px) {
    .ds-kpis { grid-template-columns:1fr; }
    .ds-search { width:100%; }
}
