:root {
  --ink: #0c1d37;
  --ink-2: #22324b;
  --muted: #6c7a91;
  --secondary: #4a576d;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --line: #e3eaf2;
  --accent: #4fd1c5;
  --accent-deep: #18a99d;
  --accent-soft: #dff8f5;
  --warning: #d97706;
  --danger: #dc2626;
  --success: #38a169;
  --shadow: 0 18px 42px rgba(12, 29, 55, 0.09);
  --shadow-soft: 0 10px 24px rgba(12, 29, 55, 0.07);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top right, rgba(79,209,197,.14), transparent 30rem), var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.prototype-ribbon {
  min-height: 34px;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #08182e;
  color: #fff;
  font-size: 12px;
  letter-spacing: .01em;
}
.prototype-ribbon span { color: #c7d4e4; }

.shell-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(244,247,251,.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(227,234,242,.86);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent), #9df5ed);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(79,209,197,.28);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.015em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; }

.persona-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: #eaf0f6;
  border-radius: 14px;
}
.persona-button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 7px 14px;
  background: transparent;
  color: var(--secondary);
  font-weight: 800;
  font-size: 12px;
}
.persona-button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 4px 12px rgba(12,29,55,.08); }

.app-shell { width: min(1180px, 100%); margin: 0 auto; padding: 24px clamp(16px, 4vw, 42px) 110px; }

