/* ========================================================================== 
   KUNALE POS — Desktop-first design system
   ========================================================================== */

:root {
    --color-bg: #f3f5f9;
    --color-bg-soft: #f8f9fc;
    --color-surface: #ffffff;
    --color-surface-2: #f7f8fb;
    --color-surface-3: #eef1f6;
    --color-border: #e2e6ee;
    --color-border-strong: #d3d8e3;
    --color-text: #171b27;
    --color-text-muted: #667085;
    --color-text-faint: #98a2b3;

    --color-primary: #3D6F49;
    --color-primary-dark: #2E5638;
    --color-primary-strong: #234229;
    --color-primary-light: #E8F0E9;
    --color-primary-soft: #F2F7F3;

    --color-accent: #E8C546;
    --color-accent-light: #FBF3D9;
    --color-success: #129a62;
    --color-success-light: #eaf8f1;
    --color-warning: #e78316;
    --color-warning-light: #fff5e8;
    --color-danger: #e5484d;
    --color-danger-light: #fff0f0;

    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .035);
    --shadow-sm: 0 4px 14px rgba(16, 24, 40, .05);
    --shadow-md: 0 12px 30px rgba(16, 24, 40, .08);
    --shadow-lg: 0 24px 56px rgba(16, 24, 40, .14);

    --font-display: 'Fraunces', Georgia, serif;
    --font-sans: 'Manrope', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --sidebar-width: 252px;
    --topbar-height: 70px;
    --content-max: 1680px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--color-bg); }
html, body { margin: 0; padding: 0; }
body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: rgba(61, 111, 73, .18); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }

/* ---- Scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: #cfd4de transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #cfd4de; border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- Main app layout ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: #111522;
    color: #fff;
    border-right: 1px solid rgba(255,255,255,.05);
    box-shadow: 12px 0 40px rgba(20, 24, 40, .04);
    transition: transform .24s ease;
}

.sidebar-brand {
    min-height: 80px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(145deg, var(--color-primary), var(--color-primary-dark));
    box-shadow: 0 9px 24px rgba(61, 111, 73, .28);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -.04em;
}
.sidebar-brand-mark svg { width: 22px; height: 22px; }
.sidebar-brand-copy { min-width: 0; line-height: 1.15; }
.sidebar-brand-name { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.sidebar-brand-subtitle {
    margin-top: 4px;
    color: #9098aa;
    font-size: 10.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .09em;
}
.sidebar-brand .logo-dot { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px 16px; }
.sidebar-group-label {
    padding: 18px 11px 7px;
    color: #697287;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .105em;
}
.sidebar-group-label:first-child { padding-top: 6px; }

.sidebar-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 3px 0;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #aab1c0;
    font-size: 13px;
    font-weight: 650;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.sidebar-link svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .82; }
.sidebar-link:hover {
    color: #fff;
    background: rgba(255,255,255,.055);
    transform: translateX(2px);
}
.sidebar-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(61,111,73,.23), rgba(61,111,73,.10));
    border-color: rgba(126,166,135,.18);
    box-shadow: inset 3px 0 0 #7EA687;
}
.sidebar-link.active svg { opacity: 1; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-system-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,.045);
    color: #99a2b5;
    font-size: 11px;
}
.sidebar-system-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #39c78a;
    box-shadow: 0 0 0 4px rgba(57,199,138,.10);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(12, 16, 26, .5);
    backdrop-filter: blur(4px);
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 24px;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(218, 223, 233, .86);
    backdrop-filter: blur(16px) saturate(135%);
}
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.topbar-heading { min-width: 0; }
.topbar-eyebrow {
    color: var(--color-text-faint);
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .09em;
    margin-bottom: 5px;
}
.topbar-title { font-size: 17px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.topbar-user-copy { line-height: 1.25; text-align: right; }
.topbar-user-name { font-size: 12.5px; font-weight: 700; }
.topbar-user-role { color: var(--color-text-muted); font-size: 10.5px; margin-top: 2px; }
.avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(145deg, var(--color-primary-light), #DCE8DE);
    color: var(--color-primary-dark);
    border: 1px solid #CCDECF;
    font-size: 12px;
    font-weight: 850;
}
.sidebar-toggle { display: none !important; width: 40px; min-width: 40px; height: 40px; padding: 0 !important; }
.sidebar-toggle svg { width: 18px; height: 18px; }

.page-content {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 24px 28px 40px;
    flex: 1;
}

/* ---- Page helpers ---- */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 25px; letter-spacing: -.035em; line-height: 1.15; }
.page-heading p { margin: 7px 0 0; color: var(--color-text-muted); }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.section-title { font-size: 13px; font-weight: 800; letter-spacing: -.01em; }

