/* ============================================================
   EmpandaHub — Design System
   ============================================================ */

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

/* ---- Tokens ---- */
:root {
    --brand:          #2563eb;
    --brand-50:       color-mix(in srgb, var(--brand)  8%, #fff);
    --brand-100:      color-mix(in srgb, var(--brand) 15%, #fff);
    --brand-600:      color-mix(in srgb, var(--brand) 90%, #000);
    --brand-700:      color-mix(in srgb, var(--brand) 78%, #000);

    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --green-50:  #f0fdf4; --green-700: #15803d; --green-200: #bbf7d0;
    --red-50:    #fef2f2; --red-700:   #b91c1c; --red-200:   #fecaca;
    --amber-50:  #fffbeb; --amber-700: #b45309; --amber-200: #fde68a;
    --blue-50:   #eff6ff; --blue-700:  #1d4ed8; --blue-200:  #bfdbfe;
    --purple-50: #faf5ff; --purple-700:#7e22ce; --purple-200:#e9d5ff;

    --text:       var(--gray-900);
    --text-muted: var(--gray-500);
    --bg:         var(--gray-100);
    --surface:    #ffffff;
    --border:     var(--gray-200);

    --sidebar-w:  256px;
    --topbar-h:   56px;

    --radius-sm:  6px;
    --radius:     10px;
    --radius-lg:  14px;
    --radius-xl:  18px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,.06), 0 8px 20px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.07), 0 20px 40px rgba(0,0,0,.08);

    --transition: .15s cubic-bezier(.4,0,.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.3; margin: 0 0 .5rem; }
a { color: var(--brand); }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }

/* ============================================================
   LAYOUT
   ============================================================ */

body.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--gray-900);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 200;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: 0 1.125rem;
    height: var(--topbar-h);
    background: color-mix(in srgb, var(--brand) 18%, var(--gray-900));
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-logo {
    width: 32px; height: 32px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255,255,255,.1);
}
.sidebar-logo-placeholder {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.sidebar-name {
    color: #fff;
    font-weight: 600;
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.01em;
}

.nav-section {
    padding: 1.25rem 0 .25rem;
}
.nav-section-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.28);
    padding: 0 1.125rem .375rem;
    display: block;
}

.nav-list { list-style: none; margin: 0; padding: 0 .5rem; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .5rem .75rem;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-size: .8125rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    transition: background var(--transition), color var(--transition);
    position: relative;
}
.nav-item svg { flex-shrink: 0; opacity: .7; transition: opacity var(--transition); }
.nav-item:hover {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.9);
}
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -.5rem;
    top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px;
    background: var(--brand);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: .875rem 1rem;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: .625rem;
    flex-shrink: 0;
}
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: .02em;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    color: rgba(255,255,255,.85);
    font-size: .75rem;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    color: rgba(255,255,255,.35);
    font-size: .65rem;
    text-transform: capitalize;
}
.nav-logout {
    color: rgba(255,255,255,.35);
    text-decoration: none;
    font-size: .7rem;
    transition: color var(--transition);
    flex-shrink: 0;
}
.nav-logout:hover { color: rgba(255,255,255,.7); }

/* ---- Light sidebar variant ---- */
.sidebar--light {
    background: var(--surface);
    border-right: 1px solid var(--border);
}
.sidebar--light .sidebar-brand {
    background: var(--gray-50);
    border-bottom-color: var(--border);
}
.sidebar--light .sidebar-name { color: var(--gray-900); }
.sidebar--light .nav-section-label { color: var(--gray-400); }
.sidebar--light .nav-item { color: var(--gray-600); }
.sidebar--light .nav-item:hover { background: var(--gray-100); color: var(--gray-900); }
.sidebar--light .nav-item:hover svg { opacity: 1; }
.sidebar--light .nav-item.active { background: var(--brand-50); color: var(--brand); }
.sidebar--light .nav-item.active::before { background: var(--brand); }
.sidebar--light .sidebar-footer { border-top-color: var(--border); }
.sidebar--light .sidebar-user-name { color: var(--gray-800); }
.sidebar--light .sidebar-user-role { color: var(--gray-500); }
.sidebar--light .nav-logout { color: var(--gray-400); }
.sidebar--light .nav-logout:hover { color: var(--gray-700); }

