:root {
    --primary: #4338ca;
    --primary-dark: #312e81;
    --primary-soft: #eef2ff;
    --primary-border: #c7d2fe;
    --background: #f7f7fa;
    --surface: #ffffff;
    --surface-alt: #f1f2f6;
    --text: #17171b;
    --muted: #61656f;
    --subtle: #8b909b;
    --border: #dfe1e7;
    --success: #16763a;
    --success-soft: #eaf7ee;
    --warning: #8f5600;
    --warning-soft: #fff6df;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --cash: #08775d;
    --upi: #7254b4;
    --shadow-sm: 0 1px 2px rgba(23, 23, 27, .05);
    --shadow-md: 0 12px 32px rgba(34, 30, 95, .13);
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 22px;
    --nav-height: 76px;
    --content-width: 1160px;
    font-family: Inter, Roboto, "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--background);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--background);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 8% 0%, rgba(67, 56, 202, .08), transparent 32rem),
        var(--background);
}

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

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
}

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

.app-loading {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    color: var(--muted);
}

.brand-mark {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    color: white;
    font-size: 25px;
    font-weight: 800;
    background: linear-gradient(145deg, #6257ea, var(--primary-dark));
    box-shadow: 0 10px 26px rgba(67, 56, 202, .25);
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
}

.login-showcase {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(36px, 6vw, 88px);
    overflow: hidden;
    position: relative;
    color: white;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .2), transparent 18rem),
        linear-gradient(145deg, #2d2877, #4338ca 55%, #6d5de7);
}

.login-showcase::after {
    content: "";
    position: absolute;
    width: 440px;
    height: 440px;
    right: -130px;
    bottom: -170px;
    border-radius: 50%;
    border: 70px solid rgba(255, 255, 255, .08);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 20px;
    font-weight: 750;
    position: relative;
    z-index: 1;
}

.login-brand .brand-mark {
    background: white;
    color: var(--primary);
    box-shadow: none;
}

.login-copy {
    max-width: 680px;
    position: relative;
    z-index: 1;
}

.login-copy h1 {
    margin: 0;
    max-width: 620px;
    font-size: clamp(38px, 5vw, 72px);
    line-height: 1.02;
    letter-spacing: -.045em;
}

.login-copy p {
    max-width: 560px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: clamp(17px, 1.6vw, 21px);
    line-height: 1.55;
}

.login-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.login-feature {
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    color: rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .08);
    font-size: 13px;
    font-weight: 650;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 32px;
    background: var(--surface);
}

.login-card {
    width: min(100%, 420px);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

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

.login-card h2 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -.025em;
}

.login-card > p {
    margin: 12px 0 28px;
    color: var(--muted);
    line-height: 1.55;
}

.demo-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
    padding: 14px;
    border-radius: var(--radius);
    color: #3f3a70;
    background: var(--primary-soft);
    font-size: 13px;
    line-height: 1.5;
}

.form-group {
    display: grid;
    gap: 7px;
    margin-bottom: 16px;
}

.form-group label,
.field-label {
    color: #34353b;
    font-size: 13px;
    font-weight: 700;
}

.field-help {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.text-input,
.select-input,
.textarea-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.textarea-input {
    min-height: 92px;
    resize: vertical;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, .12);
}

.input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
}

.input-prefix:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, .12);
}

.input-prefix span {
    padding-left: 14px;
    color: var(--muted);
    font-weight: 700;
}

.input-prefix .text-input {
    border: 0;
    box-shadow: none;
    padding-left: 8px;
}

.btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-weight: 750;
    line-height: 1.2;
    transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary {
    color: white;
    background: var(--primary);
    box-shadow: 0 7px 18px rgba(67, 56, 202, .2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    color: #a9a6d2;
    background: #e4e3ef;
    box-shadow: none;
}

.btn-secondary {
    color: var(--primary);
    border-color: var(--primary-border);
    background: var(--surface);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-soft);
}

.btn-ghost {
    color: var(--muted);
    background: transparent;
}

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

.btn-danger {
    color: white;
    background: var(--danger);
}

.btn-danger-ghost {
    color: var(--danger);
    border-color: #f4c7c3;
    background: var(--surface);
}

.btn-wide {
    width: 100%;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font-size: 20px;
}

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

.app-shell {
    min-height: 100vh;
}

.desktop-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 248px;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    border-right: 1px solid var(--border);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand strong {
    display: block;
    font-size: 16px;
}

.sidebar-brand small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.side-nav {
    display: grid;
    gap: 6px;
    margin-top: 22px;
}

