/* ═══════════════════════════════════════════════════════════
   EMAN COLLECTION — POS Kiosk Theme
   Steel-blue background, white pill cards, red+yellow accents
   Matches the "Point of Sale" promotional visual aesthetic
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Oswald:wght@400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* Steel-blue background palette — matches screenshot */
    --bg:           #3d4e63;
    --bg-2:         #344356;
    --bg-3:         #2d3a4a;
    --bg-4:         #253040;

    /* Surface — white/light for pill items */
    --surface:      #ffffff;
    --surface-2:    #f0f2f5;
    --surface-3:    #e4e8ed;
    --surface-4:    #d8dde5;

    /* Brand colors */
    --red:          #d32f2f;
    --red-light:    #ef5350;
    --red-dark:     #b71c1c;
    --red-bg:       rgba(211,47,47,0.12);
    --red-glow:     rgba(211,47,47,0.3);

    --yellow:       #f9a825;
    --yellow-light: #ffca28;
    --yellow-dark:  #e65100;
    --yellow-bg:    rgba(249,168,37,0.15);

    --green:        #2e7d32;
    --green-light:  #43a047;
    --green-bg:     rgba(46,125,50,0.12);

    --blue:         #1565c0;
    --blue-light:   #1976d2;
    --blue-bg:      rgba(21,101,192,0.12);

    /* Text on dark bg */
    --text-on-dark:        #ffffff;
    --text-on-dark-muted:  rgba(255,255,255,0.7);
    --text-on-dark-dim:    rgba(255,255,255,0.45);

    /* Text on white/light bg */
    --text:         #1a2332;
    --text-muted:   #4a5568;
    --text-light:   #718096;

    /* Borders */
    --border-dark:  rgba(255,255,255,0.12);
    --border-light: rgba(255,255,255,0.06);
    --border:       #d1d9e0;
    --border-focus: var(--red);

    /* Shadows */
    --shadow-sm:    0 2px 8px rgba(0,0,0,0.2);
    --shadow:       0 4px 20px rgba(0,0,0,0.25);
    --shadow-lg:    0 8px 40px rgba(0,0,0,0.35);
    --shadow-pill:  0 4px 15px rgba(0,0,0,0.2);

    /* Radius */
    --radius:       8px;
    --radius-lg:    12px;
    --radius-pill:  50px;

    /* Fonts */
    --font:         'Roboto', 'Segoe UI', sans-serif;
    --font-display: 'Oswald', 'Impact', sans-serif;
    --font-heading: 'Montserrat', 'Arial Black', sans-serif;

    --transition:   0.2s ease;
    --sidebar-w:    240px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-on-dark);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-3);
    border-right: 1px solid var(--border-dark);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}

/* Brand / logo area */
.brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--border-dark);
    background: var(--bg-4);
    text-align: center;
}
.brand h1 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--red-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(211,47,47,0.5);
    line-height: 1.1;
}
.brand small {
    display: block;
    font-family: var(--font);
    font-size: 0.65rem;
    color: var(--text-on-dark-dim);
    margin-top: 4px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
}

/* Nav sections */
.nav-section { padding: 10px 10px 4px; }
.nav-label {
    font-size: 0.6rem;
    color: var(--text-on-dark-dim);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0 6px 5px;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Nav items — white pill style matching screenshot */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--radius-pill);
    color: var(--text-on-dark-muted);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 4px;
    background: rgba(255,255,255,0.06);
    border: 1px solid transparent;
    font-family: var(--font);
}
.nav-item:hover {
    background: rgba(255,255,255,0.14);
    color: var(--text-on-dark);
    transform: translateX(2px);
}
.nav-item.active {
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    box-shadow: var(--shadow-pill);
    border-color: transparent;
}
.nav-item.active .icon { opacity: 1; }
.nav-item .icon { font-size: 1rem; width: 20px; text-align: center; opacity: 0.7; }
.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--border-dark);
}
.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-dark);
    text-decoration: none;
    color: var(--text-on-dark-muted);
    font-size: 0.8rem;
    transition: all var(--transition);
}
.user-pill:hover { background: rgba(255,255,255,0.16); color: var(--text-on-dark); }
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--red);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700; color: #fff;
    font-family: var(--font-heading);
    box-shadow: 0 2px 8px var(--red-glow);
    flex-shrink: 0;
}
.user-info { flex: 1; }
.user-info .name { font-weight: 700; font-size: 0.82rem; color: var(--text-on-dark); }
.user-info .role {
    font-size: 0.62rem;
    color: var(--yellow-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* ── Mobile Top Bar ── */
.topbar {
    display: none;
    position: fixed; top: 0; left: 0; right: 0;
    height: 54px;
    background: var(--bg-4);
    border-bottom: 2px solid var(--red);
    z-index: 101;
    align-items: center;
    padding: 0 14px; gap: 12px;
}
.topbar h1 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--red-light);
    flex: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 1px 6px var(--red-glow);
}
.menu-toggle {
    background: none; border: none;
    color: var(--text-on-dark);
    font-size: 1.4rem; cursor: pointer; padding: 4px;
}
.overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 99;
    backdrop-filter: blur(3px);
}
.overlay.open { display: block; }

