﻿/* =========================================================
   MedERP POS - admin theme (matches the MedEduc admin look)
   Powered by medaccess360.net
   ========================================================= */
:root {
    --green-900: #0a3d18;
    --green-800: #0c4a1d;
    --green-700: #11602a;
    --green-600: #157a35;
    --green-500: #1b8a3e;
    --green-100: #e5f3e9;
    --green-50:  #f1f8f3;
    --yellow:    #f6c344;
    --red-600:   #c62828;
    --red-100:   #fde8e8;
    --red-50:    #fff3f3;
    --amber-100: #fff4d6;
    --amber-700: #8a5a00;
    --blue-100:  #e5eefc;
    --blue-700:  #1d4ed8;
    --ink:       #1f2937;
    --muted:     #6b7280;
    --line:      #e3e7ec;
    --bg:        #f3f5f7;
    --card:      #ffffff;
    --radius:    12px;
    --sidebar-w: 256px;
    --topbar-h:  58px;
    --font: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); }
a { color: var(--green-600); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }

/* ---------------- layout ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    background: linear-gradient(180deg, var(--green-800) 0%, var(--green-900) 100%);
    color: #fff; display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
    transition: width .2s ease, transform .2s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand img { width: 40px; height: 40px; border-radius: 8px; background: #fff; padding: 3px; }
.sidebar .brand .name { font-size: 19px; font-weight: 800; letter-spacing: .2px; line-height: 1.1; }
.sidebar .brand .name .med { color: #fff; }
.sidebar .brand .name .erp { color: var(--yellow); }
.sidebar .brand .sub { font-size: 11.5px; text-transform: uppercase; opacity: .85; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.sidebar .collapse-btn { margin-left: auto; background: none; border: 0; color: #cfe8d6; font-size: 16px; cursor: pointer; padding: 6px; }

.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.sidebar nav::-webkit-scrollbar { width: 8px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 8px; }
.nav-section { font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: #9fd1ad; padding: 16px 22px 6px; }
.nav-item > a, .nav-item > button {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 9px 18px 9px 22px; color: #fff; background: none; border: 0;
    font: inherit; font-size: 14px; text-align: left; cursor: pointer; text-decoration: none;
}
.nav-item > a:hover, .nav-item > button:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav-item i.ico { width: 18px; text-align: center; color: var(--yellow); }
.nav-item .chev { margin-left: auto; font-size: 11px; opacity: .8; transition: transform .15s; }
.nav-item.open .chev { transform: rotate(180deg); }
.nav-item.active > a, .nav-item.active > button { background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 var(--yellow); }
.nav-sub { display: none; padding: 2px 0 6px; background: rgba(0,0,0,.12); }
.nav-item.open .nav-sub { display: block; }
.nav-sub a { display: block; padding: 7px 18px 7px 52px; color: #d8eedf; font-size: 13.5px; }
.nav-sub a:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.nav-sub a.active { color: #fff; font-weight: 600; }
.nav-sub a.active::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); margin: 0 8px 2px -14px; }

.sidebar .me { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 16px; border-top: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.12); }
.sidebar .me .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); color: var(--green-900); display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.sidebar .me .avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar .me .who { line-height: 1.2; min-width: 0; }
.sidebar .me .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .who small { font-size: 11.5px; color: #b9dcc3; }
.sidebar .me .logout { margin-left: auto; color: #cfe8d6; font-size: 16px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin .2s ease; }

/* collapsed sidebar */
body.sb-collapsed .sidebar { width: 68px; flex-basis: 68px; }
body.sb-collapsed .main { margin-left: 68px; }
body.sb-collapsed .sidebar .brand .txt,
body.sb-collapsed .nav-section,
body.sb-collapsed .nav-item span,
body.sb-collapsed .nav-item .chev,
body.sb-collapsed .nav-sub,
body.sb-collapsed .sidebar .me .who,
body.sb-collapsed .sidebar .me .logout { display: none !important; }
body.sb-collapsed .sidebar .brand { flex-direction: column; padding: 12px 0 8px; gap: 4px; }
body.sb-collapsed .sidebar .collapse-btn { transform: rotate(180deg); margin: 0 auto; }
body.sb-collapsed .nav-item > a, body.sb-collapsed .nav-item > button { justify-content: center; padding: 11px 0; }