.nav-btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font-weight: 700;
    text-align: left;
}

.nav-btn:hover {
    color: var(--text);
    background: var(--surface-alt);
}

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

.nav-icon {
    width: 24px;
    text-align: center;
    font-size: 18px;
}

.sidebar-new-bill {
    margin-top: 18px;
}

.sidebar-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 8px 0;
    border-top: 1px solid var(--border);
}

.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 800;
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
    max-width: 142px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user small {
    margin-top: 2px;
    color: var(--muted);
}

.main-area {
    min-height: 100vh;
    margin-left: 248px;
}

.page {
    width: min(100%, var(--content-width));
    margin: 0 auto;
    padding: 34px clamp(24px, 4vw, 52px) 64px;
}

.page-header {
    min-height: 56px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.page-title {
    margin: 0;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
    letter-spacing: -.035em;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

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

.mobile-topbar,
.mobile-bottom-nav,
.mobile-fab {
    display: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
    gap: 20px;
}

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

.card-pad {
    padding: 22px;
}

.hero-card {
    position: relative;
    overflow: hidden;
    min-height: 250px;
    padding: clamp(24px, 4vw, 38px);
    color: white;
    border: 0;
    background:
        radial-gradient(circle at 86% 22%, rgba(255, 255, 255, .18), transparent 12rem),
        linear-gradient(135deg, #312e81, #4338ca 58%, #6d5de7);
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -130px;
    width: 330px;
    height: 330px;
    border: 52px solid rgba(255, 255, 255, .07);
    border-radius: 50%;
}

.hero-card > * {
    position: relative;
    z-index: 1;
}

.hero-label {
    margin: 0;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    font-weight: 700;
}

.hero-total {
    margin: 10px 0 2px;
    font-size: clamp(42px, 7vw, 64px);
    line-height: 1;
    letter-spacing: -.04em;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.hero-meta {
    color: rgba(255, 255, 255, .78);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
}

.hero-card .btn-primary {
    color: var(--primary-dark);
    background: white;
    box-shadow: none;
}

.hero-card .btn-secondary {
    color: white;
    border-color: rgba(255, 255, 255, .32);
    background: rgba(255, 255, 255, .08);
}

.payment-split {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.metric-card {
    padding: 18px;
}

.metric-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 13px;
    background: var(--surface-alt);
    font-size: 20px;
}

.metric-icon.cash {
    color: var(--cash);
    background: #e7f7f2;
}

.metric-icon.upi {
    color: var(--upi);
    background: #f0ebfb;
}

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

.metric-value {
    margin-top: 5px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.section-card {
    margin-top: 20px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head h2,
.section-head h3 {
    margin: 0;
    font-size: 18px;
}

.text-action {
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: var(--primary);
    background: transparent;
    font-weight: 750;
}

.text-action:hover {
    background: var(--primary-soft);
}

.rank-list,
.bill-list,
.report-list {
    display: grid;
}

.rank-row,
.bill-row,
.report-row {
    width: 100%;
    min-height: 66px;
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    text-align: left;
}

.rank-row:last-child,
.bill-row:last-child,
.report-row:last-child {
    border-bottom: 0;
}

.rank-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
}

.rank-number {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 12px;
    font-weight: 800;
}

.row-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 720;
}

.row-subtitle {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-value {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.bill-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 10px;
    border-radius: 10px;
}

.bill-row:hover,
.report-row:hover {
    background: var(--surface-alt);
}

.bill-number {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--success);
    background: var(--success-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
}

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

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

.catalog-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: left;
}

.catalog-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-md);
}

.catalog-icon {
    width: 52px;
    height: 52px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 16px;
    background: var(--primary-soft);
    font-size: 24px;
}

.catalog-card strong {
    display: block;
    font-size: 18px;
}

.catalog-card span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.segmented {
    display: inline-flex;
    gap: 3px;
    padding: 4px;
    border-radius: 12px;
    background: #e9eaf0;
}

.segment-btn {
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
    font-weight: 750;
}

.segment-btn.active {
    color: var(--text);
    background: white;
    box-shadow: var(--shadow-sm);
}

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

.search-box {
    position: relative;
    flex: 1 1 260px;
}

.search-box .text-input {
    padding-left: 42px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--subtle);
    pointer-events: none;
}

.category-list,
.product-list {
    display: grid;
    gap: 9px;
}

.category-admin-row,
.product-admin-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.category-admin-row:hover,
.product-admin-row:hover {
    border-color: var(--primary-border);
}

.item-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface-alt);
    font-size: 20px;
}

