:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --bg-soft: #eef4ff;
    --panel: rgba(255, 255, 255, .92);
    --panel-solid: #ffffff;
    --ink: #182233;
    --muted: #667085;
    --line: #dbe4ef;
    --brand: #0f766e;
    --brand-2: #2563eb;
    --accent: #7c3aed;
    --danger: #b42318;
    --warning: #b54708;
    --success: #087443;
    --sidebar: #0f172a;
    --sidebar-soft: #172036;
    --sidebar-ink: #f8fafc;
    --sidebar-muted: #aeb9cc;
    --shadow: 0 18px 44px rgba(15, 23, 42, .08);
    --shadow-soft: 0 10px 26px rgba(15, 23, 42, .07);
    --radius: 8px;
    --sidebar-width: 282px;
    --sidebar-collapsed-width: 88px;
    --content-pad: clamp(14px, 1.8vw, 22px);
    --control-height: 42px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1120;
    --bg-soft: #101828;
    --panel: rgba(17, 24, 39, .88);
    --panel-solid: #111827;
    --ink: #eef2ff;
    --muted: #aeb9cc;
    --line: #273449;
    --brand: #2dd4bf;
    --brand-2: #60a5fa;
    --accent: #a78bfa;
    --danger: #f97066;
    --warning: #fdb022;
    --success: #32d583;
    --sidebar: #080d18;
    --sidebar-soft: #111827;
    --sidebar-ink: #f8fafc;
    --sidebar-muted: #9aa7bd;
    --shadow: 0 18px 44px rgba(0, 0, 0, .28);
    --shadow-soft: 0 10px 26px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .12), transparent 34rem),
        linear-gradient(180deg, var(--bg-soft), var(--bg));
    font-family: "Prompt", Tahoma, "Segoe UI", Arial, sans-serif;
    font-weight: 300;
    line-height: 1.65;
    min-height: 100vh;
    min-width: 320px;
}

a { color: inherit; }

strong, h1, h2, h3, th, label, .btn, button {
    font-weight: 500;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 2.3vw, 34px); letter-spacing: 0; }
h2 { font-size: 19px; letter-spacing: 0; }
h3 { font-size: 16px; letter-spacing: 0; }

img,
svg,
canvas,
video {
    max-width: 100%;
}

.text-gradient,
.page-head h1 {
    background: linear-gradient(90deg, var(--ink), var(--brand-2), var(--brand));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.app-shell {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    transition: grid-template-columns .2s ease;
}

body.sidebar-collapsed .app-shell {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    padding: clamp(12px, 1.2vw, 16px);
    background:
        linear-gradient(180deg, rgba(45, 212, 191, .12), transparent 28%),
        var(--sidebar);
    color: var(--sidebar-ink);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    min-height: 0;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 0 0 auto;
}

.brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    position: relative;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--brand), var(--brand-2));
    color: #fff;
    box-shadow: 0 12px 26px rgba(45, 212, 191, .22);
    font-size: 21px;
}

.brand-mark i {
    position: absolute;
    right: 8px;
    bottom: 7px;
    font-size: 13px;
    opacity: .82;
}

.brand-emoji {
    font-size: 23px;
    line-height: 1;
}

.brand-copy { min-width: 0; }
.brand strong { display: block; font-size: 20px; line-height: 1.1; }
.brand small { color: var(--sidebar-muted); font-size: 12px; }

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .side-nav .nav-label,
body.sidebar-collapsed .side-nav-section-label,
body.sidebar-collapsed .user-copy {
    display: none;
}

.icon-btn {
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: inline-grid;
    place-items: center;
    background: var(--panel-solid);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.sidebar .icon-btn {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.14);
    color: var(--sidebar-ink);
    box-shadow: none;
}

.side-nav {
    display: grid;
    align-content: start;
    gap: 8px;
    margin-top: 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.34) transparent;
}

.side-nav::-webkit-scrollbar {
    width: 6px;
}

.side-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255,255,255,.3);
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-nav-section {
    display: grid;
    gap: 6px;
}

.side-nav-section + .side-nav-section {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.side-nav-section-label {
    padding: 0 12px 2px;
    color: var(--sidebar-muted);
    opacity: .72;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
}

.side-nav a {
    position: relative;
    min-height: 46px;
    padding: 11px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    min-width: 0;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-icon-stack {
    width: 22px;
    height: 24px;
    position: relative;
    flex: 0 0 22px;
    display: grid;
    place-items: center;
}

.nav-icon-stack i {
    position: absolute;
    right: -3px;
    bottom: -2px;
    text-align: center;
    font-size: 11px;
    opacity: .82;
}

.nav-emoji {
    font-size: 18px;
    line-height: 1;
}

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-nav a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    transform: translateX(2px);
}

.side-nav a.active {
    background: linear-gradient(90deg, rgba(45, 212, 191, .22), rgba(96, 165, 250, .16));
    color: #fff;
}

.side-nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: var(--brand);
}

body.sidebar-collapsed .side-nav a {
    justify-content: center;
    padding: 11px;
}

body.sidebar-collapsed .side-nav-section {
    gap: 8px;
}

body.sidebar-collapsed .side-nav-section + .side-nav-section {
    margin-top: 6px;
    padding-top: 8px;
}

body.sidebar-collapsed .sidebar-head {
    justify-content: center;
    display: grid;
    gap: 10px;
}

body.sidebar-collapsed .sidebar-toggle {
    display: inline-grid;
    width: 46px;
}

.side-card {
    margin-top: auto;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius);
    background: rgba(255,255,255,.06);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: rgba(45, 212, 191, .16);
    color: #fff;
}

.user-copy {
    display: grid;
    min-width: 0;
}

.user-copy strong,
.user-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy span {
    color: var(--sidebar-muted);
    font-size: 12px;
}

.logout-link {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    color: var(--sidebar-muted);
    text-decoration: none;
}

.logout-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

body.sidebar-collapsed .side-card {
    grid-template-columns: 1fr;
    justify-items: center;
}

.main {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
    padding: var(--content-pad);
    display: grid;
    align-content: start;
    gap: clamp(14px, 1.4vw, 18px);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 86%, transparent);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-soft);
    min-width: 0;
}

.menu-toggle {
    min-height: var(--control-height);
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--panel-solid);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
    white-space: nowrap;
}

.menu-toggle i {
    font-size: 18px;
}

.menu-toggle span {
    font-size: 14px;
    font-weight: 500;
}

.topbar-title {
    min-width: 0;
    display: grid;
    line-height: 1.3;
    flex: 1 1 auto;
}

.topbar-route-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    position: relative;
    background: color-mix(in srgb, var(--brand-2) 12%, var(--panel-solid));
    border: 1px solid color-mix(in srgb, var(--brand-2) 18%, var(--line));
    box-shadow: var(--shadow-soft);
}

.topbar-route-icon span {
    font-size: 22px;
    line-height: 1;
}

.topbar-route-icon i {
    position: absolute;
    right: 7px;
    bottom: 6px;
    font-size: 11px;
    color: var(--brand-2);
}

.topbar-title span {
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-title strong {
    font-size: 17px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 0 0 auto;
}

.alert-chip {
    min-height: 42px;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--line));
    background: color-mix(in srgb, var(--warning) 12%, var(--panel-solid));
    color: var(--warning);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.alert-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 999px;
    background: var(--warning);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--warning) 45%, transparent);
    animation: alertPulse 1.4s ease-in-out infinite;
}

.alert-dot.info {
    background: var(--brand-2);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-2) 45%, transparent);
}

.mobile-menu { display: none; }
.desktop-menu-toggle { display: inline-flex; }

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    min-width: 0;
}

.page-head h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    line-height: 1.2;
}

.page-head h1::before {
    content: var(--page-emoji, "✨");
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: var(--radius);
    display: inline-grid;
    place-items: center;
    background: color-mix(in srgb, var(--brand) 12%, var(--panel-solid));
    border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
    box-shadow: var(--shadow-soft);
    color: var(--ink);
    -webkit-text-fill-color: var(--ink);
    font-size: 22px;
}

.page-head p,
.muted-text {
    color: var(--muted);
    max-width: 78ch;
}

.compact-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 5%, transparent);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.compact-hint i {
    color: var(--brand-2);
}

.compact-hint.warning {
    border-color: color-mix(in srgb, var(--warning) 30%, var(--line));
    background: color-mix(in srgb, var(--warning) 9%, transparent);
    color: var(--warning);
}

