/* ================================================
   Station Manager Pro — Design System v2
   Plus coloré, plus compact, plus pro
   ================================================ */

:root {
    --primary: #1B4965;
    --primary-light: #2A6F97;
    --primary-dark: #122F42;
    --primary-bg: rgba(27,73,101,0.06);
    --accent: #FF6B35;
    --accent-light: #FF8C5A;
    --accent-bg: rgba(255,107,53,0.08);
    --white: #FFFFFF;
    --bg: #F0F2F5;
    --bg-warm: #FFF8F5;
    --text: #1A1D21;
    --text-secondary: #5F6B7A;
    --border: #E1E5EB;
    --border-light: #F0F2F5;
    --success: #00B894;
    --success-bg: rgba(0,184,148,0.1);
    --error: #E17055;
    --error-bg: rgba(225,112,85,0.1);
    --warning: #FDCB6E;
    --warning-bg: rgba(253,203,110,0.15);
    --info: #74B9FF;
    --info-bg: rgba(116,185,255,0.12);
    --purple: #A29BFE;
    --purple-bg: rgba(162,155,254,0.1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-color: 0 4px 14px rgba(27,73,101,0.15);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: 0.2s ease;
    --sidebar-width: 240px;
    --topbar-height: 52px;
    --bottomnav-height: 58px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text); background: var(--bg); line-height: 1.5;
    overflow-x: hidden; -webkit-font-smoothing: antialiased;
}

/* ================================================ Screens */
.screen { display: none; }
.screen.active { display: block; }
#main-app.active { display: flex; flex-direction: column; min-height: 100vh; }

/* ================================================ Login */
.login-container {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    min-height: 100vh; padding: 2rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
}
.login-header { text-align: center; margin-bottom: 2rem; color: var(--white); }
.login-header h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; }
.login-header p { opacity: 0.7; margin-top: 0.4rem; font-size: 0.9rem; }
#login-form {
    width: 100%; max-width: 360px; background: var(--white);
    padding: 1.8rem; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}

/* ================================================ Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.3px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.55rem 0.75rem; border: 1.5px solid var(--border);
    border-radius: var(--radius); font-size: 0.9rem; font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,73,101,0.08);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; }

/* ================================================ Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    padding: 0.5rem 1rem; border: none; border-radius: var(--radius);
    font-size: 0.82rem; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--white); box-shadow: var(--shadow-color); }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: var(--white); box-shadow: 0 4px 14px rgba(255,107,53,0.25); }
.btn-accent:hover { background: var(--accent-light); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 0.4rem 0.6rem; }
.btn-ghost:hover { color: var(--primary); background: var(--primary-bg); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--error); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--text); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
.btn-xs { padding: 0.25rem 0.5rem; font-size: 0.7rem; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 50%; }

/* ================================================ Top Bar */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--topbar-height); background: var(--primary);
    display: flex; align-items: center; padding: 0 1rem;
    box-shadow: var(--shadow-color); gap: 0.6rem; color: var(--white);
}
.topbar__menu {
    display: flex; flex-direction: column; gap: 3px; background: none; border: none; cursor: pointer; padding: 4px;
}
.topbar__menu span { display: block; width: 18px; height: 2px; background: rgba(255,255,255,0.9); border-radius: 1px; transition: var(--transition); }
.topbar__title { flex: 1; font-size: 0.95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--white); }
.topbar__actions { display: flex; align-items: center; gap: 0.4rem; }
.topbar__btn {
    position: relative; width: 34px; height: 34px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--white); transition: var(--transition);
}
.topbar__btn:hover { background: rgba(255,255,255,0.25); }
.topbar__btn svg { stroke: var(--white); }
#user-initials {
    font-size: 0.75rem; font-weight: 700; color: var(--primary);
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: var(--white); border-radius: 50%;
}
.badge {
    position: absolute; top: -3px; right: -3px; background: var(--accent); color: var(--white);
    font-size: 0.6rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
    border: 2px solid var(--primary);
}

