:root {
  --ink: #101820;
  --muted: #6f777d;
  --paper: #f3f1ec;
  --card: #fff;
  --line: #dedbd3;
  --orange: #f36a2d;
  --orange-soft: #ffe5d8;
  --green: #2b9b70;
  --green-soft: #dff3e9;
  --blue: #4f6fdc;
  --shadow: 0 18px 45px rgba(16, 24, 32, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
}
em { color: var(--orange); font-family: Georgia, serif; font-weight: 400; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, .85fr) 1.15fr;
  background: #fff;
}
.login-card {
  width: min(100%, 520px);
  margin: auto;
  padding: 72px;
}
.brand-mark, .brand-symbol {
  display: inline-flex;
  align-items: end;
  gap: 4px;
}
.brand-mark { margin-bottom: 56px; }
.brand-mark span, .brand-symbol i {
  display: block;
  width: 7px;
  background: var(--orange);
  border-radius: 5px;
  transform: skew(-18deg);
}
.brand-mark span:nth-child(1), .brand-symbol i:nth-child(1) { height: 16px; }
.brand-mark span:nth-child(2), .brand-symbol i:nth-child(2) { height: 24px; }
.brand-mark span:nth-child(3), .brand-symbol i:nth-child(3) { height: 34px; }
.login-card h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 68px);
  line-height: .98;
  letter-spacing: -.055em;
}
.login-copy {
  max-width: 390px;
  margin: 26px 0 38px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}
.login-card label, .filters label {
  display: grid;
  gap: 8px;
  color: #555e64;
  font-size: 12px;
  font-weight: 700;
}
.password-field { position: relative; }
.password-field input {
  width: 100%;
  height: 54px;
  padding: 0 70px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}
