/* ============================================================
   POS · Plantilla PWA — sistema visual
   ============================================================ */

:root {
    --bg: #f5f6fb;
    --bg-2: #eef0f8;
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --surface-3: #eff1f9;
    --text: #111827;
    --text-2: #4b5563;
    --text-3: #8b93a7;
    --border: #e7e9f2;
    --border-strong: #d7dae7;
    --primary: #4f46e5;
    --primary-2: #6366f1;
    --primary-soft: #eef0ff;
    --violet: #8b5cf6;
    --violet-soft: #f4efff;
    --emerald: #10b981;
    --emerald-soft: #e8fbf3;
    --amber: #f59e0b;
    --amber-soft: #fff6e5;
    --danger: #ef4444;
    --danger-soft: #feeeee;
    --slate-soft: #eef1f6;
    --sidebar: #111426;
    --sidebar-2: #171a31;
    --sidebar-text: #c6cade;
    --sidebar-muted: #7d84a3;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 14px 34px -18px rgba(16, 24, 40, .24);
    --shadow-lg: 0 30px 70px -30px rgba(16, 24, 40, .32);
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 24px;
    --sidebar-w: 272px;
    --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
}

[data-theme="dark"] {
    --bg: #0b0d16;
    --bg-2: #0e111d;
    --surface: #121524;
    --surface-2: #171b2c;
    --surface-3: #1d2236;
    --text: #f2f4fb;
    --text-2: #aeb5cb;
    --text-3: #777f9a;
    --border: #242a40;
    --border-strong: #313852;
    --primary: #818cf8;
    --primary-2: #a5b4fc;
    --primary-soft: #1d2142;
    --violet: #c4b5fd;
    --violet-soft: #241f3f;
    --emerald: #34d399;
    --emerald-soft: #102b25;
    --amber: #fbbf24;
    --amber-soft: #322613;
    --danger: #f87171;
    --danger-soft: #341b1d;
    --slate-soft: #1b2032;
    --sidebar: #0d0f1c;
    --sidebar-2: #121526;
    --sidebar-text: #c6cade;
    --sidebar-muted: #7d84a3;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 18px 40px -20px rgba(0, 0, 0, .7);
    --shadow-lg: 0 34px 80px -30px rgba(0, 0, 0, .8);
}

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

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

::selection {
    background: var(--primary);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
    border: 2px solid var(--bg);
}

.icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-2);
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

.icon-btn:active {
    transform: scale(.96);
}

.icon-btn-sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

.icon-btn-sm .icon {
    width: 17px;
    height: 17px;
}

.mono {
    font-family: var(--mono);
    font-size: 12.5px;
}

.muted {
    color: var(--text-3);
}

.align-right {
    text-align: right;
}

.align-center {
    text-align: center;
}

.text-success {
    color: var(--emerald) !important;
}

.text-danger {
    color: var(--danger) !important;
}

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */

.app-shell {
    display: flex;
    min-height: 100dvh;
}

.app-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.page {
    width: 100%;
    max-width: 1640px;
    margin: 0 auto;
    padding: 24px 28px 80px;
    flex: 1;
}

/* ------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------ */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 60;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(120% 45% at 0% 0%, rgba(99, 102, 241, .24), transparent 60%),
        linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    color: var(--sidebar-text);
    border-right: 1px solid rgba(255, 255, 255, .04);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 18px 18px;
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    flex: none;
    display: block;
    filter: drop-shadow(0 8px 16px rgba(79, 70, 229, .35));
}

.brand-mark svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.brand-text strong {
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text small {
    font-size: 11.5px;
    color: var(--sidebar-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-lg .brand-mark {
    width: 50px;
    height: 50px;
}

.brand-lg .brand-text strong {
    font-size: 16px;
}

.sidebar-close {
    display: none;
    color: var(--sidebar-muted);
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    border-color: transparent;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-label {
    padding: 18px 12px 7px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 11px;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 13.5px;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .055);
    color: #fff;
}

.nav-item.is-active {
    background: linear-gradient(120deg, rgba(99, 102, 241, .95), rgba(139, 92, 246, .85));
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(99, 102, 241, .9);
}

.nav-item.is-active::after {
    content: "";
    position: absolute;
    right: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    opacity: .85;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .9;
}

.nav-icon .icon {
    width: 18px;
    height: 18px;
}

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f59e0b;
    color: #241a02;
    font-size: 10.5px;
    font-weight: 800;
}

.sidebar-foot {
    padding: 12px 14px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sync-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .05);
}

.sync-mini .icon-btn {
    color: var(--sidebar-muted);
    margin-left: auto;
}

.sync-mini .icon-btn:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border-color: transparent;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sidebar-muted);
    flex: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .04);
}

.sync-dot.is-ready {
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .14);
}

.sync-dot.is-stale {
    background: #fbbf24;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, .14);
}

.sync-mini-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.sync-mini-text strong {
    font-size: 11.5px;
    color: #e9ebf5;
    font-weight: 600;
}

.sync-mini-text small {
    font-size: 10.5px;
    color: var(--sidebar-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px 4px 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, .9), rgba(139, 92, 246, .8));
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .02em;
    flex: none;
}

.avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 11.5px;
}

.avatar-xs {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 11px;
}

