:root {
  --ink: #0a0908;
  --ink-2: #100e0c;
  --ink-3: #17140f;
  --line: rgba(245, 239, 230, 0.12);
  --cream: #f7f2e9;
  --muted: rgba(247, 242, 233, 0.58);
  --gold: #d9a441;
  --gold-lt: #f3d494;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* `hidden` must win over the display rules below (login is display: grid). */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(217, 164, 65, 0.09), transparent 60%),
    var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.3rem;
}
.brand small {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-lt);
  padding-top: 4px;
}
.brand .divider { color: rgba(247, 242, 233, 0.3); }
.logo-mark {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff6dd, var(--gold) 55%, #b8842a);
  box-shadow: 0 0 16px rgba(217, 164, 65, 0.7);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 500 0.84rem/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }

.btn-gold {
  width: 100%;
  background: linear-gradient(135deg, #f6dba4, var(--gold) 55%, #b8842a);
  color: #1a1305;
  font-weight: 600;
  box-shadow: 0 16px 34px -20px rgba(217, 164, 65, 0.9);
}
.btn-ghost {
  border-color: rgba(247, 242, 233, 0.2);
  color: var(--cream);
  background: rgba(247, 242, 233, 0.04);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-lt); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-lt);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.16);
}

/* ---------------- Login ---------------- */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.login-card {
  width: min(430px, 100%);
  padding: clamp(28px, 5vw, 44px);
  background: linear-gradient(168deg, rgba(30, 25, 18, 0.95), rgba(12, 11, 9, 0.98));
  border: 1px solid rgba(247, 242, 233, 0.14);
  border-radius: 22px;
  box-shadow: 0 40px 90px -40px #000;
}
.login-card h1 { font-size: 2rem; margin: 22px 0 8px; }
.login-card .sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 26px; }

.login-card label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.pw-wrap { position: relative; margin-bottom: 16px; }
.pw-wrap input { padding-right: 70px; }

input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(247, 242, 233, 0.04);
  border: 1px solid rgba(247, 242, 233, 0.16);
  border-radius: 10px;
  color: var(--cream);
  font: 400 0.92rem/1.4 var(--sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder { color: rgba(247, 242, 233, 0.32); }
input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.14);
}

.pw-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--gold-lt);
  font: 500 0.74rem/1 var(--sans);
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 8px;
}
.pw-toggle:hover { background: rgba(217, 164, 65, 0.1); }

.err {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: #f0a08a;
  text-align: center;
}
.fine { margin: 18px 0 0; font-size: 0.72rem; color: rgba(247, 242, 233, 0.4); text-align: center; }
.back {
  display: block;
  margin-top: 20px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
}
.back:hover { color: var(--gold-lt); }