/* ================================================ Sidebar — Dark Blue */
.sidebar {
    position: fixed; top: 0; left: -260px; bottom: 0; width: var(--sidebar-width);
    background: var(--primary-dark); z-index: 200; transition: left var(--transition);
    display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.sidebar.open { left: 0; }
.sidebar__header { padding: 1rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.1); background: var(--primary); }
.sidebar__header h3 { font-size: 0.95rem; font-weight: 700; color: var(--white); margin-bottom: 0.6rem; }
.sidebar__station-select {
    width: 100%; padding: 0.45rem 0.6rem; border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius); font-size: 0.8rem; font-family: inherit;
    background: rgba(255,255,255,0.1); font-weight: 500; color: var(--white);
}
.sidebar__station-select option { background: var(--primary-dark); color: var(--white); }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 0.3rem 0; list-style: none; }
.sidebar__nav li { margin: 0; }
.sidebar__nav a, .sidebar__nav button {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 1rem; width: 100%; border: none; background: none;
    font-size: 0.82rem; color: rgba(255,255,255,0.75); cursor: pointer;
    transition: all var(--transition); font-family: inherit; text-decoration: none;
    text-align: left; border-left: 3px solid transparent;
}
.sidebar__nav a:hover, .sidebar__nav button:hover { background: var(--accent); color: var(--white); border-left-color: var(--accent); }
.sidebar__nav .active a, .sidebar__nav .active button { background: var(--accent); color: var(--white); font-weight: 600; border-left-color: var(--accent-light); }
.sidebar__nav .nav-section { padding: 0.7rem 1rem 0.25rem; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: rgba(255,255,255,0.35); }
.sidebar__footer { padding: 0.8rem; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar__footer .btn { color: rgba(255,255,255,0.7); }
.sidebar__footer .btn:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 199; }
.sidebar-overlay.active { display: block; }