.user-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-meta strong {
    font-size: 12.5px;
    color: #f0f1f8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta small {
    font-size: 10.5px;
    color: var(--sidebar-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card .icon-btn {
    color: var(--sidebar-muted);
}

.user-card .icon-btn:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
    border-color: transparent;
}

.sidebar-backdrop {
    display: none;
}

/* ------------------------------------------------------------
   Topbar
   ------------------------------------------------------------ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 78px;
    padding: 12px 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

@supports (backdrop-filter: blur(16px)) {
    .topbar {
        background: color-mix(in srgb, var(--bg) 86%, transparent);
        backdrop-filter: blur(16px);
    }
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.menu-btn {
    display: none;
}

.page-heading {
    min-width: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-3);
}

.page-heading h1 {
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
}

.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.global-search {
    position: relative;
    width: 100%;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    padding: 0 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.global-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.global-search-icon {
    color: var(--text-3);
    display: flex;
}

.global-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 13px;
}

.global-search input::-webkit-search-cancel-button {
    display: none;
}

.global-search-kbd,
kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 6px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text-3);
    font-family: var(--font);
    font-size: 10.5px;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    background: var(--emerald-soft);
    color: var(--emerald);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.is-offline {
    background: var(--amber-soft);
    color: #b45309;
}

[data-theme="dark"] .status-pill.is-offline {
    color: var(--amber);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.theme-icon {
    display: none;
}

[data-theme="light"] .theme-light {
    display: flex;
}

[data-theme="dark"] .theme-dark {
    display: flex;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-left: 6px;
    margin-left: 2px;
    border-left: 1px solid var(--border);
}

.topbar-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.topbar-user-meta strong {
    font-size: 12.5px;
    white-space: nowrap;
}

.topbar-user-meta small {
    font-size: 10.5px;
    color: var(--text-3);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.install-btn {
    color: var(--primary);
    background: var(--primary-soft);
}

/* ------------------------------------------------------------
   Footer / mobile nav
   ------------------------------------------------------------ */

.app-footer {
    margin-top: auto;
}

.mobile-nav {
    display: none;
}

/* ------------------------------------------------------------
   Cards, buttons, badges
   ------------------------------------------------------------ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
}

.card-head h3 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.card-head p {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-3);
}

.card-body {
    padding: 4px 20px 20px;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.link-arrow .icon {
    width: 15px;
    height: 15px;
}

.link-arrow:hover {
    text-decoration: underline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}

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

.btn:disabled {
    opacity: .5;
    pointer-events: none;
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--violet));
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(79, 70, 229, .9);
}

.btn-primary:hover {
    box-shadow: 0 16px 30px -16px rgba(79, 70, 229, .95);
}

.btn-ghost {
    border-color: var(--border);
    color: var(--text-2);
    background: transparent;
}

.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text);
}

.btn-soft {
    background: var(--primary-soft);
    color: var(--primary);
}

.btn-soft:hover {
    background: color-mix(in srgb, var(--primary-soft) 75%, var(--primary) 8%);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(239, 68, 68, .9);
}

.btn-light {
    background: #fff;
    color: #312e81;
    box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .45);
}

.btn-light:hover {
    background: #f5f5ff;
}

.btn-ghost-light {
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
}

.btn-ghost-light:hover {
    background: rgba(255, 255, 255, .12);
}

.btn-sm {
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 12.5px;
}

.btn-sm .icon {
    width: 16px;
    height: 16px;
}

.btn-lg {
    height: 52px;
    padding: 0 20px;
    border-radius: 14px;
    font-size: 14.5px;
}

.btn-block {
    width: 100%;
}

.btn-spinner .icon {
    animation: spin .8s linear infinite;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 9px;
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
}

.badge-soft {
    background: var(--primary-soft);
    color: var(--primary);
}

.badge-success {
    background: var(--emerald-soft);
    color: var(--emerald);
}

.badge-warning {
    background: var(--amber-soft);
    color: #b45309;
}

[data-theme="dark"] .badge-warning {
    color: var(--amber);
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge-muted {
    background: var(--surface-3);
    color: var(--text-3);
}

.badge-dot .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    transition: all .16s ease;
    white-space: nowrap;
}

.chip:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px -12px rgba(79, 70, 229, .9);
}

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-2);
}

.field-control {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 0 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field-control:focus-within {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-weight: 700;
}

.field-control input,
.field-control textarea,
.field-control select {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 14px;
    padding: 12px 0;
}

.field-control textarea {
    resize: vertical;
    min-height: 56px;
}

.field-action {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px;
}

.form-error {
    padding: 11px 13px;
    border-radius: 11px;
    background: var(--danger-soft);
    border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent);
    color: var(--danger);
    font-size: 12.5px;
    font-weight: 600;
}

.form-hint {
    margin-top: 10px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-3);
}

.select-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 10px 0 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text-3);
    white-space: nowrap;
}

.select-compact .icon {
    width: 16px;
    height: 16px;
}

.select-compact select {
    border: 0;
    outline: none;
    background: transparent;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    padding-right: 4px;
    cursor: pointer;
}

.select-inline {
    height: 36px;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 12.5px;
    font-weight: 600;
}

/* ------------------------------------------------------------
   Tables, lists, empty states, skeletons
   ------------------------------------------------------------ */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table-hover tbody tr {
    transition: background .14s ease;
}

.table-hover tbody tr:hover {
    background: var(--surface-2);
}

.table td strong {
    font-weight: 650;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 54px 24px;
    color: var(--text-3);
}

.empty-state-lg {
    min-height: 52vh;
}

.empty-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--text-3);
    margin-bottom: 6px;
}

.empty-icon .icon {
    width: 24px;
    height: 24px;
}

.empty-state h2,
.empty-state h3 {
    font-size: 16px;
    color: var(--text);
    font-weight: 700;
}

.empty-state p {
    font-size: 12.5px;
    max-width: 340px;
    line-height: 1.55;
}

.empty-state .btn {
    margin-top: 8px;
}

.empty-state-sm {
    padding: 30px 18px;
}

.empty-state-sm .empty-icon {
    width: 44px;
    height: 44px;
}

.empty-state-sm .empty-icon .icon {
    width: 20px;
    height: 20px;
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

.sk-line {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: var(--surface-3);
    margin: 8px 0;
}

.sk-line.sk-sm {
    width: 40%;
    height: 9px;
}

.sk-line.sk-lg {
    width: 70%;
    height: 20px;
}

.sk-circle {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--surface-3);
    flex: none;
}

