:root {
  --navy-950: #0a1628;
  --navy-900: #0f2240;
  --navy-800: #16325c;
  --navy-700: #1e4078;
  --gold-400: #c9a962;
  --gold-500: #b8943f;
  --cream-50: #faf8f5;
  --cream-100: #f3efe8;
  --ink: #0f2240;
  --muted: #5c6b7a;
  --line: rgba(15, 34, 64, 0.10);
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --font-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
}

html, body { margin: 0; min-height: 100%; background: var(--cream-50); }
::selection { background: rgba(201, 169, 98, 0.30); color: var(--navy-950); }

#avid-deal-prototype {
  min-height: 100vh;
  width: 100%;
  background: var(--cream-50);
  color: var(--ink);
  font-family: var(--font-sans);
}
#avid-deal-prototype * { box-sizing: border-box; }
#avid-deal-prototype .shell { display: grid; grid-template-columns: 248px minmax(0,1fr); min-height: 100vh; }
#avid-deal-prototype .sidebar {
  background: var(--navy-950);
  color: rgba(255,255,255,.78);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
#avid-deal-prototype .brand { display: flex; flex-direction: column; gap: 12px; padding: 4px 6px 2px; }
#avid-deal-prototype .brand-logo {
  display: block;
  height: 58px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}
#avid-deal-prototype .brand-product { padding: 0 2px 2px; border-top: 1px solid rgba(201, 169, 98, 0.28); }
#avid-deal-prototype .brand-kicker {
  margin-top: 11px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-400);
}
#avid-deal-prototype .brand-tagline { margin-top: 4px; font-size: 12px; color: rgba(255,255,255,.52); }
#avid-deal-prototype .nav { display: flex; flex-direction: column; gap: 6px; }
#avid-deal-prototype .nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.68);
  padding: 11px 12px;
  border-radius: 10px;
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: center;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}
#avid-deal-prototype .nav button.active { background: rgba(201, 169, 98, 0.14); color: var(--gold-400); }
#avid-deal-prototype .nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
#avid-deal-prototype .sidebar-note {
  margin-top: auto;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 14px;
  font-size: 12px;
  color: rgba(255,255,255,.58);
  line-height: 1.45;
}
#avid-deal-prototype .sidebar-note strong {
  color: var(--gold-400);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
#avid-deal-prototype .main { min-width: 0; padding: 24px 28px 36px; }
#avid-deal-prototype .topbar { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
#avid-deal-prototype h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--navy-950);
}
#avid-deal-prototype .subtitle { margin-top: 7px; font-size: 14px; color: var(--muted); }
#avid-deal-prototype .top-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
#avid-deal-prototype .btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy-800);
  border-radius: 999px;
  padding: 9px 14px;
  min-height: 40px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
}
#avid-deal-prototype .top-actions .btn {
  background: var(--navy-800);
  color: #fff;
  border-color: var(--navy-700);
}
#avid-deal-prototype .top-actions .btn:hover {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: #fff;
}
#avid-deal-prototype .btn.primary,
#avid-deal-prototype .top-actions .btn.primary {
  background: var(--navy-700);
  color: #fff;
  border-color: var(--navy-700);
}
#avid-deal-prototype .btn.primary:hover,
#avid-deal-prototype .top-actions .btn.primary:hover {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
#avid-deal-prototype .btn:focus,
#avid-deal-prototype select:focus,
#avid-deal-prototype input:focus { outline: 3px solid rgba(201, 169, 98, .35); outline-offset: 2px; }
#avid-deal-prototype .top-actions .btn:focus { outline-color: rgba(30, 64, 120, .40); }
#avid-deal-prototype .statusline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
#avid-deal-prototype .chip { background: #fff; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 12px; }
#avid-deal-prototype .chip.good { background: #eef7f3; color: #2f6e57; border-color: #cde7dc; }
#avid-deal-prototype .chip.warn { background: var(--cream-100); color: #8a5a1c; border-color: #ead7b4; }
#avid-deal-prototype .chip.bad { background: #faeeee; color: #914c4c; border-color: #efd2d2; }
#avid-deal-prototype .stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
#avid-deal-prototype .stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
#avid-deal-prototype .stat-label { color: var(--gold-500); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }
#avid-deal-prototype .stat-value {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-950);
  font-variant-numeric: tabular-nums;
}
#avid-deal-prototype .stat-foot { margin-top: 5px; font-size: 12px; color: var(--muted); }
#avid-deal-prototype .grid-main { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(270px,.8fr); gap: 16px; align-items: start; }
#avid-deal-prototype .stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#avid-deal-prototype .card { background: #fff; border: 1px solid var(--line); border-radius: 15px; min-width: 0; overflow: hidden; }
#avid-deal-prototype .card-head {
  padding: 16px 18px 13px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  border-bottom: 1px solid var(--cream-100);
}
#avid-deal-prototype .card-title { font-family: var(--font-serif); font-size: 17px; font-weight: 700; color: var(--navy-950); }
#avid-deal-prototype .card-desc { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
#avid-deal-prototype .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#avid-deal-prototype select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 30px 0 10px;
  color: var(--navy-800);
  font-size: 13px;
  font-family: inherit;
}
#avid-deal-prototype .table-wrap {
  overflow-x: auto;
  margin: 0 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