.compact-hint.warning i {
    color: var(--warning);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.metric,
.panel,
.permission-card,
.receipt {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.metric {
    position: relative;
    overflow: hidden;
    padding: 18px;
    display: grid;
    gap: 6px;
}

.metric > i {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    color: var(--brand-2);
    background: color-mix(in srgb, var(--brand-2) 12%, transparent);
    font-size: 18px;
}

.metric::after {
    content: "";
    position: absolute;
    right: -22px;
    top: -22px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(37,99,235,.16), rgba(45,212,191,.12));
}

.metric span {
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    font-size: 32px;
    line-height: 1.1;
}

.sales-metric-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
}

.sales-metric-grid .metric {
    min-height: 128px;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas:
        "icon label"
        "icon value"
        "icon note";
    align-content: center;
    column-gap: 12px;
    padding: 16px;
}

.sales-metric-grid .metric > i {
    grid-area: icon;
    align-self: start;
}

.sales-metric-grid .metric span {
    grid-area: label;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sales-metric-grid .metric strong {
    grid-area: value;
    min-width: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sales-metric-grid .metric small {
    grid-area: note;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sales-report-combined {
    display: grid;
}

.installment-metric-grid {
    grid-template-columns: repeat(4, minmax(200px, 1fr));
}

.installment-follow-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.installment-follow-item {
    width: 100%;
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-solid);
    color: var(--ink);
    text-align: left;
}

.installment-follow-item:hover {
    border-color: color-mix(in srgb, var(--brand-2) 34%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 6%, var(--panel-solid));
}

.installment-follow-item span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.installment-follow-item strong,
.installment-follow-item small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.installment-follow-item small {
    color: var(--muted);
}

.installment-follow-item b {
    color: var(--warning);
    white-space: nowrap;
}

.installment-payment-grid {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: color-mix(in srgb, var(--brand-2) 4%, transparent);
}

.installment-payment-card {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) repeat(2, minmax(90px, auto)) minmax(110px, .65fr) minmax(110px, .65fr) minmax(120px, .75fr) auto;
    gap: 9px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-solid);
}

.installment-payment-card div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.installment-payment-card span,
.installment-payment-card small {
    color: var(--muted);
    font-size: 12px;
}

.installment-payment-card input,
.installment-payment-card select {
    min-width: 0;
}

.section-accent {
    --section-accent: var(--brand-2);
    --section-accent-bg: color-mix(in srgb, var(--section-accent) 7%, transparent);
    --section-accent-border: color-mix(in srgb, var(--section-accent) 30%, var(--line));
}

.accent-blue { --section-accent: #2563eb; }
.accent-green { --section-accent: #059669; }
.accent-purple { --section-accent: #7c3aed; }
.accent-amber { --section-accent: #d97706; }
.accent-cyan { --section-accent: #0891b2; }
.accent-rose { --section-accent: #be185d; }
.accent-slate { --section-accent: #475569; }

.section-accent > .panel-head {
    position: relative;
    border-bottom-color: var(--section-accent-border);
    background: linear-gradient(90deg, var(--section-accent-bg), color-mix(in srgb, var(--panel-solid) 72%, transparent));
}

.section-accent > .panel-head::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: var(--section-accent);
}

.section-accent > .panel-head h2 > i {
    color: var(--section-accent);
}

.sales-section {
    --sales-accent: var(--brand-2);
    --sales-accent-bg: color-mix(in srgb, var(--sales-accent) 7%, transparent);
    --sales-accent-border: color-mix(in srgb, var(--sales-accent) 30%, var(--line));
}

.sales-section-payment { --sales-accent: #2563eb; }
.sales-section-daily { --sales-accent: #059669; }
.sales-section-recent { --sales-accent: #7c3aed; }

.sales-section > .panel-head,
.sales-section .panel-head {
    position: relative;
    border-bottom-color: var(--sales-accent-border);
    background: linear-gradient(90deg, var(--sales-accent-bg), color-mix(in srgb, var(--panel-solid) 72%, transparent));
}

.sales-section > .panel-head::before,
.sales-section .panel-head::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: var(--sales-accent);
}

.sales-section .panel-head h2 > i {
    color: var(--sales-accent);
}

.sales-report-block + .sales-report-block {
    border-top: 1px solid var(--line);
}

.sales-report-combined .panel-head {
    background: linear-gradient(90deg, var(--sales-accent-bg), color-mix(in srgb, var(--panel-solid) 72%, transparent));
}

.sales-trophy-btn {
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 28%, var(--line));
    background: color-mix(in srgb, var(--warning) 10%, transparent);
}

.sales-trophy-btn:hover {
    border-color: color-mix(in srgb, var(--warning) 52%, var(--line));
    background: color-mix(in srgb, var(--warning) 16%, transparent);
}

.sale-detail-row > td {
    padding: 0;
    background: color-mix(in srgb, var(--brand-2) 4%, transparent);
}

.sale-detail-box {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-top: 1px solid var(--line);
}

.sale-detail-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.sale-detail-summary div {
    min-height: 66px;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-solid);
}

.sale-detail-summary span {
    color: var(--muted);
    font-size: 12px;
}

.sale-detail-summary strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-detail-table {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-solid);
}

.top-product-preview {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.top-product-card {
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
    text-align: left;
    box-shadow: none;
}

.top-product-card:hover {
    border-color: color-mix(in srgb, var(--brand-2) 36%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 7%, var(--panel-solid));
}

.top-product-card i {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--warning) 14%, transparent);
    color: var(--warning);
    font-size: 21px;
}

.top-product-card span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.top-product-card strong,
.top-product-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-product-card small {
    color: var(--muted);
    font-size: 12px;
}

.top-product-card b {
    color: var(--ink);
    white-space: nowrap;
}

.sales-products-dialog {
    --sales-accent: #d97706;
    width: min(980px, calc(100vw - 28px));
}

.sales-products-dialog .confirm-dialog-head {
    border-bottom-color: color-mix(in srgb, var(--sales-accent) 34%, var(--line));
    background: linear-gradient(90deg, color-mix(in srgb, var(--sales-accent) 11%, transparent), var(--panel-solid));
}

.sales-products-dialog .page-kicker i,
.sales-products-dialog h2 {
    color: var(--sales-accent);
}

.insight-tabs {
    display: grid;
    gap: 14px;
}

.insight-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 5px;
    border: 1px solid color-mix(in srgb, var(--sales-accent) 18%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--sales-accent) 6%, var(--panel-solid));
}

.insight-tab {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
}

.insight-tab:hover {
    border-color: color-mix(in srgb, var(--sales-accent) 22%, var(--line));
    color: var(--ink);
}

.insight-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--sales-accent), color-mix(in srgb, var(--sales-accent) 68%, var(--brand-2)));
    box-shadow: 0 10px 22px color-mix(in srgb, var(--sales-accent) 22%, transparent);
}

.insight-tab-panel {
    display: none;
}

.insight-tab-panel.active {
    display: grid;
    gap: 12px;
}

.top-products-chart {
    display: grid;
    gap: 10px;
}

.top-products-bar {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.top-products-bar > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 11%, transparent);
    color: var(--brand-2);
    font-weight: 800;
}

.top-products-bar > div {
    position: relative;
    min-height: 58px;
    display: grid;
    align-content: center;
    gap: 3px;
    overflow: hidden;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-solid);
}

.top-products-bar strong,
.top-products-bar small {
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-products-bar small {
    color: var(--muted);
    font-size: 12px;
}

.top-products-bar em {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--bar-width);
    background: linear-gradient(90deg, color-mix(in srgb, var(--brand-2) 18%, transparent), color-mix(in srgb, var(--success) 10%, transparent));
    pointer-events: none;
}

.category-insight-grid {
    display: grid;
    gap: 10px;
}

.category-insight-card {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-solid);
    display: grid;
    gap: 10px;
}

.category-insight-row {
    display: grid;
    grid-template-columns: minmax(150px, .75fr) minmax(180px, 1fr) minmax(120px, auto) minmax(70px, auto);
    gap: 10px;
    align-items: center;
}

.category-insight-meter {
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 12%, transparent);
}

.category-insight-meter i {
    display: block;
    width: var(--bar-width);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--sales-accent), color-mix(in srgb, var(--sales-accent) 45%, var(--success)));
}

.category-insight-row strong {
    text-align: right;
}

.category-insight-row small {
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
}