.sk-stack {
    flex: 1;
}

.sk-row {
    height: 48px;
    margin: 8px 14px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.product-skeleton {
    height: 148px;
    padding: 16px;
}

.customer-skeleton {
    height: 96px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.skeleton-list {
    padding: 4px 0;
}

.progress {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-2), var(--primary));
    transition: width .3s ease;
}

.progress-lg {
    height: 9px;
    margin: 14px 0 4px;
}

/* ------------------------------------------------------------
   Dashboard
   ------------------------------------------------------------ */

.hero-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 28px;
    padding: 30px 32px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(90% 160% at 100% 0%, rgba(255, 255, 255, .16), transparent 60%),
        linear-gradient(115deg, #3730a3 0%, #4f46e5 45%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 30px 60px -32px rgba(79, 70, 229, .8);
    margin-bottom: 18px;
}

.hero-card::before,
.hero-card::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero-card::before {
    width: 280px;
    height: 280px;
    right: -80px;
    top: -120px;
    background: rgba(255, 255, 255, .09);
}

.hero-card::after {
    width: 160px;
    height: 160px;
    right: 180px;
    bottom: -100px;
    background: rgba(255, 255, 255, .06);
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 620px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .78);
}

.hero-eyebrow .icon {
    width: 15px;
    height: 15px;
}

.hero-copy h2 {
    margin-top: 10px;
    font-size: clamp(1.6rem, 2.4vw, 2.15rem);
    line-height: 1.08;
    letter-spacing: -.03em;
    font-weight: 780;
}

.hero-copy p {
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .82);
    max-width: 470px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.cash-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    color: #fff;
    margin-bottom: 18px;
    background: linear-gradient(120deg, #065f46, #10b981);
    box-shadow: 0 26px 54px -30px rgba(16, 185, 129, .65);
}

.cash-hero.is-closed {
    background: linear-gradient(120deg, #1f2937, #374151);
    box-shadow: 0 26px 54px -30px rgba(15, 23, 42, .6);
}

.cash-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    right: -80px;
    top: -130px;
    background: rgba(255, 255, 255, .1);
}

.cash-hero-copy {
    position: relative;
    z-index: 1;
}

.cash-hero-copy h2 {
    margin-top: 8px;
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    letter-spacing: -.03em;
}

.cash-hero-copy p {
    margin-top: 6px;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
}

.cash-hero-side {
    position: relative;
    z-index: 1;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cash-hero-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .65);
}

.cash-hero-side strong {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 780;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.cash-hero-state {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, .8);
    margin-top: 4px;
}

.cash-hero-state .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6ee7b7;
}

.hero-cash {
    position: relative;
    z-index: 1;
    min-width: 210px;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-self: center;
}

.hero-cash-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}

.hero-cash strong {
    font-size: 26px;
    font-weight: 780;
    letter-spacing: -.03em;
    margin-top: 2px;
}

.hero-cash small {
    font-size: 11px;
    color: rgba(255, 255, 255, .72);
}

.hero-cash .btn {
    margin-top: 10px;
    height: 36px;
    font-size: 12px;
}

.cash-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, .85);
}

.cash-state .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6ee7b7;
}

.cash-state.is-closed .dot {
    background: #fbbf24;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: var(--primary-soft);
    color: var(--primary);
}

.kpi-icon .icon {
    width: 19px;
    height: 19px;
}

.kpi-icon.is-indigo {
    background: var(--primary-soft);
    color: var(--primary);
}

.kpi-icon.is-violet {
    background: var(--violet-soft);
    color: var(--violet);
}

.kpi-icon.is-emerald {
    background: var(--emerald-soft);
    color: var(--emerald);
}

.kpi-icon.is-amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.kpi-icon.is-slate {
    background: var(--slate-soft);
    color: var(--text-2);
}

.kpi-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 650;
    color: var(--text-3);
}

.kpi-value {
    font-size: 23px;
    font-weight: 780;
    letter-spacing: -.03em;
    line-height: 1.15;
}

.kpi-sub {
    font-size: 10.5px;
    color: var(--text-3);
}

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

.chart-card {
    min-height: 320px;
}

.chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 210px;
    padding: 0 20px 20px;
}

.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    height: 100%;
    min-width: 0;
}

.chart-value {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-3);
    white-space: nowrap;
}

.chart-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    background: var(--surface-2);
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.chart-bar {
    width: 100%;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, var(--primary-2), var(--primary));
    transition: height .4s ease;
    min-height: 5px;
}

