/* =============================================================================
   accounting.css — POS Accounting static UI (T-009)

   R6: the design tokens below are the shared POS design language,
   extracted from the POS stylesheets (tokens only — colors, type,
   button/input styles, nav bar, spacing, table treatment, status
   colors) and written into THIS repo's CSS. No POS HTML, routers, or
   app/accounting/ code is copied. Accounting owns its own screens.
   ============================================================================= */

/* ── Shared POS design tokens ── */
:root {
  --bg:          #0f1419;
  --surface:     #1a2332;
  --surface-2:   #212d3d;
  --text:        #e8eef7;
  --muted:       #8b9aaf;
  --accent:      #3d9cfd;
  --accent-dim:  rgba(61, 156, 253, 0.15);
  --green:       #34d399;
  --green-dim:   rgba(52, 211, 153, 0.15);
  --amber:       #fbbf24;
  --amber-dim:   rgba(251, 191, 36, 0.15);
  --purple:      #a78bfa;
  --purple-dim:  rgba(167, 139, 250, 0.15);
  --red:         #f87171;
  --red-dim:     rgba(248, 113, 113, 0.15);
  --border:      rgba(255, 255, 255, 0.07);
  --radius:      10px;

  /* spacing scale (POS paddings) */
  --space-1: 0.35rem;
  --space-2: 0.65rem;
  --space-3: 1.1rem;
  --space-4: 1.5rem;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Top bar (shared POS nav shell) ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.6rem var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar__brand { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; min-width: 0; }
.top-bar__title { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.top-bar__actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }

/* ── Nav pill tabs (shared POS nav-tabs) ── */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.2rem;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
  max-width: 100%;
}
.nav-tabs__tab {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  background: none;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.nav-tabs__tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-tabs__tab--active {
  color: #fff;
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.12);
  cursor: default;
}

/* ── Page shell ── */
.page { padding: var(--space-3) var(--space-4) 3rem; max-width: 1180px; margin: 0 auto; }
.screen { display: flex; flex-direction: column; gap: var(--space-3); }
.screen-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.screen-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.screen-sub { font-size: 0.8rem; color: var(--muted); }

/* ── Panels ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.panel-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
}

/* ── Inputs (shared POS input style) ── */
.field { display: grid; gap: 0.25rem; min-width: 0; }
.field-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
}
.input, select.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.45rem 0.65rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}
.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: rgba(139, 154, 175, 0.65); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
}
.form-grid .field--wide { grid-column: 1 / -1; }

/* ── Buttons (shared POS button treatment) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.02em;
  color: #fff; background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.12s, background 0.12s, border-color 0.12s;
}
.btn:hover:not(:disabled)  { filter: brightness(1.1); }
.btn:active:not(:disabled) { filter: brightness(0.92); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn--secondary:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.18); filter: none; }
.btn--ok     { background: #047857; }
.btn--danger { background: #b91c1c; }
.btn--sm { padding: 0.3rem 0.65rem; font-size: 0.75rem; border-radius: 7px; }

/* ── Tables (shared POS table treatment) ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem; background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.data-table th {
  background: var(--surface-2);
  padding: 0.6rem 0.85rem;
  text-align: left; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td      { background: rgba(255, 255, 255, 0.025); }
.data-table td.neg { color: var(--red); font-weight: 600; }
.data-table td.pos { color: var(--green); }
.loading-cell { text-align: center; color: var(--muted); padding: 2rem !important; }
.empty-cell   { text-align: center; color: var(--muted); padding: 1.5rem !important; }

/* ── Status chips (shared POS status colors) ── */
.chip {
  display: inline-block; padding: 0.18rem 0.55rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.chip--ok      { background: var(--green-dim);  color: var(--green); }
.chip--warn    { background: var(--amber-dim);  color: var(--amber); }
.chip--error   { background: var(--red-dim);    color: var(--red); }
.chip--info    { background: var(--accent-dim); color: var(--accent); }
.chip--muted   { background: rgba(139, 154, 175, 0.15); color: var(--muted); }
.chip--purple  { background: var(--purple-dim); color: var(--purple); }

/* ── Summary cards ── */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.summary-card__label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
}
.summary-card__value { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.summary-card__value--ok     { color: var(--green); }
.summary-card__value--error  { color: var(--red); }
.summary-card__value--accent { color: var(--accent); }

/* ── Banners / messages ── */
.banner {
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}
.banner--error   { background: var(--red-dim);   color: var(--red);   border-color: rgba(248, 113, 113, 0.35); }
.banner--ok      { background: var(--green-dim); color: var(--green); border-color: rgba(52, 211, 153, 0.35); }
.banner--info    { background: var(--accent-dim); color: var(--accent); }
.banner--muted   { color: var(--muted); }

/* ── Login page ── */
.login-shell {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
}
.login-card {
  width: 100%; max-width: 22rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.login-card h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.login-card .screen-sub { font-size: 0.78rem; }
.login-card .btn { width: 100%; padding: 0.7rem 1rem; font-size: 0.95rem; }

/* ── Misc ── */
.toolbar { display: flex; align-items: end; gap: 0.75rem; flex-wrap: wrap; }
.toolbar .field { min-width: 10rem; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.mono  { font-variant-numeric: tabular-nums; }
.total-row td { font-weight: 800; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.hint { font-size: 0.72rem; color: var(--muted); }
.payload-cell { max-width: 24rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; color: var(--muted); }

@media (max-width: 720px) {
  .page { padding: var(--space-2) var(--space-2) 2.5rem; }
  .top-bar { padding: 0.55rem var(--space-2); }
}