.password-field input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.icon-button {
  position: absolute;
  right: 8px;
  top: 8px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.primary-button {
  width: 100%;
  height: 54px;
  margin-top: 12px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--orange);
  font-weight: 800;
  transition: transform .2s, box-shadow .2s;
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(243, 106, 45, .28); }
.form-error { min-height: 20px; margin: 8px 0 0; color: #c33b2c; font-size: 13px; }
.security-note { margin-top: 24px; color: #8c9397; font-size: 11px; text-align: center; }
.security-note span { color: var(--green); margin-right: 7px; }
.login-art {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 55% 45%, rgba(243, 106, 45, .22), transparent 25%),
    linear-gradient(145deg, #101820, #1c2931);
}
.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .28;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 56px 56px;
}
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.orbit-one { width: 680px; height: 680px; left: 13%; top: 9%; }
.orbit-two { width: 420px; height: 420px; left: 30%; top: 27%; border-color: rgba(243,106,45,.38); }
.pulse-card {
  position: absolute;
  width: 190px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,.08);
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  backdrop-filter: blur(14px);
}
.pulse-card small { color: #aeb8bd; font-size: 10px; letter-spacing: .14em; }
.pulse-card strong { display: block; margin: 9px 0 2px; font-size: 34px; }
.pulse-card span { color: #ff9b6d; font-size: 12px; }
.pulse-card-one { left: 22%; top: 33%; transform: rotate(-5deg); }
.pulse-card-two { right: 13%; top: 47%; transform: rotate(6deg); }
.art-caption {
  position: absolute;
  left: 9%;
  bottom: 9%;
  color: rgba(255,255,255,.88);
  font-family: Georgia, serif;
  font-size: clamp(28px, 3vw, 48px);
}

.topbar {
  height: 74px;
  padding: 0 clamp(22px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(243,241,236,.88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 900; letter-spacing: -.02em; }
.brand b { color: var(--muted); font-weight: 500; }
.brand-symbol i { width: 4px; }
.brand-symbol i:nth-child(1) { height: 10px; }
.brand-symbol i:nth-child(2) { height: 15px; }
.brand-symbol i:nth-child(3) { height: 21px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.source-badge, .info-pill {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.5);
  font-size: 11px;
  font-weight: 700;
}
.secondary-button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}
.secondary-button:hover { border-color: var(--orange); }
.sync-icon { color: var(--orange); font-size: 16px; margin-right: 4px; }
.avatar-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 800;
}
.dashboard { max-width: 1500px; margin: auto; padding: 48px clamp(22px, 4vw, 64px) 72px; }
.hero-row { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
.hero-row h1 { margin: 0; font-size: clamp(36px, 4vw, 58px); letter-spacing: -.05em; }
.muted { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.filters { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.filters input, .filters select {
  height: 40px;
  min-width: 132px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.filters input:focus, .filters select:focus { border-color: var(--orange); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-card {
  position: relative;
  min-height: 176px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.kpi-dark { color: #fff; background: var(--ink); border-color: var(--ink); }
.kpi-heading { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.kpi-dark .kpi-heading { color: #a7b0b4; }
.trend { color: #aab1b5; text-transform: none; letter-spacing: 0; }
.trend.positive { color: var(--green); }
.kpi-card > strong { display: block; margin-top: 22px; font-size: clamp(28px, 2.4vw, 40px); letter-spacing: -.045em; }
.kpi-card > p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.kpi-dark > p { color: #aab3b7; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 5px rgba(43,155,112,.12); }
.status-dot.green { background: var(--green); }
.status-dot.orange { background: var(--orange); box-shadow: 0 0 0 5px rgba(243,106,45,.12); }
.kpi-rule { position: absolute; left: 22px; right: 22px; bottom: 19px; height: 4px; border-radius: 4px; background: #ecf0ed; }
.kpi-rule span { display: block; width: 82%; height: 100%; border-radius: inherit; background: var(--green); }
.orange-rule span { width: 18%; background: var(--orange); }
.spark-bars { position: absolute; right: 18px; bottom: 17px; height: 46px; display: flex; align-items: end; gap: 5px; opacity: .45; }
.spark-bars i { width: 5px; border-radius: 4px; background: var(--orange); }
.spark-bars i:nth-child(1) { height: 12px; }.spark-bars i:nth-child(2) { height: 22px; }.spark-bars i:nth-child(3) { height: 17px; }.spark-bars i:nth-child(4) { height: 32px; }.spark-bars i:nth-child(5) { height: 26px; }.spark-bars i:nth-child(6) { height: 40px; }.spark-bars i:nth-child(7) { height: 35px; }
.conversion-dots { position: absolute; right: 22px; bottom: 22px; width: 38px; height: 38px; border: 8px dotted var(--orange-soft); border-radius: 50%; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr); gap: 14px; margin-top: 14px; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.panel-header { padding: 22px 24px 16px; display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.panel-header h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.chart-panel { min-height: 420px; }
.chart-wrap { position: relative; height: 320px; padding: 8px 18px 22px; }
#sales-chart { width: 100%; height: 100%; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend .gross { background: var(--orange); }.legend .net { background: var(--green); }
.funnel-summary { padding: 3px 24px 16px; display: flex; align-items: baseline; gap: 8px; }
.funnel-summary strong { font-size: 34px; }.funnel-summary span { color: var(--muted); font-size: 12px; }
.funnel-list { padding: 0 24px 24px; display: grid; gap: 14px; }
.funnel-row { display: grid; grid-template-columns: 94px 1fr 36px; align-items: center; gap: 10px; }
.funnel-row label { color: var(--muted); font-size: 12px; }
.funnel-row b { font-size: 12px; text-align: right; }
.funnel-track { height: 9px; overflow: hidden; border-radius: 8px; background: #eeece7; }
.funnel-track span { display: block; height: 100%; border-radius: inherit; }
.rates-panel, .reconciliation-panel { grid-column: 1 / -1; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 24px; border-top: 1px solid #ece9e3; text-align: left; white-space: nowrap; font-size: 12px; }
th { color: var(--muted); background: #faf9f6; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.rate-badge { display: inline-block; min-width: 62px; padding: 5px 8px; border-radius: 6px; text-align: center; color: #9c431c; background: var(--orange-soft); font-weight: 800; }
.rate-badge.pending { color: #6f777d; background: #ecebe7; }
.panel-note { margin: 0; padding: 15px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.text-button { border: 0; color: var(--orange); background: transparent; font-size: 11px; font-weight: 800; }
.empty-state { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
}

@media (max-width: 1050px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .rates-panel, .reconciliation-panel { grid-column: auto; }
  .hero-row { align-items: start; flex-direction: column; }
}
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-card { padding: 42px 28px; }
  .login-art { display: none; }
  .topbar { padding: 0 18px; }
  .source-badge { display: none; }
  .secondary-button { width: 38px; padding: 0; font-size: 0; }
  .sync-icon { margin: 0; }
  .dashboard { padding: 32px 16px 48px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .filters input, .filters select { width: 100%; min-width: 0; }
  .kpi-grid { grid-template-columns: 1fr; }
  .panel-header { flex-direction: column; }
  .legend { flex-wrap: wrap; }
  th, td { padding: 12px 16px; }
}