.chart-bar.is-today {
    background: linear-gradient(180deg, #34d399, #059669);
}

.chart-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.rank-list,
.stock-list,
.movement-list {
    padding: 0 20px 18px;
    display: flex;
    flex-direction: column;
}

.rank-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.rank-item:last-child {
    border-bottom: 0;
}

.rank-index {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 800;
    flex: none;
}

.rank-body {
    flex: 1;
    min-width: 0;
}

.rank-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.rank-top strong {
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-top span {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
}

.stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.stock-item:last-child {
    border-bottom: 0;
}

.stock-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stock-body strong {
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-body small {
    font-size: 10.5px;
    color: var(--text-3);
}

/* ------------------------------------------------------------
   List pages: toolbars, grids
   ------------------------------------------------------------ */

.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filters {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    min-width: 250px;
    flex: 1;
    max-width: 430px;
    padding: 0 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.filter-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.filter-search > span {
    color: var(--text-3);
    display: flex;
}

.filter-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
}

.filter-search input::-webkit-search-cancel-button {
    display: none;
}

.toolbar-side {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.offline-ready {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 11px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-3);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.offline-ready.is-ready {
    color: var(--emerald);
    background: var(--emerald-soft);
    border-color: transparent;
}

.offline-ready.is-stale {
    color: #b45309;
    background: var(--amber-soft);
    border-color: transparent;
}

.offline-ready .icon {
    width: 16px;
    height: 16px;
}

.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 2px 12px;
}

.list-head strong {
    font-size: 13px;
    font-weight: 650;
}

.list-head .muted {
    margin-left: 8px;
    font-size: 11.5px;
}

.list-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-state {
    font-size: 11px;
    color: var(--text-3);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    min-width: 0;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    box-shadow: var(--shadow);
}

.product-card:active {
    transform: translateY(0);
}

.product-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.product-thumb {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex: none;
    color: var(--primary);
    background: var(--primary-soft);
    text-transform: uppercase;
}

.product-thumb.is-violet {
    color: var(--violet);
    background: var(--violet-soft);
}

.product-thumb.is-emerald {
    color: var(--emerald);
    background: var(--emerald-soft);
}

.product-thumb.is-amber {
    color: var(--amber);
    background: var(--amber-soft);
}

.product-thumb .icon {
    width: 19px;
    height: 19px;
}

.product-badges {
    margin-left: auto;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.product-badge {
    height: 19px;
    padding: 0 6px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    background: var(--surface-3);
    color: var(--text-3);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .02em;
}

.product-badge.is-tax {
    background: var(--violet-soft);
    color: var(--violet);
}

.product-badge.is-low {
    background: var(--amber-soft);
    color: #b45309;
}

.product-badge.is-out {
    background: var(--danger-soft);
    color: var(--danger);
}

.product-name {
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    color: var(--text-3);
    min-height: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-3);
    flex: none;
}

.product-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 2px;
}

.product-price {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.product-price strong {
    font-size: 16px;
    font-weight: 780;
    letter-spacing: -.02em;
}

.product-price small {
    font-size: 9.5px;
    color: var(--text-3);
}

.product-add {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    flex: none;
    transition: transform .15s ease, background .15s ease;
}

.product-add:hover {
    background: var(--violet);
    transform: scale(1.04);
}

.product-add .icon {
    width: 17px;
    height: 17px;
}

.product-stock {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-3);
}

.product-stock.is-low {
    color: var(--amber);
}

.product-stock.is-out {
    color: var(--danger);
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 22px 0 6px;
}

.catalog-grid .product-card {
    cursor: default;
}

/* Customers */

.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.customer-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.customer-card:hover {
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.customer-top {
    display: flex;
    align-items: center;
    gap: 11px;
}

.customer-top .avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.customer-info {
    min-width: 0;
    flex: 1;
}

.customer-info strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-info small {
    display: block;
    font-size: 10.5px;
    color: var(--text-3);
    margin-top: 1px;
}

.customer-contact {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11.5px;
    color: var(--text-2);
}

.customer-contact span {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.customer-contact .icon {
    width: 14px;
    height: 14px;
    color: var(--text-3);
    flex: none;
}

.customer-contact span > * {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-credit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 11px;
}

.customer-credit strong {
    font-size: 12px;
}

.customer-actions {
    display: flex;
    gap: 7px;
    margin-top: auto;
}

.customer-actions .btn {
    flex: 1;
}

/* ------------------------------------------------------------
   POS terminal
   ------------------------------------------------------------ */

.pos-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px;
    margin-bottom: 14px;
}

.pos-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 13px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
    min-width: 0;
}

.pos-search:focus-within {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.pos-search-icon {
    color: var(--text-3);
    display: flex;
}

.pos-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14.5px;
}

.pos-search input::-webkit-search-cancel-button {
    display: none;
}

.pos-toolbar-right {
    display: flex;
    align-items: center;
    gap: 9px;
}

.customer-pick {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 50px;
    padding: 0 12px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    max-width: 260px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.customer-pick:hover {
    border-color: var(--border-strong);
}

.customer-pick-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    flex: none;
}

.customer-pick-icon .icon {
    width: 16px;
    height: 16px;
}

.customer-pick-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.25;
}

.customer-pick-text small {
    font-size: 9.5px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
}

.customer-pick-text strong {
    font-size: 12px;
    font-weight: 650;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-pick > .icon {
    color: var(--text-3);
    width: 15px;
    height: 15px;
    flex: none;
}

.offline-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 15px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: var(--amber-soft);
    border: 1px solid color-mix(in srgb, var(--amber) 22%, transparent);
    color: #92400e;
    font-size: 12px;
}

[data-theme="dark"] .offline-note {
    color: var(--amber);
}

.offline-note .icon {
    width: 18px;
    height: 18px;
    flex: none;
    margin-top: 1px;
}

.offline-note div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.offline-note strong {
    font-weight: 700;
}

.pos-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 384px;
    gap: 16px;
    align-items: start;
}

.pos-catalog {
    min-width: 0;
}

.pos-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 2px 11px;
    min-height: 32px;
}

.pos-meta-text {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-size: 12px;
    color: var(--text-3);
}

.pos-meta-text strong {
    font-size: 12.5px;
    color: var(--text);
    font-weight: 650;
}

.pos-quick {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.pos-quick .chip {
    height: 30px;
    font-size: 11.5px;
}

.pos-cart {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    padding: 17px;
    max-height: calc(100dvh - 112px);
    min-height: 420px;
}

.cart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.cart-head h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -.02em;
    margin-top: 1px;
}

.count-pill {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10.5px;
    font-weight: 800;
}

.cart-head-actions {
    display: flex;
    gap: 2px;
}

.cart-close {
    display: none;
}

.cart-customer {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    margin: 12px 0 4px;
    padding: 9px 10px;
    border-radius: 11px;
    border: 1px dashed var(--border-strong);
    background: var(--surface-2);
    text-align: left;
    transition: border-color .16s ease, background .16s ease;
}

.cart-customer:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.cart-customer .avatar {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
}

.cart-customer .avatar .icon {
    width: 16px;
    height: 16px;
}