/* ---- Brand sidebar variant ---- */
.sidebar--brand { background: var(--brand); }
.sidebar--brand .sidebar-brand {
    background: color-mix(in srgb, #000 22%, var(--brand));
    border-bottom-color: color-mix(in srgb, #000 30%, var(--brand));
}
.sidebar--brand .sidebar-logo-placeholder {
    background: color-mix(in srgb, #000 28%, var(--brand));
}
.sidebar--brand .sidebar-name { color: #fff; }
.sidebar--brand .nav-section-label { color: color-mix(in srgb, #fff 45%, var(--brand)); }
.sidebar--brand .nav-item { color: color-mix(in srgb, #fff 80%, var(--brand)); }
.sidebar--brand .nav-item:hover {
    background: color-mix(in srgb, #000 14%, var(--brand));
    color: #fff;
}
.sidebar--brand .nav-item:hover svg { opacity: 1; }
.sidebar--brand .nav-item.active {
    background: color-mix(in srgb, #000 24%, var(--brand));
    color: #fff;
}
.sidebar--brand .nav-item.active::before { background: #fff; }
.sidebar--brand .sidebar-footer { border-top-color: color-mix(in srgb, #000 25%, var(--brand)); }
.sidebar--brand .user-avatar { background: color-mix(in srgb, #000 28%, var(--brand)); }
.sidebar--brand .sidebar-user-name { color: #fff; }
.sidebar--brand .sidebar-user-role { color: color-mix(in srgb, #fff 55%, var(--brand)); }
.sidebar--brand .nav-logout { color: color-mix(in srgb, #fff 50%, var(--brand)); }
.sidebar--brand .nav-logout:hover { color: #fff; }

/* ---- Sidebar style picker (settings) ---- */
.sidebar-style-picker { display: flex; gap: .875rem; flex-wrap: wrap; }
.sidebar-style-opt {
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: .375rem;
    position: relative;
}
.sidebar-style-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ssp-thumb {
    width: 84px; height: 56px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-200);
    overflow: hidden;
    display: flex;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.sidebar-style-opt:hover .ssp-thumb { border-color: var(--gray-400); }
.sidebar-style-opt.is-selected .ssp-thumb {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.ssp-rail { width: 24px; height: 100%; flex-shrink: 0; }
.ssp-body { flex: 1; padding: .35rem .3rem; display: flex; flex-direction: column; gap: 3px; background: var(--gray-50); }
.ssp-line { height: 4px; border-radius: 2px; background: var(--gray-200); }
.ssp-line--short { width: 60%; }
.ssp-thumb--dark  .ssp-rail { background: var(--gray-900); }
.ssp-thumb--light .ssp-rail { background: var(--gray-100); border-right: 1px solid var(--gray-200); }
.ssp-thumb--brand .ssp-rail { background: var(--brand); }
.ssp-label { font-size: .75rem; font-weight: 500; color: var(--gray-600); }
.sidebar-style-opt.is-selected .ssp-label { color: var(--brand); font-weight: 600; }

/* ---- Main wrapper + topbar ---- */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    z-index: 100;
    flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: .75rem; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }

.topbar-org {
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: .01em;
}
.topbar-divider {
    width: 1px; height: 18px;
    background: var(--border);
}
.topbar-page {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: .25rem .625rem .25rem .25rem;
}
.topbar-user-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: .02em;
}
.topbar-user-name {
    font-size: .75rem;
    font-weight: 500;
    color: var(--text);
}
.topbar-logout {
    font-size: .72rem;
    color: var(--text-muted);
    text-decoration: none;
    padding-left: .4rem;
    border-left: 1px solid var(--border);
    margin-left: .2rem;
    transition: color var(--transition);
}
.topbar-logout:hover { color: var(--text); }

/* ---- Main content ---- */
.main-content {
    flex: 1;
    padding: 1.75rem 2rem;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.02em;
    margin: 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.375rem 1.5rem;
    box-shadow: var(--shadow-sm);
}
.card h3 {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 1rem;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: .875rem;
    margin-bottom: .875rem;
    border-bottom: 1px solid var(--border);
}
.card-header h3 { margin: 0; }

/* ---- Stat cards ---- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--brand);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.stat-card-link {
    text-decoration: none;
    display: block;
    transition: box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
}
.stat-card-link:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-card .stat-label {
    font-size: .6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: .375rem;
    display: block;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    letter-spacing: -.03em;
    margin-bottom: .375rem;
}
.stat-card .stat-sub {
    font-size: .75rem;
    color: var(--text-muted);
}
.stat-card-link .stat-value { color: var(--brand); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--gray-50); }
th {
    padding: .625rem 1rem;
    text-align: left;
    font-size: .6875rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: .75rem 1rem;
    font-size: .8125rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover td { background: var(--gray-50); }
tfoot td {
    padding: .75rem 1rem;
    border-top: 2px solid var(--border);
    font-weight: 600;
    color: var(--gray-800);
    background: var(--gray-50);
    font-size: .8125rem;
    border-bottom: none;
}
td a { color: var(--brand); text-decoration: none; font-weight: 500; }
td a:hover { text-decoration: underline; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 1.125rem; }
.form-group label {
    display: block;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: .375rem;
}
input:not([type=checkbox]):not([type=radio]),
select,
textarea {
    width: 100%;
    padding: .5625rem .75rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-family: inherit;
    background: #fff;
    color: var(--gray-900);
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.5;
    -webkit-appearance: none;
}
input:not([type=checkbox]):not([type=radio])::placeholder,
textarea::placeholder { color: var(--gray-400); }
input:not([type=checkbox]):not([type=radio]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
select {
    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='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .625rem center;
    padding-right: 2rem;
    cursor: pointer;
}
textarea { resize: vertical; min-height: 90px; }
.field-error {
    color: #b91c1c;
    font-size: .75rem;
    margin-top: .3rem;
    display: flex;
    align-items: center;
    gap: .25rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }

/* Input error state */
input.is-error, select.is-error, textarea.is-error {
    border-color: #ef4444;
}
input.is-error:focus, select.is-error:focus, textarea.is-error:focus {
    box-shadow: 0 0 0 3px rgba(239,68,68,.2);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .5rem 1rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-size: .8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition);
    letter-spacing: .01em;
    line-height: 1;
    user-select: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    box-shadow: 0 1px 2px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-primary:hover {
    background: var(--brand-600);
    border-color: var(--brand-600);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 40%, transparent);
}

.btn-secondary {
    background: var(--surface);
    color: var(--gray-700);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-ghost {
    background: transparent;
    color: var(--brand);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--brand-50); }

.btn-sm {
    padding: .3125rem .625rem;
    font-size: .75rem;
    border-radius: var(--radius-sm);
}
.btn-lg {
    padding: .6875rem 1.5rem;
    font-size: .9375rem;
    border-radius: var(--radius);
}
.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
}
.btn-icon.btn-sm { width: 28px; height: 28px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .1875rem .5rem;
    border-radius: 9999px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge-success { background: var(--green-50);  color: var(--green-700);  border: 1px solid var(--green-200); }
.badge-warning { background: var(--amber-50);  color: var(--amber-700);  border: 1px solid var(--amber-200); }
.badge-danger  { background: var(--red-50);    color: var(--red-700);    border: 1px solid var(--red-200);   }
.badge-info    { background: var(--blue-50);   color: var(--blue-700);   border: 1px solid var(--blue-200);  }
.badge-muted   { background: var(--gray-100);  color: var(--gray-500);   border: 1px solid var(--gray-200);  }
.badge-purple  { background: var(--purple-50); color: var(--purple-700); border: 1px solid var(--purple-200);}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-messages { margin-bottom: 1.25rem; }
.flash {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .875rem 1rem .875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: .5rem;
    font-size: .8125rem;
    font-weight: 500;
    border: 1px solid transparent;
    animation: slideDown .2s ease;
}
.flash::before {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: .05rem;
}
.flash-success { background: var(--green-50);  color: var(--green-700);  border-color: var(--green-200); }
.flash-success::before { content: '✓'; }
.flash-error   { background: var(--red-50);    color: var(--red-700);    border-color: var(--red-200);   }
.flash-error::before   { content: '✕'; }
.flash-warning { background: var(--amber-50);  color: var(--amber-700);  border-color: var(--amber-200); }
.flash-warning::before { content: '⚠'; }
.flash-close {
    margin-left: auto;
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: .5; font-size: .9rem; line-height: 1;
    flex-shrink: 0; padding: 0 0 0 .5rem;
    transition: opacity var(--transition);
}
.flash-close:hover { opacity: 1; }

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

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress {
    height: 6px;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--brand);
    border-radius: inherit;
    transition: width .4s ease;
}
.progress-bar.progress-warning { background: #f59e0b; }
.progress-bar.progress-danger  { background: #ef4444; }

/* ============================================================
   AUTH PAGE
   ============================================================ */
body.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gray-900) 0%, #1e3a5f 100%);
}
.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
}
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-brand-logo {
    width: 52px; height: 52px;
    background: var(--brand);
    border-radius: 14px;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 1.375rem; font-weight: 800; color: #fff;
    margin-bottom: .75rem;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 50%, transparent);
}
.auth-brand-name {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
}
.auth-brand-tagline {
    font-size: .8125rem;
    color: rgba(255,255,255,.5);
    margin-top: .25rem;
    display: block;
}
.auth-box {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow-lg);
}
.auth-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 .375rem;
    letter-spacing: -.02em;
}
.auth-subtitle {
    font-size: .8125rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-1 { margin-top: .375rem; }
.mt-2 { margin-top: .875rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .375rem; }
.mb-2 { margin-bottom: .875rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-muted   { color: var(--text-muted); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-success { color: var(--green-700); }
.text-danger  { color: var(--red-700); }
.text-warning { color: var(--amber-700); }
.d-flex { display: flex; }
.d-none { display: none; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: .875rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.flex-1 { flex: 1; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-sm  { font-size: .75rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* Danger zone visual */
.danger-zone {
    border: 1.5px solid var(--red-200);
    border-radius: var(--radius-lg);
    padding: 1.375rem 1.5rem;
    background: var(--red-50);
}
.danger-zone-title {
    color: var(--red-700);
    font-weight: 700;
    font-size: .9375rem;
    margin: 0 0 .75rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: .75rem;
    opacity: .35;
    display: block;
}
.empty-state h3 { font-size: 1rem; color: var(--gray-700); margin-bottom: .375rem; }
.empty-state p  { font-size: .8125rem; margin-bottom: 1rem; }

/* Alert / info boxes */
.alert {
    padding: .875rem 1rem;
    border-radius: var(--radius);
    font-size: .8125rem;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}
.alert-warning { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-700); }
.alert-info    { background: var(--blue-50);  border-color: var(--blue-200);  color: var(--blue-700); }
.alert-danger  { background: var(--red-50);   border-color: var(--red-200);   color: var(--red-700); }

/* ============================================================
   MOBILE
   ============================================================ */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    padding: .25rem;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: color var(--transition);
}
.menu-toggle:hover { color: var(--gray-900); }
.menu-toggle svg { display: block; }

@media (max-width: 768px) {
    :root { --sidebar-w: 256px; }
    .sidebar { transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1); }
    .sidebar.open { transform: none; }
    .main-wrapper { margin-left: 0; }
    .main-content { padding: 1.25rem 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: 1fr 1fr; }
    .page-header { flex-wrap: wrap; }
    .menu-toggle { display: flex; align-items: center; }
    .sidebar-overlay {
        position: fixed; inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 199;
        display: none;
    }
    .sidebar.open ~ .main-wrapper .sidebar-overlay,
    .sidebar-overlay.show { display: block; }
}
@media (min-width: 769px) { .menu-toggle { display: none; } }