#avid-deal-prototype .table-wrap.scroll { max-height: 420px; overflow: auto; }
#avid-deal-prototype table { width: 100%; border-collapse: collapse; min-width: 820px; }
#avid-deal-prototype th {
  background: var(--cream-50);
  color: var(--navy-800);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  text-align: left;
  padding: 12px 14px 11px;
  white-space: nowrap;
  border-bottom: 2px solid var(--navy-700);
  position: sticky;
  top: 0;
  z-index: 1;
}
#avid-deal-prototype th .sub {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--muted);
}
#avid-deal-prototype th.num,
#avid-deal-prototype td.num { text-align: right; }
#avid-deal-prototype td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--cream-100);
  font-size: 13px;
  color: var(--navy-800);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#avid-deal-prototype tbody tr:nth-child(even) td { background: var(--cream-50); }
#avid-deal-prototype tbody tr:last-child td { border-bottom: 0; }
#avid-deal-prototype tbody tr:hover td { background: #eef3f8; }
#avid-deal-prototype .deal-name {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-950);
}
#avid-deal-prototype .metric-positive { color: #267053; font-weight: 600; }
#avid-deal-prototype .metric-negative { color: #a04b45; font-weight: 600; }
#avid-deal-prototype .pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 600; }
#avid-deal-prototype .pill.blue { background: #e8eef6; color: var(--navy-800); }
#avid-deal-prototype .pill.gold { background: var(--cream-100); color: var(--gold-500); }
#avid-deal-prototype .pill.gray { background: var(--cream-100); color: var(--muted); }
#avid-deal-prototype .pill.red { background: #faeeee; color: #914c4c; }
#avid-deal-prototype .action-body { padding: 14px 16px 18px; }
#avid-deal-prototype .action-card {
  border-color: var(--navy-700);
  box-shadow: inset 3px 0 0 var(--navy-700);
}
#avid-deal-prototype .action-card .card-title {
  font-size: 20px;
  letter-spacing: -0.02em;
}
#avid-deal-prototype .action-card .card-desc {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy-800);
}
#avid-deal-prototype .action-card .pill.gold {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-900);
  background: #e8eef6;
}
#avid-deal-prototype .action-card .tabs button {
  font-size: 14px;
  font-weight: 700;
}
#avid-deal-prototype .action-card .offer-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
}
#avid-deal-prototype .action-card .offer-meta {
  font-size: 13px;
  font-weight: 500;
}
#avid-deal-prototype .action-card .datebox strong {
  font-size: 22px;
}
#avid-deal-prototype .action-card .datebox span {
  font-size: 11px;
  font-weight: 700;
}
#avid-deal-prototype .tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; background: var(--cream-100); padding: 4px; border-radius: 10px; margin-bottom: 14px; }
#avid-deal-prototype .tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
#avid-deal-prototype .tabs button.active { background: #fff; color: var(--navy-950); box-shadow: 0 1px 2px rgba(10, 22, 40, .06); }
#avid-deal-prototype .offer-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 11px;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 9px;
}
#avid-deal-prototype .offer-item:first-child { margin-top: 0; }
#avid-deal-prototype .offer-item.highlighted { border-color: var(--gold-400); background: var(--cream-50); }
#avid-deal-prototype .offer-name { font-size: 14px; font-weight: 600; color: var(--navy-950); }
#avid-deal-prototype .offer-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
#avid-deal-prototype .datebox { min-width: 54px; border-left: 3px solid var(--gold-400); padding-left: 9px; text-align: left; }
#avid-deal-prototype .datebox strong { display: block; font-family: var(--font-serif); font-size: 18px; color: var(--navy-950); }
#avid-deal-prototype .datebox span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
#avid-deal-prototype .calendar-preview { padding: 14px 16px 17px; }
#avid-deal-prototype .cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
#avid-deal-prototype .cal-nav { display: flex; flex-wrap: wrap; gap: 6px; }
#avid-deal-prototype .cal-nav .btn { min-height: 32px; padding: 6px 10px; font-size: 12px; }
#avid-deal-prototype .cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
#avid-deal-prototype .dow { text-align: center; font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .06em; padding: 3px; }
#avid-deal-prototype .day {
  min-height: 52px;
  border: 1px solid var(--cream-100);
  border-radius: 8px;
  padding: 5px;
  font-size: 10px;
  color: var(--muted);
  position: relative;
  background: var(--cream-50);
}
#avid-deal-prototype button.day { font: inherit; width: 100%; text-align: left; cursor: pointer; }
#avid-deal-prototype .day.muted { opacity: .45; pointer-events: none; }
#avid-deal-prototype .day.today { border-color: var(--navy-700); background: #e8eef6; color: var(--navy-800); font-weight: 700; }
#avid-deal-prototype .day.has-event { cursor: pointer; }
#avid-deal-prototype .day.selected { border-color: var(--gold-400); background: var(--cream-100); color: #5c4a1e; font-weight: 700; }
#avid-deal-prototype .day-num { display: block; font-weight: 700; }
#avid-deal-prototype .day-count { display: block; margin-top: 8px; font-size: 10px; font-weight: 700; color: var(--gold-500); }
#avid-deal-prototype .day.has-event:after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-400);
  position: absolute;
  right: 6px;
  bottom: 6px;
  pointer-events: none;
}
#avid-deal-prototype .cal-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 14px 0 10px; }
#avid-deal-prototype .cal-day-head strong { font-size: 13px; color: var(--navy-950); }
#avid-deal-prototype .cal-day-head span { font-size: 11px; color: var(--muted); }
#avid-deal-prototype .aging { padding: 17px 18px 19px; }
#avid-deal-prototype .aging-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; min-height: 168px; }
#avid-deal-prototype .aging-col {
  appearance: none;
  font: inherit;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 6px 2px 4px;
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
#avid-deal-prototype .aging-col:hover { background: var(--cream-50); }
#avid-deal-prototype .aging-col.selected { border-color: var(--gold-400); background: var(--cream-100); }
#avid-deal-prototype .aging-col-value { font-size: 13px; font-weight: 700; color: var(--navy-950); }
#avid-deal-prototype .aging-col-track { width: 100%; height: 128px; display: flex; align-items: flex-end; justify-content: center; }
#avid-deal-prototype .aging-wide .aging-col-track { height: 168px; }
#avid-deal-prototype .aging-col-fill {
  display: block;
  width: min(42px, 72%);
  min-height: 2px;
  border-radius: 6px 6px 2px 2px;
  background: var(--navy-700);
}
#avid-deal-prototype .aging-col.sage .aging-col-fill { background: var(--navy-700); }
#avid-deal-prototype .aging-col.blue .aging-col-fill { background: var(--navy-800); }
#avid-deal-prototype .aging-col.gold .aging-col-fill { background: var(--gold-400); }
#avid-deal-prototype .aging-col.slate .aging-col-fill { background: #8a959d; }
#avid-deal-prototype .aging-col-label { font-size: 11px; font-weight: 700; color: var(--navy-800); }
#avid-deal-prototype .aging-col-hint { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.25; }
#avid-deal-prototype .aging-caption { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.45; }
#avid-deal-prototype .aging-caption strong { color: var(--navy-800); }
#avid-deal-prototype .week-chart { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; align-items: end; min-height: 148px; }
#avid-deal-prototype .week-col { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
#avid-deal-prototype .week-stack {
  width: 100%;
  max-width: 28px;
  min-height: 2px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--cream-100);
  border-radius: 4px 4px 1px 1px;
  overflow: hidden;
}
#avid-deal-prototype .week-fill { display: block; width: 100%; background: var(--navy-700); }
#avid-deal-prototype .week-untracked { display: block; width: 100%; background: var(--gold-400); }
#avid-deal-prototype .week-label { font-size: 9px; color: var(--muted); text-align: center; line-height: 1.15; white-space: nowrap; }
#avid-deal-prototype .week-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 11px; color: var(--muted); }
#avid-deal-prototype .week-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
#avid-deal-prototype .week-legend .swatch-volume { background: var(--navy-700); }
#avid-deal-prototype .week-legend .swatch-untracked { background: var(--gold-400); }
#avid-deal-prototype .empty { padding: 18px 4px; text-align: center; color: var(--muted); font-size: 13px; }
#avid-deal-prototype .section-view { display: none; }
#avid-deal-prototype .section-view.active { display: block; }
#avid-deal-prototype .mini-note {
  background: var(--cream-50);
  border: 1px dashed #d9e0e5;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0 16px 16px;
}
#avid-deal-prototype .mail-link { color: var(--navy-700); font-weight: 600; text-decoration: none; }
#avid-deal-prototype .mail-link:hover { color: var(--gold-500); text-decoration: underline; }
#avid-deal-prototype .error {
  margin-bottom: 18px;
  background: #faeeee;
  border: 1px solid #efd2d2;
  color: #7d1e19;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.45;
}
#avid-deal-prototype .error code { font-size: 12px; }
#avid-deal-prototype.loading .main { opacity: .55; pointer-events: none; }

