@import url('/design-system.css');

:root {
  color-scheme: dark;
  --md-ref-typeface-brand: Inter;
  --md-ref-typeface-plain: Inter;

  /* Material 3 dark scheme, tuned to the original Hanan Attaki red/charcoal identity. */
  --md-sys-color-primary: #ffb4ab;
  --md-sys-color-on-primary: #690005;
  --md-sys-color-primary-container: #93000a;
  --md-sys-color-on-primary-container: #ffdad6;
  --md-sys-color-secondary: #e7bdb7;
  --md-sys-color-on-secondary: #442925;
  --md-sys-color-secondary-container: #5d3f3b;
  --md-sys-color-on-secondary-container: #ffdad6;
  --md-sys-color-tertiary: #80d7c5;
  --md-sys-color-on-tertiary: #00382f;
  --md-sys-color-tertiary-container: #005047;
  --md-sys-color-on-tertiary-container: #9ff2df;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-surface: #0b1112;
  --md-sys-color-on-surface: #f7f8f8;
  --md-sys-color-surface-container-lowest: #070a0b;
  --md-sys-color-surface-container-low: #111719;
  --md-sys-color-surface-container: #171e20;
  --md-sys-color-surface-container-high: #20282b;
  --md-sys-color-surface-container-highest: #2b3437;
  --md-sys-color-on-surface-variant: #cfd6d8;
  --md-sys-color-outline: #8d979a;
  --md-sys-color-outline-variant: #414b4e;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-large: 22px;
  --md-sys-shape-corner-medium: 16px;
  --md-sys-shape-corner-full: 999px;

  --bg: #0b1112 !important;
  --bg2: #141b1d !important;
  --panel: #171e20 !important;
  --panel2: #20282b !important;
  --line: rgba(255,255,255,.09) !important;
  --line2: rgba(255,255,255,.14) !important;
  --text: #f7f8f8 !important;
  --muted: #aeb6b8 !important;
  --subtle: #6f7a7e !important;
  --red: #ef262b !important;
  --red2: #b80813 !important;
  --red3: #ff5a43 !important;
  --green: #2dd98f !important;
  --amber: #ffc857 !important;
  --shadow: 0 28px 80px rgba(0,0,0,.42) !important;
}