.cart-customer-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.cart-customer-meta small {
    font-size: 9.5px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
}

.cart-customer-meta strong {
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-customer > .icon {
    width: 15px;
    height: 15px;
    color: var(--text-3);
    flex: none;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    min-height: 60px;
    margin: 0 -4px;
    padding: 0 4px;
}

.cart-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.cart-item:last-child {
    border-bottom: 0;
}

.cart-item-thumb {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    flex: none;
}

.cart-item-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cart-item-name {
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--text-3);
}

.qty-control {
    display: inline-flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    height: 24px;
}

.qty-control button {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.qty-control button:hover {
    background: var(--surface-3);
    color: var(--text);
}

.qty-control button .icon {
    width: 12px;
    height: 12px;
}

.qty-control span {
    min-width: 24px;
    text-align: center;
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cart-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.cart-item-total {
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.cart-item-remove {
    border: 0;
    background: transparent;
    color: var(--text-3);
    padding: 0;
    display: flex;
}

.cart-item-remove:hover {
    color: var(--danger);
}

.cart-item-remove .icon {
    width: 13px;
    height: 13px;
}

.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 30px 10px;
    text-align: center;
    color: var(--text-3);
    font-size: 11.5px;
}

.cart-empty .empty-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 2px;
}

.cart-empty .empty-icon .icon {
    width: 20px;
    height: 20px;
}

.cart-totals {
    border-top: 1px solid var(--border);
    padding-top: 11px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.totals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 11.5px;
    color: var(--text-2);
}

.totals-row strong {
    font-size: 12px;
    font-weight: 650;
}

.totals-discount label {
    color: var(--text-2);
}

.discount-input {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 8px;
    color: var(--text-3);
    font-size: 11px;
}

.discount-input input {
    width: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    text-align: right;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text);
    -moz-appearance: textfield;
}

.discount-input input::-webkit-outer-spin-button,
.discount-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.totals-tax {
    font-size: 10.5px;
    color: var(--text-3);
}

.totals-total {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-strong);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.totals-total strong {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.pay-btn {
    margin-top: 12px;
    justify-content: space-between;
    padding: 0 18px;
}

.pay-btn > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pay-btn strong {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.cart-hint {
    margin-top: 8px;
    text-align: center;
    font-size: 9.5px;
    color: var(--text-3);
}

.cart-hint kbd {
    height: 17px;
    min-width: 17px;
    font-size: 9px;
    border-radius: 4px;
}

.cart-fab {
    display: none;
}

/* Modals */

.modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 11, 20, .58);
    backdrop-filter: blur(5px);
    animation: fadeIn .18s ease;
}

.modal-panel {
    position: relative;
    width: 100%;
    max-width: 620px;
    max-height: min(88dvh, 860px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalIn .22s cubic-bezier(.2, .8, .3, 1);
}

.modal-panel-sm {
    max-width: 440px;
}

.modal-panel-md {
    max-width: 560px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -.02em;
    margin-top: 1px;
}

.modal-search {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 20px 4px;
    padding: 0 12px;
    height: 44px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.modal-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.modal-search span {
    color: var(--text-3);
    display: flex;
}

.modal-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
}

.modal-body {
    padding: 18px 22px;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 22px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.customer-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 8px;
    min-height: 220px;
    max-height: 52dvh;
}

.customer-option {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 11px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    transition: background .14s ease, border-color .14s ease;
}

.customer-option:hover {
    background: var(--surface-2);
    border-color: var(--border);
}

.customer-option .avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.customer-option-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.customer-option-body strong {
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-option-body small {
    font-size: 10.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-option .badge {
    flex: none;
}

.pay-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 16px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary-soft), var(--violet-soft));
    margin-bottom: 16px;
}

.pay-total span {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-3);
}

.pay-total strong {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -.04em;
    color: var(--primary);
}

.pay-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.pay-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 650;
    transition: all .15s ease;
}

.pay-method .icon {
    width: 19px;
    height: 19px;
}

.pay-method:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.pay-method.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.pay-cash {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.pay-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pay-quick button {
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 650;
    color: var(--text-2);
}

.pay-quick button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pay-change {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--emerald-soft);
    color: var(--emerald);
    font-size: 12px;
    font-weight: 650;
}

.pay-change strong {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.pay-change.is-negative {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Receipt inside modal */

.receipt-card {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    padding: 18px;
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.55;
}

.receipt-success {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 13px;
    background: var(--emerald-soft);
    color: var(--emerald);
    margin-bottom: 14px;
}

.receipt-success .icon {
    width: 26px;
    height: 26px;
    flex: none;
}

.receipt-success strong {
    display: block;
    font-size: 13.5px;
    font-weight: 750;
}

.receipt-success small {
    display: block;
    font-size: 11px;
    opacity: .85;
}

.receipt-head {
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-strong);
}

.receipt-head strong {
    display: block;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 750;
}

.receipt-head small {
    display: block;
    font-size: 10.5px;
    color: var(--text-3);
}

.receipt-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border-strong);
    font-size: 10.5px;
    color: var(--text-2);
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
}

.receipt-items {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-strong);
}

.receipt-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 4px 0;
}

.receipt-line small {
    display: block;
    color: var(--text-3);
    font-size: 10px;
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    font-size: 16px;
    font-weight: 800;
}

.receipt-foot {
    text-align: center;
    padding-top: 10px;
    color: var(--text-3);
    font-size: 10px;
}

.receipt-legal {
    text-align: center;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border-strong);
    font-size: 9.5px;
    line-height: 1.35;
    letter-spacing: .2px;
}

.receipt-pay {
    padding: 7px 0;
    border-bottom: 1px dashed var(--border-strong);
    font-size: 10.5px;
}

.receipt-info {
    padding: 7px 0;
    border-bottom: 1px dashed var(--border-strong);
    font-size: 10px;
}