.category-model-list {
    display: grid;
    gap: 7px;
    padding-top: 10px;
    border-top: 1px dashed color-mix(in srgb, var(--sales-accent) 24%, var(--line));
}

.category-model-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) minmax(70px, auto) minmax(116px, auto);
    gap: 9px;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--sales-accent) 5%, transparent);
}

.category-model-row b {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--sales-accent) 14%, transparent);
    color: var(--sales-accent);
}

.category-model-row span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.category-model-row span strong,
.category-model-row span small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-model-row span small,
.category-model-row em {
    color: var(--muted);
    font-size: 12px;
}

.category-model-row em {
    font-style: normal;
    white-space: nowrap;
}

.category-model-row > strong {
    text-align: right;
    white-space: nowrap;
}

.transfer-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.transfer-summary-card {
    min-height: 172px;
    align-content: start;
}

.transfer-summary-card strong {
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.transfer-summary-card .document-no {
    font-size: clamp(22px, 2.2vw, 30px);
}

.transfer-summary-card small {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.danger-soft {
    background: color-mix(in srgb, #fff7ed 70%, var(--panel-solid));
}

[data-theme="dark"] .danger-soft {
    background: color-mix(in srgb, #451a03 30%, var(--panel-solid));
}

.alert-board {
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--warning) 10%, var(--panel-solid));
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 14px;
}

.alert-board-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-board-head div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.alert-board-head small {
    color: var(--muted);
}

.event-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.event-badge {
    width: fit-content;
    max-width: 100%;
    padding: 3px 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--warning) 14%, var(--panel-solid));
    color: var(--warning);
    border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.event-badge.info {
    background: color-mix(in srgb, var(--brand-2) 12%, var(--panel-solid));
    color: var(--brand-2);
    border-color: color-mix(in srgb, var(--brand-2) 26%, transparent);
}

.event-badge.danger {
    background: color-mix(in srgb, var(--danger) 10%, var(--panel-solid));
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 24%, transparent);
}

.alert-board-head .btn {
    margin-left: auto;
    flex: 0 0 auto;
}

.alert-board-grid,
.alert-list-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.alert-card {
    min-height: 88px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 86%, transparent);
    color: var(--warning);
    text-decoration: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.alert-card.danger,
.alert-list-item.danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
    background: color-mix(in srgb, var(--danger) 7%, var(--panel-solid));
}

.alert-list-item.info {
    color: var(--brand-2);
    border-color: color-mix(in srgb, var(--brand-2) 24%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 6%, var(--panel-solid));
}

.alert-card i {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-size: 20px;
}

.alert-card span {
    color: var(--ink);
}

.alert-card strong {
    font-size: 30px;
    line-height: 1;
}

.alert-list-item strong .event-badge,
.topbar-alert-item strong .event-badge {
    margin-right: 8px;
    vertical-align: middle;
}

.alert-list-item {
    padding: 11px 12px;
    border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
    color: var(--warning);
    text-decoration: none;
    display: grid;
    gap: 2px;
}

.alert-list-item span {
    color: var(--muted);
    font-size: 13px;
}

.blink-soft {
    animation: alertGlow 1.8s ease-in-out infinite;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--brand-2);
    font-size: 13px;
    font-weight: 500;
}

.stock-inspector {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 16px;
}

.product-identity {
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.product-identity-icon,
.guidance-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: 28px;
    color: var(--brand-2);
    background: color-mix(in srgb, var(--brand-2) 12%, transparent);
}

.product-identity h2,
.guidance-copy h2 {
    margin-top: 10px;
    font-size: 24px;
}

.product-identity p,
.guidance-copy p,
.serial-count-summary span {
    color: var(--muted);
}

.stock-mode-panel {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.mode-row {
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 76%, transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mode-row span {
    color: var(--muted);
}

.mode-row strong {
    font-size: 24px;
}

.serial-guidance-panel {
    margin-top: 16px;
    padding: 20px;
    border: 1px solid color-mix(in srgb, var(--success) 24%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--success) 8%, var(--panel-solid));
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.serial-guidance-panel.warning {
    border-color: color-mix(in srgb, var(--warning) 30%, var(--line));
    background: color-mix(in srgb, var(--warning) 9%, var(--panel-solid));
}

.guidance-icon.success {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 14%, transparent);
}

.guidance-icon.warning {
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 14%, transparent);
}

.guidance-icon.info {
    color: var(--brand-2);
    background: color-mix(in srgb, var(--brand-2) 14%, transparent);
}

.guidance-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.serial-table-panel,
.serial-count-summary {
    margin-top: 16px;
}

.serial-count-summary {
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.serial-count-summary > div,
.table-empty {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
}

.serial-count-summary > div {
    padding: 16px;
    display: grid;
    gap: 6px;
}

.table-empty {
    padding: 24px;
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
    color: var(--muted);
}

.table-empty i {
    font-size: 28px;
    color: var(--brand-2);
}

.content-grid {
    display: grid;
    gap: 16px;
}

.content-grid.two {
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
    align-items: start;
}

.panel {
    overflow: hidden;
}

.panel-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.panel-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    line-height: 1.35;
}

.panel-head h2 span,
.panel-head h2 strong {
    min-width: 0;
}

.stock-filter-bar {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    background: color-mix(in srgb, var(--panel-solid) 70%, transparent);
}

.stock-filter-bar label {
    margin: 0;
}

.stock-command-center {
    display: grid;
    gap: 14px;
}

.stock-hero-grid {
    display: grid;
    grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
    gap: 14px;
    align-items: stretch;
}

.stock-health-card,
.stock-kpi,
.stock-ops-card,
.stock-insight-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.compact-icon {
    width: 34px;
    height: 34px;
    min-height: 34px;
    box-shadow: none;
}

.stock-health-card {
    padding: 18px;
    display: grid;
    align-content: center;
    gap: 12px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--brand) 13%, transparent), color-mix(in srgb, var(--brand-2) 8%, transparent)),
        var(--panel);
}

.stock-health-kicker {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
}

.stock-health-card strong {
    font-size: clamp(42px, 7vw, 74px);
    line-height: 1;
}

.stock-health-card small {
    color: var(--muted);
}

.stock-health-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 70%, transparent);
}

.stock-health-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

.stock-health-bar span.warning { background: var(--warning); }
.stock-health-bar span.danger { background: var(--danger); }

.stock-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.stock-kpi {
    min-height: 142px;
    padding: 15px;
    display: grid;
    align-content: space-between;
    gap: 8px;
}

.stock-kpi i {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    color: var(--brand-2);
    background: color-mix(in srgb, var(--brand-2) 10%, transparent);
    font-size: 18px;
}

.stock-kpi.warning i { color: var(--warning); background: color-mix(in srgb, var(--warning) 11%, transparent); }
.stock-kpi.danger i { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.stock-kpi.info i { color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 11%, transparent); }
.stock-kpi.deposit i { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

.stock-kpi span,
.stock-kpi small {
    color: var(--muted);
}

.stock-kpi strong {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1;
}

.stock-ops-grid,
.stock-insight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.stock-ops-card,
.stock-insight-card {
    padding: 16px;
    display: grid;
    gap: 14px;
}

.stock-ops-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    min-width: 0;
}

.stock-ops-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

.stock-ops-head span {
    color: var(--muted);
    font-size: 13px;
    text-align: right;
}

.stock-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.stock-action {
    min-height: 94px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
    display: grid;
    gap: 4px;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.stock-action:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--brand-2) 40%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 7%, var(--panel-solid));
}

.stock-action i {
    color: var(--brand-2);
    font-size: 20px;
}

.stock-action.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent;
    color: #fff;
}

.stock-action.primary i,
.stock-action.primary span {
    color: #fff;
}

.stock-action span {
    color: var(--muted);
    font-size: 12px;
}

.stock-preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.stock-preset-chip {
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 999px;
    box-shadow: none;
    font-size: 13px;
    background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
}

.stock-preset-chip.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.stock-mini-list {
    display: grid;
    gap: 9px;
}

.stock-mini-item {
    width: 100%;
    min-height: 62px;
    padding: 11px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;
    text-align: left;
    box-shadow: none;
    background: color-mix(in srgb, var(--panel-solid) 76%, transparent);
}

.stock-mini-item span {
    display: grid;
    min-width: 0;
}

.stock-mini-item strong,
.stock-mini-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-mini-item small {
    color: var(--muted);
    font-size: 12px;
}

