/* ═══════════════════════════════════════════════════════════
   NUBIRO Marketing Hub — Design System
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────── */
:root {
    /* Colors */
    --color-primary:     #1a1a2e;
    --color-primary-dark:#12121f;
    --color-accent:      #4f46e5;
    --color-accent-hover:#4338ca;
    --color-accent-light:#818cf8;
    --color-surface:     #16213e;
    --color-surface-alt: #0f3460;
    --color-bg:          #f1f5f9;
    --color-white:       #ffffff;
    --color-text:        #1e293b;
    --color-text-light:  #64748b;
    --color-text-muted:  #94a3b8;
    --color-border:      #e2e8f0;
    --color-border-dark: #cbd5e1;

    /* Status colors */
    --color-success:     #10b981;
    --color-success-bg:  #ecfdf5;
    --color-warning:     #f59e0b;
    --color-warning-bg:  #fffbeb;
    --color-danger:      #ef4444;
    --color-danger-bg:   #fef2f2;
    --color-info:        #3b82f6;
    --color-info-bg:     #eff6ff;

    /* Layout */
    --sidebar-width:     260px;
    --topbar-height:     60px;

    /* Typography */
    --font-sans:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono:         'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs:   0.25rem;
    --space-sm:   0.5rem;
    --space-md:   1rem;
    --space-lg:   1.5rem;
    --space-xl:   2rem;
    --space-2xl:  3rem;

    /* Border radius */
    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;

    /* Shadows */
    --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

    /* Transitions */
    --transition: 150ms ease;
}


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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
}

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

a:hover {
    color: var(--color-accent-hover);
}

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


/* ── App Layout ─────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}


/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 300ms ease;
}

.sidebar-brand {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-white);
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--color-accent-light);
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.625rem var(--space-xl);
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    color: var(--color-white);
    background: rgba(255,255,255,0.05);
}

.sidebar-nav a.active {
    color: var(--color-white);
    background: rgba(79,70,229,0.15);
    border-left-color: var(--color-accent);
}

.sidebar-nav a .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.8rem;
}

.sidebar-footer .user-name {
    color: var(--color-white);
    font-weight: 600;
}

.sidebar-footer .user-role {
    color: rgba(255,255,255,0.4);
    text-transform: capitalize;
}


/* ── Main Content ───────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.topbar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    list-style: none;
}

.breadcrumb li + li::before {
    content: '/';
    margin-right: 0.375rem;
    color: var(--color-border-dark);
}

.breadcrumb a {
    color: var(--color-text-muted);
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-text);
    padding: var(--space-xs);
}


/* ── Page Container ─────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: var(--space-xl);
}


/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

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

.card-header h2, .card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: var(--space-xl);
}

.card-footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--color-border);
    background: #fafafa;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.stat-card .stat-icon {
    float: right;
    font-size: 1.5rem;
    opacity: 0.3;
}


/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    color: var(--color-white);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-border-dark);
}

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

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}


/* ── Forms ──────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

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

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

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.form-error {
    font-size: 0.75rem;
    color: var(--color-danger);
    margin-top: var(--space-xs);
}


/* ── Tables ─────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table-empty {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--color-text-muted);
}


/* ── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-draft {
    background: #f1f5f9;
    color: #475569;
}

.badge-review {
    background: var(--color-warning-bg);
    color: #92400e;
}

.badge-approved {
    background: var(--color-info-bg);
    color: #1e40af;
}

.badge-published {
    background: var(--color-success-bg);
    color: #065f46;
}

.badge-rejected {
    background: var(--color-danger-bg);
    color: #991b1b;
}

/* Role badges */
.badge-role-superadmin {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-role-admin {
    background: var(--color-info-bg);
    color: #1e40af;
}

.badge-role-lead {
    background: #f0fdfa;
    color: #115e59;
}

.badge-role-editor {
    background: var(--color-success-bg);
    color: #065f46;
}

.badge-role-viewer {
    background: #f1f5f9;
    color: #475569;
}


/* ── Flash Messages ─────────────────────────────────────── */
.flash {
    padding: 0.75rem var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: flashIn 300ms ease;
}

.flash-success {
    background: var(--color-success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background: var(--color-danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.5;
    color: inherit;
}

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

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


/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal-overlay.is-open {
    display: flex;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 200ms ease;
}

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

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: var(--space-xs);
}

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

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

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


/* ── Login Page ─────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    padding: var(--space-lg);
}

.login-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: var(--space-2xl);
}

.login-brand {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.03em;
}

.login-brand p {
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin-top: var(--space-xs);
}

.login-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
}


/* ── Error Pages ────────────────────────────────────────── */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
}

.error-page h1 {
    font-size: 5rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}

.error-page p {
    color: var(--color-text-light);
    font-size: 1.125rem;
    margin: var(--space-md) 0 var(--space-xl);
}


/* ── Media Gallery ───────────────────────────────────────── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.media-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.media-card:hover {
    box-shadow: var(--shadow-md);
}

.media-card-img {
    position: relative;
    overflow: hidden;
}

.media-card-img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.media-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    opacity: 0;
    transition: opacity 0.2s;
}

.media-card:hover .media-card-overlay {
    opacity: 1;
}

.media-card-info {
    padding: 8px 10px;
}

.media-card-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-card-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
    font-size: 0.65rem;
    color: var(--color-text-muted);
}


/* ── Upload Zone ────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--color-border-dark);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--color-accent);
    background: rgba(79,70,229,0.03);
}

.upload-zone.dragover {
    border-color: var(--color-accent);
    background: rgba(79,70,229,0.08);
}

.upload-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

@media (max-width: 480px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}


/* ── Article Editor ──────────────────────────────────────── */
.article-editor {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-xl);
    align-items: start;
}

