:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  /* ── Brand palette ──────────────────────────────────────────────────────────
     Sibling tool to IMPS — same design system, only the brand ramp + neutrals
     differ so the two feel part of one set. IMPS is warm orange; this YouTube
     AdSales tool is cool violet. The token NAMES are kept (--orange*) so every
     shared rule in base.css / yt.css resolves unchanged — only the values
     below change the identity. */
  --orange: #5B4BD6;        /* brand (violet) */
  --orange-light: #8377E6;
  --orange-dark: #4536B0;
  --orange-pale: #EEEBFB;
  --orange-mid: #CFC8F4;
  --cream: #F8F8FC;         /* cool off-white app background */
  --ink: #181626;
  --ink-mid: #423E54;
  --ink-light: #847F97;
  --ink-faint: #BDB8CC;
  --border: #E7E4F0;
  --border-dark: #D2CDE1;
  --surface: #FFFFFF;
  --surface-warm: #F6F5FB;
  --green: #1A7A4A;
  --green-pale: #E8F5EF;
  --blue: #1A5A8C;
  --blue-pale: #E8F2FA;
  --amber: #B86A0A;
  --amber-pale: #FDF0DC;
  --red: #C02020;
  --red-pale: #FDEAEA;
  --review-wash: #FDF6F3;        /* soft full-row "needs attention" wash */
  --review-wash-hover: #FBEEE9;
  --review-cell: #FCE4DC;        /* the specific cell that must be set */
  --review-accent: #E8A48F;      /* left rail on flagged rows */
  --control-height: 36px;        /* every single-line input, dropdown and button */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(24,22,38,0.08);
  --shadow-lg: 0 8px 32px rgba(24,22,38,0.14);
}

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

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* Every modal shares the same page lock; its own content remains scrollable. */
html { scrollbar-gutter: stable; }
html:has(body.modal-open), body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}
.ui-overlay, .dp-modal-backdrop, .modal-overlay,
.ui-modal, .ui-modal-body, .dp-modal, .modal {
  overscroll-behavior: contain;
}

/* ── HEADER ── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.logo:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.logo-image {
  display: block;
  width: 62px;
  height: 46px;
  object-fit: contain;
  flex: none;
}

.logo-sub {
  font-size: 11px;
  color: var(--ink-light);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .logo-sub { display: none; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Buttons: one definition for every screen (staff, customer, dialogs).
   .btn-primary = the single main action; .btn-ghost = every other action. */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--control-height);
  padding: 7px 14px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-mid);
  font: 600 13px/1.4 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { border-color: var(--orange); background: var(--orange); color: #fff; }
.btn-primary:hover:not(:disabled) { border-color: var(--orange-dark); background: var(--orange-dark); }
.btn-ghost:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.btn-primary:disabled,
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.btn-tight { min-height: 28px; padding: 4px 10px; font-size: 12px; }

/* ── MAIN LAYOUT ── */
.main {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── PAGE TITLE (AdSales workflow screens and sign-in) ── */

.page-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--ink);
  font: 700 22px/1.3 var(--font-sans);
}

/* ── FORM ── */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mid);
}

.field input,
.field select,
.field textarea {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232,80,10,0.1);
}

.field input[readonly],
.field select[disabled],
.field textarea[readonly] {
  background: var(--surface-warm);
  color: var(--ink-mid);
  cursor: default;
}

/* ── LEGACY DIALOG (.modal: host assistant) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,20,16,0.5);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: 95vw;
  overflow: hidden;
}

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--surface-warm);
}

/* ── UTIL ── */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

