@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f3f3f0;
  --panel: #ffffff;
  --panel-soft: #fafaf8;
  --ink: #202124;
  --muted: #6b6b68;
  --faint: #8b8b86;
  --line: #dddcd6;
  --dark: #111112;
  --accent: #f3331c;
  --accent-soft: #fff0ed;
  --green: #16733d;
  --green-soft: #e8f3ec;
  --amber: #9a5b00;
  --amber-soft: #fff4dc;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(17, 17, 18, .06);
  --font-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { font-family: var(--font-ui); font-size: 14px; line-height: 1.45; letter-spacing: 0; overflow-x: clip; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}
.admin-shell.is-collapsed { grid-template-columns: 76px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--dark);
  color: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid rgba(255,255,255,.08);
}
.sidebar__top {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 8px;
  align-items: center;
  min-height: 42px;
}
.brand {
  min-width: 0;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0;
}
.brand img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 7px;
}
.collapse-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  position: relative;
}
.collapse-btn span {
  position: absolute;
  left: 10px;
  width: 12px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .18s ease;
}
.collapse-btn span:first-child { top: 13px; transform: rotate(35deg); }
.collapse-btn span:last-child { bottom: 13px; transform: rotate(-35deg); }
.is-collapsed .collapse-btn span:first-child { transform: rotate(-35deg); }
.is-collapsed .collapse-btn span:last-child { transform: rotate(35deg); }

.nav, .channel-block { display: grid; gap: 3px; }
.channel-block {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 12px;
}
.channel-block p {
  margin: 0 9px 6px;
  color: rgba(255,255,255,.48);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}
.nav__item {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.74);
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0 9px;
  position: relative;
  font-weight: 600;
}
.nav__item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav__item.is-active {
  background: #fff;
  color: var(--dark);
}
.nav__item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.nav__item--sub { color: rgba(255,255,255,.58); }
.nav__icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  font-size: 11px;
  font-weight: 800;
}
.nav__item.is-active .nav__icon { background: var(--accent-soft); color: var(--accent); }
.nav__item b {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
}
.sidebar__footer { margin-top: auto; }
.store-pulse {
  min-height: 54px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,.04);
}
.store-pulse > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #45d66b;
  box-shadow: 0 0 0 5px rgba(69,214,107,.12);
}
.store-pulse strong, .store-pulse small { display: block; }
.store-pulse strong { font-size: 13px; }
.store-pulse small { color: rgba(255,255,255,.52); margin-top: 1px; }
.is-collapsed .nav__label,
.is-collapsed .nav__item b,
.is-collapsed .store-pulse .nav__label { display: none; }
.is-collapsed .sidebar__top { grid-template-columns: 1fr; }
.is-collapsed .collapse-btn { margin: 0 auto; }
.is-collapsed .brand,
.is-collapsed .nav__item,
.is-collapsed .store-pulse { justify-content: center; padding-left: 0; padding-right: 0; }

.main {
  min-width: 0;
  padding: 28px clamp(18px, 3vw, 36px) 56px;
}
.view { display: none; }
.view.is-active { display: block; }
.page-head {
  max-width: 1240px;
  margin: 0 auto 18px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}