.receipt-info-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 1px 0;
}

.receipt-info-row b {
    text-align: right;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 10px;
}

.receipt-table th {
    padding: 5px 0 4px;
    border-bottom: 1px dashed var(--border-strong);
    font-weight: 700;
    text-align: left;
}

.receipt-table td {
    padding: 3px 0;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.receipt-table .r-name {
    width: 44%;
}

.receipt-table .r-num {
    text-align: right;
    white-space: nowrap;
}

.receipt-table .r-mark {
    width: 14px;
    padding-left: 5px;
    text-align: right;
    white-space: nowrap;
}

.receipt-words {
    padding: 7px 0;
    border-top: 1px dashed var(--border-strong);
    font-size: 9.5px;
    line-height: 1.4;
}

.receipt-thanks {
    padding-top: 8px;
    text-align: center;
    font-weight: 700;
    letter-spacing: .3px;
}

.receipt-nofiscal {
    padding-top: 6px;
    text-align: center;
    font-size: 9px;
    line-height: 1.5;
    letter-spacing: .2px;
}

.receipt-barcode {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 8px auto 0;
}

/* ------------------------------------------------------------
   Sales / cash / settings
   ------------------------------------------------------------ */

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

.summary-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
    padding: 17px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-card span {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-3);
}

.summary-card strong {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.summary-card small {
    font-size: 10.5px;
    color: var(--text-3);
}

.date-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 42px;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-3);
    white-space: nowrap;
}

.date-field input {
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.preset-group {
    display: flex;
    gap: 5px;
    overflow-x: auto;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-3);
}

.movement-list {
    padding-bottom: 12px;
}

.movement-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.movement-list li:last-child {
    border-bottom: 0;
}

.movement-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    flex: none;
}

.movement-icon .icon {
    width: 15px;
    height: 15px;
}

.movement-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.movement-body strong {
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movement-body small {
    font-size: 10px;
    color: var(--text-3);
}

.movement-amount {
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.cash-preview {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin: 14px 0;
    border-radius: 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.cash-preview div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cash-preview span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-3);
}

.cash-preview strong {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.cash-forms .card-body {
    padding-top: 16px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.settings-card .card-body {
    padding-top: 14px;
}

.settings-title {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.settings-title h3 {
    font-size: 14.5px;
}

.settings-title p {
    margin-top: 2px;
}

.settings-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 6px;
}

.settings-stats div {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.settings-stats span {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-3);
}

.settings-stats strong {
    font-size: 15px;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.settings-actions .btn {
    flex: 1;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-2);
}

.settings-row:last-of-type {
    border-bottom: 0;
}

.settings-row strong {
    font-size: 12px;
    color: var(--text);
    text-align: right;
}

.segmented {
    display: inline-flex;
    padding: 3px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.segmented button {
    height: 28px;
    padding: 0 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 650;
}

.segmented button.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 12px;
    max-height: 220px;
    overflow-y: auto;
}

.pending-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 11px;
}

.pending-list li.pending-empty {
    justify-content: center;
    color: var(--text-3);
    background: transparent;
    border-style: dashed;
}

.pending-list strong {
    font-size: 11.5px;
}

.pending-list small {
    display: block;
    color: var(--text-3);
    font-size: 9.5px;
}

.account-card {
    margin-bottom: 20px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 0 20px 18px;
}

.account-grid div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.account-grid span {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-3);
}

.account-grid strong {
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-grid small {
    font-size: 10.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 10.5px;
    color: var(--text-3);
}

.account-note .icon {
    width: 15px;
    height: 15px;
    color: var(--primary);
    flex: none;
}

/* ------------------------------------------------------------
   Toasts
   ------------------------------------------------------------ */

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(340px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-size: 12px;
    pointer-events: auto;
    animation: toastIn .22s ease;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.toast.is-success::before {
    background: var(--emerald);
}

.toast.is-error::before {
    background: var(--danger);
}

.toast.is-warning::before {
    background: var(--amber);
}

.toast .icon {
    width: 17px;
    height: 17px;
    flex: none;
    margin-top: 1px;
    color: var(--primary);
}

.toast.is-success .icon {
    color: var(--emerald);
}

.toast.is-error .icon {
    color: var(--danger);
}

.toast.is-warning .icon {
    color: var(--amber);
}

.toast-body {
    min-width: 0;
    flex: 1;
    line-height: 1.45;
}

.toast-body strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.toast-body span {
    color: var(--text-3);
    font-size: 11px;
}

.toast-close {
    border: 0;
    background: transparent;
    color: var(--text-3);
    padding: 0;
    display: flex;
}

.toast-close .icon {
    width: 14px;
    height: 14px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* ------------------------------------------------------------
   Auth
   ------------------------------------------------------------ */

.auth-page {
    background: var(--bg);
}

.auth-theme {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(430px, .95fr);
    min-height: 100dvh;
}

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: #fff;
    background:
        radial-gradient(80% 90% at 15% 10%, rgba(99, 102, 241, .55), transparent 60%),
        radial-gradient(70% 80% at 90% 90%, rgba(168, 85, 247, .35), transparent 65%),
        linear-gradient(155deg, #0d1024 0%, #171a3c 55%, #241c4d 100%);
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .8), transparent 80%);
    opacity: .35;
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.auth-pitch h1 {
    font-size: clamp(2.3rem, 3.9vw, 3.55rem);
    line-height: 1.03;
    letter-spacing: -.045em;
    font-weight: 780;
}

.auth-pitch h1 span {
    background: linear-gradient(95deg, #a5b4fc, #f0abfc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-pitch p {
    margin-top: 16px;
    max-width: 440px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(226, 232, 240, .72);
}

.auth-visual {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin-top: 2px;
}

.preview-card {
    border-radius: 18px;
    padding: 15px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(16px);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .75);
}

.preview-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    font-size: 10.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, .7);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.preview-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .15);
}