.indent-line {
    position: relative;
}

.indent-line::before {
    content: "";
    position: absolute;
    left: calc(var(--depth, 0) * 18px - 9px);
    top: -17px;
    bottom: -17px;
    width: 1px;
    background: var(--border);
}

.inactive-row {
    opacity: .55;
}

.price {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.billing-page {
    min-height: 100vh;
    background: var(--background);
}

.billing-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    min-height: 100vh;
}

.billing-browser {
    min-width: 0;
    padding: 24px clamp(18px, 4vw, 42px) 54px;
}

.billing-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.billing-title {
    min-width: 0;
    flex: 1;
}

.billing-title h1 {
    margin: 0;
    font-size: 25px;
    letter-spacing: -.03em;
}

.billing-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.running-total {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 800;
    white-space: nowrap;
}

.billing-search {
    margin-bottom: 25px;
}

.billing-search .text-input {
    min-height: 54px;
    border-radius: 14px;
    font-size: 16px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -6px 0 20px;
    overflow-x: auto;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    scrollbar-width: none;
}

.breadcrumb button {
    min-height: 36px;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
}

.breadcrumb button:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.sell-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-bottom: 22px;
    padding: 16px 18px;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    color: var(--primary-dark);
    background: linear-gradient(135deg, #eef2ff, #f7f5ff);
    text-align: left;
}

.sell-current strong {
    display: block;
    font-size: 16px;
}

.sell-current span {
    display: block;
    margin-top: 4px;
    color: #625f8b;
    font-size: 13px;
}

.billing-section {
    margin-top: 25px;
}

.billing-section h2 {
    margin: 0 0 12px;
    font-size: 16px;
}

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

.item-tile {
    min-height: 116px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface);
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.item-tile:hover {
    border-color: var(--primary-border);
    box-shadow: 0 8px 22px rgba(36, 32, 92, .08);
    transform: translateY(-1px);
}

.tile-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--tile-bg, var(--surface-alt));
    font-size: 19px;
}

.tile-name {
    display: -webkit-box;
    margin-top: 15px;
    overflow: hidden;
    font-weight: 750;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tile-meta {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
}

.tile-price {
    color: var(--text);
    font-weight: 800;
}

.cart-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    background: var(--surface);
}

.cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 76px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.cart-head h2 {
    margin: 0;
    font-size: 19px;
}

.cart-head small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.cart-lines {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 18px;
}

.cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.cart-line-name {
    font-weight: 750;
}

.cart-line-meta {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.cart-line-actions {
    display: flex;
    gap: 6px;
    margin-top: 7px;
}

.mini-action {
    min-height: 32px;
    padding: 5px 8px;
    border: 0;
    border-radius: 8px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 12px;
    font-weight: 750;
}

.mini-action.remove {
    color: var(--danger);
    background: var(--danger-soft);
}

.cart-line-total {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.cart-empty {
    height: 100%;
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.cart-empty-icon,
.empty-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 20px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 26px;
}

.cart-empty strong,
.empty-state strong {
    color: var(--text);
    font-size: 17px;
}

.cart-empty p,
.empty-state p {
    max-width: 330px;
    margin: 7px auto 0;
    line-height: 1.5;
}

.cart-summary {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border);
    box-shadow: 0 -12px 30px rgba(20, 20, 35, .04);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 14px;
}

.summary-row strong {
    color: var(--text);
}

.summary-row.total {
    align-items: baseline;
    margin: 14px 0 16px;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
}

.summary-row.total strong {
    font-size: 27px;
    letter-spacing: -.025em;
}

.mobile-cart-bar {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(23, 23, 27, .52);
    backdrop-filter: blur(5px);
    animation: fadeIn .15s ease;
}

.modal {
    width: min(100%, 520px);
    max-height: min(90vh, 860px);
    overflow-y: auto;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(14, 12, 48, .24);
    animation: modalIn .18s ease;
}

.modal-lg {
    width: min(100%, 720px);
}

.modal-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
}

.modal-head h2 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -.02em;
}

.modal-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.modal-body {
    padding: 22px;
}

.modal-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
}

.price-display {
    margin: 8px 0 20px;
}

.price-display label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 800;
}

.large-money-input {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 0 16px;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.large-money-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(67, 56, 202, .1);
}

.large-money-input span {
    color: var(--muted);
    font-size: 26px;
    font-weight: 700;
}