.article-editor-main {
    min-width: 0;
}

.article-editor-sidebar {
    position: sticky;
    top: calc(var(--topbar-height) + var(--space-xl));
}

.article-title-input {
    font-size: 1.5rem !important;
    font-weight: 700;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-bottom: 2px solid var(--color-border) !important;
    border-radius: 0 !important;
}

.article-title-input:focus {
    border-bottom-color: var(--color-accent) !important;
}

.article-body-input {
    min-height: 400px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
}

.seo-section {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.seo-counter {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.article-preview-body {
    font-size: 0.9rem;
    line-height: 1.7;
    max-height: 300px;
    overflow-y: auto;
}

.article-preview-body h2,
.article-preview-body h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.article-preview-body p {
    margin-bottom: 0.75em;
}

@media (max-width: 768px) {
    .article-editor {
        grid-template-columns: 1fr;
    }
    .article-editor-sidebar {
        position: static;
    }
}


/* ── Status Tabs ────────────────────────────────────────── */
.status-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--color-border);
    overflow-x: auto;
}

.status-tab {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all var(--transition);
}

.status-tab:hover {
    color: var(--color-text);
}

.status-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-count {
    background: var(--color-bg);
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 0.7rem;
    margin-left: 4px;
}

.status-tab.active .tab-count {
    background: rgba(79,70,229,0.1);
    color: var(--color-accent);
}


/* ── Radio Cards ────────────────────────────────────────── */
.radio-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    flex: 1;
    white-space: nowrap;
}

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

.radio-card input:checked + .radio-card,
.radio-card:has(input:checked) {
    border-color: var(--color-accent);
    background: rgba(79,70,229,0.05);
}


/* ── Spinner ────────────────────────────────────────────── */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ── Topbar Right ───────────────────────────────────────── */
.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}


/* ── Company Switcher ───────────────────────────────────── */
.company-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.company-switcher-dropdown {
    position: relative;
}

.company-switcher-btn {
    background: var(--color-white);
    border: 1px solid var(--color-border-dark);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--color-text);
    transition: all var(--transition);
}

.company-switcher-btn:hover {
    border-color: var(--color-accent);
}

.company-switcher-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    min-width: 200px;
    z-index: 150;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.company-switcher-dropdown:hover .company-switcher-menu,
.company-switcher-dropdown.is-open .company-switcher-menu {
    display: block;
}

.company-switcher-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--color-text);
    text-decoration: none;
    transition: background var(--transition);
}

.company-switcher-menu a:hover {
    background: var(--color-bg);
}

.company-switcher-menu a.active {
    font-weight: 600;
    color: var(--color-accent);
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}


/* ── Company Cards ───────────────────────────────────────── */
.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-lg);
}

.company-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.company-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid var(--color-border-dark);
}

.company-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.company-card-header .badge {
    margin-left: auto;
}

@media (max-width: 480px) {
    .company-grid {
        grid-template-columns: 1fr;
    }
}


/* ── Utilities ──────────────────────────────────────────── */
.text-muted    { color: var(--color-text-muted); }
.text-sm       { font-size: 0.8rem; }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.mt-md         { margin-top: var(--space-md); }
.mt-lg         { margin-top: var(--space-lg); }
.mb-md         { margin-bottom: var(--space-md); }
.mb-lg         { margin-bottom: var(--space-lg); }
.flex          { display: flex; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm        { gap: var(--space-sm); }
.gap-md        { gap: var(--space-md); }


/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

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

    .sidebar-toggle {
        display: block;
    }

    .page-content {
        padding: var(--space-md);
    }

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

    .topbar {
        padding: 0 var(--space-md);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: var(--space-xl);
    }
}
