/* =============================================================
   Cogvert — main.css
   Single shared stylesheet for all pages
   ============================================================= */

/* -------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES & RESET
   ------------------------------------------------------------- */
:root {
  --font: 'Google Sans', 'Segoe UI', sans-serif;
  --navy: #010a28;
  --cyan: #2ff3e0;
  --pink: #ed155d;
  --yellow: #f8d210;
  --purple: #4a154b;
  --red: #ed155d;
  --white: #ffffff;
  --gray-bg: #f3f5f9;
  --gray-border: #e4e5ec;
  --sidebar-w: 220px;
  --header-h: 52px;
  --text-dark: #1a1d2e;
  --text-muted: #777777;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--gray-bg);
  color: var(--text-dark);
  line-height: 1.5;
}

a { color: inherit; }
button { font-family: var(--font); }
img { display: block; }


/* =============================================================
   2. ONBOARDING — ANIMATIONS
   ============================================================= */

@keyframes drift-cyan {
  0%   { transform: translate(0px,0px) scale(1); }
  25%  { transform: translate(-18px,22px) scale(1.04); }
  50%  { transform: translate(-8px,40px) scale(0.97); }
  75%  { transform: translate(14px,18px) scale(1.03); }
  100% { transform: translate(0px,0px) scale(1); }
}
@keyframes drift-pink {
  0%   { transform: translate(0px,0px) scale(1); }
  20%  { transform: translate(16px,-20px) scale(1.05); }
  45%  { transform: translate(28px,12px) scale(0.96); }
  70%  { transform: translate(10px,28px) scale(1.03); }
  100% { transform: translate(0px,0px) scale(1); }
}
@keyframes drift-yellow {
  0%   { transform: translate(0px,0px) scale(1); }
  30%  { transform: translate(20px,16px) scale(1.06); }
  60%  { transform: translate(-10px,24px) scale(0.95); }
  80%  { transform: translate(-18px,6px) scale(1.02); }
  100% { transform: translate(0px,0px) scale(1); }
}
@keyframes pulse-opacity {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: none; }
}


/* =============================================================
   3. ONBOARDING — BACKGROUND SCENE
   ============================================================= */

.bg-scene {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
  background: linear-gradient(120deg, #dce8f6 0%, #daeaf4 20%, #d8eef0 45%, #d5ede7 70%, #d0ecdf 100%);
}
.bg-scene::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 50% at 72% 38%, rgba(200,238,228,0.55) 0%, transparent 65%),
    radial-gradient(ellipse 40% 35% at 20% 65%, rgba(210,228,248,0.45) 0%, transparent 60%);
}
.bg-scene::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 220px; height: 100%;
  background-image: radial-gradient(circle, rgba(100,180,200,0.18) 1.2px, transparent 1.2px);
  background-size: 14px 14px;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.5) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.ring {
  position: absolute; border-radius: 50%;
  pointer-events: none; will-change: transform;
}
.ring-cyan {
  width: 300px; height: 300px;
  border: 1.8px solid rgba(56,210,200,0.60);
  top: -80px; right: -60px;
  animation: drift-cyan 14s ease-in-out infinite, pulse-opacity 7s ease-in-out infinite;
}
.ring-pink {
  width: 190px; height: 190px;
  border: 1.6px solid rgba(220,90,120,0.50);
  top: 42%; right: 8%;
  animation: drift-pink 11s ease-in-out infinite, pulse-opacity 9s ease-in-out infinite 1.5s;
}
.ring-yellow {
  width: 130px; height: 130px;
  border: 1.6px solid rgba(210,170,60,0.52);
  bottom: 12%; left: 13%;
  animation: drift-yellow 13s ease-in-out infinite, pulse-opacity 8s ease-in-out infinite 3s;
}

.page-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}


/* =============================================================
   4. ONBOARDING — CARD
   ============================================================= */

.card {
  width: 100%; max-width: 480px;
  background: var(--navy);
  border-radius: 22px;
  padding: 36px 40px 32px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 20px 60px rgba(1,10,40,0.22),
    0 4px 16px rgba(1,10,40,0.12);
  position: relative; overflow: hidden;
}
.card.wide { max-width: 680px; padding: 36px 44px 36px; }

.card::before {
  content: '';
  position: absolute;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,243,224,0.10) 0%, transparent 65%);
  top: -120px; right: -80px; pointer-events: none;
}
.card::after {
  content: '';
  position: absolute;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(237,21,93,0.10) 0%, transparent 65%);
  bottom: -80px; left: -60px; pointer-events: none;
}

.card-logo {
  display: flex; justify-content: center;
  margin-bottom: 28px; position: relative; z-index: 1;
}
.card-logo img {
  height: 32px; width: auto;
}

.progress-bar {
  display: flex; gap: 6px;
  margin-bottom: 24px; position: relative; z-index: 1;
}
.progress-seg {
  height: 3px; flex: 1; border-radius: 99px;
  background: rgba(255,255,255,0.15);
}
.progress-seg.filled { background: var(--red); }

.step-label {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--red); margin-bottom: 8px;
  position: relative; z-index: 1;
}
.card-heading {
  font-size: 22px; font-weight: 700;
  color: #fff; line-height: 1.25;
  margin-bottom: 6px; position: relative; z-index: 1;
}
.card-subtext {
  font-size: 13px; color: rgba(255,255,255,0.65);
  line-height: 1.65; margin-bottom: 26px;
  position: relative; z-index: 1;
}


/* =============================================================
   5. ONBOARDING — FORM ELEMENTS
   ============================================================= */

.form { display: flex; flex-direction: column; gap: 16px; position: relative; z-index: 1; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.80); letter-spacing: 0.02em; }

