:root {
  --pink: #ff2d6f;
  --ink: #0d0712;
  --paper: #faf7f8;
  --line: #eadde2;
  --muted: #7a6670;
  --ok: #128a5a;
  --warn: #b45309;
  --font: Inter, system-ui, sans-serif;
  --display: "Playfair Display", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; }
.brand {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 1.25rem;
}
.brand span { color: var(--pink); font-style: italic; }
.brand.big { font-size: 2rem; text-align: center; }

.theme-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 400px at 50% -10%, #ffd6e4, transparent 60%),
    #fff;
}
.login {
  width: min(400px, calc(100% - 2rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.6rem 1.6rem;
  display: grid;
  gap: 0.85rem;
  box-shadow: 0 18px 50px rgba(13,7,18,0.06);
}
.login .sub { text-align: center; color: var(--muted); margin: -0.4rem 0 0.4rem; }
.login label, .form-row label, .form-grid label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
input, select, button {
  font: inherit;
  color: var(--ink);
}
input, select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
button {
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-weight: 650;
  cursor: pointer;
}
button:hover { background: #1b1220; }
button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}
.err, .flash {
  background: #ffe4ec;
  color: #9d174d;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-weight: 550;
}
.flash { margin: 0 1.2rem 0.8rem; }

.theme-tv { background: #120910; color: #f6eef2; }
.theme-tv .top { background: #1a1016; border-color: #2a1a22; }
.theme-tv .muted { color: #b49aa6; }
.theme-tv .card { background: #1a1016; border-color: #2a1a22; }
.theme-tv table th { color: #b49aa6; }
.theme-tv table td { border-color: #2a1a22; }
.theme-tv .chip { background: #24141c; border-color: #3a2430; color: #f6eef2; }
.theme-tv .chip.is-on { background: var(--pink); border-color: var(--pink); color: #fff; }
.theme-tv .stat { background: #1a1016; border-color: #2a1a22; }
.theme-tv .stat strong { color: #fff; }
.theme-tv input, .theme-tv select { background: #120910; color: #fff; border-color: #3a2430; }

.top {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.85rem 1.2rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top nav { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.top nav a {
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.9rem;
}
.top nav a.is-on { background: var(--pink); color: #fff; }
.who { margin-left: auto; display: flex; gap: 0.8rem; align-items: center; color: var(--muted); }
.who a { color: var(--pink); font-weight: 650; text-decoration: none; }

main { padding: 1.2rem; max-width: 1480px; margin: 0 auto; }
.hero-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin: 0;
  letter-spacing: -0.03em;
}
h2 { margin: 0 0 0.8rem; font-size: 1rem; }
.muted { color: var(--muted); margin: 0.25rem 0 0; }
.ranges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-weight: 650;
  font-size: 0.86rem;
}
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem 0.9rem;
}
.stat .lbl {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  letter-spacing: -0.04em;
  margin-top: 0.2rem;
}
.stat em { font-style: normal; color: var(--muted); font-size: 0.82rem; }
.stat.is-money strong { color: var(--pink); }
.split {
  height: 6px;
  background: #3a2430;
  border-radius: 99px;
  overflow: hidden;
  margin: 0.55rem 0 0.35rem;
}
.theme-desk .split { background: #f0dce3; }
.split span { display: block; height: 100%; background: var(--pink); }

.spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 88px;
  margin: 0 0 1rem;
  padding: 0.7rem 0.8rem 0.5rem;
  background: #1a1016;
  border: 1px solid #2a1a22;
  border-radius: 16px;
}
.spark-col {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
}
.spark-col i {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #ff7aa4, #ff2d6f);
  border-radius: 5px 5px 2px 2px;
  min-height: 6px;
}

.type-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}
.type-tile {
  border-radius: 14px;
  padding: 0.9rem 0.95rem 0.8rem;
  border: 1px solid #2a1a22;
  background: #140d12;
}
.type-tile strong {
  display: block;
  font-size: 2rem;
  letter-spacing: -0.04em;
  margin: 0.35rem 0 0.1rem;
}
.type-tile em { font-style: normal; color: #b49aa6; }
.type-tile .bar-track { margin-top: 0.7rem; }
.type-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
}
.tone-swarovski { --tone: #e8b4ff; }
.tone-apple { --tone: #9ad7ff; }
.tone-brand { --tone: #ffd37a; }
.tone-acc { --tone: #7ee0c4; }
.tone-case { --tone: #ff9bb8; }
.type-tile.tone-swarovski, .type-pill.tone-swarovski { background: #2a1833; color: #e8b4ff; }
.type-tile.tone-apple, .type-pill.tone-apple { background: #122433; color: #9ad7ff; }
.type-tile.tone-brand, .type-pill.tone-brand { background: #2a2112; color: #ffd37a; }
.type-tile.tone-acc, .type-pill.tone-acc { background: #10241e; color: #7ee0c4; }
.type-tile.tone-case, .type-pill.tone-case { background: #2a121a; color: #ff9bb8; }
.theme-desk .type-tile { border-color: var(--line); }

.bars { display: grid; gap: 0.7rem; }
.bar-row { display: flex; gap: 0.7rem; align-items: center; }
.bar-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: #2a1a22;
  flex: 0 0 44px;
}
.bar-body { flex: 1; min-width: 0; }
.bar-meta {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.28rem;
}
.bar-name {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-val {
  margin-left: auto;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bar-val small {
  display: block;
  font-weight: 550;
  color: #b49aa6;
  font-size: 0.72rem;
  text-align: right;
}
.bar-track {
  height: 8px;
  background: #2a1a22;
  border-radius: 99px;
  overflow: hidden;
}
.theme-desk .bar-track { background: #f0dce3; }
.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--pink);
}
.bar-fill.tone-swarovski { background: #c084fc; }
.bar-fill.tone-apple { background: #60a5fa; }
.bar-fill.tone-brand { background: #fbbf24; }
.bar-fill.tone-acc { background: #34d399; }
.bar-fill.tone-case { background: var(--pink); }

.src {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.src.is-shop { background: #122433; color: #9ad7ff; }
.src.is-hand { background: #2a2112; color: #ffd37a; }

.stock-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}
.stock-filters input,
.stock-filters select { min-width: 160px; flex: 1; }
.stock-filters input[type="search"] { flex: 2; min-width: 220px; }
.stock-card { padding: 0; overflow: hidden; }
.stock-wrap { max-height: calc(100vh - 240px); }
.stock { font-size: 0.92rem; }
.stock thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.stock thead a { color: inherit; text-decoration: none; }
.stock thead a:hover { color: var(--pink); }
.stock td { vertical-align: middle; }
.stock-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.stock-img.is-empty { background: #f0dce3; }
.stock-name { font-weight: 650; }
.stock-model { white-space: nowrap; font-variant-numeric: tabular-nums; }
.stock tr.is-zero { opacity: 0.62; }
.qty-form { display: flex; gap: 0.25rem; align-items: center; }
.qty-form input[type="number"] { width: 4.2rem; padding: 0.35rem 0.4rem; text-align: center; }
.theme-desk .type-pill { font-size: 0.68rem; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.grid-2 > .wide { grid-column: 1 / -1; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.05rem 1.1rem;
  margin-bottom: 0.8rem;
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.4rem; vertical-align: top; }
th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
td { border-top: 1px solid var(--line); }
tr.low td { background: #fff1f4; }
.empty { color: var(--muted); padding: 0.8rem 0; }
.actions, .inline { display: flex; gap: 0.3rem; align-items: center; }
.actions form { margin: 0; }
.actions input[type="number"] { width: 4.4rem; padding: 0.3rem 0.4rem; }
.form-row, .form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 0.7rem;
  align-items: end;
}
.form-grid { grid-template-columns: 1.4fr 1fr 0.6fr 0.7fr auto; }
.form-grid .wide { grid-column: 1 / -2; }
.search input { min-width: 220px; }
.pill {
  display: inline-block;
  background: #e8f7ef;
  color: var(--ok);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.day-banner {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius, 16px);
}
.day-banner__arrow {
  flex: 0 0 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.day-banner__arrow:hover { background: #ffe4ec; color: var(--pink); }
.day-banner__arrow.is-off { opacity: 0.35; pointer-events: none; }
.day-banner__pick {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.day-banner__current {
  pointer-events: none;
  font-weight: 700;
  font-size: 0.98rem;
}
.day-banner__pick select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}
.theme-tv .day-banner,
.theme-tv .day-banner__arrow,
.theme-tv .day-banner__pick {
  background: #1a1016;
  border-color: #2a1a22;
  color: #f6eef2;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.pdf-fab {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 30;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pink);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(255, 45, 111, 0.35);
}
.pdf-fab:hover { color: #fff; filter: brightness(1.05); }

.stock thead a, table thead a { color: inherit; text-decoration: none; }
table thead a:hover { color: var(--pink); }

@media (max-width: 980px) {
  .stats, .grid-2, .form-row, .form-grid, .type-tiles { grid-template-columns: 1fr 1fr; }
  .form-grid .wide { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; }
  .who { width: 100%; margin-left: 0; }
  .stats, .grid-2, .form-row, .form-grid { grid-template-columns: 1fr; }
  main { padding: 0.9rem; }
  .actions { flex-wrap: wrap; }
}
@media (min-width: 1400px) {
  .theme-tv { font-size: 17px; }
  .theme-tv .stat strong { font-size: 3rem; }
}
