/* =========================================================================
   SmartMarket — Admin panel dizayn tizimi
   Light / Dark rejim CSS o'zgaruvchilari orqali boshqariladi.
   ========================================================================= */

:root {
    --brand: #635bff;
    --brand-600: #574fe0;
    --brand-700: #4840c0;
    --brand-soft: rgba(99, 91, 255, 0.12);

    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.12);
    --danger: #e11d48;
    --danger-soft: rgba(225, 29, 72, 0.12);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.14);
    --info: #0ea5e9;
    --info-soft: rgba(14, 165, 233, 0.12);

    /* Light (standart) */
    --bg: #eceff7;
    --surface: #ffffff;
    --surface-2: #f6f7fb;
    --surface-3: #eef0f6;
    --border: #e4e7f0;
    --border-strong: #d3d8e6;
    --text: #1c2333;
    --text-muted: #6a7387;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e9ebf3;
    --topbar-bg: rgba(255, 255, 255, 0.8);
    --shadow-sm: 0 1px 2px rgba(20, 27, 45, 0.06);
    --shadow-md: 0 6px 20px rgba(20, 27, 45, 0.08);
    --shadow-lg: 0 18px 45px rgba(20, 27, 45, 0.14);

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --sidebar-w: 260px;
    --topbar-h: 66px;
}

html[data-theme="dark"] {
    --bg: #0a0e17;
    --surface: #141a28;
    --surface-2: #1a2233;
    --surface-3: #212b40;
    --border: #26314a;
    --border-strong: #33405e;
    --text: #e7ebf5;
    --text-muted: #8a93a8;
    --sidebar-bg: #0f1523;
    --sidebar-border: #1f293e;
    --topbar-bg: rgba(15, 21, 35, 0.82);
    --brand-soft: rgba(99, 91, 255, 0.2);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s ease, color .25s ease;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    vertical-align: middle;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ========================= App shell ========================= */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.sidebar__brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom: 1px solid var(--sidebar-border);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    color: var(--text);
}
.sidebar__logo {
    width: 38px; height: 38px;
    border-radius: 11px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), #9d7bff);
    color: #fff;
    box-shadow: 0 6px 16px rgba(99, 91, 255, .4);
}
.sidebar__logo .icon { width: 22px; height: 22px; }
.sidebar__brand small {
    display: block;
    font-size: .68rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sidebar__nav {
    padding: 16px 14px;
    overflow-y: auto;
    flex: 1;
}
.sidebar__section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 16px 12px 8px;
}
.nav-link-a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
    position: relative;
    transition: background-color .15s ease, color .15s ease;
}
.nav-link-a:hover {
    background: var(--surface-2);
    color: var(--text);
}
.nav-link-a.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}
.nav-link-a.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
}
.nav-link-a .badge-count {
    margin-left: auto;
    font-size: .68rem;
    background: var(--danger);
    color: #fff;
    border-radius: 20px;
    padding: 1px 7px;
    font-weight: 600;
}

.sidebar__foot {
    padding: 14px;
    border-top: 1px solid var(--sidebar-border);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f0872f, #f0512f);
    flex: 0 0 auto;
}
.avatar.sm { width: 32px; height: 32px; font-size: .8rem; }
.user-chip__name { font-weight: 600; font-size: .88rem; line-height: 1.2; }
.user-chip__role { font-size: .74rem; color: var(--text-muted); }

/* ========================= Main ========================= */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 26px;
    background: var(--topbar-bg);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar__title h1 {
    font-size: 1.18rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -.01em;
}
.topbar__title p { margin: 0; font-size: .78rem; color: var(--text-muted); }

