/* Borhan Mobile Shop: app styles */
:root {
    --brand: #4338ca;
    --brand-2: #6366f1;
    --brand-soft: #eef0ff;
    --green: #059669;
    --green-soft: #e7f8f1;
    --red: #dc2626;
    --red-soft: #fdecec;
    --amber: #c2410c;
    --amber-soft: #fff3e6;
    --blue: #0369a1;
    --blue-soft: #e6f4fb;
    --text: #1c2033;
    --muted: #6b7189;
    --line: #e6e8f0;
    --bg: #f4f5fa;
    --card: #ffffff;
    --side: #171a2e;
    --side-text: #b9bdd6;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(20, 24, 50, .05), 0 4px 16px rgba(20, 24, 50, .05);
    --font: 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
img, svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { display: inline-block; vertical-align: middle; }

/* ---------- layout ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 40;
    background: var(--side); color: var(--side-text);
    display: flex; flex-direction: column;
    transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-logo {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff;
    box-shadow: 0 6px 18px rgba(99, 102, 241, .4);
}
.brand-logo.lg { width: 64px; height: 64px; border-radius: 18px; }
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.brand-name small { display: block; font-weight: 400; font-size: 12px; color: var(--side-text); }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px;
    border-radius: 10px; color: var(--side-text); font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(67, 56, 202, .45); }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 10px 6px; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-foot form { margin: 0; }
.me { flex: 1; display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.me:hover { text-decoration: none; }
.me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.me small { display: block; color: var(--side-text); font-weight: 400; font-size: 12px; }
.sidebar .icon-btn { color: var(--side-text); }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.avatar {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.sidebar .avatar { background: rgba(255, 255, 255, .1); color: #fff; }
.avatar.sm { width: 30px; height: 30px; }
.avatar.lg { width: 54px; height: 54px; font-size: 22px; }

.main { margin-left: 248px; min-height: 100vh; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
    padding: 12px 28px; background: rgba(244, 245, 250, .88); backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}
.topbar h1 { font-size: 21px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.content { padding: 8px 28px 40px; max-width: 1400px; }
.backdrop { display: none; }

/* ---------- basic components ---------- */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; min-width: 0;
}
.card.p0 { padding: 0; overflow: hidden; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 16.5px; font-weight: 700; margin-bottom: 14px; }
.card-title .ic { color: var(--brand); }
.card-title.pad, .card-head.pad { padding: 18px 20px 4px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .card-title { margin: 0; }
.link { font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.d-block { display: block; }
.r { text-align: right; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13.5px; letter-spacing: .2px; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.greet { margin: 0 0 16px; color: var(--muted); }
.print-only { display: none; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.3;
    transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(67, 56, 202, .28); }
.btn-primary:hover { background: #3730a3; }
.btn-secondary { background: var(--brand-soft); color: var(--brand); }
.btn-secondary:hover { background: #e0e3ff; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { background: #fff; color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-lg { padding: 13px 22px; font-size: 16.5px; }
.btn-block { width: 100%; }
.icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
    border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 13.5px; cursor: pointer;
}
.chip:hover { border-color: var(--brand-2); color: var(--brand); text-decoration: none; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip small { color: var(--muted); }

.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
    background: #eef0f5; color: #4b5068; white-space: nowrap; vertical-align: middle;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- forms ---------- */
input:not([type=checkbox]):not([type=radio]), select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #d7dae6; border-radius: 10px;
    background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }
textarea { resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); vertical-align: middle; }
.field { display: block; margin-bottom: 14px; }
.field > span, .field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #3a3f58; }
.field small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: pointer; }
.check-field { display: flex; align-items: center; gap: 10px; align-self: end; padding-bottom: 10px; }
.check-field span { margin: 0; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.form-actions.sticky {
    position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%);
}
.form-page { max-width: 980px; }
.opening { margin-top: 4px; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 40px !important; }
.search-box.big input { padding: 14px 14px 14px 44px !important; font-size: 16.5px; border-radius: 12px; }
.search-box.big .ic { left: 14px; }
.search-wrap { position: relative; margin-bottom: 10px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters.card { padding: 14px 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.filters label.grow { flex: 1; min-width: 200px; }
.filters label.check { flex-direction: row; align-items: center; padding-bottom: 10px; color: var(--text); font-weight: 500; font-size: 14.5px; }
.filters.inline { flex: 1; align-items: center; }
.filters.inline > * { width: auto; }
.filters.inline .search-box { flex: 1; min-width: 200px; }
.filters.inline label.check { padding: 0; margin: 0; }
.filters input[type=date] { width: auto; }

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

.alert {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 16px;
    border-radius: 12px; border: 1px solid; font-weight: 500;
}
.alert > span, .alert > div { flex: 1; }
.alert ul { margin: 4px 0 0; padding-left: 18px; font-weight: 400; }
.alert-success { background: var(--green-soft); border-color: #b6e8d3; color: #065f46; }
.alert-error { background: var(--red-soft); border-color: #f6c4c4; color: #991b1b; }
.alert-info { background: var(--blue-soft); border-color: #bde0f2; color: #075985; }
.alert-x { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 2px; }
.alert-x:hover { opacity: 1; }

details.collapse > summary, details.new-cust > summary {
    display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--brand); list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details.card.collapse[open] > summary { margin-bottom: 16px; }
details.collapse form { margin-top: 12px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
    text-align: left; font-weight: 600; font-size: 13px; color: var(--muted);
    padding: 11px 16px; background: #f8f9fc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th.r { text-align: right; }
.table td { padding: 12px 16px; border-bottom: 1px solid #eff0f5; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbff; }
.row-link { cursor: pointer; }
.is-off { opacity: .55; }
.empty-cell { text-align: center; color: var(--muted); padding: 36px 16px !important; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 6px 0 20px; }
.pager a { min-width: 38px; padding: 7px 10px; text-align: center; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--text); }
.pager a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
.grid-side { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 0 18px; align-items: start; }
.grid-side > form.card { position: sticky; top: 76px; }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat {
    display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius);
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stat small { display: block; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.stat strong { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.3px; margin: 2px 0; }
.stat em { font-style: normal; font-size: 13px; color: var(--muted); }
.stat-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.stat-green .stat-ic { background: var(--green-soft); color: var(--green); }
.stat-red .stat-ic { background: var(--red-soft); color: var(--red); }
.stat-amber .stat-ic { background: var(--amber-soft); color: var(--amber); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0 18px; }

.bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding: 8px 4px 0; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.bar { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); min-height: 3px; }
.bar-col:last-child .bar { background: linear-gradient(180deg, #34d399, var(--green)); }
.bar-val { font-size: 12px; color: var(--muted); min-height: 18px; }
.bar-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.mini-stats small, .sum-strip small, .stat-row small { display: block; color: var(--muted); font-size: 13px; }
.mini-stats strong { font-size: 18px; }

.acc-list, .simple-list { list-style: none; margin: 0; padding: 0; }
.acc-list li, .simple-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f1f6; }
.acc-list li:last-child, .simple-list li:last-child { border-bottom: 0; }
.acc-total { font-size: 17px; }
.acc-total span { font-weight: 700; }
.empty-mini { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 6px 0; }

.sum-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.sum-strip > div { background: #fff; padding: 14px 18px; }
.sum-strip strong { font-size: 19px; }
.stat-pill { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; text-align: right; }
.stat-pill small { display: block; color: var(--muted); font-size: 12.5px; }
.stat-pill strong { font-size: 18px; }

.hbar { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; border-radius: 99px; background: #f0f1f7; overflow: hidden; }
.hbar-track span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.hbar.red .hbar-track span { background: linear-gradient(90deg, #f87171, var(--red)); }

.acc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.acc-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.acc-card small { display: block; color: var(--muted); font-weight: 600; margin-top: 10px; }
.acc-card strong { font-size: 21px; }
.acc-card.total { background: linear-gradient(135deg, var(--brand), #312e81); color: #fff; border: 0; }
.acc-card.total small { color: #c7c9f5; }
.acc-card.total .stat-ic { background: rgba(255, 255, 255, .15); color: #fff; }
.day-nav { display: flex; align-items: center; gap: 6px; }
.day-nav input { width: auto; }
.day-nav .icon-btn { font-size: 22px; }

/* ---------- products ---------- */
.prod-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.prod-head h2 { font-size: 20px; }
.prod-head p { margin: 2px 0 0; }
.prod-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; padding: 14px; background: #f8f9fc; border-radius: 12px; margin-bottom: 16px; }
.stat-row strong.big { display: block; font-size: 20px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }
.serial-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.serial-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; max-height: 320px; overflow-y: auto; margin-bottom: 12px; }
.serial-list.compact { max-height: 180px; }
.serial-list label { font-family: ui-monospace, Consolas, monospace; font-size: 14px; padding: 6px 8px; border-radius: 8px; margin: 0; }
.serial-list label:hover { background: var(--brand-soft); }

.tree { list-style: none; margin: 0; padding: 4px 0; }
.tree-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 20px 10px calc(20px + var(--depth, 0) * 26px); border-bottom: 1px solid #f0f1f6;
}
.tree-item:last-child { border-bottom: 0; }
.tree-item:hover { background: #fafbff; }
.tree-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tree-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tree-item[style*="--depth: 1"] .tree-name::before, .tree-item[style*="--depth: 2"] .tree-name::before,
.tree-item[style*="--depth: 3"] .tree-name::before { content: '└'; color: #c3c6d6; }
.perm-list { display: grid; grid-template-columns: 1fr; gap: 2px; margin-bottom: 14px; }
.perm-list .check { padding: 6px 8px; border-radius: 8px; margin: 0; }
.perm-list .check:hover { background: #f6f7fc; }

.setting-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-content: start; }
.tile { display: flex; gap: 14px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.tile:hover { text-decoration: none; border-color: var(--brand-2); transform: translateY(-2px); }
.tile strong { display: block; margin-bottom: 2px; }
.tile small { color: var(--muted); }

.due-box { padding: 16px; border-radius: 12px; background: var(--green-soft); margin-bottom: 14px; }
.due-box.has-due { background: var(--amber-soft); }
.due-box small { display: block; color: var(--muted); font-weight: 600; }
.due-box strong { font-size: 26px; }
.due-box.has-due strong { color: var(--amber); }

.empty-state { text-align: center; padding: 50px 20px; }
.empty-state.big { padding: 90px 20px; }
.empty-icon { display: inline-grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.empty-state p { color: var(--muted); max-width: 440px; margin: 8px auto 20px; }

.seg { display: inline-flex; padding: 3px; background: #eceef5; border-radius: 10px; }
.seg-btn { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg-btn.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* ---------- POS ---------- */
.is-pos .content { max-width: none; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 18px; align-items: start; }
.pos .card { margin: 0; }
.pos-left { min-height: calc(100vh - 120px); }
.pos-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
.p-card {
    text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px;
    border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.p-card:hover { border-color: var(--brand-2); box-shadow: 0 6px 18px rgba(67, 56, 202, .12); transform: translateY(-1px); }
.p-card.out { opacity: .5; cursor: not-allowed; }
.p-card strong { font-size: 15px; line-height: 1.35; }
.p-card small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.p-card .p-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.p-card .p-price { font-weight: 700; color: var(--brand); font-size: 16px; }
.pos-right { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 92px); overflow-y: auto; }
.pos-customer { position: relative; }
.pos-cust-selected { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); }
.pos-cust-selected > div { flex: 1; min-width: 0; }
.pos-cust-selected strong { display: block; }
.pos-cust-selected small { color: var(--muted); }
.new-cust { margin-top: 8px; font-size: 14px; }
.new-cust .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.dropdown {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff;
    border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20, 24, 50, .14);
    max-height: 320px; overflow-y: auto;
}
.pos-customer .dropdown { top: 50px; }
.dd-item { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; cursor: pointer; border-bottom: 1px solid #f2f3f7; }
.dd-item:hover, .dd-item:focus { background: var(--brand-soft); outline: none; }
.dd-item small { color: var(--muted); }
.dd-empty { padding: 14px; color: var(--muted); }

.cart { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0; min-height: 80px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .cl-name { font-weight: 600; line-height: 1.35; }
.cart-line .cl-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.cart-line .cl-total { font-weight: 700; text-align: right; }
.cart-line .cl-controls { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid #d7dae6; border-radius: 9px; overflow: hidden; }
.qty button { width: 32px; height: 34px; border: 0; background: #f6f7fb; cursor: pointer; font-size: 18px; }
.qty button:hover { background: var(--brand-soft); }
.qty input { width: 48px !important; text-align: center; border: 0 !important; border-radius: 0 !important; padding: 6px 2px !important; box-shadow: none !important; }
.cl-price { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.cl-price input { width: 100px !important; padding: 6px 8px !important; }
.cl-serials { display: flex; flex-wrap: wrap; gap: 4px; }
.cl-serials .chip { font-size: 12px; padding: 2px 8px; font-family: ui-monospace, Consolas, monospace; }
.cl-remove { margin-left: auto; }
.pos-totals { display: flex; flex-direction: column; gap: 10px; }
.tot-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0; }
.tot-row strong { font-size: 17px; }
.tot-row .num-input { width: 130px; text-align: right; }
.tot-grand { padding: 12px 14px; border-radius: 12px; background: var(--brand); color: #fff; }
.tot-grand strong { font-size: 24px; }
.tot-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tot-pay label span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.tot-pay input { font-size: 17px; font-weight: 700; text-align: right; }
.quick-pay { display: flex; gap: 8px; }
#t-due-row strong { color: var(--amber); }
#t-due-row.change strong { color: var(--green); }
.note-input { font-size: 14px; }
.pos-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.pos-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: #991b1b; font-weight: 500; }

.dialog { border: 0; border-radius: 16px; padding: 22px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.dialog::backdrop { background: rgba(20, 22, 40, .45); }
.dialog h3 { margin-bottom: 4px; }
.dialog input[type=search] { margin: 10px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- purchase ---------- */
.pu-table td { vertical-align: top; }
.pu-table input, .pu-table textarea { padding: 7px 9px !important; }
.w-qty { width: 230px; }
.w-num { width: 140px; }
.pu-summary { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding: 14px 0; }
.pu-summary small { display: block; color: var(--muted); }
.pu-summary strong { font-size: 22px; }

/* ---------- invoice ---------- */
.invoice { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px; max-width: 820px; margin: 0 auto; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--text); }
.inv-head h2 { font-size: 24px; }
.inv-head p { margin: 2px 0; color: #444; }
.inv-meta { text-align: right; }
.inv-tag { display: inline-block; padding: 3px 12px; border-radius: 6px; background: var(--text); color: #fff; font-weight: 600; font-size: 13px; }
.inv-party { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; }
.inv-party small { display: block; color: var(--muted); }
.inv-party span { display: block; color: #444; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.inv-table th { text-align: left; font-size: 13px; padding: 9px 8px; background: #f3f4f8; border-bottom: 1px solid #ddd; }
.inv-table th.r { text-align: right; }
.inv-table td { padding: 10px 8px; border-bottom: 1px solid #eee; vertical-align: top; }
.inv-table small { color: #555; }
.inv-totals { margin-left: auto; width: min(100%, 340px); }
.inv-totals > div { display: flex; justify-content: space-between; padding: 6px 0; }
.inv-totals .grand { border-top: 2px solid var(--text); margin-top: 4px; padding-top: 10px; font-size: 19px; }
.inv-totals .due { color: var(--amber); font-weight: 700; }
.inv-note { color: #444; }
.inv-foot { margin-top: 30px; text-align: center; color: #555; font-size: 13.5px; }
.sign { display: flex; justify-content: space-between; margin-top: 50px; }
.sign span { border-top: 1px solid #999; padding-top: 4px; min-width: 150px; }
.invoice.inv-pos { max-width: 340px; padding: 18px 16px; font-size: 13px; }
.inv-pos .inv-head { flex-direction: column; text-align: center; gap: 8px; border-bottom-style: dashed; }
.inv-pos .inv-head h2 { font-size: 18px; }
.inv-pos .inv-meta { text-align: center; }
.inv-pos .inv-party { flex-direction: column; gap: 4px; padding: 10px 0; }
.inv-pos .inv-party .r { text-align: left; }
.inv-pos .inv-table th:first-child, .inv-pos .inv-table td:first-child { display: none; }
.inv-pos .inv-table th, .inv-pos .inv-table td { padding: 6px 3px; }
.inv-pos .inv-totals { width: 100%; }
.inv-pos .inv-totals .grand { font-size: 16px; }
.inv-pos .sign { display: none; }
.inv-pos .inv-foot { margin-top: 14px; }

/* ---------- login ---------- */
.guest { min-height: 100vh; }
.guest > .alert { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 10; width: min(480px, calc(100vw - 32px)); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
    display: grid; place-items: center; padding: 40px; color: #fff;
    background: radial-gradient(circle at 20% 20%, #6366f1 0, transparent 45%), radial-gradient(circle at 80% 80%, #0ea5e9 0, transparent 40%), linear-gradient(135deg, #312e81, #171a2e);
}
.login-art-inner { max-width: 420px; }
.login-art h2 { font-size: 34px; margin: 22px 0 10px; }
.login-art p { color: #c7c9f5; font-size: 17px; }
.login-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.login-points li { display: flex; align-items: center; gap: 10px; }
.login-points .ic { color: #34d399; }
.login-card { align-self: center; justify-self: center; width: min(400px, calc(100vw - 32px)); padding: 30px 0; }
.login-card h1 { font-size: 28px; }
.login-card .muted { margin: 4px 0 24px; }
.login-card input { padding: 13px 14px !important; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 18px; }

/* ---------- modules ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.stat-link { color: var(--text); transition: border-color .15s, transform .15s; }
.stat-link:hover { text-decoration: none; border-color: var(--brand-2); transform: translateY(-2px); }
.inline-pay { display: flex; gap: 6px; align-items: center; min-width: 300px; }
.inline-pay input { width: 100px !important; padding: 6px 8px !important; }
.inline-pay select { width: 110px !important; padding: 6px 8px !important; }
.pad-x { padding: 0 20px; }
.repair-slip .dl { margin: 6px 0 18px; }
.toolbar-right form { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
    .pos { grid-template-columns: minmax(0, 1fr) 390px; }
    .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15, 17, 35, .45); }
    .main { margin-left: 0; }
    .menu-btn { display: inline-grid; }
    .topbar { padding: 10px 16px; }
    .content { padding: 6px 16px 32px; }
    .grid-side, .pos, .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .grid-side > form.card, .pos-right { position: static; max-height: none; }
    .pos-left { min-height: 0; }
    .pos-results { max-height: 50vh; overflow-y: auto; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-art { padding: 36px 20px 30px; }
    .login-art h2 { font-size: 26px; }
    .login-points { display: none; }
}
@media (max-width: 640px) {
    body { font-size: 15px; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: auto; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { flex-direction: column; padding: 14px; gap: 8px; }
    .stat strong { font-size: 19px; }
    .stat-ic { width: 36px; height: 36px; }
    .mini-stats { grid-template-columns: 1fr; }
    .hide-sm { display: none; }
    .card { padding: 16px; }
    .filters.inline > *, .filters.inline .search-box { width: 100%; flex: 1 1 100%; }
    .filters.inline select { flex: 1 1 45%; }
    .hbar { grid-template-columns: 100px 1fr auto; }
    .invoice { padding: 18px; }
    .inv-head, .inv-party { flex-direction: column; }
    .inv-meta { text-align: left; }
    .table th, .table td { padding: 10px 12px; }
    .bars { gap: 6px; height: 170px; }
    .form-actions.sticky { background: var(--bg); border-top: 1px solid var(--line); padding: 10px 0; }
    .form-actions .btn { flex: 1 1 auto; }
    .form-actions.sticky .btn-secondary { order: 3; flex-basis: 100%; }
    .pos-actions { grid-template-columns: 1fr; }
    .pos-actions .btn-lg { order: -1; }
}

/* ---------- print ---------- */
@media print {
    @page { margin: 10mm; }
    body { background: #fff; font-size: 13px; }
    .sidebar, .topbar, .backdrop, .no-print, .toolbar, .alert, .btn, .pager { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; max-width: none; }
    .card, .invoice, .stat, .sum-strip { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    .invoice { border: 0; padding: 0; max-width: none; }
    .print-only { display: block; }
    .grid-side.repair-grid { display: block; }
    a { color: inherit; }
    body.print-pos .invoice { width: 72mm; max-width: 72mm; font-size: 11.5px; }
}