.stock-mini-item b {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    color: var(--warning);
}

.panel-head h2 > i,
.btn > i,
button > i {
    flex: 0 0 auto;
}

.panel > .form-grid,
.panel > .form-stack,
.panel .list,
.table-wrap,
.permission-grid {
    padding: 18px;
}

.empty-state {
    padding: 24px !important;
    text-align: center;
    color: var(--muted);
    background: color-mix(in srgb, var(--panel-solid) 76%, transparent);
}

.narrow { max-width: 640px; }

.btn,
button,
input,
select,
textarea {
    font: inherit;
    border-radius: var(--radius);
}

.btn,
button {
    position: relative;
    min-height: var(--control-height);
    padding: 9px 14px;
    border: 1px solid var(--line);
    background: var(--panel-solid);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.35;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease;
}

.btn:hover,
button:hover {
    border-color: color-mix(in srgb, var(--brand-2) 40%, var(--line));
}

.btn:active,
button:active {
    transform: translateY(1px);
}

.btn:disabled,
button:disabled,
.btn.loading,
button.loading {
    cursor: not-allowed;
    opacity: .68;
    transform: none;
}

.btn.loading::after,
button.loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 999px;
    animation: spin .7s linear infinite;
}

.btn.primary,
button.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}

.btn.danger,
button.danger {
    background: color-mix(in srgb, var(--danger) 14%, var(--panel-solid));
    border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
    color: var(--danger);
}

.btn.warning,
button.warning {
    background: color-mix(in srgb, var(--warning) 13%, var(--panel-solid));
    border-color: color-mix(in srgb, var(--warning) 34%, var(--line));
    color: var(--warning);
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.btn.compact {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
}

.admin-inline-editor {
    min-width: 240px;
}

.admin-inline-editor > summary {
    width: max-content;
    list-style: none;
}

.admin-inline-editor > summary::-webkit-details-marker {
    display: none;
}

.admin-inline-editor[open] > summary {
    margin-bottom: 10px;
}

.employee-edit-row > td {
    padding: 0 10px 14px;
    background: color-mix(in srgb, var(--brand-2) 4%, transparent);
}

.inline-edit-row > td {
    padding: 0 10px 14px;
    background: color-mix(in srgb, var(--brand-2) 4%, transparent);
}

.full-row-edit-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px;
}

.full-row-edit-form .span-2 {
    grid-column: span 2;
}

.full-row-edit-form button {
    align-self: end;
}

.product-edit-box {
    display: grid;
    grid-template-columns: minmax(420px, 1.25fr) minmax(300px, .85fr) minmax(260px, .7fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 90%, transparent);
}

.product-edit-box .compact-form,
.product-edit-box .danger-form {
    margin-top: 0;
    min-width: 0;
}

.product-main-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px;
}

.form-mini-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-mini-head strong {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.employee-edit-box {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 90%, transparent);
}

.employee-edit-box .compact-form,
.employee-edit-box .permission-override-form {
    margin-top: 0;
    min-width: 0;
}

.compact-form,
.danger-form {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
}

.compact-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.horizontal-edit-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 8px;
}

.horizontal-edit-form label {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.horizontal-edit-form .span-2 {
    grid-column: span 3;
}

.horizontal-edit-form button {
    grid-column: span 1;
    align-self: end;
    justify-self: stretch;
}

.danger-form {
    border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
    background: color-mix(in srgb, var(--danger) 6%, var(--panel-solid));
}

.full { width: 100%; }

input,
select,
textarea {
    width: 100%;
    min-height: var(--control-height);
    border: 1px solid var(--line);
    background: var(--panel-solid);
    color: var(--ink);
    padding: 11px 12px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

select {
    appearance: none;
    padding-right: 40px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 19px) 50%,
        calc(100% - 13px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-2);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-2) 16%, transparent);
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-2) 18%, transparent);
    border-color: var(--brand-2);
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 14px;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 7%, transparent);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.inline-check:hover {
    border-color: color-mix(in srgb, var(--brand-2) 34%, var(--line));
}

.inline-check input[type="checkbox"] {
    appearance: none;
    width: 42px;
    height: 24px;
    flex: 0 0 42px;
    border: 1px solid color-mix(in srgb, var(--muted) 34%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 12%, var(--panel-solid));
    padding: 2px;
    display: grid;
    align-items: center;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.inline-check input[type="checkbox"]::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--panel-solid);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
    transition: transform .18s ease;
}

.inline-check input[type="checkbox"]:checked {
    border-color: color-mix(in srgb, var(--success) 52%, var(--line));
    background: var(--success);
}

.inline-check input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

.inline-check input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-2) 18%, transparent);
}

.input-icon {
    position: relative;
    display: block;
}

.input-icon i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.input-icon input {
    padding-left: 42px;
}

.input-icon select {
    padding-left: 42px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.form-stack {
    display: grid;
    gap: 13px;
}

.span-2 { grid-column: span 2; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 5%, var(--panel-solid));
}

.form-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-head > i {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 12%, transparent);
    color: var(--brand-2);
    font-size: 18px;
}

.form-section-head span {
    display: grid;
    min-width: 0;
    line-height: 1.35;
}

.form-section-head small {
    color: var(--muted);
    font-size: 12px;
}

.code-field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.form-actions-bar {
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.form-actions-bar .muted-text {
    font-size: 13px;
}

.notification-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.notification-toggle {
    align-items: flex-start;
    min-height: 78px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 4%, var(--panel-solid));
}

.notification-toggle strong,
.notification-toggle small {
    overflow-wrap: anywhere;
}

.quick-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.receive-flow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.receive-flow-steps article {
    min-height: 116px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    align-content: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 84%, transparent);
}

.receive-flow-steps article.active {
    border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, transparent), color-mix(in srgb, var(--brand-2) 7%, transparent));
}

.receive-flow-steps i,
.receive-flow-steps span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
}

.receive-flow-steps i {
    grid-row: span 2;
    background: color-mix(in srgb, var(--brand-2) 10%, transparent);
    color: var(--brand-2);
    font-size: 18px;
}

.receive-flow-steps span {
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    color: var(--brand);
    font-weight: 800;
}

.receive-flow-steps strong,
.receive-flow-steps small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.receive-flow-steps small {
    color: var(--muted);
    line-height: 1.45;
}

.receive-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--brand-2) 18%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 6%, var(--panel-solid));
}

.receive-section-title > span {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-weight: 800;
}

.receive-section-title div {
    display: grid;
    gap: 2px;
}

.receive-section-title small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.receive-mode-choice .choice-card {
    min-height: 108px;
}

.receive-serial-toggle {
    align-items: flex-start;
    padding: 12px;
    border: 1px dashed color-mix(in srgb, var(--brand-2) 35%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 5%, transparent);
}

.receive-serial-toggle span {
    display: grid;
    gap: 2px;
}

.receive-serial-toggle small {
    color: var(--muted);
    font-size: 12px;
}

.locked-branch-card {
    min-height: var(--control-height);
    display: grid;
    gap: 4px;
    align-content: center;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--success) 30%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--success) 8%, var(--panel-solid));
}

.locked-branch-card span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.locked-branch-card strong,
.locked-branch-card small {
    overflow-wrap: anywhere;
}

.locked-branch-card small {
    color: var(--muted);
    font-size: 12px;
}

.receive-add-btn {
    justify-content: center;
}

.receive-summary-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.receive-summary-bar div {
    min-height: 76px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--success) 7%, var(--panel-solid));
}

.receive-summary-bar span {
    color: var(--muted);
    font-size: 12px;
}

.receive-summary-bar strong {
    font-size: 20px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.choice-card {
    min-height: 94px;
    padding: 14px;
    justify-content: flex-start;
    text-align: left;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
    box-shadow: none;
    cursor: pointer;
}

.choice-card i {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 10%, transparent);
    color: var(--brand-2);
    font-size: 20px;
}

.choice-card span {
    display: grid;
    gap: 2px;
}

.choice-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.choice-card.active {
    border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, transparent), color-mix(in srgb, var(--brand-2) 9%, transparent));
}

.choice-card.active i {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
}

.choice-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand-2) 28%, transparent);
    outline-offset: 2px;
}

.serial-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.serial-summary span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
    color: var(--muted);
    font-size: 13px;
}

.serial-summary .serial-duplicate.warning {
    border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    color: var(--warning);
}

