@font-face {
  font-family: Geist;
  src: url("/assets/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font: Geist, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --bg: #f6f6f9;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f2f2f6;
  --ink: #16161a;
  --ink-2: #464652;
  --muted: #767686;
  --line: #e7e7ee;
  --line-strong: #d4d4df;
  --accent: #ea4c89;
  --accent-dark: #c92d6a;
  --accent-soft: #fdf0f5;
  --accent-ring: rgba(234, 76, 137, 0.22);
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #be123c;
  --red-soft: #fff1f2;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --shadow-xs: 0 1px 2px rgba(17, 17, 26, 0.04);
  --shadow-sm: 0 2px 8px rgba(17, 17, 26, 0.05), 0 1px 2px rgba(17, 17, 26, 0.03);
  --shadow-lg: 0 24px 64px rgba(17, 17, 26, 0.12), 0 4px 16px rgba(17, 17, 26, 0.05);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font: 400 14px/1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.num { font-variant-numeric: tabular-nums; }
.mobile-only { display: none !important; }

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn .icon { width: 15px; height: 15px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 14px; border-radius: 11px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 22, 26, 0.16);
}
.btn-primary:hover:not(:disabled) { background: #2c2c34; }

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(234, 76, 137, 0.25);
}
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); }

.btn-soft {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn-soft:hover:not(:disabled) { background: var(--surface-2); border-color: #bebece; }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #9f1239; }

.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn-danger-soft:hover:not(:disabled) { background: #ffe4e6; }

.btn-green-soft { background: var(--green-soft); color: var(--green); }
.btn-green-soft:hover:not(:disabled) { background: #d1fae5; }

.icon-ghost {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease;
}
.icon-ghost:hover { background: var(--surface-3); color: var(--ink); }

.link-btn {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 540;
}
.link-btn:hover { text-decoration: underline; }

/* ---------------- FORM INPUTS ---------------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 560; color: var(--ink-2); }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.req { color: var(--accent); }
.field input,
.field textarea,
.select-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field input { height: 42px; padding: 0 13px; }
.field textarea { padding: 10px 13px; resize: vertical; line-height: 1.6; }
.select-input { height: 36px; padding: 0 12px; width: auto; min-width: 132px; font-size: 13px; }
.field input::placeholder,
.field textarea::placeholder { color: #9a9aaa; }
.field input:focus,
.field textarea:focus,
.select-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.field input[readonly] { background: var(--surface-3); color: var(--muted); }
.field input[aria-invalid="true"] { border-color: var(--red); }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-row:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.with-action { position: relative; }
.with-action input { padding-right: 44px; }
.icon-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  width: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover, .icon-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-dark); }

.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.code-row .btn { height: 42px; }

.field-error,
.form-error {
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}
.field-error:empty,
.form-error:empty,
.form-notice:empty { display: none; }
.form-notice {
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12.5px;
}
.form-error {
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--red-soft);
}
#test-code-display {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: flex;
  padding: 3px;
  gap: 3px;
  border-radius: 10px;
  background: var(--surface-3);
}
.segmented button {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(17, 17, 26, 0.08);
}
.segmented-sm { flex-shrink: 0; }
.segmented-sm button { flex: none; height: 30px; padding: 0 12px; font-size: 12px; }

/* ---------------- LOGIN SCREEN ---------------- */
.login-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  background: var(--surface);
}
.login-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 3.6vw, 48px) clamp(32px, 4.5vw, 68px);
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(155deg, #fff9fb 0%, #f7f6fb 54%, #fef7f4 100%);
  border-right: 1px solid var(--line);
}
.canvas-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(22, 22, 26, 0.075) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 75% at 45% 45%, #000 40%, transparent 100%);
}
.canvas-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  z-index: -1;
  pointer-events: none;
}
.canvas-glow-1 {
  width: 420px;
  height: 420px;
  top: -110px;
  left: -80px;
  background: rgba(234, 76, 137, 0.16);
}
.canvas-glow-2 {
  width: 360px;
  height: 360px;
  right: -90px;
  bottom: -90px;
  background: rgba(249, 115, 22, 0.11);
}

