:root {
  --ink: #364c63;
  --muted: #71808f;
  --green-950: #263a4d;
  --green-800: #364c63;
  --green-600: #e66a2c;
  --green-200: #f7d59d;
  --mint: #fff0e6;
  --cream: #f4f3ef;
  --white: #fff;
  --line: #dedbd4;
  --yellow: #f3b340;
  --orange: #e66a2c;
  --pink: #f094a7;
  --amber: #d79317;
  --red: #c44f48;
  --success: #2b8a63;
  --shadow: 0 16px 45px rgba(54, 76, 99, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font: 15px/1.45 Questrial, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}
button, select, input { font: inherit; }
a { color: inherit; }
.topbar {
  min-height: 72px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--ink);
  border-bottom: 4px solid var(--yellow);
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 16px; }
.brand small { color: #d7dee4; }
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--yellow) 0 34%, var(--orange) 34% 67%, var(--pink) 67%);
  border-radius: 17px;
  font: 700 25px/1 "Fira Sans", "Segoe UI", sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 19px; }
.top-actions { display: flex; gap: 22px; align-items: center; }
.sync { display: flex; align-items: center; gap: 8px; color: #d7dee4; font-size: 13px; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #aab8b1; }
.sync.ok i { background: #67d29f; box-shadow: 0 0 0 4px rgba(103,210,159,.12); }
.sync.warn i { background: var(--amber); }
.logout { color: white; font-size: 13px; text-underline-offset: 4px; }
.dashboard { width: min(1440px, 92vw); margin: 0 auto; padding: 42px 0 70px; }
.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font: 650 clamp(30px, 4vw, 48px)/1.05 "Fira Sans", "Segoe UI", sans-serif; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font: 650 23px/1.15 "Fira Sans", "Segoe UI", sans-serif; letter-spacing: -.025em; }
.hero-row > div > p:last-child { margin: 0; color: var(--muted); }
.filters {
  display: flex;
  gap: 10px;
  align-items: end;
  padding: 13px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.filters label, .login-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
select, input {
  min-height: 43px;
  padding: 0 12px;
  color: var(--ink);
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
select:focus, input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(230,106,44,.14); }
.filters button, .login-form button {
  min-height: 43px;
  padding: 0 18px;
  color: var(--ink);
  background: var(--yellow);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 750;
}
.filters button:hover { background: #f7c45f; }
.month-performance { margin-bottom: 16px; }
.month-pulse {
  position: relative;
  padding: 25px;
  display: grid;
  grid-template-columns: minmax(245px, .8fr) minmax(0, 1.8fr);
  gap: 22px 34px;
  color: white;
  background: var(--success);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.property-pulse-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}
.property-pulse {
  min-width: 0;
  min-height: 94px;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background: var(--success);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.property-pulse.behind { background: #944641; }
.property-pulse.neutral { background: #4e5b55; }
.property-pulse > span {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.property-pulse > strong {
  margin: 6px 0 4px;
  font: 700 25px/1 Georgia, serif;
}
.property-pulse > small { color: rgba(255,255,255,.68); font-size: 10px; }
.month-pulse::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: #67d29f;
}
.month-pulse.stable { background: #715c2f; }
.month-pulse.stable::before { background: #ffc65d; }
.month-pulse.behind { background: #743b39; }
.month-pulse.behind::before { background: #ff817a; }
.month-pulse.neutral { background: #4e5b55; }
.month-pulse.neutral::before { background: #aeb8b3; }
.month-pulse .eyebrow { color: rgba(255,255,255,.68); }
.pulse-title { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pulse-title h2 { font-size: 28px; }
.pulse-badge {
  padding: 6px 10px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: white;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pulse-badge i { width: 8px; height: 8px; background: #67d29f; border-radius: 50%; }
.stable .pulse-badge i { background: #ffc65d; }
.behind .pulse-badge i { background: #ff817a; }
.neutral .pulse-badge i { background: #aeb8b3; }
.pulse-change { margin: 17px 0 7px; display: block; font: 700 38px/1 "Fira Sans", "Segoe UI", sans-serif; }
.pulse-verdict > p:last-child { margin: 0; color: rgba(255,255,255,.72); }
.pulse-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pulse-metric {
  min-width: 0;
  padding: 4px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255,255,255,.16);
}
.pulse-metric > span { color: rgba(255,255,255,.67); font-size: 12px; font-weight: 700; }
.pulse-metric > strong { margin: 9px 0 7px; font: 700 clamp(23px, 2.4vw, 34px)/1 "Fira Sans", "Segoe UI", sans-serif; white-space: nowrap; }
.pulse-metric > small { color: rgba(255,255,255,.65); }
.pulse-metric.forecast > strong { color: #c9f7df; }
.stable .pulse-metric.forecast > strong { color: #ffe0a4; }
.behind .pulse-metric.forecast > strong { color: #ffd0cd; }
.pulse-method {
  grid-column: 1 / -1;
  margin: -7px 0 0;
  color: rgba(255,255,255,.56);
  font-size: 11px;
  text-align: right;
}
.attention-panel {
  margin-bottom: 16px;
  padding: 22px 24px 24px;
  background: linear-gradient(135deg, #fff8e7 0%, #fffdf7 62%, #fff3d3 100%);
  border: 1px solid #edd79e;
  border-left: 6px solid var(--yellow);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.attention-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.attention-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.watch-symbol {
  position: relative;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(243,179,64,.28);
}
.watch-symbol::before {
  content: "";
  width: 21px;
  height: 21px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.watch-symbol i {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
  box-shadow: 0 -8px 0 -2px var(--ink), 0 8px 0 -2px var(--ink);
}
.watch-status {
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(215,147,23,.25);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.watch-status i {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(43,138,99,.12);
}
.attention-list {
  display: grid;
  gap: 10px;
}
.attention-list.count-1 { grid-template-columns: 1fr; }
.attention-list.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.attention-list.count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.attention-item {
  min-width: 0;
  padding: 15px 16px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  background: rgba(255,255,255,.84);
  border: 1px solid #ecd89f;
  border-radius: 13px;
  box-shadow: 0 7px 18px rgba(54,76,99,.04);
}
.attention-icon {
  width: 11px;
  height: 11px;
  margin-top: 4px;
  background: var(--yellow);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(243,179,64,.16);
}
.attention-item strong { display: block; color: var(--ink); font-size: 14px; }
.attention-item p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.attention-item.critical { background: #fff0ef; border-color: #f1c4c0; }
.attention-item.critical .attention-icon {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(196,79,72,.14);
}
.attention-item.positive,
.attention-item.clear { background: #eef8f3; border-color: #c6e4d5; }
.attention-item.positive .attention-icon,
.attention-item.clear .attention-icon {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(43,138,99,.14);
}
.ytd-heading {
  margin: 25px 2px 13px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.ytd-heading h2 { font-size: 21px; }
.period-chip {
  padding: 7px 11px;
  color: var(--ink);
  background: #fff2cf;
  border: 1px solid #efd697;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.kpi {
  min-height: 154px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.kpi.primary {
  color: white;
  background: var(--green-800);
  border-color: var(--green-800);
  border-top: 6px solid var(--yellow);
  padding-top: 20px;
}
.kpi p { margin-bottom: 14px; color: var(--muted); font-weight: 650; }
.kpi.primary p, .kpi.primary .hint { color: #d9e1e7; }
.kpi strong { font: 700 clamp(27px, 3vw, 39px)/1 "Fira Sans", "Segoe UI", sans-serif; letter-spacing: -.03em; }
.kpi .delta, .kpi .hint { width: fit-content; margin-top: 16px; font-size: 12px; }
.delta { padding: 5px 9px; border-radius: 999px; font-weight: 750; }
.delta.positive { color: #173c2d; background: #9ce0bc; }
.delta.negative { color: #652927; background: #f4aaa6; }
.delta.neutral { color: #d5e4dc; background: rgba(255,255,255,.08); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .75fr); gap: 16px; }
.panel {
  min-width: 0;
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.panel.wide { min-height: 390px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 10px; display: inline-block; border-radius: 3px; }
.dot.current { background: var(--orange); }
.dot.previous { background: var(--yellow); }
.chart-wrap { position: relative; height: 290px; }
canvas { width: 100%; height: 100%; display: block; }
.donut-layout { min-height: 300px; display: grid; grid-template-rows: 210px auto; align-items: center; }
.channel-legend { display: grid; gap: 9px; }
.channel-legend div { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.channel-legend i { width: 9px; height: 9px; border-radius: 50%; }
.channel-legend strong { color: var(--ink); }
.metric-switch { padding: 4px; display: flex; background: var(--mint); border-radius: 10px; }
.metric-switch button { padding: 7px 10px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 750; }
.metric-switch button.active { color: white; background: var(--orange); }
.table-panel { grid-column: 1 / -1; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
th:first-child, td:first-child { text-align: left; }
td strong { display: block; }
td small { display: block; margin-top: 2px; color: var(--muted); }
.metric-value { color: var(--ink); font-size: 14px; }
.metric-comparison {
  width: fit-content;
  margin: 6px 0 0 auto;
  padding: 4px 7px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  background: #f1f0ec;
  border-radius: 7px;
  font-size: 10px;
}
.metric-comparison b { font-weight: 800; }
.metric-comparison.positive { color: #1e684b; background: #e4f3eb; }
.metric-comparison.negative { color: #8b3d38; background: #f9e7e5; }
.metric-comparison.neutral { color: var(--muted); background: #f1f0ec; }
.empty { padding: 35px; text-align: center !important; color: var(--muted); }
.definitions { margin-top: 16px; padding: 17px 20px; display: flex; gap: 17px; flex-wrap: wrap; color: var(--muted); background: #ebe8e1; border-radius: 14px; font-size: 12px; }
.definitions strong { color: var(--ink); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: var(--ink); }
.auth-card { width: min(440px, 100%); padding: 38px; background: var(--cream); border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.24); }
.auth-card .brand-mark { margin-bottom: 26px; }
.auth-card h1 { font-size: 38px; }
.muted { color: var(--muted); }
.login-form { margin-top: 26px; display: grid; gap: 16px; }
.login-form input { width: 100%; }
.login-form button { margin-top: 4px; }
.error-box { padding: 11px 13px; color: #852f2f; background: #f9dfdf; border-radius: 10px; }
.success-box { padding: 13px 15px; color: #19573d; background: #dff3e8; border-radius: 12px; }
.import-page .hero-row { align-items: start; }
.import-kpis .kpi { min-height: 135px; }
.import-action {
  margin-top: 16px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: white;
  background: var(--green-800);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.import-action p { margin: 6px 0 0; color: #c6d9cf; }
.import-action button, .button-link {
  min-height: 46px;
  padding: 0 18px;
  display: inline-grid;
  place-items: center;
  color: var(--green-950);
  background: white;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.import-action.done { color: var(--ink); background: white; border: 1px solid var(--line); }
.import-action.done p { color: var(--muted); }
.import-action.done .button-link { color: white; background: var(--green-800); }
pre { padding: 14px; overflow-x: auto; color: #eaf3ee; background: var(--green-950); border-radius: 11px; font-size: 13px; }
code { padding: 2px 5px; background: #e4e9e6; border-radius: 5px; }
@media (max-width: 1050px) {
  .month-pulse { grid-template-columns: 1fr; }
  .pulse-method { margin-top: 0; text-align: left; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 18px; }
  .sync { display: none; }
  .dashboard { width: min(100% - 28px, 700px); padding-top: 28px; }
  .hero-row { align-items: stretch; flex-direction: column; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters button { grid-column: 1 / -1; }
  .month-pulse { padding: 22px 20px; }
  .property-pulse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attention-heading { align-items: start; flex-direction: column; gap: 12px; }
  .attention-title { align-items: flex-start; }
  .watch-status { margin-left: 57px; white-space: normal; }
  .attention-list.count-1,
  .attention-list.count-2,
  .attention-list.count-3 { grid-template-columns: 1fr; }
  .ytd-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .pulse-metrics { grid-template-columns: 1fr; gap: 15px; }
  .pulse-metric { padding: 0; border-left: 0; }
  .pulse-metric + .pulse-metric { padding-top: 15px; border-top: 1px solid rgba(255,255,255,.16); }
  .pulse-change { font-size: 34px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi { min-height: 132px; }
  .panel { padding: 19px; }
  .panel.wide { min-height: 350px; }
  .chart-wrap { height: 250px; }
  .definitions { display: grid; gap: 7px; }
  .import-action { align-items: stretch; flex-direction: column; }
  .import-action form, .import-action button, .button-link { width: 100%; }
}
@media (max-width: 420px) {
  .property-pulse-grid { grid-template-columns: 1fr; }
}