@media (max-width: 1020px) {
  #avid-deal-prototype .shell { grid-template-columns: 200px minmax(0,1fr); }
  #avid-deal-prototype .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #avid-deal-prototype .grid-main { grid-template-columns: 1fr; }
  #avid-deal-prototype .brand-logo { height: 48px; }
}

@media (max-width: 720px) {
  #avid-deal-prototype .shell { display: block; }
  #avid-deal-prototype .sidebar { padding: 14px; gap: 14px; }
  #avid-deal-prototype .brand { flex-direction: row; align-items: center; gap: 12px; }
  #avid-deal-prototype .brand-product { border-top: 0; border-left: 1px solid rgba(201, 169, 98, 0.28); padding: 0 0 0 12px; }
  #avid-deal-prototype .brand-kicker { margin-top: 0; }
  #avid-deal-prototype .brand-logo { height: 42px; }
  #avid-deal-prototype .nav { flex-direction: row; overflow-x: auto; }
  #avid-deal-prototype .nav button { min-width: max-content; }
  #avid-deal-prototype .sidebar-note { display: none; }
  #avid-deal-prototype .main { padding: 18px 14px 28px; }
  #avid-deal-prototype .topbar { flex-direction: column; }
  #avid-deal-prototype .top-actions { justify-content: flex-start; }
  #avid-deal-prototype .stats { grid-template-columns: 1fr 1fr; }
  #avid-deal-prototype .week-chart { display: flex; overflow-x: auto; padding-bottom: 4px; }
  #avid-deal-prototype .week-col { flex: 0 0 36px; }
}

@media (max-width: 430px) {
  #avid-deal-prototype .stats { grid-template-columns: 1fr; }
  #avid-deal-prototype .tabs { grid-template-columns: 1fr; }
  #avid-deal-prototype h1 { font-size: 22px; }
}