.url-wrap {
  display: flex; align-items: center;
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,0.07);
  transition: border-color .2s, box-shadow .2s;
}
.url-wrap:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(237,21,93,0.30);
}
.url-prefix {
  padding: 0 10px 0 14px; height: 44px;
  display: flex; align-items: center;
  font-size: 13px; color: rgba(255,255,255,0.38);
  background: rgba(255,255,255,0.05);
  border-right: 1.5px solid rgba(255,255,255,0.14);
  white-space: nowrap; user-select: none;
}
.url-wrap input {
  flex: 1; border: none; outline: none;
  padding: 0 14px; height: 44px;
  font-family: var(--font); font-size: 13.5px;
  color: #fff; background: transparent;
}
.url-wrap input::placeholder { color: rgba(255,255,255,0.28); }

.field-input {
  height: 44px; padding: 0 14px;
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  font-family: var(--font); font-size: 13.5px;
  color: #fff; background: rgba(255,255,255,0.07);
  outline: none; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.field-input::placeholder { color: rgba(255,255,255,0.28); }
.field-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(237,21,93,0.30);
}

.field-select {
  height: 44px; padding: 0 32px 0 12px;
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  font-family: var(--font); font-size: 13.5px;
  color: #fff; background: rgba(255,255,255,0.07);
  outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.field-select option { background: #1a0a20; color: #fff; }
.field-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(237,21,93,0.30);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.loc-wrap, .tz-wrap { position: relative; }
.loc-flag, .tz-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none; display: flex; align-items: center;
}
.loc-flag { font-size: 15px; line-height: 1; }
.tz-icon { color: rgba(255,255,255,0.38); }
.loc-wrap .field-select,
.tz-wrap .field-select { padding-left: 34px; }

.form-divider {
  height: 1px; background: rgba(255,255,255,0.14);
  margin: 4px 0; position: relative; z-index: 1;
}


/* =============================================================
   6. ONBOARDING — BUTTONS & FOOTER
   ============================================================= */

.btn-row {
  display: grid; grid-template-columns: 1fr 1.6fr;
  gap: 12px; position: relative; z-index: 1;
}
.btn-back {
  height: 48px; background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  font-family: var(--font); font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-back:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.28);
}
.btn-next {
  margin-top: 4px; width: 100%; height: 48px;
  background: var(--red); color: #fff;
  border: none; border-radius: 10px;
  font-family: var(--font); font-size: 15px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, box-shadow .15s, transform .1s;
  position: relative; z-index: 1;
}
.btn-row .btn-next { margin-top: 0; width: auto; }
.btn-next:hover {
  background: #c50e4a;
  box-shadow: 0 6px 24px rgba(237,21,93,0.45);
}
.btn-next:active { transform: scale(0.98); }

.card-footer {
  margin-top: 18px; text-align: center;
  font-size: 12.5px; color: rgba(255,255,255,0.62);
  position: relative; z-index: 1;
}
.card-footer a {
  color: #2ff3e0; font-weight: 600; text-decoration: none;
}
.card-footer a:hover { text-decoration: underline; }


/* =============================================================
   7. ONBOARDING — TOPICS (STEP 2)
   ============================================================= */

.topics-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; position: relative; z-index: 1;
}
.topics-header-label { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.78); }
.topics-counter {
  font-size: 12px; font-weight: 600; color: #2ff3e0;
  background: rgba(47,243,224,0.10);
  padding: 2px 9px; border-radius: 99px;
  border: 1px solid rgba(47,243,224,0.20);
}

.topic-list {
  display: flex; flex-direction: column; gap: 8px;
  position: relative; z-index: 1; margin-bottom: 4px;
}
.topic-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.13);
  border-radius: 10px; cursor: pointer;
  transition: background .15s, border-color .2s;
  user-select: none;
}
.topic-item:hover { background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.22); }
.topic-item.checked { border-color: rgba(47,243,224,0.35); background: rgba(47,243,224,0.07); }