/* ---------------- top bar ---------------- */
.topbar {
    height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 10px; padding: 0 22px; position: sticky; top: 0; z-index: 30;
}
.topbar .burger { display: none; background: none; border: 0; font-size: 20px; color: var(--green-700); cursor: pointer; }
.topbar .spacer { flex: 1; }
.chip {
    display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
    border-radius: 999px; background: var(--green-100); color: var(--green-700); font-weight: 600; font-size: 13.5px; white-space: nowrap;
}
.chip i { color: var(--green-600); }
.chip a { color: inherit; }
.branch-select {
    height: 34px; border-radius: 999px; border: 1px solid #cfe5d6; background: #fff; color: var(--green-700);
    font: inherit; font-weight: 600; padding: 0 12px; max-width: 220px;
}
.icon-btn {
    width: 40px; height: 38px; display: inline-grid; place-items: center; position: relative;
    border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 15px; cursor: pointer;
}
.icon-btn:hover { background: var(--green-50); text-decoration: none; }
.icon-btn.wide { width: auto; padding: 0 10px; gap: 6px; display: inline-flex; font-weight: 600; font-size: 13px; }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; background: var(--red-600); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 5px; }

.content { padding: 22px 24px 40px; flex: 1; }
.footer { padding: 14px 24px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); background: #fff; }
.footer a { color: var(--green-600); font-weight: 600; }

