/* ============================================================
   CodeMate – Global Stylesheet
   Design: Modern Light, Indigo + Pink accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ── */
:root {
    --primary:       #4361ee;
    --primary-light: #eef1ff;
    --primary-dark:  #2f4acb;
    --accent:        #f72585;
    --success:       #06d6a0;
    --warning:       #ffb703;
    --danger:        #ef233c;
    --body-bg:       #f0f4ff;
    --card-bg:       #ffffff;
    --sidebar-w:     220px;
    --navbar-h:      64px;
    --text-main:     #1a1a2e;
    --text-muted:    #6c757d;
    --border-color:  #e2e8f8;
    --shadow-sm:     0 2px 12px rgba(67,97,238,.08);
    --shadow-md:     0 4px 24px rgba(67,97,238,.13);
    --radius:        14px;
    --radius-sm:     8px;
}

/* ── Reset / Base ── */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--body-bg);
    color: var(--text-main);
    margin: 0; padding: 0;
    min-height: 100vh;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--body-bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* ══════════════════════════════════════
   NAVBAR
══════════════════════════════════════ */
.cm-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--card-bg);
    border-bottom: 2px solid var(--primary-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1040;
    gap: 16px;
}

.cm-navbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.cm-navbar .brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1rem; font-weight: 700;
}

.cm-navbar .ms-auto-items {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cm-navbar .user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    border-radius: 50px;
    padding: 6px 14px 6px 6px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: background .2s;
}
.cm-navbar .user-badge:hover { background: #dde3ff; }

.cm-navbar .user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary);
}

.cm-navbar .avatar-placeholder {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: .75rem; font-weight: 700;
}

/* Toggle for mobile */
.cm-sidebar-toggle {
    border: none; background: none;
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    cursor: pointer;
    transition: background .2s;
}
.cm-sidebar-toggle:hover { background: var(--primary-light); }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.cm-sidebar {
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--navbar-h));
    background: var(--card-bg);
    border-right: 1.5px solid var(--border-color);
    overflow-y: auto;
    padding: 20px 12px;
    z-index: 1030;
    transition: transform .3s ease;
}

.cm-sidebar .nav-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px 4px;
}

.cm-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all .2s;
}
.cm-sidebar .nav-link i { font-size: 1.05rem; min-width: 20px; color: var(--text-muted); }
.cm-sidebar .nav-link:hover { background: var(--primary-light); color: var(--primary); }
.cm-sidebar .nav-link:hover i { color: var(--primary); }
.cm-sidebar .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
}
.cm-sidebar .nav-link.active i { color: var(--primary); }

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.cm-main {
    margin-left: var(--sidebar-w);
    margin-top: var(--navbar-h);
    padding: 28px 28px 40px;
    min-height: calc(100vh - var(--navbar-h));
}

/* ── Page header ── */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}
.page-header p { color: var(--text-muted); margin: 4px 0 0; font-size: .9rem; }