/* ── Main Content ── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    padding: 24px 28px;
    background: var(--bg);
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}
.page-header h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-on-dark);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.page-header p {
    font-size: 0.75rem;
    color: var(--text-on-dark-muted);
    margin-top: 3px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* ── Cards — white pill style ── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-pill);
    border: none;
    color: var(--text);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--surface-3);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title::before {
    content: '';
    display: inline-block;
    width: 3px; height: 14px;
    background: var(--red);
    border-radius: 2px;
}

/* ── Stat Cards — white pill style ── */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-pill);
    transition: all var(--transition);
    color: var(--text);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* Colored left border accent */
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.stat-card.accent::before { background: var(--yellow); }
.stat-card.green::before  { background: var(--green-light); }
.stat-card.red::before    { background: var(--red); }
.stat-card.orange::before { background: #e65100; }

.stat-card.accent .stat-value { color: #b45309; }
.stat-card.green .stat-value  { color: var(--green); }
.stat-card.red .stat-value    { color: var(--red); }
.stat-card.orange .stat-value { color: #c2410c; }

.stat-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}
.stat-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    margin: 6px 0 4px;
    line-height: 1;
    color: var(--text);
}
.stat-sub {
    font-size: 0.68rem;
    color: var(--text-light);
    font-weight: 500;
}
.stat-icon {
    position: absolute;
    top: 14px; right: 16px;
    font-size: 1.6rem;
    opacity: 0.1;
}

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gap-b  { margin-bottom: 18px; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn-primary {
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 15px var(--red-glow);
}
.btn-primary:hover {
    background: var(--red-dark);
    box-shadow: 0 6px 20px var(--red-glow);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--yellow);
    color: #fff;
    box-shadow: 0 4px 15px rgba(249,168,37,0.4);
    font-weight: 800;
}
.btn-accent:hover {
    background: var(--yellow-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: var(--text-on-dark);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.5);
}

/* btn-outline inside white cards */
.card .btn-outline {
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.card .btn-outline:hover {
    background: var(--surface-4);
    color: var(--text);
}

.btn-red   { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-green { background: var(--green-light); color: #fff; }
.btn-green:hover { background: var(--green); }

.btn-sm { padding: 5px 14px; font-size: 0.72rem; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Forms — inside white cards ── */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.88rem;
    transition: all var(--transition);
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--red);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--red-bg);
}
.form-input::placeholder { color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 70px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-hint  { font-size: 0.68rem; color: var(--text-light); margin-top: 3px; }

/* ── Tables — inside white cards ── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-pill);
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface-3); }
th {
    padding: 10px 14px;
    text-align: left;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 800;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 10px 14px;
    font-size: 0.84rem;
    border-bottom: 1px solid var(--surface-3);
    color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fef9f0; }
tbody tr { transition: background var(--transition); }

/* ── Badges — yellow pill style like screenshot ── */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: var(--red-dark); }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-blue   { background: #dbeafe; color: var(--blue); }
.badge-accent { background: var(--yellow); color: #fff; }

/* ── Tabs — pill tabs ── */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.tab {
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.78rem;
    font-family: var(--font-heading);
    color: var(--text-on-dark-muted);
    transition: all var(--transition);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
}
.tab:hover { background: rgba(255,255,255,0.18); color: var(--text-on-dark); }
.tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-pill);
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(30,40,55,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border-top: 5px solid var(--red);
    padding: 28px;
    width: 540px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    color: var(--text);
}
.modal-lg { width: 720px; }
.modal h3 {
    font-family: var(--font-display);
    color: var(--text);
    margin-bottom: 18px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.modal-close {
    position: absolute; top: 16px; right: 16px;
    background: var(--surface-3);
    border: none;
    color: var(--text-muted);
    font-size: 1rem; cursor: pointer;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    font-weight: 700;
}
.modal-close:hover { background: var(--red); color: #fff; }

/* ── Search Bar ── */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-bar input { flex: 1; }
.search-bar select { width: 200px; }

/* ── Alert ── */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.84rem;
    margin-bottom: 14px;
    display: flex; gap: 8px; align-items: center;
    font-weight: 600;
    font-family: var(--font-heading);
    letter-spacing: 0.03em;
}
.alert-success { background: #dcfce7; color: #15803d; border: 2px solid #86efac; }
.alert-error   { background: #fee2e2; color: var(--red-dark); border: 2px solid #fca5a5; }
.alert-warn    { background: #ffedd5; color: #c2410c; border: 2px solid #fdba74; }
.alert-info    { background: #dbeafe; color: var(--blue); border: 2px solid #93c5fd; }

/* ── Receipt ── */
.receipt {
    background: #fff;
    color: #111;
    padding: 24px 28px;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    max-width: 380px;
    margin: 0 auto;
    border: 2px dashed #ccc;
    box-shadow: var(--shadow);
}
.receipt-header { text-align: center; margin-bottom: 14px; border-bottom: 2px dashed #888; padding-bottom: 12px; }
.receipt-header h2 { font-size: 1.1rem; font-weight: 800; color: #111; font-family: var(--font-display); letter-spacing: 0.1em; }
.receipt-header p { font-size: 0.7rem; color: #555; }
.receipt-row { display: flex; justify-content: space-between; margin: 3px 0; }
.receipt-section { border-top: 1px dashed #aaa; margin-top: 8px; padding-top: 8px; }
.receipt-total { font-weight: 800; font-size: 1rem; color: var(--red); }

/* ── Chart Bars ── */
.chart-bar-wrap { display: flex; align-items: flex-end; gap: 6px; height: 100px; padding: 0 4px; }
.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--red), var(--red-dark));
    border-radius: 4px 4px 0 0;
    min-height: 3px;
    transition: height 0.5s ease;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px var(--red-glow);
}
.chart-bar:hover { filter: brightness(1.15); }
.chart-bar .tooltip {
    display: none;
    position: absolute; top: -30px; left: 50%;
    transform: translateX(-50%);
    background: var(--yellow);
    color: #fff;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    font-family: var(--font-heading);
    font-weight: 800;
}
.chart-bar:hover .tooltip { display: block; }
.chart-labels { display: flex; gap: 6px; padding: 4px 4px 0; }
.chart-labels span {
    flex: 1; text-align: center;
    font-size: 0.62rem;
    color: var(--text-on-dark-muted);
    font-weight: 600;
    font-family: var(--font-heading);
}

/* ── Divider ── */
.divider { height: 2px; background: var(--surface-3); margin: 16px 0; }

/* ── Account Pill — white card style ── */
.account-pill {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 10px 16px;
    margin-bottom: 8px;
    transition: all var(--transition);
    color: var(--text);
}
.account-pill:hover { background: var(--surface-3); border-color: var(--red); }
.account-pill .acc-icon { font-size: 1.2rem; }
.account-pill .acc-info { flex: 1; }
.account-pill .acc-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-heading);
}
.account-pill .acc-amount {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--green);
}

/* ── Login Page ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 20px;
}
.login-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 420px;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.login-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--red), var(--yellow));
}
.login-box h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--red);
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px var(--red-glow);
}
.login-box .subtitle {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    color: var(--text-light);
    margin-bottom: 28px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}
.login-box .form-group { text-align: left; }
.login-box .btn { width: 100%; justify-content: center; padding: 13px; font-size: 0.92rem; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 36px 20px; color: var(--text-light); }
.empty-state .icon { font-size: 2.2rem; margin-bottom: 8px; opacity: 0.4; display: block; }
.empty-state p { font-size: 0.85rem; font-family: var(--font-heading); font-weight: 600; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-3); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ── Utilities ── */
.text-red     { color: var(--red); }
.text-green   { color: var(--green); }
.text-accent  { color: var(--yellow-dark); }
.text-muted   { color: var(--text-muted); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.fw-700       { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 14px; }
.d-flex       { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 14px; }
.flex-1 { flex: 1; }
.nowrap { white-space: nowrap; }

/* ── Print ── */
@media print {
    .sidebar, .topbar, .btn, .modal-close, .no-print { display: none !important; }
    .main { margin-left: 0; padding: 0; }
    body { background: #fff; }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .topbar { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 14px; padding-top: 68px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
    .search-bar { flex-direction: column; }
    .search-bar select { width: 100%; }
    .tabs { gap: 4px; }
    .tab { padding: 7px 14px; font-size: 0.72rem; }
    .stat-value { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .main { padding: 10px; padding-top: 62px; }
    .card { padding: 14px; }
    .modal { padding: 20px; }
    td, th { padding: 8px 10px; font-size: 0.78rem; }
}

/* ── PWA Standalone ── */
@media (display-mode: standalone) {
    .topbar { padding-top: env(safe-area-inset-top); height: calc(54px + env(safe-area-inset-top)); }
    .main { padding-top: calc(68px + env(safe-area-inset-top)); }
    body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── Focus accessibility ── */
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
