/* Fuzta Fi Operations — desktop ops layout */
:root {
  --pine: #0c2b24;
  --pine-2: #14392f;
  --sand: #f1e9da;
  --cream: #eae1cf;
  --mint: #4ade9c;
  --amber: #f5a623;
  --coral: #f26b4e;
  --ink: #0c2b24;
  --muted: #6b7a70;
  --muted-2: #8fa89a;
  --line: #e0d5c0;
  --line-2: #e8dfcc;
  --sidebar-w: 224px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

h1, h2, .display {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.hidden { display: none !important; }

/* ── Login ─────────────────────────────────────────────────────────────── */
#screen-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--pine) 0%, var(--pine-2) 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(241, 233, 218, 0.12);
  border-radius: 20px;
  padding: 28px 24px;
  color: var(--sand);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-card .brand {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 6px;
}

.login-card h1 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--sand);
}

.login-card .lede {
  opacity: 0.8;
  margin: 0 0 22px;
  font-size: 15px;
}

.login-card label {
  display: block;
  font-size: 13px;
  opacity: 0.75;
  margin: 0 0 6px;
}

.login-card input {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  border-radius: 12px;
  border: 1px solid rgba(241, 233, 218, 0.2);
  background: rgba(241, 233, 218, 0.06);
  color: var(--sand);
  margin-bottom: 16px;
  font-family: inherit;
}

.login-card input:focus {
  outline: 2px solid var(--mint);
  border-color: transparent;
}

.login-card input.otp {
  letter-spacing: 0.4em;
  text-align: center;
  font-size: 22px;
}

.login-card button {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: var(--mint);
  color: var(--pine);
  cursor: pointer;
  font-family: inherit;
}

.login-card button:disabled { opacity: 0.5; cursor: default; }

.login-card button.ghost {
  background: transparent;
  color: var(--sand);
  border: 1px solid rgba(241, 233, 218, 0.2);
  margin-top: 10px;
}

.login-card .hint {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 14px;
}

.msg { min-height: 20px; font-size: 13px; margin: 4px 0 12px; }
.msg.error { color: var(--coral); }
.msg.ok { color: var(--mint); }
.panel .msg.error { color: var(--coral); }

/* ── App shell ─────────────────────────────────────────────────────────── */
#screen-app {
  display: flex;
  min-height: 100vh;
  min-width: 1100px;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--pine);
  color: var(--sand);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  box-sizing: border-box;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
}

