@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --bg: #07110f;
  --sidebar: #091512;
  --panel: #0d1b18;
  --panel-2: #10221d;
  --line: rgba(255, 255, 255, 0.09);
  --muted: #8da19b;
  --text: #f2f6f4;
  --green: #53e6a4;
  --green-dark: #189766;
  --amber: #f2bd68;
  --red: #ff7e75;
  --sidebar-width: 252px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: radial-gradient(circle at 92% 0, rgba(37, 112, 78, 0.18), transparent 29%), var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
}
button, input, select { font: inherit; }
button, select, input { outline: none; }
button:focus-visible, select:focus-visible, input:focus-visible { box-shadow: 0 0 0 3px rgba(83, 230, 164, 0.26); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: rgba(9, 21, 18, 0.97);
  border-right: 1px solid var(--line);
  z-index: 30;
}
.brand-block { display: flex; align-items: center; gap: 12px; padding: 3px 8px 27px; }
.brand-block strong { display: block; margin-top: 2px; font: 700 15px 'Manrope', sans-serif; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid rgba(83, 230, 164, 0.45); border-radius: 10px;
  background: rgba(83, 230, 164, 0.06); color: var(--green);
  font: 800 20px 'Manrope', sans-serif;
}
.eyebrow, .kicker, .nav-label { color: var(--green); font: 700 10px 'Manrope', sans-serif; letter-spacing: 0.17em; }
.nav-label { color: #667c75; margin: 9px 10px; }
.primary-nav { border-top: 1px solid var(--line); padding-top: 13px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 12px;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: #b8c6c1; cursor: pointer; text-align: left; font-weight: 700;
}
.nav-item.active { border-color: rgba(83, 230, 164, 0.2); background: rgba(83, 230, 164, 0.09); color: var(--green); }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: rgba(83, 230, 164, 0.1); }
.sidebar-spacer { flex: 1; }
.source-card { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.source-card strong, .source-card small { display: block; }
.source-card strong { font-size: 12px; }
.source-card small { color: var(--muted); font-size: 10px; margin-top: 3px; line-height: 1.35; }
.source-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(83,230,164,.6); }
.sidebar-foot { color: #60746e; font-size: 10px; padding: 13px 4px 0; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); padding: 0 32px 48px; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.breadcrumb span, .breadcrumb b { color: var(--muted); font-weight: 500; }
.top-status { color: var(--muted); font-size: 11px; border: 1px solid var(--line); border-radius: 99px; padding: 8px 11px; }
.top-status i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--amber); }
.menu-toggle { display: none; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 36px 0 24px; }
.page-head h1 { margin: 7px 0 5px; font: 800 clamp(30px, 4vw, 44px) 'Manrope', sans-serif; letter-spacing: -0.045em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.filters { display: flex; align-items: flex-end; gap: 9px; }
.filters label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
select, input[type="date"] { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #10211d; color: var(--text); padding: 9px 12px; font-size: 12px; font-weight: 600; }
select { min-width: 218px; }
.refresh-button { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #14251f; color: #6f857e; padding: 9px 14px; font-size: 12px; font-weight: 700; }
.refresh-button:disabled { cursor: not-allowed; }

.security-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 15px 17px; border: 1px solid rgba(242,189,104,.23); border-radius: 11px; background: rgba(242,189,104,.055); }
.security-banner strong { font: 700 13px 'Manrope', sans-serif; color: #f8d89f; }
.security-banner p { margin: 3px 0 0; color: #ae9e82; font-size: 11px; line-height: 1.5; }
.lock-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: rgba(242,189,104,.1); color: var(--amber); font-size: 20px; }
.badge { display: inline-flex; align-items: center; white-space: nowrap; border: 1px solid var(--line); border-radius: 99px; padding: 6px 9px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.badge.warning { color: var(--amber); border-color: rgba(242,189,104,.25); }
.badge.green { color: var(--green); border-color: rgba(83,230,164,.22); }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; margin: 18px 0 10px; }
.metric-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(150deg, rgba(16,34,29,.95), rgba(11,25,21,.95)); }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { min-height: 30px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.metric-card strong { display: block; margin: 3px 0 5px; font: 800 27px 'Manrope', sans-serif; letter-spacing: -.04em; }
.metric-card small { font-size: 9px; line-height: 1.35; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 10px; }
.panel { min-height: 270px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: rgba(13,27,24,.88); }
.span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.panel h2 { margin: 5px 0 0; font: 700 18px 'Manrope', sans-serif; }
.chart-placeholder { position: relative; height: 188px; overflow: hidden; border-radius: 8px; background: linear-gradient(180deg, rgba(83,230,164,.035), transparent); }
.chart-lines { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.chart-lines i { display: block; border-top: 1px dashed rgba(255,255,255,.06); }
.chart-placeholder svg { position: absolute; inset: 17px 0 27px; width: 100%; height: 135px; }
.chart-placeholder path { fill: none; stroke: rgba(83,230,164,.34); stroke-width: 2.5; stroke-dasharray: 7 7; }
.chart-placeholder > span { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(420px, 86%); color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }
.empty-state { min-height: 188px; display: grid; place-content: center; text-align: center; padding: 26px; border: 1px dashed rgba(255,255,255,.08); border-radius: 8px; background: rgba(0,0,0,.05); }
.empty-state.compact { min-height: 188px; }
.empty-state strong { font: 700 13px 'Manrope', sans-serif; }
.empty-state p { max-width: 330px; margin: 7px auto 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.location-list { display: grid; gap: 0; }
.location-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 9px 2px; border-top: 1px solid rgba(255,255,255,.055); }
.location-row:first-child { border-top: 0; padding-top: 0; }
.location-row strong { display: block; font: 600 12px 'Manrope', sans-serif; }
.location-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.location-row .sync-state { color: #6f857e; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.methodology { display: grid; grid-template-columns: 260px 1fr; gap: 25px; margin-top: 10px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); }
.methodology strong { display: block; margin-top: 5px; font: 700 12px 'Manrope', sans-serif; }
.methodology p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.scrim { display: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .page-head { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; }
  .filters label:first-child { flex: 1; }
  select { width: 100%; }
}
@media (max-width: 820px) {
  :root { --sidebar-width: 270px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 16px 0 45px rgba(0,0,0,.4); }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; }
  .scrim.open { display: block; }
  .main-content { margin-left: 0; padding-inline: 18px; }
  .menu-toggle { display: inline-block; }
  .breadcrumb { margin-right: auto; margin-left: 10px; }
  .top-status { display: none; }
  .span-8, .span-7, .span-5, .span-4 { grid-column: 1 / -1; }
  .methodology { grid-template-columns: 1fr; gap: 9px; }
}
@media (max-width: 620px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
  .refresh-button { width: 100%; }
  .security-banner { grid-template-columns: auto 1fr; }
  .security-banner .badge { grid-column: 2; justify-self: start; }
  .page-head { padding-top: 25px; }
}