.bulk-list {
    display: grid;
    gap: 8px;
}

.bulk-empty,
.bulk-line {
    min-height: 52px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 76%, transparent);
}

.bulk-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.bulk-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
}

.receive-bulk-line {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.bulk-line span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.bulk-line .icon-btn {
    width: 34px;
    height: 34px;
}

.table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

tbody tr {
    transition: background .16s ease;
}

tbody tr:hover {
    background: color-mix(in srgb, var(--brand-2) 6%, transparent);
}

td small {
    display: block;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge.success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.badge.warning { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.badge.info { background: color-mix(in srgb, var(--brand-2) 16%, transparent); color: var(--brand-2); }

.category-badge {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
}

.category-phone { color: #2563eb; background: rgba(37, 99, 235, .13); border-color: rgba(37, 99, 235, .2); }
.category-used { color: #7c3aed; background: rgba(124, 58, 237, .13); border-color: rgba(124, 58, 237, .2); }
.category-deposit { color: #be185d; background: rgba(190, 24, 93, .12); border-color: rgba(190, 24, 93, .2); }
.category-film { color: #0891b2; background: rgba(8, 145, 178, .13); border-color: rgba(8, 145, 178, .22); }
.category-case { color: #0f766e; background: rgba(15, 118, 110, .13); border-color: rgba(15, 118, 110, .22); }
.category-cable { color: #475569; background: rgba(71, 85, 105, .14); border-color: rgba(71, 85, 105, .22); }
.category-charger { color: #ea580c; background: rgba(234, 88, 12, .13); border-color: rgba(234, 88, 12, .22); }
.category-battery { color: #16a34a; background: rgba(22, 163, 74, .13); border-color: rgba(22, 163, 74, .22); }
.category-part { color: #b45309; background: rgba(180, 83, 9, .13); border-color: rgba(180, 83, 9, .22); }
.category-audio { color: #4f46e5; background: rgba(79, 70, 229, .13); border-color: rgba(79, 70, 229, .22); }
.category-service { color: #0d9488; background: rgba(13, 148, 136, .13); border-color: rgba(13, 148, 136, .22); }
.category-accessory { color: #9333ea; background: rgba(147, 51, 234, .12); border-color: rgba(147, 51, 234, .2); }
.category-other { color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); border-color: color-mix(in srgb, var(--muted) 22%, var(--line)); }

.stock-card-filter {
    align-items: end;
}

.stock-card-metrics .metric strong {
    font-size: 24px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.stock-card-serial-panel .panel-head {
    align-items: center;
}

.stock-card-timeline {
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stock-card-timeline article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
    padding: 14px;
    display: grid;
    gap: 7px;
    min-width: 0;
}

.stock-card-timeline strong,
.stock-card-timeline small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.stock-card-timeline small {
    color: var(--muted);
}

.price-adjust-form {
    border-color: color-mix(in srgb, var(--brand-2) 24%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 5%, var(--panel-solid));
}

.price-adjust-head {
    display: grid;
    gap: 5px;
}

.price-adjust-head small {
    color: var(--muted);
}

.permission-override-form {
    border-color: color-mix(in srgb, var(--brand-2) 24%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 5%, var(--panel-solid));
    padding: 10px;
}

.permission-override-head {
    display: grid;
    gap: 3px;
}

.permission-override-head strong {
    display: flex;
    gap: 8px;
    align-items: center;
}

.permission-override-head small {
    color: var(--muted);
    font-size: 12px;
}

.permission-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.permission-check {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 86%, transparent);
    min-height: 42px;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.permission-check input {
    margin: 0;
}

.permission-check span {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.permission-check strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.25;
}

.permission-check small {
    color: var(--muted);
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.25;
}

.permission-check .badge {
    width: fit-content;
    justify-self: end;
}

.compact-empty {
    padding: 14px;
}

.products-table-wrap {
    padding: 14px 16px;
}

.products-table {
    min-width: 1240px;
    table-layout: fixed;
    font-size: 13px;
}

.products-table th,
.products-table td {
    padding: 11px 9px;
    vertical-align: middle;
}

.products-table th:nth-child(1),
.products-table td:nth-child(1) { width: 10%; }
.products-table th:nth-child(2),
.products-table td:nth-child(2) { width: 14%; }
.products-table th:nth-child(3),
.products-table td:nth-child(3) { width: 21%; }
.products-table th:nth-child(4),
.products-table td:nth-child(4) { width: 7%; }
.products-table th:nth-child(5),
.products-table td:nth-child(5) { width: 9%; }
.products-table th:nth-child(6),
.products-table td:nth-child(6),
.products-table th:nth-child(7),
.products-table td:nth-child(7) { width: 8%; }
.products-table th:nth-child(8),
.products-table td:nth-child(8) { width: 10%; }
.products-table th:nth-child(9),
.products-table td:nth-child(9) { width: 13%; }

.products-table .code-cell code {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.45;
}

.products-table .product-name-cell strong {
    display: block;
    line-height: 1.45;
}

.products-table .money-cell {
    white-space: nowrap;
}

.products-table .badge {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.35;
    white-space: nowrap;
}

.products-table td small {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.35;
}

.product-status-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.product-edit-icon {
    width: 34px;
    height: 34px;
    min-height: 34px;
    flex: 0 0 34px;
    color: var(--brand-2);
}

.products-table .admin-inline-editor {
    min-width: 0;
}

.products-table .admin-inline-editor > summary {
    width: max-content;
    max-width: 100%;
    padding: 8px 10px;
}

.list {
    display: grid;
    gap: 10px;
}

.list-item {
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
    text-decoration: none;
    transition: transform .16s ease, border .16s ease, background .16s ease;
}

.list-item:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--brand-2) 38%, var(--line));
}

.list-item span {
    color: var(--muted);
    font-size: 13px;
}

.compact-help-list {
    gap: 8px;
}

.compact-help-list .list-item {
    min-height: auto;
    padding: 10px 12px;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
}

.compact-help-list .list-item strong {
    font-size: 14px;
}

.compact-help-list .list-item span {
    font-size: 12px;
    line-height: 1.35;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.permission-card {
    padding: 15px;
    display: grid;
    gap: 6px;
}

.permission-card span,
.permission-card p {
    color: var(--muted);
    font-size: 13px;
}

.deposit-due-summary {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand) 9%, var(--panel-solid));
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.deposit-due-summary i {
    flex: 0 0 auto;
    font-size: 18px;
}

.topbar-alert-popover {
    position: absolute;
    right: 54px;
    top: calc(100% + 8px);
    width: min(420px, calc(100vw - 44px));
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-solid);
    box-shadow: var(--shadow);
    display: none;
    z-index: 12;
}

.topbar-actions:hover .topbar-alert-popover,
.topbar-actions:focus-within .topbar-alert-popover,
.topbar-alert-popover.open {
    display: grid;
    gap: 8px;
}

.topbar-alert-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 8px;
}

.topbar-alert-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.topbar-alert-head a {
    color: var(--brand-2);
    font-size: 13px;
    text-decoration: none;
}

.topbar-alert-group-title {
    padding: 8px 10px;
    color: var(--brand-2);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--brand-2) 18%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 7%, var(--panel-solid));
}

.topbar-alert-group-title.info {
    color: var(--brand-2);
}

.topbar-alert-group-title.danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 18%, var(--line));
    background: color-mix(in srgb, var(--danger) 6%, var(--panel-solid));
}

.topbar-alert-item {
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--warning) 20%, var(--line));
    border-radius: var(--radius);
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 7%, var(--panel-solid));
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    text-decoration: none;
}

.topbar-alert-item.danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 22%, var(--line));
    background: color-mix(in srgb, var(--danger) 6%, var(--panel-solid));
}

.topbar-alert-item.info {
    color: var(--brand-2);
    border-color: color-mix(in srgb, var(--brand-2) 22%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 6%, var(--panel-solid));
}

.topbar-alert-item > i {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: color-mix(in srgb, currentColor 12%, transparent);
}

.topbar-alert-item span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.topbar-alert-item strong,
.topbar-alert-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-alert-item small {
    color: var(--muted);
}

.deposit-accessory-picker {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 5%, var(--panel-solid));
}

.deposit-accessory-picker legend {
    padding: 0 6px;
    color: var(--ink);
    font-weight: 500;
}

.deposit-accessory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
}

.accessory-check {
    display: block;
}

.accessory-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.accessory-check span {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel-solid);
    color: var(--ink);
}

