/* ==============================================
   MEY Home — Admin Panel Design System
   Premium Dark Mode Theme
   ============================================== */

/* ── Google Fonts (loaded via HTML) ─────────── */
/* Inter: 300, 400, 500, 600, 700, 800 */

/* ── CSS Variables ──────────────────────────── */
:root {
    /* Backgrounds */
    --bg-primary: #0c0e14;
    --bg-secondary: #151821;
    --bg-tertiary: #1e2230;
    --bg-hover: #262a3a;
    --bg-card: #181b25;
    --bg-input: #12141c;

    /* Sidebar & Navbar */
    --sidebar-bg: #10121a;
    --sidebar-width: 264px;
    --sidebar-collapsed: 0px;
    --navbar-height: 68px;

    /* Brand / Accent */
    --accent: #f59e0b;
    --accent-hover: #e08e05;
    --accent-active: #ca8004;
    --accent-light: rgba(245, 158, 11, 0.12);
    --accent-lighter: rgba(245, 158, 11, 0.06);
    --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);

    /* Text */
    --text-primary: #e8ecf4;
    --text-secondary: #9ba4b8;
    --text-muted: #636d83;
    --text-inverse: #0c0e14;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(245, 158, 11, 0.5);

    /* Status */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --success-border: rgba(34, 197, 94, 0.2);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(239, 68, 68, 0.2);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.2);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --info-border: rgba(59, 130, 246, 0.2);

    /* Channels */
    --instagram: #e1306c;
    --instagram-bg: rgba(225, 48, 108, 0.12);
    --elden: #22c55e;
    --elden-bg: rgba(34, 197, 94, 0.12);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(245, 158, 11, 0.12);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--border);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.25s var(--ease);
    --transition-fast: all 0.15s var(--ease);
    --transition-slow: all 0.4s var(--ease);
}

/* ── Reset & Base ───────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ══════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════ */

/* ── Sidebar ────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s var(--ease);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-inverse);
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.brand-accent { color: var(--accent); }

.brand-tagline {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* ── Sidebar Navigation ────────────────────── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

/* ── Sidebar Footer (User Card) ─────────────── */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-inverse);
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.logout-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.logout-btn:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

/* ── Main Wrapper ───────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s var(--ease);
}

/* ── Navbar ──────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    height: var(--navbar-height);
    background: rgba(12, 14, 20, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-toggle svg { width: 18px; height: 18px; }

.page-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Content Area ───────────────────────────── */
.content {
    flex: 1;
    padding: 28px 32px;
}

/* ══════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════ */

/* ── Cards ──────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* ── Stat Cards ─────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before { opacity: 1; }

.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-danger::before { background: var(--danger); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-info::before { background: var(--info); }
.stat-card:hover.stat-success::before,
.stat-card:hover.stat-danger::before,
.stat-card:hover.stat-warning::before,
.stat-card:hover.stat-info::before { opacity: 1; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-icon.icon-accent {
    background: var(--accent-light);
    color: var(--accent);
}
.stat-icon.icon-success {
    background: var(--success-bg);
    color: var(--success);
}
.stat-icon.icon-danger {
    background: var(--danger-bg);
    color: var(--danger);
}
.stat-icon.icon-info {
    background: var(--info-bg);
    color: var(--info);
}
.stat-icon.icon-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.stat-change.up {
    color: var(--success);
    background: var(--success-bg);
}

.stat-change.down {
    color: var(--danger);
    background: var(--danger-bg);
}

/* ── Tables ─────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

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

tbody tr {
    transition: var(--transition-fast);
}

tbody tr:hover {
    background: var(--bg-hover);
}

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

.table-empty {
    text-align: center;
    padding: 48px 24px !important;
    color: var(--text-muted);
}

.table-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ── Buttons ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
    color: var(--text-inverse);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}
.btn-success:hover {
    background: var(--success);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Badges ─────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-accent {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-instagram {
    background: var(--instagram-bg);
    color: var(--instagram);
}

.badge-elden {
    background: var(--elden-bg);
    color: var(--elden);
}

/* ── Alerts / Flash Messages ────────────────── */
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 13.5px;
    font-weight: 500;
    animation: slideDown 0.3s var(--ease);
    border: 1px solid;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: var(--info-border);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition-fast);
    padding: 0 4px;
    line-height: 1;
}

.alert-close:hover { opacity: 1; }

