* { box-sizing: border-box; margin: 0; }
body {
  min-height: 100vh; color: #e0e7ff; font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(135deg, #0f172a, #1e1b4b 60%, #312e81) fixed;
  padding: 18px;
}
header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; position: relative; }
.brand { font-weight: 800; font-size: 18px; }
.stale { background: #b45309; color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 99px; margin-left: 8px; vertical-align: middle; }
.pills { display: flex; gap: 4px; align-items: center; }

main { display: flex; gap: 14px; align-items: flex-start; max-width: 1100px; margin: 0 auto; }
.col-main { flex: 2.2; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rail { flex: 1; max-width: 320px; }
@media (max-width: 800px) { main { flex-direction: column; } .rail { max-width: none; width: 100%; } }

.glass { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 14px; backdrop-filter: blur(6px); }
.label { color: #a5b4fc; font-size: 11px; letter-spacing: 1px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.hero .big { font-size: 42px; font-weight: 800; color: #fff; }
.hero .sub { color: #86efac; font-size: 13px; margin-top: 4px; }
.hero .sub.down { color: #fca5a5; }
.kpis { display: flex; gap: 10px; }
.kpi { flex: 1; } .kpi .val { font-size: 18px; font-weight: 700; color: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; } .grow { flex: 1; min-width: 220px; }

.product { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.2); color: #e0e7ff; border-radius: 6px; font-size: 12px; padding: 3px 6px; }
#chart { width: 100%; height: auto; display: block; }

.trow { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.trow:last-child { border-bottom: 0; }
.trow .muted, .muted { color: #64748b; }
.trow b { color: #fff; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; display: inline-block; margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.feed-item { padding: 7px 9px; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.feed-item .meta { color: #94a3b8; font-size: 11px; }
.feed-item.new { background: rgba(134,239,172,.12); border-left: 2px solid #4ade80; }

/* calendar popover */
.range-btn {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.2);
  color: #e0e7ff; border-radius: 99px; padding: 6px 14px; font-size: 13px;
  cursor: pointer; font-family: inherit;
}
.range-btn:hover { background: rgba(255,255,255,.12); }
.cal-pop {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 50;
  display: flex; overflow: hidden; border-radius: 14px;
  background: rgba(15,23,42,.95); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(12px); box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.cal-pop[hidden] { display: none; }
.cal-presets { display: flex; flex-direction: column; padding: 6px 0; min-width: 118px; border-right: 1px solid rgba(255,255,255,.12); }
.cal-presets button {
  background: none; border: 0; color: #e0e7ff; text-align: left; font-size: 13px;
  padding: 7px 14px; cursor: pointer; font-family: inherit;
}
.cal-presets button:hover { background: rgba(255,255,255,.08); }
.cal-presets button.active { background: #6366f1; color: #fff; }
.cal-main { display: flex; flex-direction: column; padding: 12px; gap: 10px; }
.cal-months { display: flex; gap: 18px; }
.cal-mhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; color: #fff; }
.cal-mhead span { width: 22px; }
.cal-nav { background: none; border: 0; color: #a5b4fc; font-size: 16px; cursor: pointer; width: 22px; padding: 0; font-family: inherit; }
.cal-nav:hover { color: #fff; }
.cal-nav.m0-next { visibility: hidden; }   /* duplicate next-arrow on first month; shown on mobile */
.cal-grid { display: grid; grid-template-columns: repeat(7, 30px); gap: 2px; }
.cal-dow { color: #a5b4fc; font-size: 10px; text-align: center; padding: 2px 0; }
.cal-day {
  background: none; border: 0; color: #e0e7ff; font-size: 12px; height: 26px;
  border-radius: 6px; cursor: pointer; font-family: inherit; padding: 0;
}
.cal-day:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.cal-day.out { color: #475569; cursor: default; }
.cal-day.today { outline: 1px solid #a5b4fc; }
.cal-day.in-range { background: rgba(99,102,241,.35); border-radius: 0; }
.cal-day.edge { background: #6366f1; color: #fff; border-radius: 6px; }
.cal-footer { display: flex; align-items: center; gap: 10px; justify-content: flex-end; font-size: 12px; color: #a5b4fc; }
.cal-btn {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.2);
  color: #e0e7ff; border-radius: 8px; padding: 5px 14px; font-size: 13px;
  cursor: pointer; font-family: inherit;
}
.cal-btn.primary { background: #6366f1; border-color: #6366f1; color: #fff; }
@media (max-width: 700px) {
  .cal-pop { position: fixed; left: 10px; right: 10px; top: 64px; flex-direction: column; max-height: calc(100vh - 80px); overflow-y: auto; }
  .cal-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .cal-month:last-child { display: none; }
  .cal-nav.m0-next { visibility: visible; }
  .cal-grid { grid-template-columns: repeat(7, 1fr); }
}

/* chart card */
.badge { background: rgba(74,222,128,.18); color: #4ade80; font-size: 10px; padding: 1px 8px; border-radius: 99px; letter-spacing: 0; }
.chart-controls { display: flex; gap: 6px; align-items: center; }
.cbtn {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.2);
  color: #e0e7ff; border-radius: 6px; font-size: 11px; padding: 2px 8px;
  cursor: pointer; font-family: inherit;
}
.cbtn:disabled { opacity: .4; cursor: default; }
.cbtn.active { background: #6366f1; border-color: #6366f1; color: #fff; }
.seg { display: inline-flex; }
.seg .cbtn:first-child { border-radius: 6px 0 0 6px; }
.seg .cbtn:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.chart-wrap { position: relative; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 10;
  background: rgba(15,23,42,.95); border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; color: #e0e7ff; white-space: nowrap;
}
.c-grid { stroke: rgba(255,255,255,.08); }
.c-ytick { fill: #a5b4fc; font-size: 8px; text-anchor: end; }
.c-xtick { fill: #a5b4fc; font-size: 8px; text-anchor: end; }
.c-xtick.c-today { fill: #818cf8; font-weight: 700; }
.c-bar { fill: #4ade80; }
.c-bar:hover { fill: #86efac; }
.c-line { stroke: #6366f1; stroke-width: 2; fill: none; }
.c-area { fill: rgba(99,102,241,.15); }
.c-empty { fill: #64748b; font-size: 11px; text-anchor: middle; }
