/* Fixtings POS — futuristic dark theme (GSM-tool inspired, original design) */
* { box-sizing: border-box; }
:root {
  --bg: #05070d;
  --bg-2: #0a0f1c;
  --panel: rgba(255, 255, 255, .045);
  --panel-solid: #0d1424;
  --line: rgba(0, 229, 255, .14);
  --line-soft: rgba(255, 255, 255, .09);
  --ink: #eaf2ff;
  --muted: #a7b8d2;
  --cyan: #00e5ff;
  --cyan-dim: #00b8d4;
  --green: #22ff88;
  --green-dark: #16c96a;
  --gold: #ffc531;
  --red: #ff5c7a;
  --amber: #ffb020;
  --radius: 16px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "SF Mono", ui-monospace, "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(0, 229, 255, .12), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(34, 255, 136, .09), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
#app { display: flex; min-height: 100vh; }
a { color: var(--cyan); }
::selection { background: rgba(0, 229, 255, .35); }

/* Sidebar */
#sidebar {
  width: 248px; flex: 0 0 248px;
  background: linear-gradient(180deg, #0a1224 0%, #070b16 100%);
  border-right: 1px solid var(--line);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 16px; border-bottom: 1px solid var(--line-soft); }
.brand-mark {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #04121a;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
  box-shadow: 0 0 18px rgba(0, 229, 255, .45);
}
img.brand-mark { object-fit: cover; padding: 0; background: transparent; border: 1px solid rgba(0, 229, 255, .5); }
.brand-name {
  font-weight: 800; font-size: 18px; line-height: 1.2; letter-spacing: .02em;
  background: linear-gradient(90deg, #fff, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
#nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; flex: 1; }
.nav-btn {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; color: #c7d6ee;
  padding: 12px 14px; border-radius: 12px; font-size: 15px; cursor: pointer;
  min-height: 46px; transition: all .18s ease;
}
.nav-btn:hover { background: rgba(0, 229, 255, .08); color: #fff; border-color: var(--line); }
.nav-btn.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, .22), rgba(34, 255, 136, .12));
  border-color: rgba(0, 229, 255, .45);
  color: #fff; font-weight: 700;
  box-shadow: 0 0 16px rgba(0, 229, 255, .25), inset 3px 0 0 var(--cyan);
}
.side-foot { padding: 16px; border-top: 1px solid var(--line-soft); }
.side-foot .lbl { color: var(--muted); }
.side-note { font-size: 12px; color: #7e90ad; margin: 10px 0 0; }
.input.dark { background: #101a2e; color: #fff; border-color: rgba(255,255,255,.18); }

/* Main */
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#view { padding: 24px 26px; max-width: 1120px; width: 100%; margin: 0 auto; flex: 1; }
.foot { text-align: center; color: #7e90ad; font-size: 12.5px; padding: 16px; }

h1 {
  font-size: 26px; margin: 0 0 4px; letter-spacing: .01em;
  font-family: var(--font-display); font-weight: 700;
}
h1::after {
  content: ""; display: block; height: 3px; width: 64px; margin-top: 8px; border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 12px rgba(0, 229, 255, .6);
}
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { margin-top: 0; }
h4 { margin: 18px 0 6px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.bad { color: var(--red); font-weight: 700; }

/* Cards & grids — glassmorphism */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.card {
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-pos { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.stat-label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-value {
  font-size: 30px; font-weight: 800; margin: 6px 0; font-family: var(--font-display);
  background: linear-gradient(90deg, #fff, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-note { font-size: 12.5px; color: var(--muted); }
.card.stat.warn .stat-value {
  background: linear-gradient(90deg, #fff, var(--amber));
  -webkit-background-clip: text; background-clip: text;
}

/* Tables — every table lives in a .tbl-wrap so wide tables scroll sideways
   on a phone instead of crushing their columns into each other. */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--cyan); }
.tbl .r { text-align: right; }
.tbl tr.low-row td { background: rgba(255, 176, 32, .09); }

/* Buttons & inputs */
.btn {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; cursor: pointer; min-height: 44px;
  transition: all .18s ease;
}
.btn:hover { background: rgba(0, 229, 255, .12); border-color: rgba(0, 229, 255, .5); }
.btn.primary {
  background: linear-gradient(90deg, var(--cyan), var(--green));
  border-color: transparent; color: #04121a; font-weight: 800;
  box-shadow: 0 0 18px rgba(0, 229, 255, .35);
}
.btn.primary:hover { filter: brightness(1.12); box-shadow: 0 0 26px rgba(0, 229, 255, .55); }
.btn.danger { color: var(--red); border-color: rgba(255, 92, 122, .55); }
.btn.danger:hover { background: rgba(255, 92, 122, .14); }
.btn.small { padding: 7px 12px; font-size: 13px; min-height: 38px; }
.btn.tiny { padding: 3px 9px; font-size: 13px; border-radius: 7px; min-height: 30px; }
.btn.big { width: 100%; padding: 13px; font-size: 16px; margin-top: 10px; }
.input {
  width: 100%; padding: 11px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px;
  font-size: 15px; background: #0c1322; color: var(--ink); margin-bottom: 10px; min-height: 46px;
}
.input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 229, 255, .25); }
.input.inline { width: auto; margin-bottom: 0; }
.input.grow { flex: 1; min-width: 180px; }
select.input option { background: #0d1424; color: var(--ink); }
textarea.input { resize: vertical; }
.lbl { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; color: #c7d6ee; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.wrap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filters { margin-bottom: 14px; }
.chk { font-size: 14px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Badges & tags */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; background: rgba(255,255,255,.1); color: #dbe7fa; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.14);
}
.st-Received { background: rgba(99, 140, 255, .18); color: #a9c2ff; border-color: rgba(99,140,255,.4); }
.st-Diagnosing { background: rgba(255, 197, 49, .14); color: #ffd97a; border-color: rgba(255,197,49,.4); }
.st-AwaitingParts { background: rgba(255, 140, 66, .16); color: #ffb08a; border-color: rgba(255,140,66,.4); }
.st-InRepair { background: rgba(0, 229, 255, .14); color: #7df0ff; border-color: rgba(0,229,255,.4); }
.st-Ready { background: rgba(34, 255, 136, .14); color: #7dffa9; border-color: rgba(34,255,136,.4); }
.st-Collected { background: rgba(255,255,255,.08); color: #b9c7de; }
.ph-Available { background: rgba(34, 255, 136, .14); color: #7dffa9; border-color: rgba(34,255,136,.4); }
.ph-Reserved { background: rgba(255, 197, 49, .14); color: #ffd97a; border-color: rgba(255,197,49,.4); }
.ph-Sold { background: rgba(255,255,255,.08); color: #b9c7de; }
.tag { font-size: 11px; background: rgba(255, 197, 49, .16); color: #ffd97a; border: 1px solid rgba(255,197,49,.4); border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.fit-own { background: rgba(0, 229, 255, .16); color: #7df0ff; border-color: rgba(0,229,255,.45); }
.fit-confirmed { background: rgba(34, 255, 136, .16); color: #7dffa9; border-color: rgba(34,255,136,.45); }
.fit-spec { background: rgba(255, 176, 32, .16); color: #ffcf7a; border-color: rgba(255,176,32,.45); }

/* POS */
.result-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 2px; border-bottom: 1px solid var(--line-soft);
}
.pay-row { display: flex; gap: 14px; margin: 4px 0 10px; flex-wrap: wrap; }
.pay-opt { font-size: 15px; display: flex; gap: 6px; align-items: center; }
.cart-total { font-size: 18px; margin: 12px 0 4px; text-align: right; font-family: var(--font-display); }

/* Status flow */
.status-flow { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }

/* Bars (reports) */
.bars { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-date { width: 86px; flex: 0 0 86px; color: var(--muted); }
.bar-track { flex: 1; background: rgba(255,255,255,.08); border-radius: 6px; height: 16px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); border-radius: 6px; box-shadow: 0 0 10px rgba(0,229,255,.5); }
.bar-val { width: 130px; flex: 0 0 130px; text-align: right; font-weight: 600; font-family: var(--font-display); }

/* Device specs */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.spec-head h2 { margin-bottom: 2px; }
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.spec-cell {
  background: rgba(0, 229, 255, .05); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 12px 14px;
}
.spec-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--cyan); margin-bottom: 3px; }
.spec-value { font-size: 16px; font-weight: 700; font-family: var(--font-display); }
.compat-group {
  border: 1px solid rgba(34, 255, 136, .35); background: rgba(34, 255, 136, .06);
  border-radius: 12px; padding: 12px 14px; margin-top: 10px;
}
.compat-group.spec { border-color: rgba(255, 176, 32, .4); background: rgba(255, 176, 32, .06); }
.spec-warn { border-color: rgba(255, 176, 32, .4); }
.spec-warn h2 { color: #ffcf7a; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 6, 12, .72);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px; z-index: 50; overflow-y: auto;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal {
  background: linear-gradient(160deg, #101a2e, #0a0f1c);
  border: 1px solid rgba(0, 229, 255, .25); border-radius: 18px; padding: 22px;
  width: 100%; max-width: 620px; box-shadow: 0 16px 50px rgba(0,0,0,.6), 0 0 30px rgba(0,229,255,.12);
}
.receipt { border: 1px dashed rgba(255,255,255,.3); padding: 14px; border-radius: 8px; margin-bottom: 12px; }
.receipt h2 { margin-bottom: 2px; }
.receipt-total { font-size: 18px; font-weight: 800; text-align: right; font-family: var(--font-display); }
#receipt-root { display: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #0d1424; color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; opacity: 0; transition: all .25s; z-index: 100; pointer-events: none;
  max-width: 92vw; text-align: center; border: 1px solid rgba(0, 229, 255, .5);
  box-shadow: 0 0 20px rgba(0, 229, 255, .3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Print: receipt only */
@media print {
  body { background: #fff; color: #111; }
  #app, #modal-root, .toast { display: none !important; }
  #receipt-root { display: block !important; padding: 10px; color: #111; }
  #receipt-root .receipt { border-color: #999; }
}

/* Mobile */
@media (max-width: 860px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; flex: none; position: static; height: auto; }
  #nav { flex-direction: row; overflow-x: auto; padding: 8px; }
  .nav-btn { width: auto; white-space: nowrap; padding: 10px 14px; }
  .side-foot { display: flex; gap: 10px; align-items: center; }
  .side-foot .lbl { margin: 0; white-space: nowrap; flex: 0 0 auto; }
  .side-foot .input { margin-bottom: 0; flex: 1; min-width: 0; }
  .side-note { display: none; }
  .brand-sub { display: none; }
  #view { padding: 16px 14px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-pos, .grid-2col { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .bar-val { width: 96px; flex-basis: 96px; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .stat-value { font-size: 26px; }
  .spec-grid { grid-template-columns: 1fr; }
}