/* ---------------- Header ---------------- */
.adm-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px clamp(16px, 4vw, 40px);
  background: rgba(10, 9, 8, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.adm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-actions .btn { padding: 10px 18px; font-size: 0.78rem; }

.adm-main {
  width: min(1240px, 100% - 40px);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 48px) 0 80px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.stamp { margin: 0; font-size: 0.76rem; color: rgba(247, 242, 233, 0.4); }

/* ---------------- KPIs ---------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(247, 242, 233, 0.03);
}
.kpi-accent {
  border-color: rgba(217, 164, 65, 0.35);
  background: rgba(217, 164, 65, 0.07);
}
.kpi-label {
  margin: 0 0 8px;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-value { margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.1; }
.kpi-foot { margin: 4px 0 0; font-size: 0.74rem; color: rgba(247, 242, 233, 0.45); }

/* ---------------- Panel / tables ---------------- */
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247, 242, 233, 0.035), rgba(247, 242, 233, 0.015));
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 6px; }
.tab {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 500 0.84rem/1 var(--sans);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab:hover { color: var(--cream); }
.tab.is-active { background: var(--cream); color: #14110c; }

.panel-tools { display: flex; gap: 8px; align-items: center; }
.panel-tools input {
  width: 240px;
  padding: 10px 14px;
  font-size: 0.84rem;
}
.panel-tools .btn { padding: 10px 16px; font-size: 0.78rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(245, 239, 230, 0.06);
  vertical-align: middle;
  color: rgba(247, 242, 233, 0.82);
}
tbody tr:hover { background: rgba(247, 242, 233, 0.03); }
tbody tr:last-child td { border-bottom: 0; }
td.strong { color: var(--cream); font-weight: 500; }
td.num { font-variant-numeric: tabular-nums; }
td.when { color: rgba(247, 242, 233, 0.45); font-size: 0.76rem; white-space: nowrap; }
td.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.74rem; color: var(--gold-lt); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-pending { color: #f0c96b; background: rgba(217, 164, 65, 0.12); border-color: rgba(217, 164, 65, 0.35); }
.badge-confirmed { color: #93d6a4; background: rgba(93, 196, 118, 0.12); border-color: rgba(93, 196, 118, 0.3); }
.badge-declined { color: #e7a79a; background: rgba(214, 110, 90, 0.12); border-color: rgba(214, 110, 90, 0.3); }
.badge-received { color: #9fd0e8; background: rgba(120, 180, 210, 0.12); border-color: rgba(120, 180, 210, 0.28); }

.row-actions { display: flex; gap: 6px; }
.mini {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  font: 500 0.72rem/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.mini:hover { border-color: var(--gold); color: var(--gold-lt); }
.mini-confirm { border-color: rgba(93, 196, 118, 0.4); color: #a8e0b7; }
.mini-confirm:hover { background: rgba(93, 196, 118, 0.14); border-color: #93d6a4; color: #c6f0d1; }

.empty { margin: 0; padding: 44px 20px; text-align: center; color: var(--muted); font-size: 0.88rem; }
.panel-foot {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: rgba(247, 242, 233, 0.4);
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 140%);
  z-index: 50;
  padding: 13px 20px;
  border-radius: 999px;
  background: rgba(247, 242, 233, 0.97);
  color: #17130a;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 20px 50px -20px #000;
  transition: transform 0.4s cubic-bezier(0.2, 1.2, 0.4, 1);
  max-width: calc(100% - 32px);
}
.toast.is-visible { transform: translate(-50%, 0); }

/* ---------------- Lineup + charges ---------------- */
.panel-title { margin: 4px 0 0; font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.lineup-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}
.lineup-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 242, 233, 0.03);
}
.lineup-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  display: block;
}
.lineup-name { margin: 2px 0 0; font-size: 0.88rem; font-weight: 500; color: var(--cream); }
.lineup-note { margin: 0 0 4px; font-size: 0.7rem; color: rgba(247, 242, 233, 0.45); }
.lineup-item .mini { width: 100%; text-align: center; }
.file-btn { cursor: pointer; display: block; }

/* Editable lineup rows */
.lineup-body { display: flex; flex-direction: column; gap: 5px; }
.lineup-body label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(247, 242, 233, 0.45); }
.lineup-body input,
.lineup-body select {
  width: 100%;
  padding: 7px 9px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.8rem;
}
.lineup-body input:focus,
.lineup-body select:focus { outline: none; border-color: var(--gold); }
.lineup-actions { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.lineup-photo-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(160deg, #221d16, #12100d);
  color: var(--gold-lt);
  font-family: var(--serif);
  font-size: 1.6rem;
}
.lineup-add {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.2fr auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}
.lineup-add label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(247, 242, 233, 0.45);
}
.lineup-add input,
.lineup-add select {
  width: 100%;
  padding: 10px 12px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.85rem;
}
.lineup-add input:focus,
.lineup-add select:focus { outline: none; border-color: var(--gold); }
.mini.primary { background: var(--gold); border-color: var(--gold); color: #14100a; }
.mini.primary:hover { background: var(--gold-lt); border-color: var(--gold-lt); color: #14100a; }
@media (max-width: 760px) { .lineup-add { grid-template-columns: 1fr; } }

.pricing-rows { display: grid; gap: 14px; padding: 18px; }
.pricing-row {
  display: grid;
  grid-template-columns: 1.1fr 0.5fr 2fr;
  gap: 12px;
  align-items: end;
}
.pricing-row label {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.pricing-row input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(247, 242, 233, 0.05);
  border: 1px solid rgba(247, 242, 233, 0.16);
  border-radius: 10px;
  color: var(--cream);
  font: 400 0.85rem/1.4 var(--sans);
}
.pricing-row input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.14);
}

@media (max-width: 900px) {
  .lineup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-row { grid-template-columns: 1fr; }
}

/* ---------------- Deposit ledger ---------------- */
.deposit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(217, 164, 65, 0.045);
}
.deposit-form label {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.deposit-form input,
.deposit-form select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(247, 242, 233, 0.05);
  border: 1px solid rgba(247, 242, 233, 0.16);
  border-radius: 10px;
  color: var(--cream);
  font: 400 0.85rem/1.4 var(--sans);
}
.deposit-form select { cursor: pointer; }
.deposit-form input:focus,
.deposit-form select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.14);
}
.deposit-form .form-actions {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.deposit-form .btn { width: auto; padding: 11px 20px; }
.deposit-form .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  cursor: pointer;
}
.deposit-form .check input { width: auto; margin: 0; }

@media (max-width: 1100px) {
  .deposit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deposit-form .form-actions { grid-column: span 2; }
}

@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .panel-tools input { width: 180px; }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .panel-tools { width: 100%; }
  .panel-tools input { flex: 1; width: auto; }
  .adm-main { width: calc(100% - 28px); }
  .adm-actions .btn { padding: 9px 14px; }
  .deposit-form { grid-template-columns: 1fr; }
  .lineup-grid { grid-template-columns: 1fr; }
  .deposit-form .form-actions { grid-column: span 1; flex-wrap: wrap; justify-content: flex-start; }
}