.topic-checkbox {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, box-shadow .15s;
  background: transparent;
}
.topic-item.checked .topic-checkbox {
  background: #2ff3e0; border-color: #2ff3e0;
  box-shadow: 0 0 0 3px rgba(47,243,224,0.22);
}
.topic-checkbox svg { display: none; }
.topic-item.checked .topic-checkbox svg { display: block; }
.topic-text { font-size: 13.5px; font-weight: 500; color: #fff; line-height: 1.3; }

.add-custom {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; margin-bottom: 4px; padding: 0 2px;
  cursor: pointer; position: relative; z-index: 1;
  width: fit-content;
}
.add-custom-icon {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid rgba(47,243,224,0.45);
  display: flex; align-items: center; justify-content: center;
  color: #2ff3e0; font-size: 14px; line-height: 1;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.add-custom:hover .add-custom-icon {
  background: rgba(47,243,224,0.12); border-color: #2ff3e0;
}
.add-custom-label { font-size: 13px; font-weight: 600; color: #2ff3e0; }

.custom-input-wrap { display: none; margin-top: 10px; position: relative; z-index: 1; }
.custom-input-wrap.visible { display: flex; gap: 8px; }
.custom-input {
  flex: 1; height: 40px; padding: 0 12px;
  border: 1.5px solid rgba(47,243,224,0.35);
  border-radius: 8px; background: rgba(255,255,255,0.07);
  color: #fff; font-family: var(--font); font-size: 13px; outline: none;
}
.custom-input::placeholder { color: rgba(255,255,255,0.28); }
.custom-input:focus {
  border-color: #2ff3e0;
  box-shadow: 0 0 0 3px rgba(47,243,224,0.20);
}
.custom-add-btn {
  height: 40px; padding: 0 16px; background: #2ff3e0;
  color: #010a28; border: none; border-radius: 8px;
  font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.custom-add-btn:hover { opacity: 0.85; }


/* =============================================================
   8. ONBOARDING — PROMPTS (STEP 3)
   ============================================================= */

.prompts-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; position: relative; z-index: 1;
}
.prompts-counter {
  font-size: 12px; font-weight: 600; color: #2ff3e0;
  background: rgba(47,243,224,0.10);
  padding: 2px 9px; border-radius: 99px;
  border: 1px solid rgba(47,243,224,0.20);
}

.topic-selector-wrap { position: relative; z-index: 10; margin-bottom: 14px; }
.topic-selector-btn {
  width: 100%; height: 44px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.13);
  border-radius: 10px; cursor: pointer;
  transition: border-color .2s, background .15s;
}
.topic-selector-btn:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.24);
}
.topic-selector-btn.open {
  border-color: rgba(47,243,224,0.45);
  border-radius: 10px 10px 0 0;
}
.topic-selector-left { display: flex; align-items: center; gap: 10px; }
.topic-sel-label { font-size: 13.5px; font-weight: 500; color: #fff; }
.topic-sel-badge {
  font-size: 11px; font-weight: 700;
  background: rgba(47,243,224,0.14); color: #2ff3e0;
  padding: 2px 7px; border-radius: 99px;
  border: 1px solid rgba(47,243,224,0.22);
}
.topic-chevron {
  color: rgba(255,255,255,0.36); flex-shrink: 0;
  transition: transform .2s;
}
.topic-selector-btn.open .topic-chevron { transform: rotate(180deg); }

.topic-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: #1a0a20;
  border: 1.5px solid rgba(47,243,224,0.45);
  border-top: none; border-radius: 0 0 10px 10px;
  overflow: hidden; z-index: 20;
  animation: slideDown .18s ease;
}
.topic-dropdown.open { display: block; }
.topic-dd-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; cursor: pointer;
  transition: background .12s;
}
.topic-dd-item:hover { background: rgba(255,255,255,0.07); }
.topic-dd-item.active { background: rgba(47,243,224,0.08); }
.topic-dd-name { font-size: 13px; font-weight: 500; color: #fff; }
.topic-dd-badge {
  font-size: 11px; font-weight: 700; color: #2ff3e0;
  background: rgba(47,243,224,0.12);
  padding: 2px 7px; border-radius: 99px;
}

.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(255,255,255,0.36);
  margin-bottom: 10px; position: relative; z-index: 1;
}
.prompt-list-wrap { position: relative; z-index: 1; }
.prompt-list { display: flex; flex-direction: column; gap: 7px; }

.prompt-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 13px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.13);
  border-radius: 10px; cursor: pointer;
  transition: background .15s, border-color .2s;
  user-select: none;
}
.prompt-item:hover { background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.22); }
.prompt-item.checked { border-color: rgba(47,243,224,0.32); background: rgba(47,243,224,0.06); }