.page-stack { display: grid; gap: 18px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.page-heading h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.04em; }
.page-heading p { margin: 8px 0 0; color: var(--secondary); max-width: 760px; line-height: 1.55; }
.page-heading-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.eyebrow { color: var(--accent-deep); font-size: 11px; text-transform: uppercase; letter-spacing: .11em; font-weight: 900; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title h2, .section-title h3 { margin: 0; letter-spacing: -.025em; }
.section-title h2 { font-size: 21px; }
.section-title h3 { font-size: 17px; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.button {
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 850;
  font-size: 13px;
  text-decoration: none;
}
.button-primary { background: var(--ink); color: #fff; box-shadow: 0 8px 18px rgba(12,29,55,.16); }
.button-primary:hover { transform: translateY(-1px); }
.button-accent { background: var(--accent); color: var(--ink); }
.button-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.button-ghost { background: transparent; color: var(--secondary); }
.button-danger { background: #fff0f0; color: #a31818; border: 1px solid #ffd1d1; }
.button[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.card { background: var(--surface); border: 1px solid rgba(227,234,242,.9); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.card-pad { padding: 18px; }

.mobile-frame {
  max-width: 520px;
  margin: 0 auto;
  border-radius: 34px;
  border: 1px solid #d7e0eb;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mobile-status { height: 22px; background: var(--surface); }
.mobile-content { min-height: 680px; background: linear-gradient(180deg, #fbfdff, var(--bg)); }
.mobile-topbar { padding: 14px 16px 8px; display: flex; align-items: center; justify-content: space-between; }
.mobile-topbar strong { font-size: 14px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; }

.home-intro { padding: 8px 16px 14px; }
.home-intro h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.home-intro p { margin: 6px 0 0; color: var(--secondary); font-size: 13px; line-height: 1.45; }

.promo-spotlight {
  margin: 0 14px;
  min-height: 150px;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(128deg, #0c1d37 0%, #143a4f 44%, #2a9f98 100%);
  color: #fff;
  box-shadow: 0 16px 30px rgba(12,29,55,.2);
}
.promo-spotlight::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  right: -60px;
  top: -72px;
  background: radial-gradient(circle, rgba(255,255,255,.26), rgba(255,255,255,0));
}
.promo-spotlight-inner { position: relative; z-index: 2; padding: 14px 14px 12px; min-height: 150px; display: flex; flex-direction: column; }
.promo-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.promo-meta-left { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.sponsored-label { display: inline-flex; align-items: center; min-height: 22px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); color: #ecfffd; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; font-weight: 900; }
.advertiser-name { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verified { color: #9af4eb; font-size: 11px; font-weight: 900; }
.promo-menu { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255,255,255,.11); color: #fff; font-size: 20px; }
.promo-copy { width: min(72%, 360px); margin-top: 12px; }
.promo-copy h3 { margin: 0; font-size: 22px; line-height: 1.02; letter-spacing: -.04em; }
.promo-copy p { margin: 6px 0 0; color: #dff7f4; font-size: 12px; line-height: 1.42; }
.promo-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.promo-validity { color: #d2f0ec; font-size: 10px; font-weight: 750; }
.action-row { display: flex; align-items: center; gap: 6px; }
.icon-action {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.1);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
}
.icon-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-action.is-active { background: #fff; color: var(--ink); }
.spotlight-cta { min-height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--accent); color: var(--ink); font-size: 11px; font-weight: 900; }

.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; }
.mini-card { padding: 12px; border-radius: 17px; background: var(--surface); border: 1px solid var(--line); }
.mini-card strong { display: block; font-size: 17px; }
.mini-card span { color: var(--muted); font-size: 10px; }

.promo-feed { padding: 14px; display: grid; gap: 12px; }
.category-strip { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.category-strip::-webkit-scrollbar { display: none; }
.category-chip { flex: 0 0 auto; min-height: 37px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; background: var(--surface); color: var(--secondary); font-size: 11px; font-weight: 850; }
.category-chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.feed-card { overflow: hidden; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(12,29,55,.06); }
.feed-art { min-height: 142px; padding: 13px; position: relative; display: flex; flex-direction: column; justify-content: space-between; color: #fff; }
.feed-art.variant-a { background: linear-gradient(135deg, #5e250c, #df7e1e 55%, #f4b96b); }
.feed-art.variant-b { background: linear-gradient(135deg, #091d3b, #235a96 52%, #6ba9f4); }
.feed-art.variant-c { background: linear-gradient(135deg, #123222, #2b7b52 52%, #72d6a0); }
.feed-art.variant-d { background: linear-gradient(135deg, #331348, #7a3ca1 52%, #c48bdd); }
.art-badge { align-self: flex-start; padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.2); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; font-weight: 900; }
.art-copy { max-width: 80%; }
.art-copy strong { display: block; font-size: 22px; line-height: 1.02; letter-spacing: -.04em; }
.art-copy span { display: block; margin-top: 5px; font-size: 11px; color: rgba(255,255,255,.88); }
.feed-body { padding: 13px; }
.feed-topline { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.feed-topline strong { font-size: 13px; }
.feed-topline small { color: var(--muted); font-size: 10px; }
.feed-body p { margin: 9px 0 10px; color: var(--secondary); font-size: 12px; line-height: 1.5; }
.feed-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.feed-actions-left { display: flex; gap: 6px; }
.feed-actions .icon-action { color: var(--secondary); border-color: var(--line); background: #f9fbfd; }
.feed-actions .icon-action.is-active { color: var(--ink); background: var(--accent-soft); border-color: #b8ece7; }
.feed-cta { min-height: 40px; border: 0; border-radius: 12px; padding: 8px 13px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; }

.mobile-nav { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 14px; padding: 7px; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 25px rgba(12,29,55,.12); }
.mobile-nav button { min-height: 48px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; }
.mobile-nav button.is-active { background: var(--accent-soft); color: var(--ink); }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.panel { grid-column: span 12; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.panel.half { grid-column: span 6; }
.panel.third { grid-column: span 4; }
.panel.two-thirds { grid-column: span 8; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdff; }
.kpi strong { display: block; font-size: 25px; letter-spacing: -.04em; }
.kpi span { color: var(--muted); font-size: 11px; }
.kpi small { display: block; margin-top: 7px; color: var(--success); font-size: 10px; font-weight: 850; }

.metric-funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.funnel-step { padding: 11px; border-radius: 14px; background: linear-gradient(180deg, #fbfdff, #f5f9fc); border: 1px solid var(--line); }
.funnel-step b { display: block; font-size: 17px; }
.funnel-step span { color: var(--muted); font-size: 10px; }

.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
.data-table th, .data-table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.status-live { background: #e7f7ed; color: #1f7a45; }
.status-review { background: #fff7e5; color: #9b5e05; }
.status-change { background: #eef2ff; color: #4155a3; }
.status-scheduled { background: #e6f5ff; color: #1b6f9d; }
.status-rejected { background: #fff0f0; color: #a31818; }

.recommendation-card { display: flex; gap: 12px; padding: 13px; border-radius: 16px; background: #f4fbfa; border: 1px solid #cceeea; }
.recommendation-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--accent); font-weight: 900; }
.recommendation-card strong { display: block; font-size: 13px; }
.recommendation-card p { margin: 4px 0 0; color: var(--secondary); font-size: 11px; line-height: 1.45; }

.form-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
.step-list { display: grid; gap: 6px; align-content: start; }
.step-button { text-align: left; min-height: 48px; border: 1px solid transparent; border-radius: 13px; padding: 9px 11px; background: transparent; color: var(--secondary); font-size: 12px; font-weight: 800; }
.step-button.is-active { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-soft); }
.form-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 850; color: var(--secondary); }
.field input, .field textarea, .field select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 11px; color: var(--ink); outline: none; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(79,209,197,.16); }
.helper { color: var(--muted); font-size: 10px; line-height: 1.45; }

.package-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.package-card { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; }
.package-card.is-selected { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(79,209,197,.16); }
.package-card strong { display: block; font-size: 14px; }
.package-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.checkout-summary { display: grid; gap: 8px; margin-top: 14px; padding: 14px; border-radius: 16px; background: #f8fafc; border: 1px solid var(--line); }
.checkout-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.checkout-row.total { padding-top: 9px; border-top: 1px solid var(--line); font-weight: 900; font-size: 14px; }

.admin-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.control-card { padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.control-card strong { font-size: 12px; }
.control-card p { margin: 5px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.toggle { width: 46px; height: 26px; position: relative; border: 0; border-radius: 999px; background: #cbd5e1; }
.toggle::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .18s ease; box-shadow: 0 2px 5px rgba(0,0,0,.16); }
.toggle.is-on { background: var(--accent-deep); }
.toggle.is-on::after { transform: translateX(20px); }

.queue-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.queue-card + .queue-card { margin-top: 9px; }
.queue-card h4 { margin: 0; font-size: 14px; }
.queue-card p { margin: 6px 0 0; color: var(--secondary); font-size: 11px; line-height: 1.45; }
.queue-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.queue-actions .button { min-height: 38px; padding: 7px 10px; font-size: 10px; }

.inventory-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.inventory-cell { min-height: 82px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.inventory-cell strong { display: block; font-size: 10px; }
.inventory-cell span { display: block; margin-top: 6px; font-size: 9px; color: var(--muted); }
.inventory-cell.is-heavy { background: #fff6e8; border-color: #f5d2a2; }
.inventory-cell.is-open { background: #effbf8; border-color: #bfece5; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(5,18,35,.58); backdrop-filter: blur(6px); }
.modal-card { width: min(620px, 100%); max-height: min(820px, 92vh); overflow: auto; padding: 20px; border-radius: 26px; background: var(--surface); box-shadow: 0 28px 70px rgba(0,0,0,.28); }
.modal-header { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.modal-header h3 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.modal-header p { margin: 6px 0 0; color: var(--secondary); font-size: 12px; line-height: 1.45; }
.modal-close { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; flex-wrap: wrap; }

.detail-creative { min-height: 220px; margin-top: 16px; padding: 20px; border-radius: 22px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(135deg, #0c1d37, #237f7a); }
.detail-creative strong { max-width: 70%; font-size: 30px; letter-spacing: -.045em; line-height: 1; }
.detail-creative span { margin-top: 8px; color: #dcfbf7; font-size: 12px; }
.detail-info { margin-top: 15px; display: grid; gap: 10px; }
.detail-row { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.detail-row span:first-child { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 120px); opacity: 0; padding: 10px 14px; max-width: min(92vw, 480px); border-radius: 13px; background: #08182e; color: #fff; font-size: 12px; font-weight: 750; box-shadow: var(--shadow); transition: transform .22s ease, opacity .22s ease; pointer-events: none; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

.inline-note { padding: 11px 12px; border-radius: 14px; background: #eefaf8; color: #225d59; border: 1px solid #c6ece7; font-size: 11px; line-height: 1.45; }
.warning-note { background: #fff7e8; color: #8a5809; border-color: #f6d69e; }
.danger-note { background: #fff1f1; color: #9b2020; border-color: #ffcaca; }

@media (max-width: 860px) {
  .shell-header { align-items: flex-start; flex-direction: column; }
  .persona-switch { width: 100%; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading-actions { justify-content: flex-start; }
  .panel.half, .panel.third, .panel.two-thirds { grid-column: span 12; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-layout { grid-template-columns: 1fr; }
  .step-list { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow-x: auto; }
  .step-button { min-width: 150px; }
  .package-grid { grid-template-columns: 1fr; }
  .admin-controls { grid-template-columns: repeat(2, 1fr); }
  .inventory-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 560px) {
  .prototype-ribbon { align-items: flex-start; flex-direction: column; gap: 1px; }
  .app-shell { padding: 16px 10px 90px; }
  .brand small { display: none; }
  .persona-button { padding-inline: 8px; }
  .mobile-frame { border-radius: 24px; }
  .promo-copy { width: 78%; }
  .promo-copy h3 { font-size: 19px; }
  .promo-foot { align-items: flex-start; flex-direction: column; }
  .action-row { width: 100%; }
  .spotlight-cta { margin-left: auto; }
  .kpi-grid, .form-grid, .admin-controls { grid-template-columns: 1fr; }
  .metric-funnel { grid-template-columns: 1fr 1fr; }
  .queue-card { grid-template-columns: 1fr; }
  .queue-actions { justify-content: flex-start; }
  .inventory-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-creative strong { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