.preview-chip {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .1);
    font-size: 9px;
    letter-spacing: .02em;
}

.preview-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    font-size: 11px;
}

.preview-row:last-of-type {
    border-bottom: 0;
}

.preview-avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.preview-avatar .icon {
    width: 15px;
    height: 15px;
}

.preview-avatar.is-pink {
    background: rgba(244, 114, 182, .22);
    color: #f9a8d4;
}

.preview-avatar.is-amber {
    background: rgba(251, 191, 36, .2);
    color: #fcd34d;
}

.preview-avatar.is-emerald {
    background: rgba(52, 211, 153, .2);
    color: #6ee7b7;
}

.preview-row div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.preview-row strong {
    font-size: 10.5px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-row small {
    font-size: 9.5px;
    color: rgba(255, 255, 255, .5);
}

.preview-row > span:last-child {
    font-size: 10.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, .85);
}

.preview-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, .18);
    font-size: 10.5px;
    color: rgba(255, 255, 255, .65);
}

.preview-total strong {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
}

.preview-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 11px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    font-size: 11π5px;
    font-weight: 700;
    box-shadow: 0 12px 24px -12px rgba(99, 102, 241, .8);
}

.preview-pay .icon {
    width: 15px;
    height: 15px;
}

.preview-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 11px;
    background: rgba(17, 20, 38, .85);
    border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .8);
}

.preview-badge .icon {
    width: 17px;
    height: 17px;
    flex: none;
}

.preview-badge div {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.preview-badge strong {
    font-size: 9.5px;
    font-weight: 700;
}

.preview-badge small {
    font-size: 8.5px;
    color: rgba(255, 255, 255, .55);
}

.preview-badge-offline {
    right: -26px;
    top: 62px;
    color: #fcd34d;
}

.preview-badge-sync {
    left: -30px;
    bottom: 54px;
    color: #6ee7b7;
}

.auth-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 11px;
    color: rgba(226, 232, 240, .7);
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-points .icon {
    width: 14px;
    height: 14px;
    color: #6ee7b7;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 34px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

.auth-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.auth-head h2 {
    font-size: 25px;
    font-weight: 780;
    letter-spacing: -.035em;
    margin-top: 4px;
}

.auth-head p {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-3);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form .btn-lg {
    margin-top: 4px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-3);
}

.auth-note .icon {
    width: 15px;
    height: 15px;
    flex: none;
    margin-top: 1px;
    color: var(--primary);
}

.auth-foot {
    margin-top: 22px;
    font-size: 10.5px;
    color: var(--text-3);
    text-align: center;
}

/* ------------------------------------------------------------
   Print
   ------------------------------------------------------------ */

.print-area {
    display: none;
}

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

    .app-shell,
    .toast-stack,
    .modal {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        margin: 0 !important;
    }

    .print-area {
        display: block !important;
        width: 80mm;
        margin: 0 auto;
        padding: 3mm;
        font-family: var(--mono);
        font-size: 9pt;
        line-height: 1.25;
        color: #000;
        background: #fff;
    }

    .print-area .receipt-card {
        border: 0;
        border-radius: 0;
        background: #fff;
        padding: 0;
    }

    .print-area .receipt-head,
    .print-area .receipt-info,
    .print-area .receipt-legal,
    .print-area .receipt-pay,
    .print-area .receipt-words,
    .print-area .receipt-table th {
        border-color: #000;
    }

    .print-area .receipt-head strong {
        font-size: 11pt;
    }

    .print-area .receipt-head small,
    .print-area .receipt-legal,
    .print-area .receipt-info,
    .print-area .receipt-pay,
    .print-area .receipt-line small,
    .print-area .receipt-foot,
    .print-area .receipt-words,
    .print-area .receipt-nofiscal {
        color: #000;
    }

    .print-area .receipt-row,
    .print-area .receipt-line,
    .print-area .receipt-total,
    .print-area .receipt-table tr {
        color: #000;
        break-inside: avoid;
    }

    .print-area .receipt-total {
        font-size: 11pt;
        border-top: 1px solid #000;
        margin-top: 3px;
    }

    .print-area .receipt-barcode {
        margin-top: 3mm;
    }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 1280px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-grid {
        grid-template-columns: minmax(0, 1fr) 350px;
    }

    .topbar-user-meta {
        display: none;
    }
}

@media (max-width: 1120px) {
    .sidebar {
        transform: translateX(-104%);
        transition: transform .24s cubic-bezier(.2, .8, .3, 1);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: inline-flex;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(9, 11, 20, .5);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
    }

    .sidebar-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .app-main {
        margin-left: 0;
    }

    .menu-btn {
        display: inline-flex;
    }

    .topbar-center {
        justify-content: flex-end;
    }
}