.page-head--wide { max-width: 1440px; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}
h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  font-weight: 750;
}
h2 { margin-bottom: 0; font-size: 15px; line-height: 1.25; font-weight: 750; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.primary, .filters button, .filters select, .filters input, .tabs button {
  min-height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 650;
}
.filters input[hidden] { display: none; }
.primary {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.filters button.is-active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.card, .metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-grid {
  max-width: 1440px;
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metric-card {
  min-height: 118px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 8px;
}
.metric-card span,
.mini span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.metric-card strong {
  display: block;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1;
  font-weight: 780;
}
.metric-card small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-card--accent {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.metric-card--accent span,
.metric-card--accent small { color: rgba(255,255,255,.66); }

.performance-card {
  max-width: 1440px;
  margin: 0 auto 14px;
  overflow: hidden;
}
.performance-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.performance-stats article {
  min-height: 92px;
  padding: 16px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: space-between;
  gap: 6px;
}
.performance-stats article:last-child { border-right: 0; }
.performance-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.performance-stats strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 780;
}
.performance-stats small {
  min-width: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.performance-chart {
  width: 100%;
  min-height: 260px;
  display: block;
}
.chart-grid {
  stroke: #ecebe7;
  stroke-width: 1;
}
.chart-line {
  fill: none;
  stroke: #55b9cf;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-dot { fill: #55b9cf; }
.chart-label,
.chart-empty {
  fill: var(--muted);
  font-size: 12px;
  font-family: var(--font-ui);
}

.work-grid {
  max-width: 1440px;
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, .72fr);
  gap: 12px;
}
.work-grid--single { grid-template-columns: 1fr; }
.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.action-card {
  padding: 16px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.action-card button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  text-align: left;
}
.action-card strong {
  min-width: 32px;
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
}
.action-card span { color: var(--muted); font-weight: 650; }

.analytics-depth, .analytics-board {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.side-card { padding: 16px; min-width: 0; }
.bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: center;
  margin-top: 13px;
}
.bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}
.bar i {
  grid-column: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}
.bar em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.table-card, .email-layout {
  max-width: 1240px;
  margin: 0 auto;
}
.table-card { overflow: hidden; }
.table-card--home { max-width: none; }
.table-card .card-head { padding: 16px 16px 0; }
.tabs {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.tabs button.is-active { background: var(--dark); color: #fff; border-color: var(--dark); }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 750;
  background: var(--panel-soft);
}
td { color: #343437; font-size: 13px; }
td strong { color: var(--ink); font-weight: 750; }
.status {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #eeeeea;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.status--paid { background: var(--green-soft); color: var(--green); }
.status--pending { background: var(--amber-soft); color: var(--amber); }

.email-layout,
.inbox-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(300px, .9fr);
  gap: 12px;
}
.inbox-layout {
  max-width: 1240px;
  margin: 0 auto;
  grid-template-columns: minmax(280px, .45fr) minmax(0, 1fr);
  align-items: start;
}
.compose-card, .inbox-card { padding: 16px; }
form { display: grid; gap: 13px; margin-top: 14px; }
label {
  display: grid;
  gap: 7px;
  color: #343437;
  font-weight: 700;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: 0;
}
input:focus, textarea:focus {
  border-color: #9e9d98;
  box-shadow: 0 0 0 3px rgba(243,51,28,.09);
}
textarea { min-height: 220px; resize: vertical; }
.form-note, .mail-item p { color: var(--muted); }
.form-note { margin-bottom: 0; font-size: 13px; }
.mail-item {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 5px;
  margin-top: 10px;
}
.mail-item strong { font-size: 14px; }
.mail-item span { color: var(--muted); font-size: 12px; }
.mail-item p { margin-bottom: 0; font-size: 13px; }

.thread-list-card,
.thread-card { padding: 16px; }
.thread-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.thread-item {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--ink);
  padding: 10px;
  display: grid;
  gap: 2px;
  text-align: left;
}
.thread-item.is-active {
  border-color: var(--dark);
  background: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.thread-item strong,
.thread-item span,
.thread-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-item span,
.thread-item small { color: var(--muted); font-size: 12px; }
.thread-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.message-list {
  min-height: 280px;
  max-height: 52vh;
  overflow: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px 0;
}
.message {
  max-width: 78%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}
.message--outbound {
  justify-self: end;
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.message div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.message span { color: var(--muted); }
.message--outbound span { color: rgba(255,255,255,.58); }
.message p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.empty-state {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
}

.world-board {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .55fr);
  gap: 12px;
  align-items: start;
}
.map-card {
  min-height: 620px;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(circle at 45% 35%, #f8ffff 0 12%, #e5f8fb 40%, #f6f6f2 100%);
  border-radius: 999px;
  aspect-ratio: 1;
  justify-self: center;
  width: min(100%, 720px);
}
.world-map {
  width: 100%;
  height: 100%;
  min-height: 620px;
  cursor: grab;
  position: relative;
}
.world-map:active { cursor: grabbing; }
.world-map canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.globe-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  color: rgba(32,33,36,.58);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.world-side {
  display: grid;
  gap: 12px;
}

.login-page {
  min-height: 100vh;
  background: var(--dark);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(100%, 390px);
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0,0,0,.24);
  padding: 24px;
}
.login-card img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 18px;
}
.login-card h1 {
  font-size: 26px;
  margin-bottom: 18px;
}
.login-card .primary { width: 100%; }

@media (max-width: 1100px) {
  .admin-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .admin-shell .nav__label,
  .admin-shell .nav__item b,
  .admin-shell .store-pulse .nav__label { display: none; }
  .admin-shell .brand,
  .admin-shell .nav__item,
  .admin-shell .store-pulse { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar__top { grid-template-columns: 1fr; }
  .metric-grid, .performance-stats, .work-grid, .analytics-depth, .analytics-board, .world-board { grid-template-columns: 1fr 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .world-board { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .admin-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar {
    position: sticky;
    z-index: 5;
    height: auto;
    min-height: 64px;
    flex-direction: row;
    overflow-x: auto;
    grid-row: 1;
    grid-column: 1;
  }
  .sidebar__top, .channel-block, .sidebar__footer { display: none; }
  .nav { display: flex; min-width: max-content; }
  .nav__label { display: inline !important; }
  .main { grid-column: 1; padding: 20px 12px 42px; }
  .page-head { align-items: start; display: grid; }
  .metric-grid, .performance-stats, .analytics-depth, .analytics-board, .email-layout, .inbox-layout, .world-board { grid-template-columns: 1fr; }
  .table-card { overflow-x: auto; }
  .filters { align-items: center; }
  .message { max-width: 100%; }
  .map-card, .world-map { min-height: min(92vw, 420px); }
}