.topbar__search {
    margin-left: auto;
    position: relative;
    width: 300px;
    max-width: 34vw;
}
.topbar__search .icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px; height: 18px;
}
.topbar__search input {
    width: 100%;
    height: 40px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    padding: 0 14px 0 40px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.topbar__search input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.icon-btn {
    width: 42px; height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: grid; place-items: center;
    cursor: pointer;
    position: relative;
    transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn .dot {
    position: absolute; top: 9px; right: 10px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--surface);
}

.theme-sun, .theme-moon { display: none; align-items: center; }
html[data-theme="light"] .theme-moon { display: inline-flex; }
html[data-theme="dark"] .theme-sun { display: inline-flex; }

.content {
    padding: 26px;
    flex: 1;
}

/* ========================= Cards ========================= */
.card-s {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-s__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.card-s__head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.card-s__head .sub { font-size: .78rem; color: var(--text-muted); }
.card-s__body { padding: 20px; }
.card-s__foot { padding: 14px 20px; border-top: 1px solid var(--border); }

/* ========================= Stat tiles ========================= */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat__icon {
    width: 46px; height: 46px;
    border-radius: 13px;
    display: grid; place-items: center;
    margin-bottom: 14px;
}
.stat__icon .icon { width: 24px; height: 24px; }
.stat__label { font-size: .82rem; color: var(--text-muted); font-weight: 500; }
.stat__value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.stat__delta {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .76rem; font-weight: 600; margin-top: 8px;
    padding: 2px 8px; border-radius: 20px;
}
.stat__delta.up { color: var(--success); background: var(--success-soft); }
.stat__delta.down { color: var(--danger); background: var(--danger-soft); }
.stat__delta .icon { width: 14px; height: 14px; }

.tint-brand { background: var(--brand-soft); color: var(--brand); }
.tint-success { background: var(--success-soft); color: var(--success); }
.tint-warning { background: var(--warning-soft); color: var(--warning); }
.tint-info { background: var(--info-soft); color: var(--info); }
.tint-danger { background: var(--danger-soft); color: var(--danger); }

/* ========================= Badges & pills ========================= */
.badge-s {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .74rem; font-weight: 600;
    padding: 3px 10px; border-radius: 20px;
    line-height: 1.4;
}
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info { color: var(--info); background: var(--info-soft); }
.badge-secondary { color: var(--text-muted); background: var(--surface-3); }
.badge-brand { color: var(--brand); background: var(--brand-soft); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ========================= Tables ========================= */
.table-s { width: 100%; border-collapse: collapse; }
.table-s thead th {
    text-align: left;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table-s tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table-s tbody tr:last-child td { border-bottom: 0; }
.table-s tbody tr { transition: background-color .12s; }
.table-s tbody tr:hover { background: var(--surface-2); }
.table-s .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.cell-title { font-weight: 600; }
.cell-sub { font-size: .78rem; color: var(--text-muted); }

/* ========================= Buttons ========================= */
.btn-s {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600; font-size: .88rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, transform .05s;
    background: var(--surface);
    color: var(--text);
}
.btn-s:active { transform: translateY(1px); }
.btn-s .icon { width: 18px; height: 18px; }
.btn-primary-s { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(99,91,255,.32); }
.btn-primary-s:hover { background: var(--brand-600); color: #fff; }
.btn-outline-s { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline-s:hover { background: var(--surface-2); }
.btn-ghost-s { background: transparent; color: var(--text-muted); }
.btn-ghost-s:hover { background: var(--surface-2); color: var(--text); }
.btn-danger-s { background: var(--danger); color: #fff; }
.btn-danger-s:hover { filter: brightness(.94); color: #fff; }
.btn-success-s { background: var(--success); color: #fff; }
.btn-success-s:hover { filter: brightness(.94); color: #fff; }
.btn-block-s { width: 100%; }
.btn-sm-s { height: 34px; padding: 0 12px; font-size: .82rem; }
.btn-icon-s { width: 38px; padding: 0; }

/* ========================= Forms ========================= */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.input-s, .select-s {
    width: 100%;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    padding: 0 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-size: .9rem;
}
textarea.input-s { height: auto; padding: 10px 14px; resize: vertical; }
.input-s:focus, .select-s:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    background: var(--surface);
}
.select-s {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a7387' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.field-error { color: var(--danger); font-size: .78rem; margin-top: 5px; }
.text-danger { color: var(--danger) !important; }
.input-validation-error { border-color: var(--danger) !important; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.filter-bar .field { margin-bottom: 0; }
.filter-bar .grow { flex: 1; min-width: 180px; }

/* ========================= Product cards ========================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.product-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--surface-3);
    display: grid; place-items: center;
    overflow: hidden;
}
.product-card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.product-card__ph {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    font-size: 2.4rem; font-weight: 800; color: #fff;
}
.product-card__badge {
    position: absolute; top: 10px; left: 10px;
}
.product-card__body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card__cat { font-size: .72rem; color: var(--brand); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.product-card__name { font-weight: 600; line-height: 1.3; }
.product-card__meta { font-size: .76rem; color: var(--text-muted); display: flex; justify-content: space-between; }
.product-card__foot {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 10px;
}
.product-card__price { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.product-card__price span { font-size: .72rem; font-weight: 500; color: var(--text-muted); }

/* ========================= POS ========================= */
.pos {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}
.pos__cart {
    position: sticky;
    top: calc(var(--topbar-h) + 20px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--topbar-h) - 40px);
}
.pos__cat {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.chip {
    height: 36px; padding: 0 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 600; font-size: .82rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.pos__products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.pos-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    text-align: left;
    transition: transform .1s, border-color .15s, box-shadow .15s;
    display: flex; flex-direction: column; gap: 8px;
}
.pos-tile:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.pos-tile:active { transform: scale(.98); }
.pos-tile[disabled] { opacity: .5; cursor: not-allowed; }
.pos-tile__thumb {
    width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
    background: var(--surface-3); display: grid; place-items: center;
}
.pos-tile__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pos-tile__thumb .ph { font-size: 1.4rem; font-weight: 800; color: #fff; width:100%; height:100%; display:grid; place-items:center; }
.pos-tile__name { font-size: .82rem; font-weight: 600; line-height: 1.25; }
.pos-tile__price { font-size: .84rem; font-weight: 700; color: var(--brand); }
.pos-tile__stock { font-size: .7rem; color: var(--text-muted); }

.cart__head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.cart__head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.cart__items { flex: 1; overflow-y: auto; padding: 8px 10px; min-height: 120px; }
.cart-line { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 10px; }
.cart-line:hover { background: var(--surface-2); }
.cart-line__name { font-size: .84rem; font-weight: 600; }
.cart-line__price { font-size: .74rem; color: var(--text-muted); }
.cart-line__total { margin-left: auto; font-weight: 700; font-size: .86rem; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.stepper button { width: 28px; height: 28px; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.stepper button:hover { background: var(--surface-3); }
.stepper input { width: 38px; height: 28px; border: 0; text-align: center; background: var(--surface); color: var(--text); font-weight: 600; }
.cart__empty { text-align: center; color: var(--text-muted); padding: 40px 20px; font-size: .88rem; }
.cart__empty .icon { width: 40px; height: 40px; margin-bottom: 10px; opacity: .5; }

.cart__foot { border-top: 1px solid var(--border); padding: 16px 18px; }
.sum-row { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 8px; color: var(--text-muted); }
.sum-row.total { font-size: 1.25rem; font-weight: 800; color: var(--text); margin: 12px 0; }
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.pay-opt { position: relative; }
.pay-opt input { position: absolute; opacity: 0; }
.pay-opt span {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; border-radius: 10px; border: 1px solid var(--border);
    font-weight: 600; font-size: .82rem; cursor: pointer; color: var(--text-muted);
}
.pay-opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* ========================= Segmented / tabs ========================= */
.segment { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 4px; gap: 4px; }
.segment a {
    padding: 7px 16px; border-radius: 9px; font-weight: 600; font-size: .84rem; color: var(--text-muted);
}
.segment a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ========================= Mini bar chart ========================= */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 10px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .bar {
    width: 100%; max-width: 40px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, var(--brand), #9d7bff);
    transition: height .5s cubic-bezier(.4,0,.2,1);
    min-height: 4px;
}
.bars .bar.muted { background: var(--surface-3); }
.bars .bar-label { font-size: .72rem; color: var(--text-muted); }

/* ========================= Page header ========================= */
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.section-title { font-size: 1.05rem; font-weight: 700; margin: 0; }

/* ========================= Empty / misc ========================= */
.muted { color: var(--text-muted); }
.hr-s { height: 1px; background: var(--border); border: 0; margin: 18px 0; }

.flash {
    display: flex; align-items: center; gap: 10px;
    background: var(--success-soft); color: var(--success);
    border: 1px solid rgba(22, 163, 74, .25);
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 20px; font-weight: 600; font-size: .88rem;
}
.flash__x { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; display: grid; place-items: center; }
.flash__x:hover { opacity: 1; }

/* ========================= Pager ========================= */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.pager__info { font-size: .82rem; color: var(--text-muted); }
.pager__list { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pager__btn {
    min-width: 38px; height: 38px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600; font-size: .86rem;
    transition: background-color .15s, border-color .15s, color .15s;
}
.pager__btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.pager__btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager__btn.disabled { opacity: .45; pointer-events: none; }
.pager__ellipsis { padding: 0 4px; color: var(--text-muted); }

/* ========================= Auth (login) ========================= */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg);
}
.auth-aside {
    position: relative;
    background: linear-gradient(150deg, #4b40d6 0%, #635bff 45%, #9d7bff 100%);
    color: #fff;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.auth-aside::after {
    content: "";
    position: absolute; right: -120px; bottom: -120px;
    width: 380px; height: 380px; border-radius: 50%;
    background: rgba(255,255,255,.12);
}
.auth-aside::before {
    content: "";
    position: absolute; left: -80px; top: -80px;
    width: 240px; height: 240px; border-radius: 50%;
    background: rgba(255,255,255,.1);
}
.auth-aside__brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.3rem; position: relative; }
.auth-aside__brand .sidebar__logo { background: rgba(255,255,255,.2); box-shadow: none; }
.auth-aside__pitch { position: relative; max-width: 420px; }
.auth-aside__pitch h2 { font-size: 2rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.auth-aside__pitch p { opacity: .85; margin-top: 12px; font-size: 1rem; }
.auth-aside__stats { display: flex; gap: 30px; position: relative; }
.auth-aside__stats b { font-size: 1.6rem; display: block; }
.auth-aside__stats span { opacity: .8; font-size: .82rem; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; position: relative; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card .lead { color: var(--text-muted); margin-bottom: 28px; }
.auth-theme-toggle { position: absolute; top: 24px; right: 24px; }
.pw-wrap { position: relative; }
.pw-wrap .toggle-pw {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: var(--text-muted); cursor: pointer;
    width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
}
.pw-wrap .toggle-pw:hover { background: var(--surface-2); color: var(--text); }
.check-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.check-inline { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--text-muted); }
.demo-hint {
    margin-top: 22px; padding: 12px 14px; border-radius: 10px;
    background: var(--brand-soft); color: var(--brand);
    font-size: .82rem; display: flex; gap: 8px; align-items: center;
}

/* ========================= Responsive ========================= */
.scrim { display: none; }

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .scrim {
        display: block; position: fixed; inset: 0; z-index: 1035;
        background: rgba(0,0,0,.45);
    }
    .main { margin-left: 0; }
    .pos { grid-template-columns: 1fr; }
    .pos__cart { position: static; max-height: none; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
}

@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr; }
    .topbar__search { display: none; }
    .content { padding: 18px 16px; }
    .topbar { padding: 0 16px; }
}

.sidebar-toggle { display: none; }
@media (max-width: 992px) { .sidebar-toggle { display: grid; } }