.large-money-input input {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
    border: 0;
    outline: none;
    color: var(--text);
    font-size: 32px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.quantity-control {
    display: grid;
    grid-template-columns: 48px minmax(80px, 1fr) 48px;
    gap: 8px;
    align-items: center;
}

.quantity-control button {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--primary);
    background: var(--surface);
    font-size: 23px;
}

.quantity-control input {
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    font-weight: 800;
}

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

.form-grid .span-2 {
    grid-column: 1 / -1;
}

.toggle-row {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
}

.toggle {
    width: 48px;
    height: 28px;
    position: relative;
    flex: 0 0 auto;
}

.toggle input {
    position: absolute;
    opacity: 0;
}

.toggle span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #cfd1d8;
    transition: background .15s;
}

.toggle span::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
    transition: transform .15s;
}

.toggle input:checked + span {
    background: var(--primary);
}

.toggle input:checked + span::after {
    transform: translateX(20px);
}

.payment-options {
    display: grid;
    gap: 11px;
    margin-top: 18px;
}

.payment-option {
    width: 100%;
    min-height: 68px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    background: var(--surface);
    text-align: left;
}

.payment-option.selected {
    border: 2px solid var(--primary);
    padding: 10px 13px;
    background: var(--primary-soft);
}

.payment-option-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface-alt);
    font-size: 20px;
}

.payment-check {
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    border: 2px solid var(--border);
    border-radius: 50%;
    color: white;
    font-size: 12px;
}

.payment-option.selected .payment-check {
    border-color: var(--primary);
    background: var(--primary);
}

.success-view {
    padding: 12px 0 6px;
    text-align: center;
}

.success-icon {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 24px;
    color: var(--success);
    background: var(--success-soft);
    font-size: 34px;
    font-weight: 800;
}

.success-view h2 {
    margin: 0;
    font-size: 26px;
}

.success-total {
    margin: 10px 0 4px;
    font-size: 38px;
    font-weight: 850;
    letter-spacing: -.035em;
}

.success-meta {
    color: var(--muted);
}

.success-actions {
    display: grid;
    gap: 10px;
    margin-top: 26px;
}

.bill-paper {
    max-width: 520px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: #18181b;
    box-shadow: 0 12px 40px rgba(23, 23, 27, .08);
}

.bill-paper-head {
    padding-bottom: 18px;
    border-bottom: 1px dashed #bbb;
    text-align: center;
}

.bill-paper-head h2 {
    margin: 0;
    font-size: 22px;
}

.bill-paper-head p {
    margin: 5px 0 0;
    color: #606068;
    font-size: 13px;
}

.bill-paper-lines {
    padding: 12px 0;
    border-bottom: 1px dashed #bbb;
}

.bill-paper-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 7px 0;
}

.bill-paper-line small {
    display: block;
    margin-top: 3px;
    color: #6b6b73;
}

.bill-paper-totals {
    padding: 14px 0;
}

.bill-footer {
    padding-top: 14px;
    border-top: 1px dashed #bbb;
    text-align: center;
    color: #555;
    font-size: 13px;
}

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

.report-kpi {
    padding: 18px;
}

.report-kpi .metric-value {
    font-size: 22px;
}

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

.progress-row {
    padding: 11px 0;
}

.progress-label {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.progress-label strong {
    font-size: 14px;
}

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

.progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #ebecf1;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--bar-color, var(--primary));
}

.trend-chart {
    min-height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    padding-top: 20px;
}

.trend-column {
    flex: 1;
    min-width: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.trend-bar {
    width: min(100%, 28px);
    min-height: 4px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, #6d5de7, var(--primary));
}

.trend-date {
    color: var(--muted);
    font-size: 10px;
}

.empty-state {
    display: grid;
    justify-items: center;
    min-height: 260px;
    place-content: center;
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .45fr);
    gap: 18px;
}

.settings-nav {
    display: grid;
    gap: 8px;
}

.settings-link {
    width: 100%;
    min-height: 62px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background: var(--surface);
    text-align: left;
}

.settings-link:hover {
    border-color: var(--primary-border);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 200;
    max-width: min(92vw, 440px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 12px;
    color: white;
    background: #24242b;
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
    animation: toastIn .2s ease;
}

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

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

.loading-skeleton {
    position: relative;
    overflow: hidden;
    color: transparent !important;
    background: #ebecf1 !important;
}

.loading-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
    animation: shimmer 1.2s infinite;
}

.error-card {
    padding: 18px;
    border: 1px solid #f4c7c3;
    border-radius: var(--radius);
    color: #7e211a;
    background: var(--danger-soft);
}

.error-card strong {
    display: block;
}