@media (max-width: 1024px) {
    .pos-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pos-cart {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        top: auto;
        z-index: 90;
        max-height: 84dvh;
        min-height: 0;
        border-radius: 20px;
        transform: translateY(calc(100% + 24px));
        transition: transform .26s cubic-bezier(.2, .8, .3, 1);
        box-shadow: var(--shadow-lg);
        padding: 16px;
        margin: 0 auto;
        max-width: 520px;
    }

    .pos-cart.is-open {
        transform: translateY(0);
    }

    .cart-close {
        display: inline-flex;
    }

    .cart-fab {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: calc(72px + env(safe-area-inset-bottom));
        z-index: 80;
        display: flex;
        align-items: center;
        gap: 10px;
        height: 54px;
        padding: 0 14px;
        border: 0;
        border-radius: 15px;
        background: linear-gradient(135deg, var(--primary), var(--violet));
        color: #fff;
        box-shadow: 0 18px 34px -16px rgba(79, 70, 229, .8);
        font-weight: 700;
    }

    .cart-fab.is-hidden {
        display: none;
    }

    .cart-fab-icon {
        position: relative;
        display: flex;
    }

    .cart-fab-icon b {
        position: absolute;
        top: -7px;
        right: -9px;
        min-width: 17px;
        height: 17px;
        border-radius: 999px;
        background: #fff;
        color: var(--primary);
        font-size: 9.5px;
        font-weight: 800;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
    }

    .cart-fab-total {
        margin-left: auto;
        font-size: 16px;
        font-weight: 800;
    }

    .cart-fab-label {
        font-size: 10.5px;
        opacity: .8;
        font-weight: 600;
    }

    .page {
        padding-bottom: 120px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .account-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .topbar-center {
        display: none;
    }

    .topbar {
        gap: 12px;
        padding: 10px 18px;
        min-height: 70px;
    }

    .page {
        padding: 18px 18px 120px;
    }

    .page-heading h1 {
        font-size: 18px;
    }

    .hero-card {
        flex-direction: column;
        padding: 24px;
        gap: 18px;
    }

    .hero-cash {
        align-self: stretch;
        min-width: 0;
    }

    .hero-cash strong {
        font-size: 22px;
    }

    .cash-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
        gap: 14px;
    }

    .cash-hero-side {
        text-align: left;
        align-items: flex-start;
    }

    .cash-hero-state {
        justify-content: flex-start;
    }

    .summary-grid,
    .summary-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-grid {
        grid-template-columns: 1fr;
    }

    .settings-stats {
        grid-template-columns: 1fr;
    }

    .settings-row {
        flex-wrap: wrap;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 26px 24px;
        min-height: auto;
    }

    .auth-brand-inner {
        gap: 0;
    }

    .auth-pitch,
    .auth-visual,
    .auth-points {
        display: none;
    }

    .auth-panel {
        padding: 30px 20px 44px;
    }
}

@media (max-width: 760px) {
    .mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 70;
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        border-top: 1px solid var(--border);
        backdrop-filter: blur(14px);
    }

    .mobile-nav-item {
        position: relative;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 4px 2px;
        border-radius: 10px;
        color: var(--text-3);
        font-size: 9.5px;
        font-weight: 650;
        min-width: 0;
    }

    .mobile-nav-item .icon {
        width: 20px;
        height: 20px;
    }

    .mobile-nav-item.is-active {
        color: var(--primary);
    }

    .mobile-nav-item.is-active::before {
        content: "";
        position: absolute;
        top: -7px;
        width: 22px;
        height: 3px;
        border-radius: 0 0 4px 4px;
        background: var(--primary);
    }

    .mobile-badge {
        position: absolute;
        top: 3px;
        right: 24%;
        min-width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--amber);
    }

    .toast-stack {
        bottom: calc(82px + env(safe-area-inset-bottom));
        right: 12px;
    }

    .page {
        padding: 16px 14px 120px;
    }

    .topbar {
        padding: 9px 14px;
        min-height: 64px;
    }

    .topbar-user {
        display: none;
    }

    .status-pill {
        padding: 0 9px;
        height: 30px;
    }

    .status-text {
        display: none;
    }

    .status-pill {
        width: 30px;
        justify-content: center;
    }

    .install-btn {
        display: none;
    }

    .pos-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 9px;
    }

    .pos-toolbar-right {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 8px;
    }

    .customer-pick {
        max-width: none;
    }

    .pos-search {
        height: 46px;
    }

    .pos-meta {
        flex-wrap: wrap;
    }

    .product-grid,
    .skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
        gap: 9px;
    }

    .product-card {
        padding: 11px;
        border-radius: 13px;
        gap: 8px;
    }

    .product-thumb {
        width: 34px;
        height: 34px;
    }

    .product-name {
        font-size: 11.5px;
        min-height: 31px;
    }

    .product-price strong {
        font-size: 14.5px;
    }

    .product-add {
        width: 31px;
        height: 31px;
    }

    .page-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filters {
        width: 100%;
    }

    .filter-search {
        max-width: none;
        min-width: 0;
        flex-basis: 100%;
    }

    .toolbar-side {
        justify-content: space-between;
    }

    .list-head {
        flex-wrap: wrap;
        gap: 6px;
    }

    .summary-card strong {
        font-size: 20px;
    }

    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-panel {
        max-width: none;
        max-height: 92dvh;
        border-radius: 22px 22px 0 0;
        animation: sheetIn .24s cubic-bezier(.2, .8, .3, 1);
    }

    @keyframes sheetIn {
        from {
            transform: translateY(30px);
            opacity: .6;
        }
    }

    .modal-foot {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .modal-foot .btn {
        flex: 1;
    }

    .auth-card {
        padding: 26px 22px;
        border-radius: 20px;
    }

    .auth-head h2 {
        font-size: 22px;
    }

    .auth-theme {
        top: 12px;
        right: 12px;
    }

    .account-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .account-grid div {
        padding-bottom: 9px;
        border-bottom: 1px solid var(--border);
    }

    .account-grid div:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }
}

@media (max-width: 540px) {
    .kpi-grid,
    .summary-grid,
    .summary-grid-4 {
        grid-template-columns: 1fr;
    }

    .chart {
        gap: 7px;
        height: 180px;
        padding: 0 12px 16px;
    }

    .chart-value {
        display: none;
    }

    .cash-hero-side strong {
        font-size: 30px;
    }

    .product-grid,
    .skeleton-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters {
        gap: 7px;
    }

    .select-compact {
        flex: 1;
        min-width: 0;
    }

    .select-compact select {
        width: 100%;
    }

    .date-field {
        flex: 1;
    }

    .date-field input {
        width: 100%;
    }

    .preset-group {
        width: 100%;
    }

    .settings-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        flex: 1;
    }

    .pay-methods {
        gap: 6px;
    }

    .pay-method {
        padding: 10px 4px;
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
    }
}