.canvas-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark { width: 32px; height: 32px; display: block; }
.wordmark { width: 96px; height: auto; display: block; }
.canvas-pill {
  margin-left: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(234, 76, 137, 0.1);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 640;
  letter-spacing: 0.04em;
}

.canvas-center {
  max-width: 500px;
  margin: auto 0;
  padding: 28px 0;
  display: grid;
  gap: 18px;
}
.canvas-kicker {
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
}
.canvas-headline {
  font-size: clamp(32px, 3.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.22;
  color: var(--ink);
}
.headline-accent {
  color: var(--accent);
}
.canvas-sub {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 430px;
}

.studio-preview {
  margin-top: 10px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(22, 22, 26, 0.07);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(22, 22, 26, 0.07), 0 2px 6px rgba(22, 22, 26, 0.03);
  display: grid;
  gap: 14px;
}
.preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.preview-dots { display: inline-flex; gap: 5px; }
.preview-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dedee8;
}
.preview-dots i:first-child { background: #fda4af; }
.preview-dots i:nth-child(2) { background: #fcd34d; }
.preview-dots i:nth-child(3) { background: #6ee7b7; }
.preview-title { font-size: 12px; font-weight: 620; color: var(--ink-2); }
.preview-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 620;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.preview-metric {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  gap: 2px;
}
.preview-metric span { font-size: 11px; color: var(--muted); }
.preview-metric strong { font-size: 14px; font-weight: 680; color: var(--ink); font-variant-numeric: tabular-nums; }
.preview-wave {
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(253, 240, 245, 0.5), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(234, 76, 137, 0.1);
  overflow: hidden;
  padding-top: 6px;
}
.wave-svg { width: 100%; height: 100%; display: block; }
.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.preview-tags span {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 550;
}

.canvas-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.login-surface {
  display: grid;
  place-items: center;
  padding: clamp(28px, 4vw, 56px) clamp(20px, 4vw, 48px);
  background: var(--surface);
}
.login-box {
  width: min(400px, 100%);
  display: grid;
  gap: 22px;
}
.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 9px;
}
.login-head { display: grid; gap: 6px; }
.login-eyebrow {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11.5px;
  font-weight: 640;
  margin-bottom: 4px;
}
.login-head h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.25;
}
.login-head p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.login-segmented { padding: 4px; border-radius: 12px; }
.login-segmented button { height: 38px; border-radius: 9px; font-size: 13.5px; }

.dev-sms-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid #f7cde0;
  color: var(--accent-dark);
}
.dev-sms-banner .icon { width: 17px; height: 17px; margin-top: 2px; flex: none; }
.dev-sms-copy { display: grid; gap: 2px; }
.dev-sms-copy strong { font-size: 12.5px; font-weight: 660; }
.dev-sms-copy span { font-size: 12px; color: #7a294d; line-height: 1.5; }

.dev-code-card {
  margin-top: 4px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dev-code-info { display: grid; gap: 2px; }
.dev-code-info span { font-size: 11px; color: var(--muted); }
.dev-code-info strong {
  font-size: 20px;
  font-weight: 720;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
}

#credentials { display: grid; gap: 16px; }
#credentials .field input { height: 46px; border-radius: 11px; padding: 0 14px; font-size: 14px; }
#credentials .code-row .btn { height: 46px; padding: 0 16px; border-radius: 11px; }
.login-submit {
  height: 48px;
  margin-top: 4px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(22, 22, 26, 0.14);
}
.login-submit:hover:not(:disabled) {
  background: #282832;
  box-shadow: 0 10px 24px rgba(234, 76, 137, 0.22);
}
.access-footer { display: flex; justify-content: flex-end; gap: 16px; margin-top: -8px; }

/* ---------------- APP SHELL ---------------- */
.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px 16px;
  overflow-y: auto;
  z-index: 30;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--line);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-text { display: grid; gap: 2px; }
.brand-text .wordmark { width: 88px; }
.brand-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 0;
}
.nav-group { display: grid; gap: 3px; }
.nav-label {
  padding: 0 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #9494a6;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 520;
  transition: background 140ms ease, color 140ms ease;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item[aria-current="page"] {
  background: var(--ink);
  color: #fff;
  font-weight: 580;
  box-shadow: 0 2px 8px rgba(22, 22, 26, 0.14);
}
.nav-item[aria-current="page"] .icon { color: #ff8ab6; }
.nav-pill {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  color: var(--ink-2);
}
.nav-pill-warn { background: var(--amber-soft); color: var(--amber); }
.nav-pill-accent { background: var(--accent-soft); color: var(--accent-dark); }
.nav-item[aria-current="page"] .nav-pill { background: rgba(255, 255, 255, 0.16); color: #fff; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.storefront-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 140ms ease;
}
.storefront-chip:hover { background: #fbe1ec; }
.storefront-chip .icon { width: 14px; height: 14px; }

.admin-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, var(--accent), #ff7bac);
  color: #fff;
  font-weight: 680;
  font-size: 14px;
}
.admin-meta { min-width: 0; display: grid; }
.admin-meta strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-meta span { font-size: 11px; color: var(--muted); }

.admin-footer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 540;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.footer-btn .icon { width: 14px; height: 14px; }
.footer-btn:hover { background: var(--surface-3); color: var(--ink); }
.footer-btn-danger:hover { background: var(--red-soft); border-color: #fecdd3; color: var(--red); }

/* ---------------- MAIN COLUMN & TOPBAR ---------------- */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  padding: 12px clamp(18px, 2.8vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(246, 246, 249, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title-group { min-width: 0; }
.topbar-title-group h1 {
  font-size: 19px;
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.topbar-title-group p {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.channel-pills { display: flex; align-items: center; gap: 6px; }
.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 540;
  color: var(--ink-2);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a1a1b5;
}
.status-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.16); }
.status-dot.off { background: #d97706; }

.view-body {
  flex: 1;
  padding: 24px clamp(18px, 2.8vw, 36px) 44px;
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
}

.inline-alert {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--red-soft);
  border: 1px solid #fecdd3;
  color: var(--red);
  font-size: 13px;
  font-weight: 520;
}

/* ---------------- OVERVIEW DASHBOARD ---------------- */
.overview-view { display: grid; gap: 20px; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.kpi-card {
  position: relative;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 12px;
  transition: transform 150ms ease, border-color 150ms ease;
}
.kpi-card.clickable { cursor: pointer; }
.kpi-card.clickable:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.kpi-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 13px; font-weight: 540; color: var(--muted); }
.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--ink);
}
.kpi-icon.pink { background: var(--accent-soft); color: var(--accent-dark); }
.kpi-icon.green { background: var(--green-soft); color: var(--green); }
.kpi-icon.amber { background: var(--amber-soft); color: var(--amber); }
.kpi-icon.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-value {
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}
.kpi-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--ink-2);
}
.kpi-tag.good { background: var(--green-soft); color: var(--green); }
.kpi-tag.warn { background: var(--amber-soft); color: var(--amber); }
.kpi-tag.pink { background: var(--accent-soft); color: var(--accent-dark); }

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  gap: 16px;
}
.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr);
  gap: 16px;
}
.panel {
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 15.5px; font-weight: 640; letter-spacing: -0.015em; }
.panel-head p { margin-top: 2px; font-size: 12px; color: var(--muted); }