.accessory-check i {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--muted) 16%, transparent);
    color: transparent;
}

.accessory-check input:checked + span {
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
    background: color-mix(in srgb, var(--brand) 12%, var(--panel-solid));
    color: var(--brand);
}

.accessory-check input:checked + span i {
    background: var(--brand);
    color: #fff;
}

.accessory-other {
    margin-top: 2px;
}

.audit-context {
    margin-top: 6px;
}

.audit-context summary {
    color: var(--brand-2);
    cursor: pointer;
    font-size: 12px;
}

.audit-context pre {
    max-width: 460px;
    max-height: 180px;
    margin: 8px 0 0;
    padding: 10px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--bg-soft) 70%, var(--panel-solid));
    color: var(--ink);
    font-size: 12px;
    white-space: pre-wrap;
}

.flash {
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
    background: color-mix(in srgb, var(--success) 10%, var(--panel-solid));
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash i {
    font-size: 18px;
}

.flash span {
    line-height: 1;
}

.flash strong {
    min-width: 0;
}

.flash.error {
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
    background: color-mix(in srgb, var(--danger) 10%, var(--panel-solid));
    color: var(--danger);
}

.auth-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .18), rgba(37, 99, 235, .12)),
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, .16), transparent 26rem),
        var(--bg);
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.login-shell {
    width: min(1060px, 100%);
    min-height: 640px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.login-hero {
    position: relative;
    padding: 34px;
    display: grid;
    align-content: space-between;
    gap: 28px;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, .92), rgba(15, 118, 110, .78)),
        linear-gradient(90deg, rgba(37, 99, 235, .72), rgba(124, 58, 237, .26));
}

.login-hero::after {
    content: "";
    position: absolute;
    inset: auto 34px 34px auto;
    width: 220px;
    aspect-ratio: 1;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 26px;
    transform: rotate(10deg);
}

.login-brand {
    position: relative;
    z-index: 1;
    color: #fff;
}

.login-hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    max-width: 620px;
}

.eyebrow {
    color: var(--brand);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.login-hero .eyebrow {
    color: #99f6e4;
}

.login-hero h1 {
    color: #fff;
    font-size: clamp(32px, 4vw, 50px);
    line-height: 1.18;
}

.login-hero p {
    color: rgba(255,255,255,.74);
    max-width: 560px;
}

.login-feature-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.login-feature-grid div {
    min-height: 96px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: var(--radius);
    background: rgba(255,255,255,.08);
    display: grid;
    align-content: space-between;
    gap: 8px;
}

.feature-emoji {
    font-size: 24px;
    line-height: 1;
}

.login-feature-grid i {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    font-size: 13px;
    color: #99f6e4;
    margin-top: -30px;
    margin-left: 22px;
}

.login-panel {
    position: relative;
    padding: 42px;
    display: grid;
    align-content: center;
    gap: 18px;
    background: var(--panel-solid);
}

.login-theme {
    position: absolute;
    top: 18px;
    right: 18px;
}

.login-panel-head {
    display: grid;
    gap: 6px;
}

.login-panel-head h2 {
    font-size: 30px;
}

.login-panel-head p,
.login-note {
    color: var(--muted);
}

.empty-state {
    min-height: 70vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    text-align: center;
}

.empty-state i {
    font-size: 52px;
    color: var(--brand);
}

.toolbar-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.transfer-status-card {
    min-height: 78px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 8%, var(--panel-solid));
    display: grid;
    align-content: center;
    gap: 4px;
}

.transfer-status-card span,
.transfer-status-card small {
    color: var(--muted);
}

.transfer-status-card strong {
    font-size: 30px;
    line-height: 1;
}

.transfer-search-results {
    display: grid;
    gap: 8px;
}

.transfer-result-item {
    width: 100%;
    min-height: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    justify-content: stretch;
    text-align: left;
    padding: 10px 12px;
    box-shadow: none;
    background: color-mix(in srgb, var(--panel-solid) 80%, transparent);
}

.transfer-result-item span:first-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.transfer-result-item small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.id-reader-panel,
.pos-scanner,
.pos-cart-form {
    padding: 18px;
    display: grid;
    gap: 13px;
}

.pos-flow-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.pos-flow-bar article {
    min-height: 72px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
}

.pos-flow-bar article.active {
    border-color: color-mix(in srgb, var(--brand-2) 42%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-2) 12%, transparent), color-mix(in srgb, var(--success) 8%, transparent));
}

.pos-flow-bar i,
.pos-ready-card i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 10%, transparent);
    color: var(--brand-2);
    font-size: 20px;
}

.pos-flow-bar span,
.pos-ready-card span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.pos-flow-bar small,
.pos-ready-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.pos-sell-context {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, .45fr);
    gap: 12px;
    align-items: end;
}

.pos-ready-card {
    min-height: var(--control-height);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--success) 28%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--success) 8%, var(--panel-solid));
}

.pos-ready-card i {
    background: color-mix(in srgb, var(--success) 14%, transparent);
    color: var(--success);
}

.pos-scan-box {
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--brand-2) 30%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 6%, var(--panel-solid));
}

.pos-scan-input input {
    min-height: 58px;
    font-size: 18px;
    font-weight: 700;
}

.pos-status-line {
    min-height: 22px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.pos-search-help {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pos-backup-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--warning) 9%, var(--panel-solid));
}

.pos-backup-panel > div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.pos-backup-panel .badge {
    width: fit-content;
}

.pos-backup-panel strong,
.pos-backup-panel small {
    overflow-wrap: anywhere;
}

.pos-backup-panel small {
    color: var(--muted);
    line-height: 1.45;
}

.pos-search-help span {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 6%, transparent);
    color: var(--muted);
    font-size: 12px;
}

.pos-search-results {
    display: grid;
    gap: 8px;
}

.pos-result-item {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 10px;
    align-items: center;
    justify-content: stretch;
    text-align: left;
    padding: 10px 12px;
    box-shadow: none;
    background: color-mix(in srgb, var(--panel-solid) 80%, transparent);
}

.pos-result-item span:first-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.pos-result-item small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-result-item em {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand) 10%, transparent);
    color: var(--brand);
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
}

.id-reader-panel code {
    color: var(--brand-2);
}

.pos-grid {
    align-items: start;
}

.pos-grid > .panel:last-child {
    position: sticky;
    top: 84px;
}

.panel-subhead {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--brand-2) 4%, var(--panel-solid));
}

.panel-subhead strong {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.panel-subhead small {
    color: var(--muted);
    text-align: right;
}

.pos-product-table td:nth-child(3) {
    font-weight: 700;
}

.pos-cart-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
}

.pos-cart-list {
    display: grid;
    gap: 10px;
}

.pos-cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
}

.pos-cart-line span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.pos-checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.pos-qty {
    display: grid;
    grid-template-columns: 34px 30px 34px;
    align-items: center;
    text-align: center;
}

.pos-qty button {
    min-height: 34px;
    width: 34px;
    padding: 0;
}

.pos-qty button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pos-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    font-size: 20px;
}

.pos-bill-summary {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 80%, transparent);
}

.pos-bill-summary div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.pos-bill-summary span {
    color: var(--muted);
}

.pos-bill-summary strong {
    white-space: nowrap;
}

.pos-bill-summary .total {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 20px;
}

.confirm-payment-field {
    margin-top: 8px;
    display: block;
}

.confirm-payment-field select {
    min-height: 44px;
    font-weight: 800;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.confirm-modal.open {
    display: flex;
}

.confirm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .64);
    backdrop-filter: blur(10px);
}

.confirm-dialog {
    position: relative;
    width: min(860px, calc(100vw - 28px));
    max-height: min(88dvh, 760px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-solid);
    box-shadow: 0 26px 80px rgba(15, 23, 42, .34);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    animation: modalLift .18s ease-out;
}

.branch-dialog {
    width: min(720px, calc(100vw - 28px));
}

.modal-form,
.branch-create-form {
    padding: 18px;
    overflow-y: auto;
}

.employee-dialog {
    width: min(760px, calc(100vw - 28px));
}

.product-dialog {
    width: min(980px, calc(100vw - 28px));
}

.product-create-form {
    max-height: calc(88dvh - 92px);
}

.modal-form .confirm-dialog-actions,
.branch-create-form .confirm-dialog-actions {
    margin: 0 -18px -18px;
}