.error-card p {
    margin: 5px 0 12px;
}

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

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

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

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

@media (max-width: 980px) {
    .desktop-sidebar {
        display: none;
    }

    .main-area {
        margin-left: 0;
        padding-top: 64px;
        padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
    }

    .mobile-topbar {
        position: fixed;
        inset: 0 0 auto;
        z-index: 40;
        height: 64px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 16px;
        border-bottom: 1px solid var(--border);
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(16px);
    }

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

    .mobile-brand .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 19px;
    }

    .mobile-brand strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-brand small {
        display: block;
        margin-top: 1px;
        color: var(--muted);
    }

    .mobile-bottom-nav {
        position: fixed;
        inset: auto 0 0;
        z-index: 40;
        height: calc(var(--nav-height) + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        padding: 7px 8px env(safe-area-inset-bottom);
        border-top: 1px solid var(--border);
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(16px);
    }

    .mobile-nav-btn {
        min-width: 0;
        display: grid;
        place-content: center;
        justify-items: center;
        gap: 3px;
        padding: 5px;
        border: 0;
        border-radius: 11px;
        color: var(--muted);
        background: transparent;
        font-size: 11px;
        font-weight: 700;
    }

    .mobile-nav-btn .nav-icon {
        width: auto;
        font-size: 18px;
    }

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

    .mobile-fab {
        position: fixed;
        right: 18px;
        bottom: calc(var(--nav-height) + 14px + env(safe-area-inset-bottom));
        z-index: 41;
        min-height: 50px;
        display: inline-flex;
        border-radius: 16px;
        box-shadow: 0 10px 28px rgba(67, 56, 202, .3);
    }

    .page {
        padding: 24px 18px 58px;
    }

    .page-header {
        margin-bottom: 22px;
    }

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

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

    .billing-shell {
        display: block;
    }

    .billing-browser {
        padding: 16px 16px 110px;
    }

    .cart-panel {
        display: none;
    }

    .mobile-cart-bar {
        position: fixed;
        inset: auto 12px 12px;
        z-index: 30;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        min-height: 64px;
        padding: 10px 12px 10px 16px;
        border: 1px solid rgba(255, 255, 255, .2);
        border-radius: 17px;
        color: white;
        background: #24242b;
        box-shadow: 0 16px 36px rgba(19, 18, 37, .25);
    }

    .mobile-cart-bar strong,
    .mobile-cart-bar small {
        display: block;
    }

    .mobile-cart-bar small {
        margin-top: 3px;
        color: rgba(255, 255, 255, .68);
    }

    .mobile-cart-bar .btn {
        min-height: 44px;
        color: var(--primary-dark);
        background: white;
    }

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

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

@media (max-width: 720px) {
    .login-page {
        display: block;
        background: var(--surface);
    }

    .login-showcase {
        min-height: 280px;
        padding: 28px 22px 40px;
    }

    .login-brand {
        margin-bottom: 56px;
    }

    .login-copy h1 {
        font-size: 38px;
    }

    .login-copy p {
        font-size: 16px;
    }

    .login-features {
        display: none;
    }

    .login-panel {
        display: block;
        padding: 28px 22px 44px;
    }

    .login-card {
        margin: 0 auto;
    }

    .page-title {
        font-size: 27px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .page-header {
        display: block;
    }

    .page-header .header-actions {
        margin-top: 14px;
    }

    .hero-card {
        min-height: 230px;
    }

    .hero-total {
        font-size: 48px;
    }

    .catalog-summary,
    .report-grid {
        grid-template-columns: 1fr;
    }

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

    .item-tile {
        min-height: 110px;
        padding: 13px;
    }

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

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

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

    .modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
    }

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

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

@media (max-width: 390px) {
    .page {
        padding-inline: 14px;
    }

    .billing-browser {
        padding-inline: 12px;
    }

    .item-grid {
        gap: 9px;
    }

    .item-tile {
        min-width: 0;
        min-height: 108px;
    }

    .payment-split {
        gap: 9px;
    }

    .metric-card {
        padding: 14px;
    }

    .metric-value {
        font-size: 21px;
    }
}

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

@media print {
    body {
        background: white;
    }

    .desktop-sidebar,
    .mobile-topbar,
    .mobile-bottom-nav,
    .mobile-fab,
    .page-header,
    .no-print {
        display: none !important;
    }

    .main-area {
        margin: 0;
        padding: 0;
    }

    .page {
        padding: 0;
    }

    .bill-paper {
        border: 0;
        box-shadow: none;
    }
}