html { scroll-behavior: smooth; }
html,
body,
button,
input,
select,
textarea,
md-filled-button,
md-filled-tonal-button,
md-outlined-button,
md-text-button,
md-outlined-text-field,
md-outlined-select,
md-assist-chip,
.shell,
.shell * {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}
body {
  background:
    radial-gradient(circle at 10% 0%, #1d2527 0, #0c1112 42%, #080b0c 100%) !important;
  color: var(--text) !important;
}
.shell {
  width: min(1500px, calc(100vw - 56px)) !important;
  border-radius: 44px !important;
  background: linear-gradient(145deg, rgba(18,25,27,.96), rgba(6,9,10,.96)) !important;
  border: 1px solid var(--line2) !important;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.03) !important;
  backdrop-filter: blur(18px);
}
.topbar {
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr) !important;
  padding: 18px 20px !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: linear-gradient(180deg, rgba(20,27,29,.98), rgba(10,14,15,.96)) !important;
  box-shadow: 0 22px 58px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.04) !important;
  top: 12px !important;
  z-index: 80 !important;
}
.logo {
  background: linear-gradient(135deg, var(--red), #ff4438) !important;
  color: #fff !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 26px rgba(239,38,43,.25) !important;
}
.brand { color: var(--text) !important; letter-spacing: -.05em !important; }
.nav {
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
  min-width: 0 !important;
}
.nav button,
.period button,
.privacy-chip {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid transparent !important;
  border-radius: var(--md-sys-shape-corner-full) !important;
  min-height: 40px !important;
  padding: 0 16px !important;
  font-weight: 750 !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.nav button:hover,
.period button:hover,
.privacy-chip:hover {
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
}
.nav button.active,
.period button.active,
.privacy-chip.active {
  background: linear-gradient(135deg, var(--red), var(--red2)) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(239,38,43,.24) !important;
  border-color: rgba(255,255,255,.16) !important;
}
.privacy-controls {
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}
.privacy-controls span { color: var(--muted) !important; }
.hero h1,
.section-head h2,
.value,
.metric-stack strong { color: var(--text) !important; }
.hero p,
.section-head span,
.meta,
.metric-stack small,
.fresh,
.insight p { color: var(--muted) !important; }
.eyebrow { color: var(--red3) !important; }
.period {
  top: 150px !important;
  z-index: 70 !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(20,27,29,.98), rgba(10,14,15,.96)) !important;
  border: 1px solid rgba(239,38,43,.34) !important;
  box-shadow: 0 22px 58px rgba(0,0,0,.46), 0 0 0 1px rgba(255,255,255,.04), 0 0 34px rgba(239,38,43,.12) !important;
}
.period-label {
  background: rgba(239,38,43,.18) !important;
  border: 1px solid rgba(239,38,43,.38) !important;
  color: #fff !important;
}
.period input {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  color: var(--text) !important;
  color-scheme: dark !important;
}
.period button.month-action,
.period button.date-action {
  background: linear-gradient(135deg,#ffffff,#ffd6cf) !important;
  color: #6f070b !important;
  border: 1px solid rgba(255,255,255,.45) !important;
  box-shadow: 0 12px 30px rgba(255,90,67,.24), inset 0 0 0 1px rgba(255,255,255,.55) !important;
}
.card,
.kpi,
.chart-card,
.insight-card {
  background: rgba(255,255,255,.035) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  border-radius: 28px !important;
  box-shadow: none !important;
}
.kpi .label,
.label { color: var(--muted) !important; }
.delta { background: rgba(255,255,255,.07) !important; color: var(--muted) !important; }
.delta.up { background: rgba(45,217,143,.16) !important; color: #8af0c3 !important; }
.delta.down { background: rgba(239,38,43,.18) !important; color: #ffb4ab !important; }
.tag,
.pill,
.open-link {
  background: rgba(239,38,43,.18) !important;
  color: #fff !important;
  border: 1px solid rgba(239,38,43,.35) !important;
}
.open-link:hover,
.content-link:hover { text-decoration-color: var(--red3) !important; }
.video {
  background: rgba(255,255,255,.035) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
}
.thumb.placeholder,
.logo:before { color: #fff !important; }
.thumb.placeholder {
  background: linear-gradient(135deg, rgba(239,38,43,.55), rgba(255,255,255,.08)) !important;
}
.table th {
  color: var(--muted) !important;
  background: rgba(255,255,255,.035) !important;
}
.table td,
.table th { border-bottom-color: rgba(255,255,255,.09) !important; }
.grade.scale { background: #2dd98f !important; color: #082019 !important; }
.grade.maintain { background: #ffc857 !important; color: #301f00 !important; }
.grade.fix { background: #ff744f !important; color: #fff !important; }
.grade.low { background: #6f7a7e !important; color: #fff !important; }
.bar-track { background: rgba(255,255,255,.07) !important; }
.bar-fill { background: linear-gradient(90deg, var(--red), #ff6a42) !important; }
.footer,
.empty { color: var(--muted) !important; }
.masked { color: var(--text) !important; }
canvas { filter: none; }

@media(max-width:1320px) {
  .topbar { grid-template-columns: 1fr !important; grid-template-areas:'brand' 'nav' 'privacy' !important; }
  .period { top: 190px !important; }
}
@media(max-width:680px) {
  .shell { width: calc(100vw - 24px) !important; padding: 18px !important; border-radius: 28px !important; }
  .period { top: 230px !important; }
}
section { scroll-margin-top: 260px !important; }