.confirm-dialog-head,
.confirm-dialog-actions {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.confirm-dialog-head {
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--brand-2) 5%, var(--panel-solid));
}

.confirm-dialog-head h2,
.confirm-dialog-head h3 {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

.confirm-dialog-head h2::before,
.confirm-dialog-head h3::before {
    content: "✨";
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 12%, var(--panel-solid));
    border: 1px solid color-mix(in srgb, var(--brand-2) 20%, var(--line));
    font-size: 17px;
}

.confirm-dialog-body {
    padding: 18px;
    overflow: auto;
    display: grid;
    gap: 14px;
}

.confirm-dialog-actions {
    border-top: 1px solid var(--line);
    justify-content: flex-end;
    background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
    flex-wrap: wrap;
}

.confirm-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.confirm-summary-grid > div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel) 74%, transparent);
    display: grid;
    gap: 5px;
}

.confirm-summary-grid span {
    color: var(--muted);
    font-size: 13px;
}

.confirm-summary-grid strong {
    font-size: 18px;
}

.confirm-table-wrap {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: auto;
}

.forfeit-flow-card {
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--warning) 10%, var(--panel-solid));
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.forfeit-flow-card i {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--warning) 16%, transparent);
    color: var(--warning);
    font-size: 22px;
}

.forfeit-flow-card div {
    display: grid;
    gap: 4px;
}

.forfeit-flow-card span {
    color: var(--muted);
}

@keyframes modalLift {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.label-flow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.label-flow-steps article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 14px;
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 4px 11px;
    align-items: center;
    min-width: 0;
}

.label-flow-steps article > i {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--muted) 10%, transparent);
    color: var(--muted);
    display: grid;
    place-items: center;
    grid-row: span 3;
}

.label-flow-steps article > span {
    width: fit-content;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: color-mix(in srgb, var(--muted) 12%, transparent);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.label-flow-steps strong,
.label-flow-steps small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.label-flow-steps small {
    color: var(--muted);
}

.label-flow-steps article.active {
    border-color: color-mix(in srgb, var(--brand-2) 34%, var(--line));
}

.label-flow-steps article.active > i,
.label-flow-steps article.active > span {
    background: color-mix(in srgb, var(--brand-2) 14%, transparent);
    color: var(--brand-2);
}

.label-flow-steps article.done > i,
.label-flow-steps article.done > span {
    background: color-mix(in srgb, var(--success) 14%, transparent);
    color: var(--success);
}

.label-printer-workbench {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.label-printer-settings {
    position: sticky;
    top: 92px;
}

.inline-option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.label-printer-hint {
    border: 1px solid color-mix(in srgb, var(--brand-2) 24%, transparent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--brand-2) 8%, var(--panel-solid));
    color: var(--muted);
    padding: 12px;
    display: flex;
    gap: 9px;
    align-items: flex-start;
    font-size: 13px;
}

.label-setting-actions {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.label-setting-actions span {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
}

.label-product-list {
    padding: 16px;
    display: grid;
    gap: 10px;
    max-height: 620px;
    overflow: auto;
}

.label-product-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
    padding: 10px;
}

.label-product-row small {
    display: block;
    color: var(--muted);
}

.label-product-row input[type="number"] {
    min-width: 0;
}

.barcode-print-area {
    --label-width: 63mm;
    --label-height: 32mm;
    --label-columns: 3;
    --label-gap: 4mm;
    --label-margin: 8mm;
    background: color-mix(in srgb, var(--muted) 8%, transparent);
    padding: 18px;
    overflow: auto;
}

.barcode-label-grid {
    width: fit-content;
    min-width: min(100%, 210mm);
    padding: var(--label-margin);
    display: grid;
    grid-template-columns: repeat(var(--label-columns), var(--label-width));
    gap: var(--label-gap);
    background: #fff;
    color: #111827;
    box-shadow: var(--shadow);
}

.barcode-print-area[data-paper="roll"] .barcode-label-grid {
    min-width: auto;
    box-shadow: none;
}

.barcode-label {
    width: var(--label-width);
    height: var(--label-height);
    padding: 2mm;
    border: 1px dashed color-mix(in srgb, #111827 22%, transparent);
    border-radius: 2px;
    background: #fff;
    color: #111827;
    display: grid;
    grid-template-rows: auto minmax(10mm, 1fr) auto auto;
    gap: 1mm;
    place-items: center;
    text-align: center;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
}

.barcode-svg {
    width: 100%;
    height: 13mm;
    color: #111827;
}

.label-product {
    font-size: 9px;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.label-code {
    font-family: Consolas, monospace;
    font-size: 9px;
}

.label-price {
    font-size: 10px;
    font-weight: 500;
}

.a4-split-receipt {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    color: #111827;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.receipt-copy {
    min-height: 145mm;
    padding: 14mm;
    display: grid;
    align-content: start;
    gap: 8px;
}

.receipt-copy + .receipt-copy {
    border-top: 1px dashed #6b7280;
}

.receipt-copy-head,
.receipt-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.receipt-copy h1 {
    font-size: 21px;
}

.receipt-copy h2 {
    font-size: 14px;
}

.receipt-copy p,
.receipt-copy li,
.receipt-copy .receipt-terms {
    font-size: 12px;
    line-height: 1.45;
}

.receipt-compact-block,
.receipt-terms.compact {
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
}

.signature-grid.compact {
    margin-top: 18px;
}

.signature-grid.compact span {
    height: 30px;
}

.receipt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.deposit-workbench {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    display: grid;
    gap: 14px;
}

.workflow-alert-stack {
    display: grid;
    gap: 12px;
}

.alert-board-transfer {
    border-color: color-mix(in srgb, var(--brand-2) 34%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 8%, var(--panel-solid));
}

.alert-board-deposit {
    border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
    background: color-mix(in srgb, var(--danger) 6%, var(--panel-solid));
}

.deposit-workbench-summary {
    display: grid;
    gap: 8px;
}

.deposit-workbench-summary h2 {
    font-size: 21px;
}

.deposit-workbench-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.deposit-workbench-meta span,
.deposit-returned-note {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-solid);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.deposit-returned-note {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 28%, var(--line));
    background: color-mix(in srgb, var(--success) 9%, var(--panel-solid));
}

.deposit-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.deposit-action-card {
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--brand-2) 20%, var(--line));
    border-radius: var(--radius);
    background: var(--panel-solid);
    display: grid;
    gap: 12px;
}

.deposit-action-card.danger {
    border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
    background: color-mix(in srgb, var(--danger) 5%, var(--panel-solid));
}

.deposit-action-card.follow {
    border-color: color-mix(in srgb, var(--warning) 24%, var(--line));
    background: color-mix(in srgb, var(--warning) 5%, var(--panel-solid));
}

.deposit-action-card > strong,
.deposit-mini-form > strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.deposit-mini-form,
.deposit-forfeit-form {
    display: grid;
    gap: 12px;
}

.deposit-forfeit-form {
    margin-top: auto;
}

.deposit-action-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.receipt {
    max-width: 900px;
    margin: 0 auto;
    background: var(--panel-solid);
    padding: 28px;
}

.receipt-head,
.receipt-grid,
.signature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.receipt-no {
    justify-self: end;
    text-align: right;
    display: grid;
    align-content: start;
    gap: 6px;
}

.receipt-block,
.receipt-terms {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.signature-grid {
    margin-top: 60px;
}

.signature-grid span {
    display: block;
    border-bottom: 1px solid var(--ink);
    height: 46px;
}

.signature-grid p {
    text-align: center;
    margin-top: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

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

@keyframes alertPulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warning) 42%, transparent); }
    50% { box-shadow: 0 0 0 8px transparent; }
}

@keyframes alertGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .alert-dot,
    .blink-soft {
        animation: none;
    }
}

