/* ==========================================================================
   Page-specific styles: login, POS, dashboard, labels
   ========================================================================== */

/* --------------------------------------------------------------- login -- */

body.login-page {
  display: grid; place-items: center; min-height: 100vh; padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(212,175,55,.09), transparent 42%),
    radial-gradient(circle at 82% 88%, rgba(212,175,55,.06), transparent 45%),
    var(--bg-body);
}

.login-card {
  width: 100%; max-width: 396px;
  background: var(--bg-card); border: 1px solid var(--gold-border-hi);
  border-radius: 18px; padding: 34px 30px;
  box-shadow: var(--shadow), var(--gold-glow);
}
.login-card .monogram { width: 62px; height: 62px; font-size: 25px; margin-bottom: 14px; }
.login-head { text-align: center; margin-bottom: 24px; }
.login-head .shop-name { font-size: 21px; }
.login-head .tag {
  font-size: 10px; color: var(--text-mut); text-transform: uppercase;
  letter-spacing: .18em; margin-top: 6px;
}
.login-foot { text-align: center; margin-top: 20px; font-size: 11px; color: var(--text-mut); }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-mut); padding: 6px 9px;
  font-size: 15px; border-radius: 6px;
}
.pw-toggle:hover { color: var(--gold); }

/* ----------------------------------------------------------------- POS -- */

.pos-wrap { display: grid; grid-template-columns: 288px minmax(0, 1fr) 306px; gap: 14px; align-items: start; }

.pos-col { display: flex; flex-direction: column; gap: 14px; }

/* Left: scan + item detail */
.scan-box {
  background: var(--bg-card-2); border: 1px solid var(--gold-border-hi);
  border-radius: var(--radius); padding: 12px;
}
.scan-box .inp {
  height: 44px; font-family: var(--font-mono); font-size: 15px;
  text-align: center; letter-spacing: .05em;
}
.scan-hint { font-size: 10px; color: var(--text-mut); text-align: center; margin-top: 7px; }

.item-preview { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 13px; }
.item-preview .pic {
  width: 68px; height: 68px; flex: 0 0 68px; border-radius: var(--radius);
  object-fit: cover; background: var(--bg-card-2); border: 1px solid var(--gold-border);
}
.item-preview .pic-ph {
  width: 68px; height: 68px; flex: 0 0 68px; border-radius: var(--radius);
  display: grid; place-items: center; background: var(--bg-card-2);
  border: 1px solid var(--gold-border); color: var(--gold-dim); font-size: 24px;
}
.item-preview .meta { min-width: 0; }
.item-preview .meta b { display: block; font-size: 13px; color: var(--text-hi); line-height: 1.3; }
.item-preview .meta small { display: block; font-size: 11px; color: var(--text-mut); margin-top: 3px; font-family: var(--font-mono); }

.calc-lines { font-size: 12px; }
.calc-lines .stat-row { padding: 5px 0; font-size: 12px; }

/* Centre: bill grid */
.pos-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px 14px; background: var(--bg-card-2);
  border: 1px solid var(--gold-border); border-radius: var(--radius);
  font-size: 12px;
}
.pos-toolbar .tb-item { display: flex; flex-direction: column; gap: 2px; }
.pos-toolbar .tb-item span { color: var(--text-mut); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.pos-toolbar .tb-item b { color: var(--text-hi); font-family: var(--font-mono); font-size: 13px; }

.bill-grid-wrap { min-height: 210px; }

table.bill-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
table.bill-grid thead th {
  background: var(--bg-card-2); font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-mut); font-weight: 600; padding: 8px 7px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--gold-border);
}
table.bill-grid tbody td { padding: 7px; border-bottom: 1px solid rgba(212,175,55,.08); vertical-align: middle; }
table.bill-grid td.num { text-align: right; font-family: var(--font-mono); }
table.bill-grid tbody tr:hover { background: var(--bg-hover); }

table.bill-grid .cell-inp {
  width: 100%; max-width: 74px; height: 28px; padding: 0 7px;
  background: var(--bg-input); border: 1px solid var(--gold-border);
  border-radius: 6px; color: var(--text-hi); font-family: var(--font-mono);
  font-size: 12px; text-align: right;
}
table.bill-grid .cell-inp:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,175,55,.15); }

.qty-ctrl { display: inline-flex; align-items: center; gap: 3px; }
.qty-ctrl button {
  width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--gold-border);
  background: var(--bg-card-2); color: var(--gold); font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}
.qty-ctrl button:hover { border-color: var(--gold-border-hi); background: var(--bg-hover); }
.qty-ctrl .q { min-width: 24px; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-hi); }

.line-del { background: none; border: 0; color: var(--text-mut); font-size: 14px; padding: 4px 6px; border-radius: 5px; }
.line-del:hover { color: var(--red); background: var(--red-bg); }