.sidebar-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--pine-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand .name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-brand .sub {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #c9d6cd;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.nav button:hover { background: var(--pine-2); }

.nav button.active {
  background: var(--pine-2);
  color: var(--mint);
  font-weight: 600;
}

.nav .badge {
  background: var(--coral);
  color: #fff;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
}

.sidebar-foot {
  margin-top: auto;
  background: var(--pine-2);
  border-radius: 12px;
  padding: 12px;
}

.sidebar-foot .k {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
}

.sidebar-foot .v {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 3px;
  word-break: break-all;
}

.sidebar-foot .m {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 2px;
}

.sidebar-foot .logout {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(241, 233, 218, 0.15);
  background: transparent;
  color: var(--sand);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.main {
  flex: 1;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
  overflow-x: auto;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-head h1 {
  font-size: 24px;
  margin: 0;
}

.page-head .sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.filter-label select,
.inline-edit select,
.form-grid select,
.form-grid input {
  font-family: inherit;
}

.filter-label select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d8cdb8;
  background: var(--sand);
  color: var(--ink);
  font-size: 13px;
}

.page { display: none; flex-direction: column; gap: 18px; }
.page.active { display: flex; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.kpi-row.four { grid-template-columns: repeat(4, 1fr); }
.kpi-row.three { grid-template-columns: repeat(3, 1fr); }

.kpi {
  background: var(--sand);
  border-radius: 16px;
  padding: 18px;
}

.kpi.dark {
  background: var(--pine);
  color: var(--sand);
}

.kpi .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.kpi.dark .label { color: var(--muted-2); }

.kpi .value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 30px;
  font-weight: 700;
  margin-top: 4px;
}

.kpi .value .slash {
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}

.kpi.dark .value { color: var(--mint); }

.kpi .meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

.kpi.dark .meta { color: var(--muted-2); }

.kpi.compact {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi.compact .value { font-size: 22px; margin-top: 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.chip span {
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
}

.panel {
  background: var(--sand);
  border-radius: 16px;
  padding: 20px 22px;
}

.panel.dark {
  background: var(--pine);
  color: var(--sand);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.panel-sub {
  font-size: 12px;
  color: var(--muted);
}

.panel.dark .panel-sub { color: var(--muted-2); }

.grid-2 {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}

.grid-2.equal { grid-template-columns: 1fr 1fr; }

.stack { display: flex; flex-direction: column; gap: 16px; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.funnel.wide { margin-top: 8px; }

.funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.funnel-label {
  width: 150px;
  font-size: 12.5px;
  font-weight: 500;
  text-align: right;
  color: #3d4a42;
  flex-shrink: 0;
}

.funnel.wide .funnel-label { width: 180px; }

.panel.dark .funnel-label { color: var(--muted-2); }

.funnel-track {
  flex: 1;
  height: 30px;
  background: #e0d5c0;
  border-radius: 8px;
  overflow: hidden;
}

.panel.dark .funnel-track { background: rgba(241, 233, 218, 0.12); }

.funnel-bar {
  height: 100%;
  background: var(--pine-2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  box-sizing: border-box;
  min-width: 0;
}

.funnel-bar span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sand);
  white-space: nowrap;
}

.funnel-bar.amber { background: var(--amber); }
.funnel-bar.mint { background: var(--mint); }
.funnel-bar.mint span { color: var(--pine); }
.funnel-bar.coral { background: var(--coral); }

.funnel-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* Charts */
.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.legend span { display: inline-flex; align-items: center; gap: 6px; }

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.swatch.pine { background: var(--pine-2); }
.swatch.mint { background: var(--mint); }
.swatch.amber { background: var(--amber); }

.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 180px;
  margin-top: 18px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.chart-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  width: 100%;
  justify-content: center;
}

.chart-bar {
  width: 10px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--pine-2);
}

.chart-bar.mint { background: var(--mint); }
.chart-bar.amber { background: var(--amber); }

.chart-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Alerts */
.alert {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: flex-start;
}

.alert .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--amber);
}

.alert .dot.critical,
.alert .dot.high,
.alert .dot.warn { background: var(--coral); }

.alert .title { font-size: 13px; font-weight: 600; }
.alert .body { font-size: 12px; color: var(--muted); }

.empty {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
}

/* Revenue split */
.split-bar {
  display: flex;
  height: 14px;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 14px;
  background: rgba(241, 233, 218, 0.12);
}

.split-bar > div { height: 100%; }
.split-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  font-size: 12.5px;
}

.split-rows .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.split-rows .amt {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 8px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data.dense { font-size: 12.5px; }

table.data th {
  text-align: left;
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 13px 8px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}

table.data.dense td { padding: 10px 6px; }

table.data tr:hover td { background: #ece3d0; }

table.data .name { font-weight: 600; }
table.data .mono {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

.status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.status.live,
.status.active { color: #1e8a5f; }
.status.offline { color: var(--coral); }
.status.busy,
.status.review { color: #c47d0e; }
.status.ended,
.status.paused { color: var(--muted); }

.coupon-chip {
  border: 1px dashed var(--amber);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #a06a0a;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--pine);
  color: var(--sand);
}

.btn:disabled { opacity: 0.5; cursor: default; }

.btn.ghost {
  background: var(--sand);
  color: var(--ink);
  border: 1px solid #d8cdb8;
}

.btn.mint { background: var(--mint); color: var(--pine); }
.btn.amber { background: var(--amber); color: var(--pine); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.link {
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-decoration: underline;
  font-weight: 500;
  font-size: 11px;
}

.inline-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-edit input,
.inline-edit select {
  width: 110px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d8cdb8;
  background: #fff;
  font-size: 12px;
}

.inline-edit select { width: auto; min-width: 100px; }

.geo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.page-error {
  background: rgba(242, 107, 78, 0.12);
  color: var(--coral);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 43, 36, 0.55);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  background: var(--cream);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.form-grid input,
.form-grid select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d8cdb8;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}

.form-grid .span-2 { grid-column: 1 / -1; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.form-actions .msg { margin: 0; flex: 1; }