/* ---- Cards ---- */
.card {
    background: rgba(255,255,255,.96);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: 20px;
}
.card:hover { border-color: #d9dee8; }
.card-title { margin: 0 0 4px; color: var(--color-text); font-size: 15px; font-weight: 800; letter-spacing: -.015em; }
.card-subtitle { margin: 0 0 16px; color: var(--color-text-muted); font-size: 12.5px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 116px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: 16px 20px;
}
.stat-card::after {
    content: '';
    position: absolute;
    right: -22px;
    bottom: -34px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(61,111,73,.035);
}
.stat-card-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    float: right;
    border-radius: 10px;
    color: var(--color-primary-dark);
    background: var(--color-primary-light);
}
.stat-card-icon svg { width: 17px; height: 17px; }
.stat-label { color: var(--color-text-muted); font-size: 11.5px; font-weight: 700; }
.stat-value { margin-top: 7px; color: var(--color-text); font-size: 25px; line-height: 1.08; font-weight: 850; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-delta { margin-top: 7px; font-size: 11.5px; font-weight: 700; }
.stat-delta.up { color: var(--color-success); }
.stat-delta.down { color: var(--color-danger); }

/* ---- Buttons ---- */
.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.15;
    cursor: pointer;
    user-select: none;
    transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease, color .14s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(61,111,73,.17); outline-offset: 1px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: 0 4px 12px rgba(61,111,73,.16); }
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-outline { background: #fff; border-color: var(--color-border-strong); color: #394150; }
.btn-outline:hover { background: var(--color-surface-2); border-color: #c8ceda; color: var(--color-text); }
.btn-block { width: 100%; }
.btn-lg { min-height: 46px; padding: 12px 16px; font-size: 13.5px; border-radius: 11px; }
.btn-sm { min-height: 32px; padding: 8px 12px; font-size: 11.5px; }
.btn-icon { width: 38px; min-width: 38px; padding: 0; }

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.48);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
.btn-outline.is-loading::after { border-color: rgba(23,27,39,.15); border-top-color: var(--color-text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Forms ---- */
.form-group { margin-bottom: 15px; }
.form-label { display: block; margin-bottom: 6px; color: #3c4352; font-size: 12px; font-weight: 750; }
.form-control {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    outline: none;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    box-shadow: inset 0 1px 1px rgba(16,24,40,.015);
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.form-control::placeholder { color: #a8afbc; }
.form-control:hover { border-color: #c5cbd7; }
.form-control:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(61,111,73,.105); }
textarea.form-control { min-height: 104px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-error { margin-top: 6px; color: var(--color-danger); font-size: 11.5px; font-weight: 600; }
.form-hint { margin-top: 6px; color: var(--color-text-muted); font-size: 11.5px; }

/* ---- Tables ---- */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}
table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 13px;
    border-bottom: 1px solid var(--color-border);
    background: #f7f8fb;
    color: #70798a;
    text-align: left;
    white-space: nowrap;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .055em;
}
.data-table td { padding: 11px 13px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover td { background: #fbfbfd; }
.data-table .actions { white-space: nowrap; }

/* ---- Badges ---- */
.badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.badge-success { background: var(--color-success-light); border-color: #d8f0e4; color: #087a4a; }
.badge-warning { background: var(--color-warning-light); border-color: #f8e6cb; color: #b35d07; }
.badge-danger { background: var(--color-danger-light); border-color: #f8dddd; color: #bd3036; }
.badge-neutral { background: #f2f4f7; border-color: #e4e7ec; color: #667085; }
.badge-primary { background: var(--color-primary-light); border-color: #CCDECF; color: var(--color-primary-dark); }

/* ---- Modal defaults for inline project modals ---- */
[id$="-modal"] { backdrop-filter: blur(5px); }
[id$="-modal"] > .card { box-shadow: var(--shadow-lg); border-color: rgba(224,228,236,.92); }

/* ---- Toast ---- */
#toast-container { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 9px; }
.toast {
    min-width: 240px;
    max-width: 390px;
    padding: 11px 14px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 11px;
    background: #171b27;
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: 12.5px;
    font-weight: 650;
    animation: toast-in .18s ease;
}
.toast.success { background: #087a4a; }
.toast.error { background: #b92f36; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- Skeleton ---- */
.skeleton { background: linear-gradient(90deg, #edf0f5 25%, #f8f9fb 37%, #edf0f5 63%); background-size: 400% 100%; animation: skeleton-loading 1.35s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- Login ---- */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(440px, 1.05fr) minmax(420px, .95fr);
    background: #f5f6fa;
}
.auth-showcase {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(34px, 5vw, 72px);
    background:
        linear-gradient(145deg, rgba(19,23,37,.96), rgba(26,30,49,.97)),
        #171b27;
    color: #fff;
}
.auth-showcase::before {
    content: '';
    position: absolute;
    width: 520px;
    height: 520px;
    right: -180px;
    top: -170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(61,111,73,.42), rgba(61,111,73,0) 68%);
}
.auth-showcase::after {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    left: -200px;
    bottom: -190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,197,70,.10), rgba(232,197,70,0) 70%);
}
.auth-showcase > * { position: relative; z-index: 1; }
.auth-showcase-brand { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 800; }
.auth-showcase-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--color-primary); box-shadow: 0 12px 28px rgba(61,111,73,.26); color: #fff; }
.auth-showcase-brand-mark svg { width: 22px; height: 22px; }
.auth-showcase-copy { max-width: 610px; }
.auth-kicker { color: var(--color-accent); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; }
.auth-showcase h1 { font-family: var(--font-display); font-weight: 700; margin: 14px 0 16px; max-width: 680px; font-size: clamp(36px, 4.1vw, 62px); line-height: .98; letter-spacing: -.055em; }
.auth-showcase p { max-width: 560px; margin: 0; color: #aeb5c4; font-size: 15px; line-height: 1.7; }
.auth-features { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 28px; }
.auth-feature { padding: 8px 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 999px; background: rgba(255,255,255,.04); color: #d9ddea; font-size: 11px; font-weight: 650; }
.auth-version { color: #747d90; font-size: 11px; }
.auth-panel { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 34px; }
.auth-card { width: 100%; max-width: 410px; padding: 0; background: transparent; border: none; border-radius: 0; box-shadow: none; }
.auth-logo { display: none; }
.auth-card-header { margin-bottom: 28px; }
.auth-card-header h2 { margin: 0 0 8px; font-size: 29px; line-height: 1.1; letter-spacing: -.04em; }
.auth-card-header p { margin: 0; color: var(--color-text-muted); }
.auth-submit { margin-top: 4px; }
.auth-security-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--color-text-faint); font-size: 10.5px; }
.auth-security-note svg { width: 14px; height: 14px; }

/* ---- Dashboard ---- */
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: 20px 24px;
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-xl);
    background: linear-gradient(120deg, #171b27 0%, #232840 58%, #292d4a 100%);
    color: #fff;
    box-shadow: 0 16px 34px rgba(25,30,48,.11);
}
.dashboard-hero::after { content:''; position:absolute; width:240px; height:240px; right:-70px; top:-120px; border-radius:50%; background:rgba(61,111,73,.18); }
.dashboard-hero-copy { position: relative; z-index: 1; }
.dashboard-hero-eyebrow { color: var(--color-accent); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .11em; }
.dashboard-hero h2 { font-family: var(--font-display); font-weight: 700; margin: 7px 0 5px; font-size: 22px; letter-spacing: -.035em; }
.dashboard-hero p { margin: 0; color: #aeb5c4; font-size: 12px; }
.dashboard-hero-actions { position: relative; z-index: 1; display: flex; gap: 9px; flex-wrap: wrap; }
.dashboard-hero .btn-outline { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; }
.dashboard-hero .btn-outline:hover { background: rgba(255,255,255,.13); }
.dashboard-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.65fr); gap: 16px; }
.quick-action-grid { display: grid; gap: 9px; margin-top: 14px; }
.quick-action {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: .14s ease;
}
.quick-action:hover { border-color: #B6CDBB; background: var(--color-primary-soft); transform: translateY(-1px); }
.quick-action-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--color-surface-3); color: var(--color-primary-dark); }
.quick-action-icon svg { width: 16px; height: 16px; }
.quick-action-copy { min-width: 0; flex: 1; }
.quick-action-title { font-size: 12.5px; font-weight: 750; }
.quick-action-desc { margin-top: 2px; color: var(--color-text-muted); font-size: 10.5px; }
.quick-action-arrow { color: var(--color-text-faint); font-size: 18px; }

/* ---- GuideBar ---- */
/* Usage: .guide-bar > .guide-bar-icon + .guide-bar-body (title/text) + button.guide-bar-dismiss[aria-label="Cerrar"]. */
.guide-bar {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid #CCDECF;
    border-radius: var(--radius-md);
    background: var(--color-primary-soft);
    font-family: var(--font-sans);
}
.guide-bar-icon { display: grid; place-items: center; flex: 0 0 24px; color: var(--color-primary); }
.guide-bar-icon svg { width: 24px; height: 24px; }
.guide-bar-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.guide-bar-title { color: var(--color-primary-strong); font-size: 13px; font-weight: 700; }
.guide-bar-text { margin-top: 4px; color: var(--color-text-muted); font-size: 12.5px; }
.guide-bar-dismiss {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: 4px 8px;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--color-primary);
    cursor: pointer;
}
.guide-bar-dismiss svg { width: 16px; height: 16px; }
.guide-bar-dismiss:hover { background: var(--color-primary-light); }
.guide-bar-dismiss:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ---- Utility ---- */
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ---- Responsive ---- */
@media (max-width: 1180px) {
    :root { --sidebar-width: 228px; }
    .page-content { padding-inline: 24px; }
    .topbar { padding-inline: 20px; }
    .dashboard-layout { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 980px) {
    .sidebar { width: 264px; transform: translateX(-102%); box-shadow: 20px 0 60px rgba(12,16,26,.18); }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open + .sidebar-overlay, .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: inline-flex !important; }
    .topbar-user-copy { display: none; }
    .topbar .logout-label { display: none; }
    .page-content { padding: 20px 16px 32px; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
    .auth-panel { min-height: 100vh; }
    .auth-card { max-width: 430px; }
}

@media (max-width: 720px) {
    body { font-size: 13px; }
    .topbar { min-height: 62px; padding: 8px 12px; }
    .topbar-eyebrow { display: none; }
    .topbar-title { font-size: 15px; }
    .topbar-user { gap: 7px; }
    .topbar-user > .btn { width: 36px; min-width: 36px; padding: 0; }
    .page-content { padding: 16px 12px 28px; }
    .card { padding: 16px; border-radius: 15px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
    .stat-card { min-height: 104px; padding: 16px; border-radius: 15px; }
    .stat-value { font-size: 21px; }
    .stat-card-icon { width: 30px; height: 30px; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 16px; border-radius: 18px; }
    .dashboard-hero-actions { width: 100%; }
    .dashboard-hero-actions .btn { flex: 1; }
    .table-wrap { border-radius: 12px; }
    .data-table th, .data-table td { padding: 10px 11px; }
    .flex.gap-12.responsive-stack { flex-direction: column; }
    .flex.gap-12:has(.form-group) { flex-direction: column; align-items: stretch !important; }
    .flex.gap-12:has(.form-group) > .form-group { flex: none; }
    .flex.gap-12:has(.form-group) > .btn { width: 100%; }
}

@media (max-width: 460px) {
    .stat-grid { grid-template-columns: 1fr; }
    .auth-panel { padding: 24px 20px; }
    .auth-card-header h2 { font-size: 25px; }
    #toast-container { inset: 12px 12px auto; }
    .toast { min-width: 0; max-width: none; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