/* ================================================ Chip Grid (horizontal scrollable cards) */
.chip-grid {
    display: flex; gap: 0.4rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: 0.2rem 0; scrollbar-width: none;
}
.chip-grid::-webkit-scrollbar { display: none; }
.date-filter { background: var(--bg-secondary); border-radius: var(--radius); padding: 0.6rem 0.8rem; }
.date-filter .form-row { align-items: flex-end; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 0.5rem 1rem; font-size: 0.8rem; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all var(--transition); background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Progress bar */
.progress-bar { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar__fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; background: var(--primary); }
.chip {
    flex-shrink: 0; display: flex; align-items: center; gap: 0.3rem;
    padding: 0.45rem 0.8rem; border-radius: 20px; border: 1.5px solid var(--border);
    background: var(--white); cursor: pointer; transition: all var(--transition);
    font-family: inherit; font-size: 0.78rem; font-weight: 600; color: var(--text);
    white-space: nowrap;
}
.chip:hover { border-color: var(--primary); background: var(--primary-bg); }
.chip.selected { background: var(--primary); color: var(--white); border-color: var(--primary); box-shadow: var(--shadow-color); }
.chip--accent.selected { background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 14px rgba(255,107,53,0.25); }
.chip--success.selected { background: var(--success); border-color: var(--success); }
.chip--purple.selected { background: var(--purple); border-color: var(--purple); }

/* ================================================ Content */
.content {
    margin-top: var(--topbar-height); padding: 1rem;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left var(--transition);
}

/* ================================================ Alert Banners */
.alert {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem;
    border-radius: var(--radius); margin-bottom: 0.8rem; font-size: 0.82rem; font-weight: 500;
    animation: fadeSlideUp 0.3s ease;
}
.alert--warning { background: var(--warning-bg); color: #856404; border-left: 3px solid var(--warning); }
.alert--error { background: var(--error-bg); color: var(--error); border-left: 3px solid var(--error); }
.alert--info { background: var(--info-bg); color: var(--primary); border-left: 3px solid var(--info); }
.alert--success { background: var(--success-bg); color: #0d6832; border-left: 3px solid var(--success); }
.alert__icon { font-size: 1.1rem; flex-shrink: 0; }
.alert__text { flex: 1; }
.alert__action { flex-shrink: 0; }

/* ================================================ Cards v2 */
.card {
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); padding: 1rem; margin-bottom: 0.8rem;
    transition: box-shadow var(--transition), transform var(--transition);
    animation: fadeSlideUp 0.3s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card--clickable { cursor: pointer; }
.card--clickable:hover { transform: translateY(-1px); }
.card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; gap: 0.5rem; }
.card__title { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.card__subtitle { font-size: 0.75rem; color: var(--text-secondary); }
.card--colored { border-top: 3px solid var(--primary); }
.card--accent { border-top: 3px solid var(--accent); }
.card--success { border-top: 3px solid var(--success); }
.card--warning { border-top: 3px solid var(--warning); }
.card--compact { padding: 0.75rem; }

/* ================================================ Stats Cards v2 — More colorful */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.6rem; margin-bottom: 0.8rem; }
.stat-card {
    border-radius: var(--radius-lg); padding: 0.8rem; position: relative; overflow: hidden;
    animation: fadeSlideUp 0.3s ease;
}
.stat-card__label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; opacity: 0.8; }
.stat-card__value { font-size: 1.3rem; font-weight: 800; margin-top: 0.15rem; }
.stat-card__sub { font-size: 0.7rem; margin-top: 0.1rem; opacity: 0.7; }
.stat-card--primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: var(--white); box-shadow: var(--shadow-color); }
.stat-card--accent { background: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%); color: var(--white); box-shadow: 0 4px 14px rgba(255,107,53,0.2); }
.stat-card--success { background: var(--success-bg); color: #0d6832; border: 1px solid rgba(0,184,148,0.2); }
.stat-card--warning { background: var(--warning-bg); color: #856404; border: 1px solid rgba(253,203,110,0.3); }
.stat-card--error { background: var(--error-bg); color: var(--error); border: 1px solid rgba(225,112,85,0.2); }
.stat-card--info { background: var(--info-bg); color: var(--primary); border: 1px solid rgba(116,185,255,0.2); }
.stat-card--purple { background: var(--purple-bg); color: #5B4FCF; border: 1px solid rgba(162,155,254,0.2); }
.stat-card--white { background: var(--white); color: var(--text); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }

/* ================================================ Action Grid — Quick Action Buttons */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.5rem; margin-bottom: 0.8rem; }
.action-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
    padding: 0.8rem 0.5rem; border-radius: var(--radius-lg); border: 1.5px solid var(--border);
    background: var(--white); cursor: pointer; transition: all var(--transition); font-family: inherit;
    text-align: center;
}
.action-btn:hover { border-color: var(--primary); background: var(--primary-bg); transform: translateY(-1px); box-shadow: var(--shadow); }
.action-btn__icon { font-size: 1.4rem; }
.action-btn__label { font-size: 0.72rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.action-btn--active { border-color: var(--primary); background: var(--primary-bg); }
.action-btn--warning { border-color: var(--warning); background: var(--warning-bg); }
.action-btn--accent { border-color: var(--accent); background: var(--accent-bg); }

/* ================================================ Compact Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
thead th {
    text-align: left; padding: 0.5rem 0.6rem; background: var(--bg); color: var(--text-secondary);
    font-weight: 700; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.4px;
    border-bottom: 2px solid var(--border); white-space: nowrap;
}
tbody td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border-light); }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--primary-bg); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.row-highlight { background: var(--warning-bg) !important; }

/* ================================================ Inline Stats Row */
.inline-stats { display: flex; gap: 1.2rem; flex-wrap: wrap; padding: 0.5rem 0; }
.inline-stat { display: flex; flex-direction: column; }
.inline-stat__label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.3px; }
.inline-stat__value { font-size: 1rem; font-weight: 700; }

/* ================================================ Chart Container */
.chart-container { position: relative; height: 220px; margin-top: 0.5rem; }
.chart-container--sm { height: 160px; }

/* ================================================ Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); margin-bottom: 0.8rem; }
.tab {
    padding: 0.5rem 1rem; border: none; background: none; font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: all var(--transition); font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ================================================ Filters Bar */
.filters { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.8rem; }
.filters select, .filters input[type="date"] {
    padding: 0.4rem 0.6rem; border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 0.78rem; font-family: inherit; background: var(--white);
}

/* ================================================ Station Card (Admin) */
.station-card {
    background: var(--white); border-radius: var(--radius-lg); padding: 0.8rem;
    box-shadow: var(--shadow-sm); cursor: pointer; transition: all var(--transition);
    border-left: 4px solid var(--primary); animation: fadeSlideUp 0.3s ease;
}
.station-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.station-card__name { font-size: 0.95rem; font-weight: 700; }
.station-card__location { font-size: 0.75rem; color: var(--text-secondary); }
.station-card__stats { display: flex; gap: 1rem; margin-top: 0.5rem; flex-wrap: wrap; }
.station-card__stat { font-size: 0.72rem; }
.station-card__stat strong { display: block; font-size: 0.95rem; color: var(--primary); }

/* ================================================ Modal */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 300; align-items: center; justify-content: center; padding: 0.8rem;
    backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--white); border-radius: var(--radius-xl); width: 100%; max-width: 480px;
    max-height: 88vh; display: flex; flex-direction: column;
    animation: modalIn 0.25s ease; box-shadow: var(--shadow-lg);
}
.modal--lg { max-width: 640px; }
.modal__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 1rem; border-bottom: 1px solid var(--border-light);
    background: var(--primary-bg); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal__title { font-size: 0.92rem; font-weight: 700; color: var(--primary); }