/* SVG Chart */
.trend-chart { position: relative; min-height: 230px; }
.chart-svg { width: 100%; height: 224px; display: block; overflow: visible; }
.chart-grid-line { stroke: var(--line); stroke-dasharray: 3 3; }
.chart-axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-area { fill: url(#pinkGrad); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-bar-dl { fill: #ea4c89; opacity: 0.88; }
.chart-bar-ord { fill: #16161a; }
.chart-dot { fill: #fff; stroke: var(--accent); stroke-width: 2.2; }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
.legend-swatch.pink { background: var(--accent); }
.legend-swatch.ink { background: var(--ink); }
.chart-tooltip {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}
.chart-tooltip strong { color: #ff8ab6; }

/* Section Health Bars */
.section-health { display: grid; gap: 9px; }
.health-row {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease;
}
.health-row:hover { border-color: var(--accent); background: #fff; }
.health-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.health-top strong { font-weight: 600; }
.health-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.health-warn { color: var(--red); font-weight: 600; }
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: #e9e9f0;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ff76ac);
  transition: width 320ms ease;
}

/* Queue & Top Items */
.queue-list { display: grid; gap: 10px; }
.queue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.queue-info { min-width: 0; display: grid; gap: 3px; }
.queue-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-sub { font-size: 12px; color: var(--muted); }
.queue-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.queue-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}

.top-items { display: grid; gap: 9px; }
.top-item-row {
  display: grid;
  grid-template-columns: 24px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.rank-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rank-num.top3 { color: var(--accent-dark); }
.top-item-info { min-width: 0; }
.top-item-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-item-info span { font-size: 11.5px; color: var(--muted); }
.top-item-count {
  font-size: 12.5px;
  font-weight: 640;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.channels-box {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.channels-box h3 { font-size: 12.5px; font-weight: 620; color: var(--muted); margin-bottom: 10px; }
.channel-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.channel-tile {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}

/* ---------------- RECORDS VIEW ---------------- */
.records-view { display: grid; gap: 16px; }
.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.mini-stat {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: grid;
  gap: 4px;
}
.mini-stat span { font-size: 12px; color: var(--muted); }
.mini-stat strong { font-size: 21px; font-weight: 680; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }

.section-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.section-tabs::-webkit-scrollbar { display: none; }
.section-tab {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 560;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}
.section-tab:hover { background: var(--surface-3); color: var(--ink); }
.section-tab[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
}
.section-tab-count {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 620;
  background: var(--surface-3);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.section-tab[aria-selected="true"] .section-tab-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
}
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pill {
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 540;
  transition: all 140ms ease;
}
.filter-pill:hover { border-color: var(--line-strong); color: var(--ink); }
.filter-pill[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 620;
}

.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 34px;
  min-width: 136px;
  padding: 0 12px 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.dropdown-trigger:hover { border-color: #b8b8ca; }
.dropdown-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.dropdown-trigger.has-value {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 620;
}
.dropdown-caret {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 160ms ease;
}
.dropdown-trigger[aria-expanded="true"] .dropdown-caret {
  transform: rotate(180deg);
  color: var(--accent-dark);
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 45;
  min-width: 176px;
  max-width: 260px;
  max-height: 280px;
  overflow-y: auto;
  padding: 5px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(17, 17, 26, 0.12), 0 2px 6px rgba(17, 17, 26, 0.04);
  display: grid;
  gap: 2px;
  animation: fadeIn 120ms ease;
}
.dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
}
.dropdown-option:hover { background: var(--surface-3); color: var(--ink); }
.dropdown-option[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 620;
}
.dropdown-option .icon { width: 14px; height: 14px; flex: none; opacity: 0; }
.dropdown-option[aria-selected="true"] .icon { opacity: 1; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  width: 230px;
  min-width: 140px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.search-box .icon { width: 15px; height: 15px; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.view-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.view-switch button {
  width: 30px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}
.view-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.view-switch .icon { width: 15px; height: 15px; }
.summary-text { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------- VISUAL CATALOG CARDS ---------------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.asset-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.asset-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 26px rgba(17, 17, 26, 0.08);
}
.asset-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #f3f1f6 0%, #eae8ef 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.asset-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.asset-cover.contain img { object-fit: contain; padding: 10px; background: #faf9fb; }
.asset-cover-fallback {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
}
.asset-cover-fallback strong { font-size: 13px; color: var(--ink-2); font-weight: 620; }
.asset-cover-fallback span { font-size: 11px; }
.asset-cover-badges {
  position: absolute;
  top: 9px;
  right: 9px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: none;
}
.asset-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.asset-cat {
  font-weight: 580;
  color: var(--accent-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cover-chip {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 620;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.cover-chip.warn { background: #fff1f2; color: var(--red); }
.cover-chip.price { background: var(--ink); color: #fff; font-variant-numeric: tabular-nums; }
.cover-chip.member { background: var(--accent); color: #fff; }

.asset-body {
  flex: 1;
  padding: 14px 15px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.asset-title {
  font-size: 14.5px;
  font-weight: 640;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.asset-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.asset-foot {
  margin-top: auto;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.asset-status-group { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }

/* ---------------- TABLES ---------------- */
.table-card {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
thead th {
  padding: 11px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfbfd; }
.th-right, .td-right { text-align: right; }

.cell-media {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}
.thumb {
  width: 44px;
  height: 33px;
  border-radius: 7px;
  overflow: hidden;
  flex: none;
  background: var(--surface-3);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 620;
  color: var(--muted);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell-primary { display: grid; gap: 2px; min-width: 0; }
.cell-primary strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 195px;
}
.cell-primary small {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 195px;
}

.user-chip { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 680;
}
.user-avatar.guest { background: var(--surface-3); color: var(--muted); }
.user-chip div { min-width: 0; display: grid; }
.user-chip strong { font-size: 13px; font-weight: 580; }
.user-chip span { font-size: 11.5px; color: var(--muted); }

.copy-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 190px;
  max-width: 260px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11.5px;
  line-height: 1.4;
  text-align: left;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.copy-id span { word-break: break-all; }
.copy-id:hover { border-color: var(--accent); color: var(--accent-dark); }
.copy-id .icon { width: 13px; height: 13px; flex: none; }

/* ---------------- FINANCE LEDGER ---------------- */
.finance-view { display: grid; gap: 16px; }
.ledger-card {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.ledger-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.ledger-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: none;
}
.ledger-head-right .search-box { width: 200px; }
.ledger-summary {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ledger-table-wrap {
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}
.ledger-card .copy-id { max-width: none; white-space: nowrap; }
.ledger-card .copy-id span { word-break: normal; }
.ledger-item-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.mini-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--ink-2);
}
.mini-tag.blue { background: var(--blue-soft); color: var(--blue); }
.mini-tag.pink { background: var(--accent-soft); color: var(--accent-dark); }
.amount-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ledger-empty {
  padding: 48px 24px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.ledger-empty h2 { font-size: 15px; font-weight: 620; }
.ledger-empty p { font-size: 13px; color: var(--muted); max-width: 340px; }
.ledger-empty .btn { margin-top: 6px; }
.ledger-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.amount-in { font-weight: 680; color: var(--green); white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount-zero { font-weight: 560; color: var(--muted); white-space: nowrap; }
.balance-cell { font-weight: 640; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.id-stack { display: grid; gap: 4px; }
.tx-sub { font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--ink-2);
}
.badge.good { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.pink { background: var(--accent-soft); color: var(--accent-dark); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }

.action-row { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.price-strong { font-weight: 660; font-size: 13.5px; white-space: nowrap; }
.time-muted { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------------- FEEDBACK CARDS ---------------- */
.feedback-grid { display: grid; gap: 12px; }
.feedback-card {
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: grid;
  gap: 12px;
}
.feedback-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feedback-text {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.feedback-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ---------------- TOGGLE SWITCH ---------------- */
.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d5d5e0;
  position: relative;
  transition: background 160ms ease;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px var(--accent-ring); }
.toggle-sm .toggle-track { width: 34px; height: 19px; }
.toggle-sm .toggle-track::after { width: 15px; height: 15px; }
.toggle-sm input:checked + .toggle-track::after { transform: translateX(15px); }

/* ---------------- EMPTY & PAGER ---------------- */
.empty-card {
  padding: 54px 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.empty-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--muted);
  margin-bottom: 4px;
}
.empty-badge .icon { width: 22px; height: 22px; }
.empty-card h2 { font-size: 16px; font-weight: 620; }
.empty-card p { font-size: 13px; color: var(--muted); max-width: 360px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}
.pager-actions { display: flex; align-items: center; gap: 8px; }

/* ---------------- SLIDE-OVER DRAWER ---------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 16, 22, 0.42);
  backdrop-filter: blur(4px);
  animation: fadeIn 160ms ease;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  width: min(560px, 100vw);
  background: var(--surface);
  box-shadow: -12px 0 48px rgba(17, 17, 26, 0.16);
  display: flex;
  flex-direction: column;
  animation: slideIn 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.drawer-kicker { font-size: 11.5px; font-weight: 600; color: var(--accent-dark); }
.drawer-head h2 { margin-top: 2px; font-size: 19px; font-weight: 660; letter-spacing: -0.02em; }
.drawer-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.drawer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.drawer-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cover-preview-card {
  position: relative;
  flex: none;
  width: 100%;
  height: 210px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #f4f2f7, #eceaf1);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.cover-preview-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-preview-empty { display: grid; place-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.cover-preview-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22, 22, 26, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.form-section { display: grid; gap: 13px; }
.form-section h3 {
  font-size: 12.5px;
  font-weight: 640;
  color: var(--muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.publish-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch-row strong { display: block; font-size: 13.5px; font-weight: 620; }
.switch-row p { margin-top: 2px; font-size: 12px; color: var(--muted); }

.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 11px;
  border: 1.5px dashed var(--line-strong);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.dropzone:hover, .dropzone.has-file {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone .icon { width: 20px; height: 20px; color: var(--accent-dark); }
.dropzone-copy { min-width: 0; display: grid; gap: 2px; }
.dropzone-copy strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropzone-copy span { font-size: 11.5px; color: var(--muted); }

/* Customer Detail Drawer */
.customer-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.customer-hero .user-avatar { width: 46px; height: 46px; font-size: 18px; }
.customer-hero-meta { min-width: 0; display: grid; gap: 3px; }
.customer-hero-meta strong { font-size: 16px; font-weight: 660; }
.customer-hero-meta span { font-size: 12.5px; color: var(--muted); }

.grant-box {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff5f9, #fff);
  border: 1px solid #f7cfe0;
  display: grid;
  gap: 10px;
}
.grant-box strong { font-size: 13.5px; font-weight: 640; }
.grant-box p { font-size: 12px; color: var(--muted); }
.grant-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.access-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.access-box.is-disabled {
  background: #fff5f5;
  border-color: #f8c7cc;
}
.access-box-meta { display: grid; gap: 3px; min-width: 0; }
.access-box-meta strong { font-size: 13.5px; font-weight: 640; }
.access-box-meta p { font-size: 12px; color: var(--muted); }
.customer-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
tr.row-disabled td { background: #fcfbfc; }
tr.row-disabled .user-avatar { background: var(--surface-3); color: var(--muted); }
tr.row-disabled .user-chip strong { color: var(--muted); }

.detail-list { display: grid; gap: 8px; }
.detail-row {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}
.detail-row strong { display: block; font-size: 13px; font-weight: 600; }
.detail-row small { color: var(--muted); font-size: 11.5px; }

/* ---------------- DIALOGS ---------------- */
.modal-dialog {
  width: min(460px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.modal-dialog::backdrop { background: rgba(16, 16, 22, 0.45); backdrop-filter: blur(4px); }
.modal-inner { padding: 22px 24px; display: grid; gap: 16px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 18px; font-weight: 660; }
.modal-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.modal-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }
.confirm-highlight {
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.security-form, .security-change-group { display: grid; gap: 13px; }

/* ---------------- TOASTS ---------------- */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 90;
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 540;
  box-shadow: 0 12px 32px rgba(17, 17, 26, 0.22);
  animation: toastIn 180ms ease;
  pointer-events: auto;
}
.toast.good .icon { color: #34d399; }
.toast.error { background: #9f1239; }
.toast.error .icon { color: #fecdd3; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(36px); } to { transform: none; } }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 700ms linear infinite; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 224px minmax(0, 1fr); }
  .channel-pills { display: none; }
}
@media (max-width: 1040px) {
  .kpi-grid, .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid, .ops-grid { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .login-shell { grid-template-columns: 1fr; background: linear-gradient(160deg, #fff9fb 0%, #f6f6fa 100%); }
  .login-canvas { display: none; }
  .login-surface { background: transparent; padding: 28px 18px; }
  .login-box {
    padding: 28px 24px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }
  .login-mobile-brand { display: flex; }
}
@media (max-width: 780px) {
  .mobile-only { display: inline-grid !important; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(16, 16, 22, 0.42);
    backdrop-filter: blur(3px);
  }
}
@media (max-width: 600px) {
  .kpi-grid, .mini-stats, .field-row, .field-row-3, .channel-details { grid-template-columns: 1fr; }
  .topbar-title-group p { display: none; }
  .toolbar-right { width: 100%; }
  .toolbar-right .search-box { flex: 1; width: auto; min-width: 0; }
}