.prompt-checkbox {
  width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.prompt-item.checked .prompt-checkbox {
  background: #2ff3e0; border-color: #2ff3e0;
  box-shadow: 0 0 0 3px rgba(47,243,224,0.20);
}
.prompt-checkbox svg { display: none; }
.prompt-item.checked .prompt-checkbox svg { display: block; }
.prompt-text { font-size: 12.5px; font-weight: 400; color: #fff; line-height: 1.5; }


/* =============================================================
   9. ONBOARDING — SUCCESS (STEP 4)
   ============================================================= */

.success-wrap {
  display: flex; flex-direction: column;
  align-items: center; text-align: center; padding: 8px 0;
}
.success-icon-ring {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(47,243,224,0.12);
  border: 2px solid rgba(47,243,224,0.35);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
}
.success-summary {
  width: 100%; margin-top: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.success-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.10);
  border-radius: 10px;
}
.success-item-label { font-size: 12px; color: rgba(255,255,255,0.55); }
.success-item-val { font-size: 13px; font-weight: 600; color: #fff; }
.success-item-tag {
  font-size: 11px; font-weight: 700;
  background: rgba(47,243,224,0.14); color: #2ff3e0;
  padding: 2px 8px; border-radius: 99px;
  border: 1px solid rgba(47,243,224,0.25);
}


/* =============================================================
   10. DASHBOARD — LAYOUT SHELL
   ============================================================= */

.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h); z-index: 100;
  background: var(--navy);
  display: flex; align-items: center; gap: 0;
  padding: 0 16px 0 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.header-logo {
  width: var(--sidebar-w); flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 16px; height: 100%;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.header-logo img {
  height: 28px; width: auto;
}

.header-nav {
  display: flex; align-items: center; gap: 2px;
  padding: 0 12px; height: 100%; flex-shrink: 0;
}
.header-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px; height: 36px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500;
  color: rgba(255,255,255,0.60);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.header-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.header-nav a.active { background: rgba(255,255,255,0.10); color: #fff; }

.header-brand-strip {
  flex: 1; min-width: 0; overflow: hidden;
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px;
  font-size: 12px; color: rgba(255,255,255,0.55);
  white-space: nowrap;
}
.header-brand-strip strong { color: #fff; font-weight: 600; }
.brand-more {
  background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.70);
  padding: 2px 7px; border-radius: 4px; font-size: 11px;
  cursor: pointer;
}

.header-right {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0; margin-left: auto;
}
.workspace-dropdown-wrap {
  position: relative;
}
.workspace-dropdown-menu {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}
.workspace-dropdown-menu.open { display: block; }
.workspace-dropdown-menu .wsd-header {
  padding: 10px 14px 6px;
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.workspace-dropdown-menu a,
.workspace-dropdown-menu button {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 14px;
  font-size: 13px; color: var(--text-dark);
  text-decoration: none; background: none; border: none;
  cursor: pointer; text-align: left;
  transition: background .12s;
}
.workspace-dropdown-menu a:hover,
.workspace-dropdown-menu button:hover { background: var(--gray-bg); }
.workspace-dropdown-menu .wsd-divider {
  height: 1px; background: var(--gray-border); margin: 4px 0;
}
.hdr-icon-btn {
  width: 32px; height: 32px; border-radius: 7px;
  background: transparent; border: none;
  color: rgba(255,255,255,0.55); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.hdr-icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.hdr-divider {
  width: 1px; height: 18px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0; margin: 0 4px;
}
/* Notifications dropdown */
.notif-dropdown-wrap { position: relative; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.notif-dropdown-menu {
  display: none !important;
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  width: 320px;
  z-index: 500;
  overflow: hidden;
}
.notif-dropdown-menu.open { display: block !important; }
.ndm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--gray-border);
}
.ndm-title { font-size: 13px; font-weight: 700; color: var(--text-dark); }
.ndm-mark-read {
  font-size: 11.5px; color: var(--red); font-weight: 500;
  background: none; border: none; cursor: pointer; padding: 0;
}
.ndm-mark-read:hover { text-decoration: underline; }
.ndm-list { max-height: 320px; overflow-y: auto; }
.ndm-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-border);
  transition: background .12s; cursor: pointer;
  position: relative;
}
.ndm-item:last-child { border-bottom: none; }
.ndm-item:hover { background: var(--gray-bg); }
.ndm-item.unread { background: #fff8fa; }
.ndm-item.unread:hover { background: #ffecf2; }
.ndm-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.ndm-icon--alert { background: #fff0f4; color: var(--red); }
.ndm-icon--up { background: #edfaf4; color: #16a34a; }
.ndm-icon--competitor { background: #fff7ed; color: #ea7e17; }
.ndm-icon--report { background: #f0f4ff; color: #4361ee; }
.ndm-icon--chat { background: #f0fbfa; color: #0d9488; }
.ndm-body { flex: 1; min-width: 0; }
.ndm-text { font-size: 12.5px; color: var(--text-dark); line-height: 1.45; }
.ndm-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.ndm-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); flex-shrink: 0; margin-top: 5px;
}
.ndm-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--gray-border);
  text-align: center;
}
.ndm-footer a {
  font-size: 12.5px; font-weight: 500; color: var(--red);
  text-decoration: none;
}
.ndm-footer a:hover { text-decoration: underline; }

/* Usage quota dropdown */
.usage-dropdown-wrap { position: relative; }
.usage-dropdown-menu {
  display: none !important;
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  width: 280px;
  z-index: 500;
  padding: 16px;
}
.usage-dropdown-menu.open { display: block !important; }
.udm-header { margin-bottom: 10px; }
.udm-count { font-size: 14px; color: var(--text-dark); }
.udm-count strong { font-weight: 700; }
.udm-bar-wrap { margin-bottom: 8px; }
.udm-bar-track {
  height: 8px; border-radius: 99px;
  background: #e4e5ec; overflow: hidden;
}
.udm-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--red), #2ff3e0);
  transition: width .3s ease;
}
.udm-reset {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 10px;
}
.udm-desc {
  font-size: 12.5px; color: var(--text-dark);
  line-height: 1.5; margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-border);
}
.udm-links { display: flex; flex-direction: column; gap: 6px; }
.udm-links a {
  font-size: 13px; font-weight: 500;
  color: var(--red); text-decoration: none;
}
.udm-links a:hover { text-decoration: underline; }

.profile-dropdown-wrap { position: relative; }
.profile-dropdown-menu {
  display: none !important;
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  min-width: 220px;
  z-index: 500;
  overflow: hidden;
}
.profile-dropdown-menu.open { display: block !important; }
.pdd-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 10px;
}
.pdd-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--cyan); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.pdd-name { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.pdd-email { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.pdd-divider { height: 1px; background: var(--gray-border); margin: 4px 0; }
.profile-dropdown-menu a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px;
  font-size: 13px; color: var(--text-dark);
  text-decoration: none;
  transition: background .12s;
}
.profile-dropdown-menu a:hover { background: var(--gray-bg); }
.profile-dropdown-menu a.pdd-signout { color: var(--red); }
.profile-dropdown-menu a.pdd-signout:hover { background: #fff0f4; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--cyan); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; cursor: pointer;
  flex-shrink: 0;
}

/* Sidebar */
.app-sidebar {
  position: fixed; top: var(--header-h); left: 0; bottom: 0;
  width: var(--sidebar-w); z-index: 90;
  background: var(--white);
  border-right: 1px solid var(--gray-border);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
.app-sidebar::-webkit-scrollbar { width: 4px; }
.app-sidebar::-webkit-scrollbar-thumb { background: var(--gray-border); border-radius: 99px; }

/* Main content area */
.app-main {
  margin-top: var(--header-h);
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--header-h));
  background: var(--gray-bg);
  display: flex; flex-direction: column;
}
.main-inner {
  flex: 1; padding: 24px 28px;
}

/* Footer */
.app-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-border);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}

.footer-links {
  display: flex; align-items: center; gap: 16px;
}
.footer-links a {
  font-size: 12px; color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--text-dark); }
.footer-copy { font-size: 12px; color: var(--text-muted); }


/* =============================================================
   11. DASHBOARD — PROJECT SWITCHER
   ============================================================= */