.modal__close { width: 28px; height: 28px; border: none; background: var(--white); border-radius: 50%; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.modal__close:hover { background: var(--error-bg); color: var(--error); }
.modal__body { padding: 1rem; overflow-y: auto; flex: 1; }
.modal__footer { padding: 0.7rem 1rem; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 0.4rem; }

/* ================================================ Toast */
#toast-container { position: fixed; top: calc(var(--topbar-height) + 0.5rem); right: 0.5rem; z-index: 400; display: flex; flex-direction: column; gap: 0.4rem; }
.toast {
    padding: 0.65rem 1rem; border-radius: var(--radius); color: var(--white);
    font-size: 0.8rem; font-weight: 600; max-width: 300px;
    animation: toastIn 0.3s ease; box-shadow: var(--shadow-lg);
}
.toast--success { background: var(--success); }
.toast--error { background: var(--error); }
.toast--warning { background: var(--warning); color: var(--text); }
.toast--info { background: var(--primary); }
.toast.out { animation: toastOut 0.3s ease forwards; }

/* ================================================ Dropdown */
.dropdown {
    position: fixed; top: calc(var(--topbar-height) + 4px); right: 0.5rem;
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    min-width: 200px; z-index: 150; animation: fadeSlideUp 0.15s ease;
}
.dropdown__item { display: block; width: 100%; padding: 0.6rem 0.9rem; border: none; background: none; text-align: left; font-size: 0.82rem; cursor: pointer; font-family: inherit; }
.dropdown__item:hover { background: var(--bg); }
.dropdown__item strong { display: block; font-size: 0.85rem; }
.dropdown__item small { color: var(--text-secondary); font-size: 0.72rem; }
.dropdown hr { border: none; border-top: 1px solid var(--border-light); margin: 0; }

/* ================================================ Bottom Nav */
.bottomnav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--white); box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 100; height: var(--bottomnav-height);
    padding: 0 0.3rem; align-items: center; justify-content: space-around;
}
.bottomnav__item {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 0.3rem 0.6rem; border: none; background: none; cursor: pointer;
    color: var(--text-secondary); font-size: 0.6rem; font-weight: 600;
    transition: color var(--transition); font-family: inherit;
}
.bottomnav__item.active { color: var(--primary); }
.bottomnav__item svg { width: 20px; height: 20px; }

/* ================================================ Status / Tags */
.status { display: inline-flex; padding: 0.15rem 0.5rem; border-radius: 20px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.2px; }
.status--open { background: var(--success-bg); color: var(--success); }
.status--closed { background: rgba(99,110,114,0.1); color: var(--text-secondary); }
.status--pending { background: var(--warning-bg); color: #E17055; }
.status--positive { color: var(--success); }
.status--negative { color: var(--error); }
.tag { display: inline-flex; padding: 0.15rem 0.45rem; border-radius: 4px; font-size: 0.65rem; font-weight: 700; }
.tag--primary { background: var(--primary-bg); color: var(--primary); }
.tag--accent { background: var(--accent-bg); color: var(--accent); }
.tag--success { background: var(--success-bg); color: var(--success); }

/* ================================================ Empty State */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-secondary); }
.empty-state__icon { font-size: 2.5rem; margin-bottom: 0.5rem; opacity: 0.4; }
.empty-state p { font-size: 0.85rem; margin-bottom: 0.8rem; }

/* ================================================ Loading */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
.loading-page { display: flex; justify-content: center; padding: 3rem; }

/* ================================================ Grid Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 0.8rem; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 0.8rem; }

/* ================================================ Progress Bar */
.progress { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.progress__bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.progress__bar--primary { background: var(--primary); }
.progress__bar--success { background: var(--success); }
.progress__bar--warning { background: var(--warning); }
.progress__bar--error { background: var(--error); }

/* ================================================ Animations */
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes notifSlideIn {
    from { opacity: 0; transform: translateY(-40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ================================================ Responsive */
@media (max-width: 768px) {
    .bottomnav { display: flex; }
    .content { padding-bottom: calc(var(--bottomnav-height) + 0.8rem); }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .topbar__menu { display: flex; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
    .action-grid { grid-template-columns: repeat(3, 1fr); }
    html { font-size: 13.5px; }
}

@media (min-width: 769px) {
    .sidebar { left: 0; top: var(--topbar-height); box-shadow: var(--shadow-sm); }
    .content { margin-left: var(--sidebar-width); }
    .topbar { left: var(--sidebar-width); }
    .topbar__menu { display: none; }
    .bottomnav { display: none; }
    .sidebar-overlay { display: none !important; }
}

@media (min-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================ Utility */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.4rem; }
.mb-2 { margin-bottom: 0.8rem; }
.mb-3 { margin-bottom: 1.2rem; }
.mt-1 { margin-top: 0.4rem; }
.mt-2 { margin-top: 0.8rem; }
.p-0 { padding: 0; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 0.4rem; }
.gap-2 { gap: 0.8rem; }
.text-sm { font-size: 0.75rem; }
.text-xs { font-size: 0.68rem; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 800; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.amount--positive { color: var(--success); }
.amount--negative { color: var(--error); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.opacity-60 { opacity: 0.6; }
