/* SellerDesk UI: navy header band, white rounded cards, periwinkle accents. */
:root {
  --navy-900: #171b29;
  --navy-800: #1e2334;
  --navy-700: #2a3045;
  --navy-600: #363d55;
  --bg: #f2f3f7;
  --card: #ffffff;
  --border: #e8e9f0;
  --text: #1d2130;
  --muted: #8b90a3;
  --primary: #5b6ccf;
  --primary-600: #4c5cc0;
  --primary-50: #eceffc;
  --track: #e3e5ee;
  --success: #1f9d62;
  --success-50: #e3f6ec;
  --danger: #e15b5b;
  --danger-50: #fdeaea;
  --warning: #c98a12;
  --warning-50: #fdf3dc;
  --info: #3f7fd8;
  --info-50: #e6f0fd;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 27, 41, .04), 0 8px 24px rgba(23, 27, 41, .05);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Header band ---------- */
.band {
  position: relative; background: var(--navy-800); color: #fff;
  padding: 0 0 120px; overflow: hidden;
}
.band::after {
  content: ""; position: absolute; inset: 0 0 0 30%;
  background: url("../img/wave.svg") right center / cover no-repeat;
  opacity: .9; pointer-events: none;
}
.band > * { position: relative; z-index: 1; }
.shell { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

.topbar { display: flex; align-items: center; gap: 32px; height: 84px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #7d8cf0, #5b6ccf); box-shadow: 0 4px 14px rgba(91,108,207,.45);
}
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: #9aa0b8; margin-top: -2px; }

.nav { display: flex; gap: 6px; flex: 1; }
.nav a {
  padding: 9px 18px; border-radius: 999px; color: #b7bcd0; font-weight: 500; transition: .15s;
}
.nav a:hover { color: #fff; }
.nav a.active { background: var(--navy-600); color: #fff; }

.top-actions { display: flex; align-items: center; gap: 12px; }
.search {
  display: flex; align-items: center; gap: 10px; background: var(--navy-700); border-radius: 999px;
  padding: 0 18px; height: 42px; width: 240px; color: #9aa0b8;
}
.search input { background: none; border: 0; outline: 0; color: #fff; width: 100%; font: inherit; }
.search input::placeholder { color: #8a90a8; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; background: var(--navy-700); border: 0;
  display: grid; place-items: center; color: #d6d9e6;
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, #8996f2, #5b6ccf); color: #fff; border: 2px solid var(--navy-600);
}
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; color: #9aa0b8; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .menu {
  position: absolute; right: 0; top: 52px; background: #fff; color: var(--text); border-radius: 12px;
  box-shadow: var(--shadow); min-width: 220px; padding: 8px; z-index: 20;
}
.user-menu .menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu .menu .who small { color: var(--muted); display: block; }
.user-menu .menu button, .user-menu .menu a {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px;
}
.user-menu .menu button:hover, .user-menu .menu a:hover { background: var(--bg); }

.welcome { margin: 26px 0 22px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.welcome small { display: block; font-size: 14px; font-weight: 400; color: #9aa0b8; margin-top: 4px; }
.subtabs { display: flex; gap: 8px; border-bottom: 1px solid rgba(255,255,255,.12); max-width: 560px; }
.subtabs a { padding: 12px 24px; color: #9aa0b8; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a.active { color: #fff; border-color: #fff; }

/* ---------- Page body ---------- */
.page { margin-top: -96px; padding-bottom: 48px; position: relative; z-index: 2; }
.grid { display: grid; gap: 20px; }
.grid-dash { grid-template-columns: 300px 1fr; align-items: start; }
.grid-kpi { grid-template-columns: repeat(4, 1fr); }
.stack { display: grid; gap: 20px; }
@media (max-width: 1100px) {
  .grid-dash { grid-template-columns: 1fr; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .search { display: none; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .grid-kpi { grid-template-columns: 1fr; }
}

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title { font-size: 16px; font-weight: 600; margin: 0; }
.card-sub { color: var(--muted); font-size: 13px; }

.kpi-label { color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 8px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.kpi-icon.indigo { background: var(--primary-50); color: var(--primary); }
.kpi-icon.rose { background: var(--danger-50); color: var(--danger); }
.delta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.delta b { font-weight: 600; }
.delta.up b, .delta.up svg { color: var(--success); }
.delta.down b, .delta.down svg { color: var(--danger); }

.balance-label { color: var(--muted); }
.balance { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; transition: .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: #cfd2df; }
.btn-ghost { background: none; color: var(--muted); padding: 0 10px; }
.btn-danger-ghost { background: none; color: var(--danger); padding: 0 10px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Selects as small pills (like the "Weeks" dropdown) */
.pill-select {
  height: 30px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 12px;
  background: #fff; color: var(--text);
}

/* Progress bars */
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.bar.success > span { background: var(--success); }
.bar.warn > span { background: var(--warning); }
.bar.danger > span { background: var(--danger); }
.seg { display: flex; gap: 4px; }
.seg > span { height: 8px; border-radius: 999px; }
.legend { display: flex; justify-content: space-between; margin-top: 12px; gap: 8px; }
.legend div { font-size: 12px; color: var(--muted); }
.legend b { display: block; color: var(--text); font-size: 14px; margin-top: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* Channel tiles (left column list) */
.tile { border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.tile + .tile { margin-top: 12px; }
.tile-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tile-head .name { font-weight: 600; }
.tile-head .meta { font-size: 12px; color: var(--muted); }
.tile-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.tile-foot b { color: var(--text); font-size: 13px; }
.ch-logo {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: #fff; border: 1px solid var(--border); padding: 6px; overflow: hidden;
}
.ch-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 0 12px 14px; border-bottom: 1px solid var(--border); }
.table td { padding: 16px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .cell-main { display: flex; align-items: center; gap: 12px; }
.table .cell-main small, .table td small { display: block; color: var(--muted); font-size: 12px; }
.table .num { text-align: right; }

/* Badges */
.badge { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.success { background: var(--success-50); color: var(--success); }
.badge.danger { background: var(--danger-50); color: var(--danger); }
.badge.warning { background: var(--warning-50); color: var(--warning); }
.badge.info { background: var(--info-50); color: var(--info); }
.badge.muted { background: #eef0f4; color: var(--muted); }
.badge.outline { background: none; border: 1px solid var(--border); color: var(--muted); }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 500; font-size: 13px; }
.field small { color: var(--muted); font-size: 12px; }
.input {
  height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px; font: inherit;
  background: #fff; color: var(--text); width: 100%;
}
.input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.error { color: var(--danger); font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.alert { border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; background: var(--success-50); color: #13784a; font-weight: 500; }

/* Platform picker */
.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.platform-opt { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; gap: 12px; align-items: center; }
.platform-opt.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.platform-opt small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 720px) { .platforms { grid-template-columns: 1fr; } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 6px; }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-wrap .band { padding-bottom: 180px; }
.auth-card { max-width: 460px; margin: -150px auto 48px; position: relative; z-index: 2; }
.auth-card .card { padding: 32px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); }
.auth-foot a { color: var(--primary); font-weight: 600; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Filters, tabs, pager */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 18px; }
.filters .field { margin: 0; }
.filters .input { height: 40px; min-width: 140px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 500; }
.tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tabs a b { margin-left: 6px; font-weight: 600; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; color: var(--muted); font-size: 13px; }
.pager .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.neg { color: var(--danger); }
.pos { color: var(--success); }
.dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.dl .total { border-top: 1px solid var(--border); padding-top: 10px; font-weight: 600; color: var(--text); }
.note { background: var(--primary-50); color: var(--text); border-radius: 12px; padding: 12px 16px; font-size: 13px; margin-bottom: 18px; }

/* Admin */
.impersonating { background: var(--warning-50); color: #7a4b00; display: flex; justify-content: center; align-items: center; gap: 16px; padding: 10px 16px; font-size: 13px; }
.impersonating button { background: #7a4b00; color: #fff; border: 0; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.alert-danger { background: var(--danger-50); color: var(--danger); }
.creds { border: 1px dashed var(--primary); background: var(--primary-50); border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; }
.creds code { font-size: 15px; font-weight: 600; background: #fff; padding: 2px 8px; border-radius: 6px; }
.logos { display: flex; gap: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
