/* Кудрявый Банк — операторская панель. Светлая по умолчанию, компактная. */
*,*::before,*::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* По умолчанию — тёмная. data-theme переопределяет. */
:root {
  --bg: #0b1224; --bg-elev: #131c33; --fg: #eef1f7; --fg-muted: #97a0b6;
  --accent: #1f63d2; --accent-2: #18a3e2; --line: #1c2745;
  --danger: #ff6464; --ok: #57d985;
  --radius: 12px; --shadow: 0 4px 20px rgba(0,0,0,.5);
}
/* Светлая = розовая палитра. */
:root[data-theme="light"] {
  --bg: #fff0f7; --bg-elev: #ffffff; --fg: #2a0a3a; --fg-muted: #7a3a5a;
  --accent: #622d89; --accent-2: #da2187; --line: #f7c8de;
  --danger: #b51b1b; --ok: #137a3c;
  --shadow: 0 2px 12px rgba(98,45,137,.12);
}
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 14px/1.45 -apple-system, Segoe UI, Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 20px; margin: 0 0 10px; }
h2 { font-size: 15px; margin: 10px 0; color: var(--fg-muted); font-weight: 600; }
.muted { color: var(--fg-muted); }
.error { color: var(--danger); }
.ok    { color: var(--ok); }

.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: var(--bg-elev); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { padding: 8px 12px; border-radius: 8px; color: var(--fg); }
.topnav a.active { background: color-mix(in srgb, var(--accent) 14%, var(--bg-elev)); color: var(--accent); }
.user { display: flex; gap: 8px; align-items: center; }

#view { padding: 18px; max-width: 1200px; margin: 0 auto; }
#hidCard { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

input, select, button { font: inherit; color: inherit; }
input, select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-elev); outline: none;
  min-width: 0;
}
input:focus, select:focus { border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 4px; color: var(--fg-muted); font-size: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }

.btn { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-elev); cursor: pointer; }
.btn:hover { background: color-mix(in srgb, var(--bg-elev) 80%, var(--accent) 20%); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: 0; }
.btn.ghost { background: transparent; }

.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row > * { flex: 1 1 140px; }
.row button { flex: 0 0 auto; }
.list { display: flex; flex-direction: column; gap: 6px; }
.item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev);
}
.item:hover { background: color-mix(in srgb, var(--bg-elev) 90%, var(--accent) 10%); cursor: pointer; }
.item .meta { font-size: 12px; color: var(--fg-muted); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; background: color-mix(in srgb, var(--accent) 18%, var(--bg-elev)); color: var(--accent); }
.badge.warn { background: color-mix(in srgb, var(--danger) 18%, var(--bg-elev)); color: var(--danger); }
.badge.ok   { background: color-mix(in srgb, var(--ok) 18%, var(--bg-elev)); color: var(--ok); }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 8px; margin-bottom: 10px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

.qrwrap { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: 12px; }

/* === Касса === */
.cashbox-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
@media (max-width: 900px) { .cashbox-grid { grid-template-columns: 1fr; } }
.cashbox-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.cashbox-tile {
  cursor: pointer; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--fg);
  text-align: left; font: inherit; display: flex; flex-direction: column; gap: 4px;
}
.cashbox-tile:hover { border-color: var(--accent); background: color-mix(in srgb, var(--bg-elev) 85%, var(--accent) 15%); }
.cashbox-tile .price { font-weight: 700; color: var(--accent); }
.cashbox-tile .meta { font-size: 11px; color: var(--fg-muted); }
.cashbox-receipt .item { padding: 8px 10px; }
.cashbox-receipt .balance-amount { font-size: 24px; font-weight: 700; }

/* Модалки */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: grid; place-items: center; padding: 16px; z-index: 100;
}
.modal {
  background: var(--bg-elev); color: var(--fg); border-radius: 14px;
  padding: 22px; max-width: 420px; width: 100%; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.modal h2 { margin: 0; }
.modal .list { max-height: 320px; overflow: auto; }

/* PIN-инпуты — крупный моноширинный для четырёх символов */
input[type="password"][inputmode="numeric"] {
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 18px; letter-spacing: 5px; text-align: center;
}
.auth { max-width: 360px; margin: 8vh auto 0; }
.creds-print {
  border: 1px dashed var(--line); padding: 12px; border-radius: 10px;
  font-family: ui-monospace, Menlo, monospace; white-space: pre;
}