@media (max-width: 1180px) {
    .app-shell { grid-template-columns: 1fr; }
    body.sidebar-collapsed .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        display: none;
        position: fixed;
        z-index: 20;
        inset: 10px auto 10px 10px;
        width: min(var(--sidebar-width), calc(100vw - 20px));
        border: 1px solid rgba(255,255,255,.12);
        border-radius: var(--radius);
        box-shadow: 0 26px 80px rgba(15, 23, 42, .34);
        transform: none;
        transition: transform .2s ease;
    }
    body.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 19;
        background: rgba(15, 23, 42, .55);
        backdrop-filter: blur(7px);
    }
    body.sidebar-open .sidebar { display: flex; }
    .mobile-menu { display: inline-flex; }
    .desktop-menu-toggle { display: none; }
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .installment-metric-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
    .sales-metric-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
    .sale-detail-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stock-hero-grid { grid-template-columns: 1fr; }
    .stock-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .transfer-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-inspector,
    .serial-guidance-panel,
    .serial-count-summary,
    .confirm-summary-grid,
    .installment-payment-card,
    .pos-flow-bar,
    .pos-sell-context { grid-template-columns: 1fr; }
    .guidance-actions { justify-content: flex-start; }
    .content-grid.two,
    .permission-grid { grid-template-columns: 1fr; }
    .pos-grid > .panel:last-child {
        position: static;
    }
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { min-height: 420px; }
}

@media (max-width: 720px) {
    :root {
        --content-pad: 12px;
    }
    .main { padding: var(--content-pad); }
    .topbar {
        min-height: 58px;
        gap: 8px;
        padding: 8px;
    }
    .menu-toggle {
        padding: 0 10px;
    }
    .menu-toggle span {
        display: none;
    }
    .topbar-route-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }
    .topbar-route-icon span {
        font-size: 20px;
    }
    .topbar-title strong { font-size: 14px; }
    .alert-chip span:last-child { display: none; }
    .topbar-alert-popover {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 72px;
        width: auto;
        max-height: 72vh;
    }
    .topbar-alert-item strong,
    .topbar-alert-item small {
        white-space: normal;
    }
    .page-head,
    .panel-head,
    .alert-board-head { align-items: stretch; flex-direction: column; }
    .page-head h1 {
        font-size: clamp(22px, 7vw, 28px);
    }
    .page-head h1::before {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        font-size: 20px;
    }
    .panel-head {
        padding: 14px;
    }
    .panel > .form-grid,
    .panel > .form-stack,
    .panel .list,
    .table-wrap,
    .permission-grid,
    .stock-filter-bar {
        padding: 14px;
    }
    .alert-board-head .btn {
        margin-left: 0;
        width: 100%;
    }
    .metric-grid,
    .installment-metric-grid,
    .sales-metric-grid,
    .sale-detail-summary,
    .stock-kpi-grid,
    .stock-ops-grid,
    .stock-insight-grid,
    .transfer-summary-grid,
    .label-flow-steps,
    .receive-flow-steps,
    .stock-filter-bar,
    .alert-board-grid,
    .alert-list-grid,
    .stock-card-timeline,
    .label-printer-workbench,
    .inline-option-grid,
    .deposit-action-grid,
    .deposit-action-fields,
    .form-grid,
    .code-field-grid,
    .notification-toggle-grid,
    .quick-choice,
    .receive-summary-bar,
    .receipt-head,
    .receipt-grid,
    .signature-grid,
    .login-feature-grid { grid-template-columns: 1fr; }
    .sales-metric-grid .metric {
        min-height: 112px;
    }
    .sales-metric-grid .metric strong {
        font-size: clamp(22px, 8vw, 30px);
    }
    .insight-tab {
        flex: 1 1 130px;
    }
    .category-insight-row {
        grid-template-columns: 1fr;
    }
    .category-model-row {
        grid-template-columns: 28px minmax(0, 1fr);
    }
    .category-insight-row strong,
    .category-insight-row small,
    .category-model-row > strong {
        text-align: left;
    }
    .category-model-row em,
    .category-model-row > strong {
        grid-column: 2;
    }
    .installment-follow-item {
        grid-template-columns: 1fr;
    }
    .installment-follow-item b {
        justify-self: start;
    }
    .product-identity {
        align-items: flex-start;
        flex-direction: column;
    }
    .label-printer-settings {
        position: static;
    }
    .label-product-row {
        grid-template-columns: 1fr;
    }
    .guidance-actions .btn { width: 100%; }
    .stock-health-card,
    .stock-ops-card,
    .stock-insight-card {
        padding: 14px;
    }
    .stock-kpi {
        min-height: 118px;
    }
    .stock-ops-head {
        align-items: stretch;
        flex-direction: column;
    }
    .stock-ops-head span {
        text-align: left;
    }
    .stock-action-grid {
        grid-template-columns: 1fr;
    }
    .stock-preset-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .stock-preset-chip {
        width: 100%;
    }
    .confirm-modal {
        align-items: flex-end;
        padding: 8px;
    }
    .confirm-dialog {
        width: 100%;
        max-height: 92dvh;
        border-radius: var(--radius) var(--radius) 0 0;
    }
    .confirm-dialog-head,
    .confirm-dialog-actions {
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
    }
    .confirm-dialog-body {
        padding: 14px;
    }
    .confirm-dialog-actions .btn,
    .confirm-dialog-actions button {
        width: 100%;
    }
    .span-2 { grid-column: span 1; }
    .form-actions-bar {
        align-items: stretch;
        flex-direction: column;
    }
    .form-actions-bar button {
        width: 100%;
    }
    .login-wrap { padding: 12px; }
    .login-shell { min-height: auto; }
    .login-hero,
    .login-panel { padding: 24px; }
    .login-hero { min-height: 520px; }
    table {
        min-width: 680px;
        font-size: 13px;
    }
    th, td { padding: 10px 8px; }
    .pos-cart-line,
    .pos-result-item,
    .top-product-card,
    .bulk-line,
    .receive-bulk-line { grid-template-columns: 1fr; }
    .top-product-card b {
        justify-self: start;
    }
    .pos-flow-bar article,
    .pos-ready-card,
    .pos-checkout-grid {
        grid-template-columns: 1fr;
    }
    .pos-scan-input input {
        min-height: 52px;
        font-size: 16px;
    }
    .panel-subhead {
        align-items: flex-start;
        flex-direction: column;
    }
    .panel-subhead small {
        text-align: left;
    }
    .pos-backup-panel {
        grid-template-columns: 1fr;
    }
    .pos-backup-panel .btn {
        width: 100%;
    }
    .employee-edit-box {
        grid-template-columns: 1fr;
    }
    .product-edit-box {
        grid-template-columns: 1fr;
    }
    .full-row-edit-form {
        grid-template-columns: 1fr;
    }
    .full-row-edit-form .span-2 {
        grid-column: span 1;
    }
    .horizontal-edit-form {
        grid-template-columns: 1fr;
    }
    .horizontal-edit-form label {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .horizontal-edit-form .span-2,
    .horizontal-edit-form button {
        grid-column: span 1;
    }
    .permission-check-grid {
        grid-template-columns: 1fr;
    }
    .permission-check {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }
    .permission-check span {
        display: grid;
        gap: 3px;
    }
    .permission-check .badge {
        grid-column: 2;
        justify-self: start;
    }
    .receive-section-title {
        align-items: flex-start;
    }
    .receive-flow-steps article {
        min-height: auto;
    }
    .receipt-copy-head,
    .receipt-mini-grid { grid-template-columns: 1fr; }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body { background: #fff; color: #111827; }
    .sidebar,
    .topbar,
    .receipt-actions,
    .deposit-workbench,
    .flash,
    body[data-route="product_labels"] .page-head,
    body[data-route="product_labels"] .label-flow-steps,
    body[data-route="product_labels"] .label-printer-workbench,
    body[data-route="product_labels"] .label-preview-panel > .panel-head {
        display: none !important;
    }
    .app-shell { display: block; }
    .main { padding: 0; }
    .receipt { box-shadow: none; border: 0; max-width: none; border-radius: 0; }
    .label-control-panel,
    .label-preview-panel,
    .a4-split-receipt {
        box-shadow: none;
        border: 0;
        max-width: none;
    }
    body[data-route="product_labels"] .label-preview-panel {
        margin: 0;
        border-radius: 0;
    }
    body[data-route="product_labels"] .barcode-print-area {
        padding: 0;
        overflow: visible;
        background: #fff;
    }
    body[data-route="product_labels"] .barcode-label-grid {
        display: grid;
        grid-template-columns: repeat(var(--label-columns), var(--label-width));
        gap: var(--label-gap);
        padding: var(--label-margin);
        box-shadow: none;
        min-width: auto;
    }
    body[data-route="product_labels"] .barcode-label {
        width: var(--label-width);
        height: var(--label-height);
        border-color: transparent;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .a4-split-receipt {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        border-radius: 0;
    }
    .receipt-copy {
        min-height: 148.5mm;
        padding: 9mm 10mm;
        break-inside: avoid;
    }
}