.project-switcher-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-border);
  position: relative;
}
.project-switcher-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--gray-bg); border: 1px solid var(--gray-border);
  cursor: pointer; transition: background .15s;
}
.project-switcher-btn:hover { background: #eaebf2; }
.project-switcher-btn.open { background: #eaebf2; }
.psw-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan); flex-shrink: 0;
}
.psw-name {
  flex: 1; min-width: 0; text-align: left;
  font-size: 12.5px; font-weight: 600; color: var(--text-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.psw-chevron {
  color: var(--text-muted); flex-shrink: 0;
  transition: transform .2s;
}
.project-switcher-btn.open .psw-chevron { transform: rotate(180deg); }

.project-dropdown {
  display: none !important; position: absolute; top: calc(100% - 4px);
  left: 12px; right: 12px; z-index: 500;
  background: var(--white); border: 1px solid var(--gray-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(1,10,40,0.12);
  overflow: hidden; animation: slideDown .15s ease;
}
.project-dropdown.open { display: block !important; }
.pd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer;
  font-size: 12.5px; color: var(--text-dark);
  transition: background .12s;
}
.pd-item:hover { background: var(--gray-bg); }
.pd-item.active { background: #fff0f4; color: #ed155d; font-weight: 600; }
.pd-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pd-sep {
  height: 1px; background: var(--gray-border); margin: 4px 0;
}
.pd-add {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; cursor: pointer;
  font-size: 12px; color: #ed155d; font-weight: 600;
  transition: background .12s;
}
.pd-add:hover { background: var(--gray-bg); }


/* =============================================================
   12. DASHBOARD — SIDEBAR NAV
   ============================================================= */

.sidebar-nav { flex: 1; padding: 8px 0; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 10px 16px 4px;
}
.sidebar-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px; font-size: 12.5px; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  border-radius: 0; cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
}
.sidebar-nav-item:hover { background: var(--gray-bg); color: var(--text-dark); }
.sidebar-nav-item.active {
  background: #fff0f4; color: #ed155d; font-weight: 600;
}
.sidebar-nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: #ed155d; border-radius: 0 2px 2px 0;
}
.sidebar-nav-item svg { flex-shrink: 0; }
.sidebar-divider { height: 1px; background: var(--gray-border); margin: 8px 12px; }
.sidebar-action {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px; font-size: 12px; color: var(--text-muted);
  cursor: pointer; transition: color .12s;
}
.sidebar-action:hover { color: var(--text-dark); }


/* =============================================================
   13. DASHBOARD — RECOMMENDATIONS ACCORDION
   ============================================================= */

.rec-section { padding: 0 12px 8px; }
.rec-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px; background: none; border: none;
  cursor: pointer; border-radius: 7px;
  transition: background .12s;
}
.rec-toggle:hover { background: var(--gray-bg); }
.rec-toggle-left { display: flex; align-items: center; gap: 7px; }
.rec-toggle-label { font-size: 12px; font-weight: 600; color: var(--text-dark); }
.rec-count {
  font-size: 10px; font-weight: 700;
  background: var(--red); color: #fff;
  padding: 1px 5px; border-radius: 99px;
}
.rec-chevron { color: var(--text-muted); transition: transform .2s; }
.rec-toggle.open .rec-chevron { transform: rotate(180deg); }
.rec-body { display: none; padding: 0; overflow: hidden; }
.rec-body-inner { padding: 4px 0 6px; }
.rec-toggle.open + .rec-body { display: block; }
.rec-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0; margin-top: 5px;
}
.rec-dot.red { background: var(--red); }
.rec-dot.yellow { background: var(--yellow); }
.rec-dot.cyan { background: var(--cyan); }
.rec-text { font-size: 11.5px; color: var(--text-dark); line-height: 1.4; }

/* ── Sidebar: Collapse toggle ── */
.sb-collapse-btn {
  position: absolute; top: 12px; right: -12px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--gray-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 100; color: var(--text-muted);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background .15s, color .15s;
}
.sb-collapse-btn:hover { background: var(--gray-bg); color: var(--text-dark); }
.sb-collapse-btn svg { transition: transform .25s; }
.app-sidebar.collapsed .sb-collapse-btn svg { transform: rotate(180deg); }

/* Sidebar + main animated transitions */
.app-sidebar { transition: width .25s cubic-bezier(.4,0,.2,1); }
.app-main, .app-footer { transition: margin-left .25s cubic-bezier(.4,0,.2,1); }

/* Collapsed sidebar state */
.app-sidebar.collapsed {
  width: 52px;
  overflow: hidden;
}
.app-sidebar.collapsed ~ .app-main {
  margin-left: 52px;
}
.app-sidebar.collapsed .project-switcher-wrap,
.app-sidebar.collapsed .sb-score-widget,
.app-sidebar.collapsed .sidebar-section-label,
.app-sidebar.collapsed .rec-section,
.app-sidebar.collapsed .sidebar-divider,
.app-sidebar.collapsed .sidebar-action-bar {
  display: none;
}
/* font-size:0 hides bare text nodes; reset on SVG so icons stay sized */
.app-sidebar.collapsed .sidebar-nav-item {
  font-size: 0;
  justify-content: center;
  padding: 9px 0;
}
.app-sidebar.collapsed .sidebar-nav-item svg { font-size: 14px; flex-shrink: 0; }
.app-sidebar.collapsed .sidebar-nav-item .sb-chan-score { display: none; }
.app-sidebar.collapsed .sidebar-nav { padding: 8px 4px; }
.app-sidebar.collapsed .sb-collapse-btn { right: 4px; top: 8px; }

/* ── Card hover elevation (global) ── */
.dash-card { transition: box-shadow .2s cubic-bezier(.4,0,.2,1), transform .2s cubic-bezier(.4,0,.2,1); }