/* ---------------- page bits ---------------- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.page-head h1 { font-size: 21px; margin: 0; display: flex; align-items: center; gap: 10px; }
.page-head h1 i { color: var(--green-600); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.card > h2, .card-title { font-size: 16px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.card > h2 i, .card-title i { color: var(--green-600); }
.card .lead { color: var(--muted); margin: 0 0 16px; font-size: 13.5px; }
.subcard { border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px; background: #fafbfc; }
.subcard h3 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.subcard h3 i { color: var(--green-600); }
.subcard .kv { font-size: 13px; margin: 6px 0; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }

/* ---------------- forms ---------------- */
.field label, label.lbl { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #2b3440; }
.field .req { color: var(--red-600); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number],
.field input[type=date], .field input[type=time], .field select, .field textarea {
    width: 100%; height: 40px; border: 1px solid #cfd6de; border-radius: 9px; padding: 8px 12px;
    font: inherit; color: var(--ink); background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 84px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(27,138,62,.15); }
.field .with-icon { position: relative; }
.field .with-icon input { padding-right: 40px; }
.field .with-icon .eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #6b7280; cursor: pointer; background: none; border: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; height: 40px; }
.check input { width: 18px; height: 18px; accent-color: var(--green-600); }

.btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 9px;
    border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-outline { background: #fff; color: var(--ink); border-color: #cfd6de; }
.btn-outline:hover { background: var(--green-50); border-color: var(--green-500); }
.btn-danger { background: #fff; color: var(--red-600); border-color: #f2c4c4; }
.btn-danger:hover { background: var(--red-50); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------------- pills / status ---------------- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.pill-on, .pill-ok, .pill-Paid, .pill-Completed, .pill-Received, .pill-Approved, .pill-Active, .pill-Present, .pill-Delivered, .pill-Done, .pill-Accepted { background: var(--green-100); color: var(--green-700); }
.pill-off, .pill-bad, .pill-Unpaid, .pill-Cancelled, .pill-Rejected, .pill-Absent, .pill-Expired, .pill-Terminated, .pill-Disposed { background: var(--red-100); color: var(--red-600); }
.pill-warn, .pill-Partial, .pill-Pending, .pill-Late, .pill-Ordered, .pill-Draft, .pill-New { background: var(--amber-100); color: var(--amber-700); }
.pill-info { background: var(--blue-100); color: var(--blue-700); }

/* ---------------- alerts ---------------- */
.alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; border: 1px solid; font-size: 14px; }
.alert > b:first-child { display: block; margin-bottom: 4px; }
.alert ul { margin: 6px 0 0 18px; padding: 0; }
.alert-danger { background: var(--red-50); border-color: #f3c0c0; color: #a31515; }
.alert-danger i { color: var(--red-600); }
.alert-success { background: var(--green-50); border-color: #b9dfc4; color: var(--green-700); }
.alert-warning { background: #fffaeb; border-color: #f5dd9b; color: var(--amber-700); }
.alert-info { background: #eff5ff; border-color: #c3d6fb; color: var(--blue-700); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; background: #fff; }
table.data th { background: #f6f8fa; text-align: left; font-weight: 600; font-size: 13px; color: #374151; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fbfcfd; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 700; background: #f6f8fa; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 220px; }
.toolbar > .field { flex: 1 1 170px; max-width: 280px; margin: 0; }
.toolbar > .field input, .toolbar > .field select { width: 100%; }
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 12px; align-items: center; color: var(--muted); font-size: 13px; }

/* ---------------- stat tiles ---------------- */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: var(--green-100); color: var(--green-700); }
.stat .ic.y { background: #fff4d6; color: #a06a00; }
.stat .ic.r { background: var(--red-100); color: var(--red-600); }
.stat .ic.b { background: var(--blue-100); color: var(--blue-700); }
.stat .v { font-size: 20px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 12.5px; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 10px 4px 0; border-bottom: 1px solid var(--line); }
.bars .bar { flex: 1; background: var(--green-500); border-radius: 6px 6px 0 0; min-height: 2px; position: relative; }
.bars .bar:hover { background: var(--green-700); }
.bars-labels { display: flex; gap: 8px; padding: 6px 4px 0; }
.bars-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }

/* ---------------- POS ---------------- */
.pos { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); gap: 16px; }
.pos .products { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; max-height: calc(100vh - 260px); overflow-y: auto; padding-right: 4px; }
.pos .p-card { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px; cursor: pointer; text-align: left; font: inherit; }
.pos .p-card:hover { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(27,138,62,.1); }
.pos .p-card .nm { font-weight: 600; font-size: 13px; line-height: 1.25; min-height: 33px; }
.pos .p-card .pr { color: var(--green-700); font-weight: 800; margin-top: 6px; }
.pos .p-card .st { font-size: 11.5px; color: var(--muted); }
.pos .p-card.out { opacity: .5; }
.pos .cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pos .cats button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.pos .cats button.on { background: var(--green-600); color: #fff; border-color: var(--green-600); }
.pos .cart table.data td { padding: 7px 8px; }
.pos .cart .qty { width: 64px; height: 32px; text-align: center; }
.pos .totals { margin-top: 10px; }
.pos .totals div { display: flex; justify-content: space-between; padding: 4px 2px; }
.pos .totals .grand { font-size: 22px; font-weight: 800; color: var(--green-700); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }

/* ---------------- login ---------------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art {
    position: relative; overflow: hidden; color: #fff; padding: 44px 48px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
    background:
        radial-gradient(circle at 18% 22%, rgba(246,195,68,.20), transparent 38%),
        radial-gradient(circle at 85% 78%, rgba(255,255,255,.10), transparent 42%),
        linear-gradient(160deg, var(--green-700), var(--green-900));
}
.login-art > *:not(.la-bg) { position: relative; z-index: 2; }
.la-top { display: flex; align-items: center; gap: 12px; }
.login-art h1 { font-size: 34px; margin: 0; } .login-art h1 .erp { color: var(--yellow); }
.la-text p { opacity: .92; max-width: 470px; line-height: 1.6; margin: 0 0 10px; font-size: 15px; }
.la-text ul { list-style: none; padding: 0; margin: 0 0 18px; line-height: 2; opacity: .95; }
.la-text li i { color: var(--yellow); margin-right: 8px; }

/* background layer: dot grid + watermark words + floating icons */
.la-bg { position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.10) 1.2px, transparent 1.3px); background-size: 26px 26px; }
.la-bg .wm { position: absolute; font-weight: 900; letter-spacing: 4px; white-space: nowrap; color: transparent;
    -webkit-text-stroke: 1.5px rgba(255,255,255,.13); user-select: none; }
.la-bg .w1 { font-size: 190px; top: 7%; right: -24px; transform: rotate(-8deg); }
.la-bg .w2 { font-size: 150px; bottom: 3%; left: -14px; transform: rotate(6deg); -webkit-text-stroke-color: rgba(255,255,255,.11); }
.la-bg .w3 { font-size: 54px; top: 34%; right: 14px; writing-mode: vertical-rl; letter-spacing: 8px; -webkit-text-stroke-color: rgba(246,195,68,.30); }
.la-bg .w4 { font-size: 26px; top: 4%; left: 44%; color: rgba(255,255,255,.07); -webkit-text-stroke: 0; }
.la-bg .w5 { font-size: 32px; bottom: 21%; right: 13%; color: rgba(255,255,255,.08); -webkit-text-stroke: 0; }
.la-bg .w6 { font-size: 30px; top: 34%; right: 13%; color: rgba(255,255,255,.07); -webkit-text-stroke: 0; transform: rotate(5deg); }
.la-bg .w7 { font-size: 24px; bottom: 9%; right: 20%; color: rgba(255,255,255,.07); -webkit-text-stroke: 0; }
.la-bg .w8 { font-size: 24px; top: 13%; left: 42%; color: rgba(255,255,255,.07); -webkit-text-stroke: 0; transform: rotate(-6deg); }
.la-bg .fl { position: absolute; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 22px;
    color: var(--yellow); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(2px);
    animation: laFloat 7s ease-in-out infinite; }
.la-bg .f1 { top: 13%; left: 60%; }
.la-bg .f2 { top: 29%; left: 82%; animation-delay: -1s; }
.la-bg .f3 { top: 62%; left: 82%; animation-delay: -2s; }
.la-bg .f4 { top: 84%; left: 66%; animation-delay: -3s; }
.la-bg .f5 { top: 45%; left: 72%; animation-delay: -4s; }
.la-bg .f6 { top: 67%; left: 69%; animation-delay: -5s; }
.la-bg .f7 { top: 57%; left: 64%; animation-delay: -2.5s; width: 44px; height: 44px; font-size: 18px; }
.la-bg .f8 { top: 91%; left: 82%; animation-delay: -1.5s; width: 44px; height: 44px; font-size: 18px; }
.la-bg .f9 { top: 6%; left: 76%; animation-delay: -3.5s; width: 44px; height: 44px; font-size: 18px; }
@keyframes laFloat { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }
@media (prefers-reduced-motion: reduce) { .la-bg .fl { animation: none; } }

/* glass showcase cards */
.la-show { position: relative; height: 360px; max-width: 620px; width: 100%; }
.gcard { position: absolute; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); border-radius: 16px;
    padding: 14px 16px; backdrop-filter: blur(8px); box-shadow: 0 14px 40px rgba(0,0,0,.22); font-size: 13px; }
.gc-h { font-size: 12px; opacity: .85; margin-bottom: 8px; font-weight: 600; } .gc-h i { color: var(--yellow); margin-right: 4px; }
.gc-v { font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.gc-bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin-top: 10px; }
.gc-bars i { flex: 1; background: linear-gradient(180deg, var(--yellow), rgba(246,195,68,.35)); border-radius: 4px 4px 0 0; }
.gc-row { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.gc-row.tot { border-top: 1px dashed rgba(255,255,255,.35); margin-top: 6px; padding-top: 7px; font-size: 15px; }
.gc-row b.warn { color: #ffd166; } .gc-row b.ok { color: #9be7b0; }
.gc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gc-chips span { background: rgba(255,255,255,.14); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.c-sales { left: 0; top: 0; width: 270px; }
.c-pos { left: 290px; top: 26px; width: 240px; }
.c-br { left: 30px; top: 196px; width: 250px; }
.c-stock { left: 300px; top: 210px; width: 220px; }
.c-pay { left: 120px; top: 300px; width: 300px; }

/* right side brand mark */
.lf-brand { display: inline-flex; align-items: center; gap: 8px; background: var(--green-50); border: 1px solid #cfe5d6; color: var(--green-700);
    padding: 5px 12px 5px 6px; border-radius: 999px; font-size: 12.5px; margin-bottom: 18px; }
.lf-brand img { width: 22px; height: 22px; } .lf-brand em { font-style: normal; color: #c58a00; }
.login-form { background:
    radial-gradient(circle at 90% 10%, rgba(27,138,62,.07), transparent 35%),
    radial-gradient(circle at 10% 95%, rgba(246,195,68,.10), transparent 35%), #f6f8f9; }
@media (max-width: 1600px) { .la-bg .f2, .la-bg .f5, .la-bg .f6, .la-bg .f7, .la-bg .w5, .la-bg .w7, .la-bg .w8 { display: none; } }
@media (max-width: 1300px) { .la-show { transform: scale(.85); transform-origin: left top; height: 310px; } .la-bg .f4, .la-bg .f3 { display: none; } }
.login-form { display: grid; place-items: center; padding: 30px; }
.login-form .box { width: 100%; max-width: 400px; }
.login-form h2 { margin: 0 0 6px; font-size: 24px; }

/* ---------------- print / receipt ---------------- */
.receipt { max-width: 340px; margin: 0 auto; background: #fff; padding: 16px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.receipt h3 { text-align: center; margin: 0; font-size: 16px; }
.receipt .c { text-align: center; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 2px 0; vertical-align: top; }
.receipt .r { text-align: right; }
.receipt hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
@media print {
    .sidebar, .topbar, .footer, .no-print { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; }
    .card { border: 0; box-shadow: none; }
    body { background: #fff; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1200px) { .g6 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); }
    body.sb-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .main, body.sb-collapsed .main { margin-left: 0; }
    .topbar .burger { display: inline-block; }
    .g2, .g3, .g4, .g6 { grid-template-columns: minmax(0,1fr); }
    .span2, .span3 { grid-column: auto; }
    .pos { grid-template-columns: minmax(0,1fr); }
    .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; }
    .chip .chip-text { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------------- page & action loader (Scripts/loader.js) ---------------- */
.ml-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 10001; pointer-events: none; opacity: 0;
    background: linear-gradient(90deg, var(--yellow), var(--green-500)); box-shadow: 0 0 10px rgba(246,195,68,.7); }
.ml-bar.run { opacity: 1; width: 82%; transition: width 6s cubic-bezier(.08,.7,.15,1), opacity .2s; }
.ml-bar.done { width: 100%; opacity: 0; transition: width .2s ease, opacity .35s .15s; }
.page-loader { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
    background: rgba(243,245,247,.72); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.page-loader.show { opacity: 1; visibility: visible; }
/* first paint of a page: appears only if the page is slow, and never stays more than 8 s even if scripts fail */
.page-loader.initial { visibility: visible; background: var(--bg); animation: plIn .2s .15s forwards, plFail .3s 8s forwards; }
@keyframes plIn { to { opacity: 1; } }
@keyframes plFail { to { opacity: 0; visibility: hidden; } }
.pl-box { position: relative; width: 150px; padding: 26px 0 18px; border-radius: 18px; background: #fff; text-align: center;
    box-shadow: 0 20px 50px rgba(16,24,40,.14); border: 1px solid var(--line); }
.pl-ring { width: 74px; height: 74px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--green-100);
    border-top-color: var(--green-600); border-right-color: var(--yellow); animation: plSpin .8s linear infinite; }
.pl-box img, .pl-box .pl-dot { position: absolute; top: 40px; left: 50%; width: 46px; height: 46px; margin-left: -23px;
    object-fit: contain; animation: plPulse 1.4s ease-in-out infinite; }
.pl-box .pl-dot { border-radius: 50%; background: var(--green-600); width: 22px; height: 22px; margin-left: -11px; top: 52px; }
.pl-text { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--green-700); }
@keyframes plSpin { to { transform: rotate(360deg); } }
@keyframes plPulse { 0%,100% { transform: scale(.92); opacity: .85; } 50% { transform: scale(1); opacity: 1; } }
.is-loading { pointer-events: none; opacity: .85; }
.is-loading > i:not(.ml-spin) { display: none; }
.ml-spin { margin-right: 2px; }
@media (prefers-reduced-motion: reduce) { .pl-ring, .pl-box img, .pl-box .pl-dot { animation-duration: 2.5s; } .ml-bar.run { transition: none; } }
@media print { .page-loader, .ml-bar { display: none !important; } }

/* ============ INSTALLED APP (phones, tablets, desktops, TVs) ============ */
.pwa-install {
    position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 9000;
    display: flex; align-items: center; gap: 12px; max-width: min(440px, calc(100vw - 36px));
    background: #fff; border: 1px solid var(--green-100); border-radius: 14px; padding: 12px 12px 12px 14px;
    box-shadow: 0 12px 34px rgba(10, 61, 24, .22); animation: piIn .3s ease-out;
}
.pwa-install img { width: 42px; height: 42px; flex: none; }
.pwa-install .pi-text { font-size: 13px; line-height: 1.4; color: #374151; }
.pwa-install .pi-text b { color: var(--green-700); }
.pwa-install .pi-text span { display: block; }
.pwa-install .pi-go { white-space: nowrap; }
.pwa-install .pi-x { border: 0; background: transparent; font-size: 22px; line-height: 1; color: #9ca3af; cursor: pointer; padding: 4px 6px; }
@keyframes piIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 560px) { .pwa-install { left: 12px; right: 12px; max-width: none; } }
@media print { .pwa-install { display: none !important; } }

/* Running as an installed app: keep clear of the notch, rounded corners and home bar */
.is-app body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.is-app .topbar { padding-top: max(0px, env(safe-area-inset-top)); }
.is-app .sidebar { padding-bottom: env(safe-area-inset-bottom); }
/* Desktop app with the title bar hidden: let the top bar be dragged like a window title */
@media (display-mode: window-controls-overlay) {
    .topbar { -webkit-app-region: drag; app-region: drag; padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 12px); }
    .topbar a, .topbar button, .topbar select, .topbar input { -webkit-app-region: no-drag; app-region: no-drag; }
}

/* TVs and keyboard users: the TV remote (arrow keys + OK) moves focus, so make it obvious */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible,
.btn:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid var(--yellow); outline-offset: 2px; box-shadow: 0 0 0 6px rgba(17, 96, 42, .35);
}
/* Big screens viewed from a sofa (TV browsers report no fine pointer) */
@media (min-width: 1700px) and (hover: none), (min-width: 1700px) and (pointer: coarse) {
    html { font-size: 112%; }
    .sidebar nav a { padding-top: 11px; padding-bottom: 11px; }
    .btn { min-height: 44px; }
    a:focus-visible, button:focus-visible, .btn:focus-visible { outline-width: 5px; outline-offset: 4px; }
}