/* ── Forms ──────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    transition: var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-lighter);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636d83' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
}

/* ── Search & Filter Bar ────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 9px 14px 9px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    min-width: 240px;
    transition: var(--transition-fast);
    outline: none;
}

.search-box input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-lighter);
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.filter-select {
    padding: 9px 36px 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636d83' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
}

.filter-select:focus {
    border-color: var(--border-focus);
}

/* ── Pagination ─────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.page-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.page-link.active {
    background: var(--accent);
    color: var(--text-inverse);
    font-weight: 600;
}

.page-dots {
    padding: 8px 6px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Modal ──────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(10px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 20px;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ── Charts ─────────────────────────────────── */
.chart-container {
    position: relative;
    padding: 8px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

/* ── Empty State ────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ── Low Stock Warning ──────────────────────── */
.stock-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stock-dot.critical { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.stock-dot.low { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.stock-dot.ok { background: var(--success); }

/* ── Miscellaneous ──────────────────────────── */
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

.section-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    margin-bottom: 16px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ══════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.06) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.login-header {
    padding: 40px 36px 24px;
    text-align: center;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.login-brand-icon {
    width: 52px;
    height: 52px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-inverse);
    box-shadow: var(--shadow-glow);
}

.login-brand-text {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-brand-text span { color: var(--accent); }

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-body {
    padding: 8px 36px 36px;
}

.login-body .form-group {
    margin-bottom: 18px;
}

.login-body .form-control {
    padding: 12px 16px;
    font-size: 14px;
}

.login-body .btn {
    width: 100%;
    padding: 13px;
    font-size: 14.5px;
    margin-top: 8px;
}

.login-footer {
    padding: 20px 36px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   SETUP PAGE
   ══════════════════════════════════════════════ */

.setup-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.setup-card {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.setup-header {
    padding: 32px 36px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.setup-body {
    padding: 32px 36px;
}

.setup-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
}

.setup-step-number {
    width: 28px;
    height: 28px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.setup-step-text {
    font-size: 14px;
    color: var(--text-secondary);
    padding-top: 3px;
}

.setup-step-text code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12.5px;
    color: var(--accent);
}

.setup-footer {
    padding: 24px 36px;
    border-top: 1px solid var(--border);
}

.setup-success {
    text-align: center;
    padding: 24px;
}

.setup-success svg {
    width: 64px;
    height: 64px;
    color: var(--success);
    margin-bottom: 16px;
}

/* ══════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════ */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in { animation: fadeIn 0.4s var(--ease); }
.animate-slide-down { animation: slideDown 0.4s var(--ease); }
.animate-scale-in { animation: scaleIn 0.3s var(--ease); }

/* Stagger animation for stat cards */
.stats-grid .stat-card:nth-child(1) { animation: scaleIn 0.4s var(--ease) 0.05s both; }
.stats-grid .stat-card:nth-child(2) { animation: scaleIn 0.4s var(--ease) 0.1s both; }
.stats-grid .stat-card:nth-child(3) { animation: scaleIn 0.4s var(--ease) 0.15s both; }
.stats-grid .stat-card:nth-child(4) { animation: scaleIn 0.4s var(--ease) 0.2s both; }
.stats-grid .stat-card:nth-child(5) { animation: scaleIn 0.4s var(--ease) 0.25s both; }

/* Table row stagger */
tbody tr { animation: fadeIn 0.3s var(--ease) both; }
tbody tr:nth-child(1) { animation-delay: 0.02s; }
tbody tr:nth-child(2) { animation-delay: 0.04s; }
tbody tr:nth-child(3) { animation-delay: 0.06s; }
tbody tr:nth-child(4) { animation-delay: 0.08s; }
tbody tr:nth-child(5) { animation-delay: 0.1s; }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .content {
        padding: 20px;
    }

    .navbar {
        padding: 0 20px;
    }

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

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    html { font-size: 14px; }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 22px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        flex-wrap: wrap;
    }

    .search-box input {
        min-width: unset;
        width: 100%;
    }

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

    .btn-group {
        flex-wrap: wrap;
    }

    .navbar {
        padding: 0 16px;
    }

    .page-title {
        font-size: 16px;
    }

    .navbar-date {
        display: none;
    }

    .content {
        padding: 16px;
    }
}

/* ── Mobile Overlay ─────────────────────────── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Print Styles ───────────────────────────── */
@media print {
    .sidebar,
    .navbar,
    .sidebar-overlay,
    .btn,
    .toolbar {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .content {
        padding: 0 !important;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}