/* Bill summary strip */
.summary-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 1px; background: var(--gold-border);
  border: 1px solid var(--gold-border); border-radius: var(--radius); overflow: hidden;
}
.summary-cell { background: var(--bg-card); padding: 10px 12px; }
.summary-cell .k { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mut); font-weight: 600; }
.summary-cell .v { font-family: var(--font-mono); font-size: 14px; color: var(--text-hi); font-weight: 600; margin-top: 3px; }
.summary-cell.grand { background: rgba(212,175,55,.1); }
.summary-cell.grand .k { color: var(--gold); }
.summary-cell.grand .v { font-size: 19px; color: var(--gold-bright); font-weight: 700; }
.summary-cell.credit .v { color: var(--green); }

.in-words {
  font-size: 11px; color: var(--text-mut); font-style: italic;
  padding: 8px 12px; background: var(--bg-card-2);
  border: 1px solid var(--gold-border); border-radius: var(--radius);
}

/* Right: customer panel */
.cust-card { background: var(--bg-card-2); border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 12px; }
.cust-card.selected { border-color: var(--gold-border-hi); background: rgba(212,175,55,.06); }
.cust-name { font-size: 14px; color: var(--text-hi); font-weight: 600; }
.cust-meta { font-size: 11px; color: var(--text-mut); margin-top: 3px; font-family: var(--font-mono); }

.loyalty-box {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  background: rgba(212,175,55,.08); border: 1px solid var(--gold-border);
  border-radius: var(--radius); font-size: 12px;
}
.loyalty-box .pts { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--gold-bright); }

/* Payment + action bars */
.pay-bar {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  padding: 13px 14px; background: var(--bg-card);
  border: 1px solid var(--gold-border); border-radius: var(--radius-lg);
}
.pay-bar .paid-info { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
.pay-bar .paid-info .k { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mut); font-weight: 600; }
.pay-bar .paid-info .v { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--text-hi); }
.pay-bar .paid-info .v.bal-due { color: var(--amber); }
.pay-bar .paid-info .v.bal-clear { color: var(--green); }

.action-bar {
  display: flex; gap: 9px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--bg-card-2);
  border: 1px solid var(--gold-border); border-radius: var(--radius-lg);
}

.paid-list { display: flex; flex-direction: column; gap: 6px; }
.paid-chip {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  padding: 6px 10px; background: var(--bg-card-2);
  border: 1px solid var(--gold-border); border-radius: 7px;
}
.paid-chip .amt { margin-left: auto; font-family: var(--font-mono); color: var(--text-hi); font-weight: 600; }
.paid-chip .x { background: none; border: 0; color: var(--text-mut); padding: 0 3px; font-size: 14px; }
.paid-chip .x:hover { color: var(--red); }

/* Search results dropdown (customer / item pickers) */
.search-results {
  max-height: 288px; overflow-y: auto; border: 1px solid var(--gold-border);
  border-radius: var(--radius); background: var(--bg-input);
}
.search-row {
  padding: 9px 12px; border-bottom: 1px solid rgba(212,175,55,.08);
  cursor: pointer; display: flex; align-items: center; gap: 11px;
}
.search-row:last-child { border-bottom: 0; }
.search-row:hover, .search-row.hl { background: var(--bg-hover); }
.search-row .body { flex: 1 1 auto; min-width: 0; }
.search-row .body b { display: block; font-size: 13px; color: var(--text-hi); }
.search-row .body small { font-size: 11px; color: var(--text-mut); font-family: var(--font-mono); }

@media (max-width: 1400px) {
  .pos-wrap { grid-template-columns: 262px minmax(0, 1fr) 276px; }
}
@media (max-width: 1180px) {
  .pos-wrap { grid-template-columns: minmax(0, 1fr); }
}

/* ----------------------------------------------------------- dashboard -- */

.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

.wealth-value { font-family: var(--font-mono); font-size: 24px; font-weight: 700; color: var(--gold-bright); }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-canvas { flex: 0 0 148px; width: 148px; height: 148px; }
.donut-legend { flex: 1 1 130px; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.donut-legend .lg { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-legend .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.donut-legend .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-body); }
.donut-legend .vl { font-family: var(--font-mono); color: var(--text-hi); font-weight: 600; }

/* ---------------------------------------------------------- item label -- */

.label-sheet { display: flex; flex-wrap: wrap; gap: 4mm; }
.item-label {
  width: 50mm; height: 25mm; padding: 2mm;
  border: 1px dashed var(--gold-border);
  background: #fff; color: #000;
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: Arial, sans-serif;
}
.item-label .l-name { font-size: 7pt; font-weight: 700; line-height: 1.1; overflow: hidden; }
.item-label .l-meta { font-size: 6pt; display: flex; justify-content: space-between; }
.item-label svg { display: block; width: 100%; height: 9mm; }
.item-label .l-code { font-size: 6pt; text-align: center; font-family: monospace; }