/* ── Sidebar: channel score badges ── */
.sb-chan-score {
  margin-left: auto;
  font-size: 10.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  flex-shrink: 0;
}
.sb-chan-score.g { background: #edfaf4; color: #16a34a; }
.sb-chan-score.y { background: #fffbeb; color: #d97706; }
.sb-chan-score.r { background: #fff0f4; color: var(--red); }

/* ── Sidebar: richer rec items ── */
.rec-item {
  display: flex !important; align-items: flex-start; gap: 8px;
  padding: 7px 8px; border-radius: 7px; cursor: pointer;
  transition: background .12s;
}
.rec-item:hover { background: var(--gray-bg); }
.rec-item-body { flex: 1; min-width: 0; overflow: hidden; }
.rec-item-tags { display: flex !important; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.rec-item-tag { padding: 1px 5px; border-radius: 3px; font-size: 10px; font-weight: 600; }
.rec-tag--hi { background: #fff0f4; color: var(--red); }
.rec-tag--mi { background: #fffbeb; color: #d97706; }
.rec-tag--lo { background: #f0f4ff; color: #4285f4; }
.rec-impact { font-size: 10.5px; font-weight: 700; color: #16a34a; margin-left: auto; flex-shrink: 0; padding-top: 1px; }
.rec-dismiss {
  display: none !important; background: none; border: none; cursor: pointer;
  padding: 2px 4px; color: #ccc; border-radius: 4px;
  flex-shrink: 0; align-self: flex-start; line-height: 1; font-size: 12px;
}
.rec-item:hover .rec-dismiss { display: block !important; }
.rec-dismiss:hover { color: var(--red); background: #fff0f4; }
.rec-item.dismissed { display: none !important; }

/* ── Sidebar: Recommendations sub-nav ── */
.rec-subnav { padding: 4px 0 6px; }

.rec-subnav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px 7px 12px; margin: 1px 4px;
  border-radius: 8px; text-decoration: none;
  color: var(--text-dark); font-size: 12.5px; font-weight: 500;
  transition: background .12s; position: relative; cursor: pointer;
}
.rec-subnav-item::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 2.5px; border-radius: 0 2px 2px 0;
  background: var(--cat, #ccc); opacity: 0; transition: opacity .15s;
}
.rec-subnav-item:hover { background: var(--gray-bg); }
.rec-subnav-item:hover::before { opacity: 0.45; }
.rec-subnav-item.active { background: color-mix(in srgb, var(--cat, #4285f4) 8%, white); }
.rec-subnav-item.active::before { opacity: 1; }
.rec-subnav-item.active .rec-cat-label { color: var(--cat, #4285f4); font-weight: 600; }

.rec-cat-icon {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--cat-bg, #f3f5f9); color: var(--cat, #777);
}
.rec-cat-icon--letter {
  font-size: 11px; font-weight: 800; font-family: Georgia, serif;
  letter-spacing: -0.02em;
}

.rec-cat-label { flex: 1; min-width: 0; }

.rec-cat-pill {
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2px 6px; border-radius: 99px;
  background: var(--pill, #f3f5f9); color: var(--pill-fg, #777);
}
.rec-cat-pill:empty { display: none; }

.rec-cat-badge {
  font-size: 9.5px; font-weight: 700; line-height: 1;
  padding: 2px 6px; border-radius: 99px;
}
.rec-badge--soon {
  background: #f3f5f9; color: #aaa; letter-spacing: 0.03em;
}

.rec-subnav-divider {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 10px 12px 4px; opacity: 0.7;
}

/* ── Sidebar: action buttons at bottom ── */
.sidebar-action-bar {
  padding: 10px 12px 14px;
  display: flex; flex-direction: column; gap: 7px;
  margin-top: auto;
  border-top: 1px solid var(--gray-border);
}
.sb-action-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s; text-decoration: none;
  border: 1px solid var(--gray-border); background: var(--white);
  color: var(--text-dark); font-family: inherit;
  width: 100%; text-align: left;
}
.sb-action-btn:hover { background: var(--gray-bg); border-color: #c9c9da; }
.sb-action-btn--primary {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.sb-action-btn--primary:hover { background: #2d1040; border-color: #2d1040; }

/* ── Rec body open animation (JS-driven via class) ── */
.rec-toggle.open + .rec-body { animation: rec-open .22s ease; }
@keyframes rec-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* =============================================================
   14. DASHBOARD — FILTER BAR & PAGE HEADER
   ============================================================= */

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.page-title { font-size: 18px; font-weight: 700; color: var(--text-dark); }
.page-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filter-chip {
  display: flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 12px;
  background: var(--white); border: 1px solid var(--gray-border);
  border-radius: 7px; font-family: var(--font);
  font-size: 12px; font-weight: 500; color: var(--text-dark);
  cursor: pointer; transition: border-color .15s, background .15s;
  white-space: nowrap;
}
.filter-chip:hover { border-color: #d4a0b0; background: #fafafa; }
.filter-chip.active { border-color: #ed155d; background: #fff0f4; color: #ed155d; }
.filter-sep { height: 20px; width: 1px; background: var(--gray-border); }


/* =============================================================
   15. DASHBOARD — STAT CARDS
   ============================================================= */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--white); border: 1px solid var(--gray-border);
  border-radius: 12px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
}
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; padding: 2px 6px;
  border-radius: 5px;
}
.stat-delta.up { background: #e6faf1; color: #1a9e5c; }
.stat-delta.down { background: #fff0f0; color: #c0392b; }
.stat-delta.neutral { background: var(--gray-bg); color: var(--text-muted); }
.stat-meta { font-size: 11px; color: var(--text-muted); }


/* =============================================================
   16. DASHBOARD — TAB NAV
   ============================================================= */

.tab-nav {
  display: flex; align-items: center; gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: 0;
}
.tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: none; border: none;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-dark); }
.tab-btn.active { color: #ed155d; border-bottom-color: #ed155d; font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }


/* =============================================================
   17. DASHBOARD — CONTENT GRID
   ============================================================= */

.top-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px; margin-bottom: 16px;
}
.dash-card {
  background: var(--white); border: 1px solid var(--gray-border);
  border-radius: 12px; padding: 18px 20px;
}
.dash-card-title {
  font-size: 13px; font-weight: 700; color: var(--text-dark);
  margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}
.dash-card-title a {
  font-size: 11.5px; font-weight: 600; color: #ed155d;
  text-decoration: none; margin-left: auto;
}
.dash-card-title a:hover { text-decoration: underline; }

/* Gauge card */
.gauge-card { display: flex; flex-direction: column; align-items: center; }
.gauge-wrap {
  position: relative; width: 130px; height: 130px;
  margin: 10px auto;
}
.gauge-wrap svg { width: 130px; height: 130px; }
.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.gauge-val { font-size: 26px; font-weight: 800; color: var(--text-dark); line-height: 1; }
.gauge-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.gauge-label { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }

/* Breakdown card */
.breakdown-list { display: flex; flex-direction: column; gap: 10px; }
.breakdown-item { display: flex; flex-direction: column; gap: 4px; }
.breakdown-meta {
  display: flex; align-items: center; justify-content: space-between;
}
.breakdown-name { font-size: 12.5px; font-weight: 500; color: var(--text-dark); }
.breakdown-val { font-size: 12px; font-weight: 700; color: var(--text-dark); }
.breakdown-bar {
  height: 5px; background: var(--gray-bg); border-radius: 99px; overflow: hidden;
}
.breakdown-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #ed155d, #2ff3e0);
}
.breakdown-fill.cyan { background: var(--cyan); }
.breakdown-fill.pink { background: var(--pink); }
.breakdown-fill.yellow { background: var(--yellow); }

/* Mini stats */
.mini-stats { display: flex; flex-direction: column; gap: 10px; }
.mini-stat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--gray-bg); border-radius: 8px;
}
.mini-stat-label { font-size: 12px; color: var(--text-muted); }
.mini-stat-val { font-size: 14px; font-weight: 700; color: var(--text-dark); }

/* Ranking card */
.ranking-card { grid-column: span 3; }
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th {
  padding: 8px 12px; text-align: left;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--gray-border);
  white-space: nowrap;
}
.rank-table td {
  padding: 10px 12px;
  font-size: 12.5px; color: var(--text-dark);
  border-bottom: 1px solid #f0f1f8;
}
.rank-table tr:last-child td { border-bottom: none; }
.rank-table tr:hover td { background: #fafafa; }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; padding: 3px 8px;
  border-radius: 5px; font-size: 12px; font-weight: 700;
}
.rank-badge.g { background: #e6faf1; color: #1a9e5c; border: 1px solid #b8f0d4; }
.rank-badge.y { background: #fffbea; color: #c8860a; border: 1px solid #ffe4a0; }
.rank-badge.r { background: #fff0f0; color: #c0392b; border: 1px solid #ffc8c8; }
.rank-badge.na { background: var(--gray-bg); color: var(--text-muted); border: 1px solid var(--gray-border); }
.mention-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
}
.mention-dot.yes { background: #1a9e5c; }
.mention-dot.no { background: #e4e5ec; }


/* =============================================================
   18. DASHBOARD — MODAL
   ============================================================= */

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(1,10,40,0.55);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 16px;
  padding: 28px 32px; width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(1,10,40,0.18);
  animation: modal-in .2s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.modal-close {
  width: 28px; height: 28px; border-radius: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.modal-close:hover { background: var(--gray-bg); color: var(--text-dark); }
.modal-field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.modal-label { font-size: 12px; font-weight: 600; color: var(--text-dark); }
.modal-input {
  height: 40px; padding: 0 12px;
  border: 1.5px solid var(--gray-border); border-radius: 8px;
  font-family: var(--font); font-size: 13px; color: var(--text-dark);
  outline: none; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.modal-input:focus { border-color: #ed155d; box-shadow: 0 0 0 3px rgba(237,21,93,0.15); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-btn-cancel {
  height: 36px; padding: 0 16px;
  background: none; border: 1.5px solid var(--gray-border);
  border-radius: 7px; font-family: var(--font);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: background .12s;
}
.modal-btn-cancel:hover { background: var(--gray-bg); }
.modal-btn-create {
  height: 36px; padding: 0 20px;
  background: #ed155d; border: none; border-radius: 7px;
  font-family: var(--font); font-size: 13px; font-weight: 700;
  color: #fff; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.modal-btn-create:hover {
  background: #c50e4a; box-shadow: 0 4px 14px rgba(237,21,93,0.35);
}


/* =============================================================
   19. AI RESPONSES PAGE
   ============================================================= */

.ar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); margin-bottom: 4px;
}
.ar-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.ar-breadcrumb a:hover { color: #ed155d; }
.ar-breadcrumb-sep { font-size: 10px; }

.ar-summary {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 0; background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 12px; overflow: hidden;
  margin-bottom: 20px;
}
.ar-model-card {
  padding: 16px 20px;
  border-right: 1px solid var(--gray-border);
}
.ar-model-card:last-child { border-right: none; }
.ar-model-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.ar-model-logo {
  width: 22px; height: 22px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ar-model-name { font-size: 13px; font-weight: 700; color: var(--text-dark); }
.ar-model-score { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 3px; }
.ar-model-meta { font-size: 11.5px; color: var(--text-muted); }

.ar-prompt-table {
  background: var(--white); border: 1px solid var(--gray-border);
  border-radius: 12px; overflow: hidden;
}
.ar-table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--gray-border);
}
.ar-table-title {
  font-size: 14px; font-weight: 700; color: var(--text-dark);
  display: flex; align-items: center; gap: 8px;
}

.ar-table { width: 100%; border-collapse: collapse; }
.ar-table thead tr { background: #f8f9fc; border-bottom: 1px solid var(--gray-border); }
.ar-table th {
  padding: 10px 16px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  text-align: left; white-space: nowrap;
}
.ar-table td { padding: 0; border-bottom: 1px solid #f0f1f8; vertical-align: top; }
.ar-table tr:last-child td { border-bottom: none; }
.ar-table tr:hover .ar-td-inner { background: #fafafa; }

.ar-td-inner { padding: 13px 16px; display: flex; align-items: center; height: 100%; }
.ar-td-top { display: flex; flex-direction: column; justify-content: center; }

.ar-num { font-size: 12px; color: var(--text-muted); font-weight: 600; min-width: 24px; }
.ar-prompt-text {
  font-size: 12.5px; font-weight: 500; color: var(--text-dark);
  line-height: 1.45; max-width: 340px;
}

.bp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.bp-badge.mentioned    { background: #e6faf1; color: #1a9e5c; border: 1px solid #b8f0d4; }
.bp-badge.recommended  { background: #fff0f9; color: #c0185a; border: 1px solid #f9b8d8; }
.bp-badge.partial      { background: #fffbea; color: #c8860a; border: 1px solid #ffe4a0; }
.bp-badge.notfound     { background: #f4f5f8; color: var(--text-muted); border: 1px solid var(--gray-border); }

.sentiment-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.sentiment-badge.positive { background: #e6faf1; color: #1a9e5c; border: 1px solid #b8f0d4; }
.sentiment-badge.neutral  { background: #fff0f4; color: #ed155d; border: 1px solid #ffc0d4; }
.sentiment-badge.negative { background: #fff0f0; color: #c0392b; border: 1px solid #ffc8c8; }

.ar-rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; padding: 4px 8px;
  border-radius: 6px; font-size: 11.5px; font-weight: 700; line-height: 1;
}
.ar-rank-badge.green  { background: #e6faf1; color: #1a9e5c; border: 1px solid #b8f0d4; }
.ar-rank-badge.yellow { background: #fffbea; color: #c8860a; border: 1px solid #ffe4a0; }
.ar-rank-badge.red    { background: #fff0f0; color: #c0392b; border: 1px solid #ffc8c8; }
.ar-rank-badge.gray   { background: #f4f5f8; color: var(--text-muted); border: 1px solid var(--gray-border); }

.ar-snippet {
  font-size: 11.5px; color: var(--text-muted);
  line-height: 1.4; max-width: 260px;
}
.ar-snippet mark {
  background: rgba(248,210,16,0.3); color: var(--text-dark);
  border-radius: 2px; padding: 0 1px;
}

.expand-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border: 1px solid var(--gray-border);
  border-radius: 6px; background: var(--white);
  font-family: var(--font); font-size: 11.5px; font-weight: 600;
  color: #ed155d; cursor: pointer;
  transition: background .12s, border-color .12s; white-space: nowrap;
}
.expand-btn:hover { background: #fff5f7; border-color: #d4a0b0; }
.expand-btn svg { transition: transform .2s; }
.expand-btn.open svg { transform: rotate(180deg); }

.ar-expanded-row { display: none; }
.ar-expanded-row.open { display: table-row; }
.ar-expanded-cell {
  padding: 0; border-bottom: 1px solid #f0f1f8;
  background: #fafafa;
}
.ar-expanded-inner { padding: 16px 20px 20px 56px; }
.ar-response-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 8px;
}
.ar-response-text {
  font-size: 13px; color: var(--text-dark); line-height: 1.7;
  border-left: 3px solid var(--gray-border); padding-left: 14px;
}
.ar-response-text mark {
  background: rgba(248,210,16,0.35); color: var(--text-dark);
  border-radius: 2px; padding: 0 2px; font-weight: 600;
}
.ar-citation {
  margin-top: 10px; font-size: 11.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}
.ar-citation a { color: #ed155d; text-decoration: none; }
.ar-citation a:hover { text-decoration: underline; }


/* =============================================================
   20. RESPONSIVE BREAKPOINTS
   ============================================================= */

@media (max-width: 1100px) {
  .top-row { grid-template-columns: 1fr 1fr; }
  .ranking-card { grid-column: span 2; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .ar-summary { grid-template-columns: 1fr; }
  .ar-model-card { border-right: none; border-bottom: 1px solid var(--gray-border); }
  .ar-model-card:last-child { border-bottom: none; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .app-sidebar { transform: translateX(-220px); transition: transform .25s; }
  .app-sidebar.open { transform: translateX(0); width: 220px; }
  .app-main { margin-left: 0; }
  .app-footer { margin-left: 0; }
  .header-logo { width: auto; min-width: 52px; }
  .header-nav { display: none; }
}

@media (max-width: 640px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .top-row { grid-template-columns: 1fr; }
  .ranking-card { grid-column: span 1; }
  .main-inner { padding: 16px; }
  .card { padding: 28px 20px 24px; }
  .card.wide { padding: 28px 20px 24px; }
  .field-row { grid-template-columns: 1fr; }
  .ar-table { font-size: 11px; }
  .ar-prompt-text { max-width: 180px; }
  .ar-snippet { max-width: 130px; }
}