/* ── Cards ── */
.cm-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-color);
    padding: 24px;
}
.cm-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cm-card-title i { color: var(--primary); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn-primary-cm {
    background: linear-gradient(135deg, var(--primary), #6a3de8);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 3px 12px rgba(67,97,238,.3);
}
.btn-primary-cm:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(67,97,238,.4); color: white; }
.btn-primary-cm:active { transform: translateY(0); }

.btn-accent-cm {
    background: linear-gradient(135deg, var(--accent), #c7004e);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 3px 12px rgba(247,37,133,.3);
}
.btn-accent-cm:hover { transform: translateY(-1px); color: white; }

.btn-success-cm {
    background: linear-gradient(135deg, var(--success), #04a07a);
    color: white; border: none;
    border-radius: var(--radius-sm);
    padding: 10px 24px; font-weight: 600; font-size: .9rem;
    cursor: pointer; transition: all .2s;
}
.btn-success-cm:hover { transform: translateY(-1px); color: white; }

.btn-outline-cm {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 9px 22px;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: all .2s;
}
.btn-outline-cm:hover { background: var(--primary); color: white; }

/* ══════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    /* Default to mobile background */
    background: url('../bg_phone.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Tablet background */
@media (min-width: 768px) {
    .login-page {
        background: url('../bg_tab.jpg') no-repeat center center fixed;
        background-size: cover;
    }
}

/* PC / Laptop background */
@media (min-width: 1024px) {
    .login-page {
        background: url('../bg_pc.jpg') no-repeat center center fixed;
        background-size: cover;
    }
}

.login-card {
    /* Glassmorphism transparent effect */
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}
.login-brand .logo-box {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    color: white; font-size: 1.5rem; font-weight: 800;
    margin-bottom: 12px;
}
.login-brand h2 { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin: 0; }
.login-brand p { color: var(--text-muted); font-size: .85rem; margin: 4px 0 0; }

.login-tabs .nav-link {
    flex: 1; text-align: center;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 10px 10px 0 0;
    border: 2px solid var(--border-color);
    border-bottom: none;
    padding: 10px;
    background: #f8faff;
    transition: all .2s;
}
.login-tabs .nav-link.active {
    color: var(--primary);
    background: white;
    border-color: var(--primary);
    border-bottom-color: white;
}

.login-form-wrap {
    border: 2px solid var(--border-color);
    border-radius: 0 0 14px 14px;
    padding: 24px;
}

/* ══════════════════════════════════════
   FORM CONTROLS
══════════════════════════════════════ */
.cm-input {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: inherit;
    font-size: .9rem;
    color: var(--text-main);
    background: white;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.cm-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(67,97,238,.1);
}
.cm-input::placeholder { color: #bbc3d8; }

.cm-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234361ee' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.cm-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: block;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* ══════════════════════════════════════
   PROFILE PAGE
══════════════════════════════════════ */
.profile-card {
    display: flex;
    align-items: center;
    gap: 24px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 28px 32px;
    border: 1.5px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.profile-photo-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-photo {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 0 0 5px rgba(67,97,238,.1);
}

.profile-photo-placeholder {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 2rem; font-weight: 700;
    border: 3px solid var(--primary);
    box-shadow: 0 0 0 5px rgba(67,97,238,.1);
}

.profile-info h2 { font-size: 1.4rem; font-weight: 700; margin: 0 0 4px; }
.profile-info .class-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--primary-light); color: var(--primary);
    font-size: .78rem; font-weight: 600;
    padding: 3px 10px; border-radius: 50px;
    margin-bottom: 8px;
}

.points-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, var(--warning), #f59e0b);
    color: white; font-weight: 700; font-size: 1rem;
    padding: 6px 18px; border-radius: 50px;
    box-shadow: 0 3px 10px rgba(255,183,3,.35);
}
.points-pill i { font-size: 1rem; }

/* ══════════════════════════════════════
   STUDENT POINTS TABLE
══════════════════════════════════════ */
.points-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.points-table th {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    padding: 8px 16px;
    background: transparent;
    border-bottom: 2px solid var(--border-color);
}

.points-table td {
    padding: 12px 16px;
    background: white;
    border-top: 1.5px solid var(--border-color);
    border-bottom: 1.5px solid var(--border-color);
    vertical-align: middle;
}

.points-table td:first-child { border-left: 1.5px solid var(--border-color); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.points-table td:last-child  { border-right: 1.5px solid var(--border-color); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.points-table tr.top-student td { background: var(--primary-light); }
.points-table tr.top-student td:first-child { border-left: 3px solid var(--primary); }

.points-badge {
    background: linear-gradient(135deg, var(--warning), #f59e0b);
    color: white; font-weight: 700;
    padding: 4px 14px; border-radius: 50px;
    font-size: .9rem;
    display: inline-block;
}

.rank-badge {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .8rem;
}
.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: white; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #999); color: white; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #8B5E3C); color: white; }
.rank-other { background: var(--border-color); color: var(--text-muted); }

.point-controls {
    display: flex; align-items: center; gap: 4px;
}
.point-input {
    width: 60px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    font-weight: 600;
    font-size: .9rem;
    outline: none;
}
.point-input:focus { border-color: var(--primary); }

.btn-point {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.btn-point-add { background: var(--primary); color: white; }
.btn-point-add:hover { background: var(--primary-dark); }
.btn-point-sub { background: var(--danger); color: white; }
.btn-point-sub:hover { background: #c91a2f; }

/* ══════════════════════════════════════
   SETTINGS PAGE
══════════════════════════════════════ */
.settings-grid {
    display: grid;
    gap: 16px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
}

.settings-row label {
    min-width: 220px;
    font-weight: 600;
    color: var(--text-main);
    font-size: .9rem;
    margin: 0;
}

.settings-price-input {
    flex: 1;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    outline: none;
    transition: border-color .2s;
}
.settings-price-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,.12); }

.settings-note {
    background: #fff8e1;
    border: 1.5px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    color: #7c6200;
    font-size: .875rem;
    line-height: 1.6;
}
.settings-note strong { color: #5a4600; }

/* ══════════════════════════════════════
   RECEIPT PAGE
══════════════════════════════════════ */
.receipt-box {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 16px;
}

.receipt-header {
    background: linear-gradient(90deg, var(--primary-light), #fce4ec);
    padding: 14px 20px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    border-bottom: 1.5px solid var(--border-color);
    display: flex; align-items: center; gap: 8px;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.receipt-table th {
    background: #f8faff;
    padding: 8px 14px;
    text-align: left;
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    border-bottom: 1.5px solid var(--border-color);
}
.receipt-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}
.receipt-table tr:last-child td { border-bottom: none; }
.receipt-table .total-row td {
    background: var(--primary-light);
    font-weight: 700;
    color: var(--primary);
    font-size: .95rem;
}
.receipt-table .final-row td {
    background: linear-gradient(90deg, #e8f5e9, #f1f8e9);
    font-weight: 800;
    color: #2e7d32;
    font-size: 1rem;
}
.receipt-table .student-split-row td { background: #fff8e1; }

.receipt-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-whatsapp {
    background: #25D366;
    color: white; border: none;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-weight: 600; font-size: .9rem;
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center; gap: 8px;
    justify-content: center;
}
.btn-whatsapp:hover { background: #1da550; }

.btn-download {
    background: var(--primary);
    color: white; border: none;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-weight: 600; font-size: .9rem;
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center; gap: 8px;
    justify-content: center;
}
.btn-download:hover { background: var(--primary-dark); }

/* Month selector */
.month-selector {
    display: flex; align-items: center; gap: 16px;
    background: white;
    border-radius: var(--radius);
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-color);
    margin-bottom: 24px;
}
.month-selector label { font-weight: 700; color: var(--text-main); margin: 0; font-size: 1rem; }

/* ══════════════════════════════════════
   USERS TABLE
══════════════════════════════════════ */
.cm-table {
    width: 100%;
    border-collapse: collapse;
}
.cm-table thead tr {
    background: var(--primary-light);
}
.cm-table th {
    padding: 12px 16px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}
.cm-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: .9rem;
}
.cm-table tbody tr:hover { background: #f8faff; }

.table-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}
.table-avatar-placeholder {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: inline-flex; align-items: center; justify-content: center;
    color: white; font-size: .8rem; font-weight: 700;
}

.badge-class {
    font-size: .72rem; font-weight: 600;
    padding: 3px 10px; border-radius: 50px;
    white-space: nowrap;
}
.badge-monthly     { background: #e8eafe; color: var(--primary); }
.badge-weekly_twice{ background: #fce4ec; color: var(--accent); }
.badge-weekly_sat  { background: #e8f5e9; color: #2e7d32; }
.badge-weekly_sun  { background: #fff8e1; color: #7c6200; }

/* Group number badge */
.group-num-badge {
    background: linear-gradient(135deg, var(--primary), #6a3de8);
    color: white;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 50px;
    display: inline-block;
    letter-spacing: .3px;
}

.btn-edit-sm {
    width: 30px; height: 30px;
    border: none; border-radius: 6px;
    background: var(--primary-light); color: var(--primary);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-size: .85rem; transition: all .15s;
}
.btn-edit-sm:hover { background: var(--primary); color: white; }
.btn-del-sm {
    width: 30px; height: 30px;
    border: none; border-radius: 6px;
    background: #fce4ec; color: var(--danger);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-size: .85rem; transition: all .15s;
}
.btn-del-sm:hover { background: var(--danger); color: white; }

/* ══════════════════════════════════════
   MODALS
══════════════════════════════════════ */
.modal-content {
    border-radius: var(--radius);
    border: none;
    box-shadow: 0 24px 80px rgba(0,0,0,.15);
}
.modal-header {
    border-bottom: 1.5px solid var(--border-color);
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-light), white);
    border-radius: var(--radius) var(--radius) 0 0;
}
.modal-title { font-weight: 700; color: var(--primary); }
.modal-footer { border-top: 1.5px solid var(--border-color); padding: 14px 24px; }

/* ══════════════════════════════════════
   CROPPER MODAL
══════════════════════════════════════ */
#cropperContainer {
    max-height: 340px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #f0f4ff;
}
#cropperImage { max-width: 100%; display: block; }

.shape-btn {
    border: 2px solid var(--border-color);
    background: white; border-radius: var(--radius-sm);
    padding: 6px 14px; font-size: .82rem; font-weight: 600;
    cursor: pointer; color: var(--text-muted); transition: all .2s;
}
.shape-btn.active, .shape-btn:hover {
    border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}

/* ══════════════════════════════════════
   STAT CARDS
══════════════════════════════════════ */
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px 22px;
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon-blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon-pink   { background: #fce4ec; color: var(--accent); }
.stat-icon-green  { background: #e8f5e9; color: #2e7d32; }
.stat-icon-yellow { background: #fff8e1; color: #e65100; }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: 2px; }
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }

/* ══════════════════════════════════════
   TOAST / ALERTS
══════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; }
.cm-toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    padding: 14px 20px;
    min-width: 260px;
    display: flex; align-items: center; gap: 12px;
    font-size: .9rem; font-weight: 500;
    border-left: 4px solid var(--primary);
    animation: slideUp .3s ease;
}
.cm-toast.success { border-left-color: var(--success); }
.cm-toast.error   { border-left-color: var(--danger); }
.cm-toast.warning { border-left-color: var(--warning); }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {
    .cm-sidebar { transform: translateX(-100%); }
    .cm-sidebar.open { transform: translateX(0); }
    .cm-main { margin-left: 0; }
    .profile-card { flex-direction: column; text-align: center; }
    .receipt-actions { flex-direction: row; }
    .month-selector { flex-direction: column; align-items: flex-start; }
    .settings-row { flex-direction: column; align-items: flex-start; }
    .settings-row label { min-width: unset; }
}

/* ══════════════════════════════════════
   UTILITIES
══════════════════════════════════════ */
.divider { border: none; border-top: 1.5px solid var(--border-color); margin: 20px 0; }
.text-primary-cm { color: var(--primary) !important; }
.text-accent-cm  { color: var(--accent) !important; }
.bg-primary-light { background: var(--primary-light) !important; }
.fw-800 { font-weight: 800 !important; }
.no-data-msg {
    text-align: center; padding: 48px 0;
    color: var(--text-muted); font-size: .95rem;
}
.no-data-msg i { font-size: 2.5rem; margin-bottom: 12px; color: #ccd4f8; display: block; }

/* spinner */
.cm-spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Global Lightbox */
#global-lightbox {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9); z-index: 9999; display: none;
    align-items: center; justify-content: center; padding: 2rem;
}
#global-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.5); }
#global-lightbox .close-lightbox { position: absolute; top: 20px; right: 30px; color: white; font-size: 2rem; cursor: pointer; background: none; border: none; }

