:root {
  --bg: #07101c;
  --bg-soft: #0b1625;
  --panel: rgba(13, 28, 46, 0.78);
  --panel-solid: #0e1c2d;
  --border: rgba(255,255,255,.08);
  --text: #eef4f7;
  --muted: #8ea2b4;
  --accent: #73d6c3;
  --accent-2: #d0ad73;
  --danger: #ff7979;
  --warning: #f1c66a;
  --success: #62d4a7;
  --shadow: 0 20px 50px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(75,137,164,.14), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(115,214,195,.10), transparent 28%),
    var(--bg);
  color: var(--text);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ambient { position: fixed; filter: blur(90px); opacity: .22; pointer-events: none; z-index: 0; }
.ambient-a { width: 300px; height: 300px; background: #1d6c77; top: -80px; left: -80px; }
.ambient-b { width: 340px; height: 340px; background: #87623b; right: -100px; bottom: -120px; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.eyebrow, .section-kicker { letter-spacing: .18em; text-transform: uppercase; font-size: .72rem; color: var(--accent); font-weight: 800; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.login-card { width: min(460px, 100%); border: 1px solid var(--border); border-radius: 28px; padding: 36px; background: linear-gradient(180deg, rgba(16,33,52,.94), rgba(8,20,34,.96)); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.brand-mark { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; font-weight: 900; font-size: 1.4rem; color: #082019; background: linear-gradient(135deg, var(--accent), #b4eadf); box-shadow: 0 12px 24px rgba(115,214,195,.18); margin-bottom: 22px; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 13px; margin: 0; font-size: 1rem; }
.login-card h1 { margin: 4px 0 10px; font-size: clamp(2rem, 5vw, 2.8rem); }
.login-form { display: grid; gap: 16px; margin-top: 28px; }
.login-form label { display: grid; gap: 8px; font-size: .88rem; color: #c6d2da; }
.login-form input { width: 100%; border: 1px solid var(--border); background: #081523; color: var(--text); border-radius: 14px; padding: 14px 15px; outline: none; }
.login-form input:focus { border-color: rgba(115,214,195,.65); box-shadow: 0 0 0 3px rgba(115,214,195,.08); }
.form-error { min-height: 20px; margin: 0; color: var(--danger); font-size: .84rem; }

.button { border: 0; border-radius: 13px; padding: 11px 16px; font-weight: 750; transition: transform .16s ease, opacity .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-primary { background: linear-gradient(135deg, var(--accent), #8be3d2); color: #072018; }
.button-secondary { background: #14283e; color: #e9f3f7; border: 1px solid var(--border); }
.button-ghost { background: transparent; border: 1px solid var(--border); color: #c9d5dd; width: 100%; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); position: relative; z-index: 1; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 18px; border-right: 1px solid var(--border); background: rgba(5,15,26,.88); backdrop-filter: blur(18px); display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 28px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.nav-list { display: grid; gap: 7px; }
.nav-item { text-decoration: none; color: #9fb0be; padding: 11px 12px; border-radius: 12px; font-size: .9rem; font-weight: 650; }
.nav-item:hover, .nav-item.active { background: rgba(115,214,195,.08); color: #eafbf7; }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.sync-badge { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 11px; color: var(--muted); font-size: .78rem; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: #71808b; box-shadow: 0 0 0 4px rgba(113,128,139,.1); }
.sync-badge.ok .sync-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(98,212,167,.1); }
.sync-badge.warning .sync-dot { background: var(--warning); box-shadow: 0 0 0 4px rgba(241,198,106,.1); }
.sync-badge.error .sync-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,121,121,.1); }

.content { min-width: 0; padding: 28px 34px 70px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 34px; }
.topbar h2 { margin: 5px 0 6px; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.topbar-actions { display: flex; gap: 10px; }
.select { border: 1px solid var(--border); background: #102136; color: var(--text); border-radius: 13px; padding: 10px 13px; outline: none; }
.section-stack { margin-top: 34px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 15px; }
.section-head h3 { margin: 5px 0 0; font-size: 1.35rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.kpi-card { min-height: 128px; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(180deg, rgba(17,35,55,.9), rgba(11,25,42,.9)); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.kpi-card.accent { background: linear-gradient(135deg, rgba(35,105,104,.5), rgba(15,42,54,.95)); }
.kpi-card span, .kpi-card small { display: block; color: var(--muted); }
.kpi-card span { font-size: .82rem; font-weight: 650; }
.kpi-card strong { display: block; margin: 9px 0 8px; font-size: clamp(1.45rem, 2.4vw, 2rem); letter-spacing: -.03em; }
.kpi-card small { font-size: .73rem; }

.panel { border: 1px solid var(--border); border-radius: 18px; background: var(--panel); box-shadow: 0 14px 40px rgba(0,0,0,.13); backdrop-filter: blur(14px); }
.panel-head { display: flex; justify-content: space-between; gap: 16px; padding: 18px 18px 0; }
.panel-head h4 { margin: 0 0 4px; font-size: .98rem; }
.chart-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 14px; }
.chart-wrap { height: 300px; padding: 14px 16px 16px; }

.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab { border: 1px solid var(--border); background: #0c1c2c; color: var(--muted); padding: 9px 13px; border-radius: 11px; font-weight: 750; }
.tab.active { background: rgba(115,214,195,.1); color: #eafbf7; border-color: rgba(115,214,195,.28); }
.table-view { display: none; }
.table-view.active { display: block; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: .82rem; }
th { color: #88a1b2; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; font-weight: 800; }
td { color: #dce7ed; }
tbody tr:last-child td { border-bottom: 0; }
.empty-row td { text-align: center; color: var(--muted); padding: 26px; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: .7rem; font-weight: 800; background: rgba(255,255,255,.06); }
.status-pill.approved { color: #82e3bc; background: rgba(98,212,167,.1); }
.status-pill.waiting_payment { color: #f0cf86; background: rgba(241,198,106,.1); }
.status-pill.refunded, .status-pill.chargeback, .status-pill.rejected { color: #ff9d9d; background: rgba(255,121,121,.1); }
.toast { position: fixed; right: 22px; bottom: 22px; padding: 12px 14px; border-radius: 12px; background: #102438; border: 1px solid var(--border); box-shadow: var(--shadow); color: #dceaf0; font-size: .84rem; z-index: 20; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); display: block; padding: 16px; }
  .sidebar-brand { padding-bottom: 14px; }
  .nav-list { grid-template-columns: repeat(4, 1fr); overflow-x: auto; }
  .nav-item { white-space: nowrap; text-align: center; }
  .sidebar-foot { margin-top: 14px; grid-template-columns: 1fr auto; }
  .button-ghost { width: auto; }
  .content { padding: 22px 18px 60px; }
  .topbar { flex-direction: column; }
  .topbar-actions { width: 100%; }
  .select, .topbar-actions .button { flex: 1; }
}
@media (max-width: 560px) {
  .login-card { padding: 26px 22px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .nav-list { grid-template-columns: repeat(2, 1fr); }
  .sidebar-foot { grid-template-columns: 1fr; }
  .button-ghost { width: 100%; }
}
