/* Karki'z POS theme v2: clean white top bar, sidebar on tablets and computers, soft cards, green accent (change --accent to re-colour everything). Loaded after pos.css. */
:root { --accent:#16a34a; --accent-d:#15803d; --accent-l:#ecfdf3; --blue:#16a34a; --blue-d:#15803d; --blue-l:#ecfdf3; --bg:#f4f6fa; --line:#e4e9f1; --r:16px; --shadow:0 1px 2px rgba(15,23,42,.05), 0 4px 14px rgba(15,23,42,.04); --amber:#b45309; --amber-l:#fffbeb; --purple:#7e22ce; --purple-l:#f5f3ff; --sky:#0369a1; --sky-l:#f0f9ff; }
body { background:var(--bg); }
.ico { display:inline-flex; vertical-align:middle; flex:0 0 auto; } .ico svg { display:block; }

/* ---------- top bar ---------- */
.top { background:#fff; color:var(--ink); border-bottom:1px solid var(--line); box-shadow:0 1px 0 rgba(15,23,42,.02); gap:10px; min-height:64px; }
.top .logo { width:42px; height:42px; border-radius:12px; border:1px solid var(--line); }
.top .brand { display:none; min-width:0; line-height:1.2; } .top .brand b { display:block; font-size:19px; } .top .brand span { font-size:13px; color:var(--mute); }
.top .clockbox { display:none !important; text-align:center; line-height:1.15; position:absolute; left:50%; transform:translateX(-50%); pointer-events:none; }
.top .clockbox b { display:block; font:700 24px/1.1 ui-monospace, "SF Mono", Consolas, monospace; color:var(--accent-d); letter-spacing:.05em; font-variant-numeric:tabular-nums; }
.top .clockbox span { font-size:13px; color:var(--mute); }
.top .who { flex:1; min-width:0; text-align:left; } .top .who b { font-size:15px; color:var(--ink); } .top .who span { color:var(--mute); font-size:12.5px; opacity:1; }
.top button { background:#fff; color:var(--ink); border:1.5px solid var(--line); padding:8px 12px; display:inline-flex; align-items:center; gap:6px; }
.top button#sign_out { color:var(--red); border-color:#fecaca; background:#fff; } .top button .lbl { display:none; }
.top button#lang { font-weight:700; }
.pill { display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:4px 12px; border-radius:999px; font-weight:700; font-size:14px; background:var(--accent-l); color:var(--accent-d); border:1px solid #bbf7d0; white-space:nowrap; }
.pill .lbl { display:none; } .pill.off { background:var(--red-l); color:var(--red); border-color:#fecaca; } .pill.wait { background:var(--amber-l); color:var(--amber); border-color:#fde68a; }

/* ---------- navigation: bottom bar on phones, sidebar on tablets and computers ---------- */
.bar { box-shadow:0 -2px 12px rgba(15,23,42,.06); }
.bar button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font-size:11.5px; font-weight:700; padding:6px 0; color:var(--mute); }
.bar button.on { color:var(--accent-d); box-shadow:inset 0 3px 0 var(--accent); background:var(--accent-l); }
.bar .navlink, .bar .sidefoot { display:none; }
.bar .dot { top:2px; left:calc(50% + 10px); }

/* ---------- cards ---------- */
.card { border:1px solid var(--line); box-shadow:var(--shadow); border-radius:var(--r); }
.card h2 { font-size:18px; }
.pg { display:flex; align-items:center; gap:10px; }
.chipico { width:42px; height:42px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; }
.c-green { background:#dcfce7; color:#15803d; } .c-blue { background:#dbeafe; color:#1d4ed8; } .c-purple { background:#f3e8ff; color:#7e22ce; } .c-red { background:#fee2e2; color:#b91c1c; } .c-amber { background:#fef3c7; color:#b45309; } .c-sky { background:#e0f2fe; color:#0369a1; }
.prod { border:1px solid var(--line); box-shadow:var(--shadow); } .prod:active { transform:scale(.985); }
button.primary { box-shadow:0 1px 2px rgba(22,163,74,.3); }
.chip.on, .seg.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.size.on { background:var(--accent-l); border-color:var(--accent); color:var(--accent-d); }

/* ---------- login ---------- */
.login { background:radial-gradient(1200px 500px at 50% -10%, #dcfce7 0%, transparent 60%), var(--bg); }
.login .card { box-shadow:0 10px 40px rgba(15,23,42,.10); border:0; padding:24px; }
.brand img { width:64px; height:64px; }

/* ---------- dashboard ---------- */
.dhead { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:4px; }
.dhead h1 { display:flex; align-items:center; gap:10px; font-size:26px; } .dhead p { color:var(--mute); margin-top:4px; }
.range { display:flex; gap:6px; align-items:center; flex-wrap:wrap; } .range button { min-height:44px; padding:8px 14px; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:14px; margin-top:16px; }
.kpi { background:#fff; border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); padding:16px; display:flex; justify-content:space-between; align-items:flex-start; gap:10px; min-width:0; }
.kpi .lbl { color:var(--mute); font-size:13.5px; } .kpi .val { font-size:26px; font-weight:800; line-height:1.2; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; } .kpi .sub { color:var(--mute); font-size:12.5px; margin-top:4px; }
.kpi .val.good { color:var(--accent-d); } .kpi .val.bad { color:var(--red); }
.kpis.small { grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); } .kpis.small .kpi { padding:12px 14px; } .kpis.small .val { font-size:19px; } .kpis.small .chipico { width:34px; height:34px; }
.charts { display:grid; grid-template-columns:1fr; gap:14px; margin-top:16px; align-items:start; } .charts .card { margin-top:0; min-width:0; }
.charts h2 { display:flex; align-items:center; gap:8px; font-size:16px; margin-bottom:10px; }
.chartsvg { width:100%; height:auto; display:block; } .chartsvg text { font:12px system-ui, sans-serif; fill:#64748b; }
.legend { list-style:none; margin:10px 0 0; padding:0; display:grid; gap:6px; } .legend li { display:flex; align-items:center; gap:8px; font-size:14px; } .legend i { width:12px; height:12px; border-radius:3px; flex:0 0 auto; } .legend b { margin-left:auto; font-variant-numeric:tabular-nums; }
.hbars { display:grid; gap:10px; } .hbar { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:4px 10px; align-items:center; font-size:14px; } .hbar .nm { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.hbar .tr { grid-column:1 / -1; height:10px; background:#eef2f7; border-radius:999px; overflow:hidden; } .hbar .tr i { display:block; height:100%; border-radius:999px; }
.empty { color:var(--mute); text-align:center; padding:24px 8px; }

/* ---------- POS terminal: products + the current sale side by side on a wide screen ---------- */
.term .ticket { display:none; }
.ticket h3 { font-size:17px; display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.ticket .tl { list-style:none; margin:0; padding:0; } .ticket .tl li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; padding:10px 0; border-top:1px solid var(--line); align-items:center; }
.ticket .tl .nm { font-weight:700; overflow-wrap:anywhere; } .ticket .tl small { color:var(--mute); display:block; font-weight:400; }
.ticket .tl .q { display:flex; align-items:center; gap:6px; } .ticket .tl .q button { min-height:44px; min-width:44px; padding:0; } .ticket .tl .q b { min-width:22px; text-align:center; }
.ticket .tl .amt { font-weight:800; font-variant-numeric:tabular-nums; text-align:right; }
.ticket .tot { display:flex; justify-content:space-between; align-items:baseline; font-size:22px; font-weight:800; padding:12px 0 4px; border-top:2px solid var(--ink); margin-top:6px; }
.ticket .empty { padding:30px 6px; }

/* ---------- tablets and computers ---------- */
@media (min-width:900px) {
  .top { padding-left:16px; padding-right:20px; min-height:66px; }
  .top .brand { display:block; } .top button .lbl { display:inline; } .pill .lbl { display:inline; }
  .top .who { flex:0 1 auto; text-align:right; margin-left:auto; } .top .who b, .top .who span { text-align:right; }
  .top button { padding:8px 16px; }
  .bar { top:66px; left:0; right:auto; bottom:0; width:248px; flex-direction:column; justify-content:flex-start; gap:4px; padding:14px 12px; border-top:0; border-right:1px solid var(--line); box-shadow:none; background:#fff; overflow:auto; }
  .bar button { flex:0 0 auto; flex-direction:row; justify-content:flex-start; gap:14px; width:100%; min-height:50px; padding:10px 16px; border-radius:12px; font-size:15.5px; font-weight:600; position:relative; }
  .bar button.on { background:var(--accent-l); color:var(--accent-d); box-shadow:none; }
  .bar button:not(.on):hover, .bar .navlink:hover { background:#f6f8fb; }
  .bar .dot { top:50%; left:auto; right:14px; transform:translateY(-50%); }
  .bar .navlink { display:flex; align-items:center; gap:14px; min-height:50px; padding:10px 16px; border-radius:12px; color:var(--mute); text-decoration:none; font-weight:600; font-size:15.5px; width:100%; }
  .bar .sidefoot { display:block; margin-top:auto; padding:14px 8px 4px; border-top:1px solid var(--line); text-align:center; color:var(--mute); font-size:12.5px; } .bar .sidefoot img { width:46px; height:46px; border-radius:12px; border:1px solid var(--line); margin-bottom:6px; } .bar .sidefoot b { display:block; color:var(--ink); font-size:14px; }
  .netbar { margin-left:248px; top:66px; }
  .wrap { max-width:none; margin:0; margin-left:248px; padding:24px 32px 40px; } .wrap > * { max-width:900px; } .wrap.wide > * { max-width:none; }
  .wrap, .sell { padding-bottom:40px; }
  .cartbar { display:none !important; }
  .grid { grid-template-columns:repeat(auto-fill, minmax(168px, 1fr)); }
  .tgrid { grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); }
  .charts { grid-template-columns:2fr 1fr; } .charts .span2 { grid-column:1 / -1; }
  .login .card { max-width:420px; }
  .tickets { grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); }
  .cartwrap > * { max-width:760px; }
}
@media (min-width:1100px) {
  .term { display:grid; grid-template-columns:minmax(0, 1fr) 372px; gap:20px; align-items:start; }
  .term .ticket { display:block; position:sticky; top:84px; background:#fff; border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); padding:16px; max-height:calc(100vh - 110px); overflow:auto; }
  #toast { top:76px; }
}
@media (min-width:1500px) { .charts .third { grid-column:auto; } }
@media print { .top, .bar, .netbar, #toast { display:none !important; } .wrap { margin-left:0; } }

/* header order on a phone: logo, name, online dot, language, sign out; on a wide screen: logo, brand, [clock], online, name, language, sign out */
.top .logo { order:0; } .top .brand { order:0; } .top .who { order:1; } .top .pill { order:2; } .top #lang { order:3; } .top #sign_out { order:4; }
@media (min-width:900px) { .top .pill { order:1; margin-left:auto; } .top .who { order:2; margin-left:8px; flex:0 0 auto; } }

.bar .lbl.short { display:inline; } .bar .lbl.full { display:none; } .bar .lbl { text-align:center; line-height:1.1; }
@media (min-width:900px) { .bar .lbl.short { display:none; } .bar .lbl.full { display:inline; } }
@media (min-width:1180px) { .top .clockbox { display:block !important; } }
.kpi .val { font-size:24px; } @media (max-width:600px) { .kpi { padding:12px; } .kpi .val { font-size:20px; } .kpi .chipico { width:36px; height:36px; } .kpi .lbl { font-size:12.5px; } }
.donutbox svg { max-width:190px !important; }
.chartsvg[viewBox="0 0 160 160"] { max-width:190px; margin:0 auto; }

.chartsvg .tx14 { font-size:14px; } .chartsvg .tx11 { font-size:11px; } .chartsvg text.tx15 { font-size:15px; font-weight:800; fill:#0f172a; }
.card h2 .chipico { width:32px; height:32px; }
.dashfoot { margin-top:12px; color:var(--mute); font-size:13px; }
.legend .sw0 { background:#22c55e; } .legend .sw1 { background:#3b82f6; } .legend .sw2 { background:#f59e0b; } .legend .sw3 { background:#a855f7; } .legend .sw4 { background:#ef4444; } .legend .sw5 { background:#14b8a6; } 

.tr i.w5 { width:5%; } .tr i.w10 { width:10%; } .tr i.w15 { width:15%; } .tr i.w20 { width:20%; } .tr i.w25 { width:25%; } .tr i.w30 { width:30%; } .tr i.w35 { width:35%; } .tr i.w40 { width:40%; } .tr i.w45 { width:45%; } .tr i.w50 { width:50%; } .tr i.w55 { width:55%; } .tr i.w60 { width:60%; } .tr i.w65 { width:65%; } .tr i.w70 { width:70%; } .tr i.w75 { width:75%; } .tr i.w80 { width:80%; } .tr i.w85 { width:85%; } .tr i.w90 { width:90%; } .tr i.w95 { width:95%; } .tr i.w100 { width:100%; } 
.tr i.sw0 { background:#22c55e; } .tr i.sw1 { background:#3b82f6; } .tr i.sw2 { background:#f59e0b; } .tr i.sw3 { background:#a855f7; } .tr i.sw4 { background:#ef4444; } .tr i.sw5 { background:#14b8a6; } 
@media (max-width:600px) { .kpis { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
