:root {
  --violet: #7552ef;
  --violet-light: #9b7ff5;
  --violet-glow: rgba(117, 82, 239, .25);
  --bg: #0b0c12;
  --surface: #12131b;
  --surface-2: #171823;
  --border: rgba(155, 127, 245, .14);
  --text: #f5f4f0;
  --muted: #9699a8;
  --green: #4ade80;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: Inter, sans-serif; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 88% 5%, rgba(117,82,239,.12), transparent 28%), radial-gradient(rgba(117,82,239,.10) 1px, transparent 1px); background-size: auto, 32px 32px; opacity: .65; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.app-shell { position: relative; display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 3; display: flex; flex-direction: column; padding: 26px 18px; background: rgba(15,16,24,.94); border-right: 1px solid var(--border); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; font-family: Montserrat, sans-serif; font-weight: 800; }
.brand img { width: 54px; height: 28px; object-fit: contain; }
.sidebar__nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: var(--muted); border: 1px solid transparent; border-radius: 12px; font-weight: 600; transition: .2s ease; }
.nav-item:hover, .nav-item--active { color: var(--text); border-color: var(--border); background: rgba(117,82,239,.12); }
.nav-item__icon { display: grid; place-items: center; width: 24px; color: var(--violet-light); font-size: 20px; }
.sidebar__footer { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 11px; border-top: 1px solid var(--border); }
.sidebar__footer div { display: grid; gap: 3px; }
.sidebar__footer strong { font-size: 12px; }
.sidebar__footer small { color: var(--muted); font-size: 11px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(74,222,128,.7); }

.main { min-width: 0; }
.topbar { height: 92px; display: flex; align-items: center; gap: 16px; padding: 0 38px; border-bottom: 1px solid var(--border); background: rgba(11,12,18,.78); backdrop-filter: blur(16px); }
.eyebrow, .panel__kicker { margin: 0 0 5px; color: var(--violet-light); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.topbar h1 { margin: 0; font: 700 21px Montserrat, sans-serif; }
.profile { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.profile__avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), #4b28cb); box-shadow: 0 0 20px var(--violet-glow); font-size: 12px; font-weight: 800; }
.profile__text { display: grid; gap: 2px; }
.profile__text strong { font-size: 12px; }.profile__text small { color: var(--muted); font-size: 10px; }
.menu-button { display: none; color: var(--text); background: transparent; border: 0; font-size: 22px; }

.content { max-width: 1500px; margin: 0 auto; padding: 36px 38px 60px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.intro h2 { margin: 0 0 7px; font: 800 28px Montserrat, sans-serif; }.intro p { margin: 0; color: var(--muted); font-size: 14px; }
.date-chip { padding: 9px 13px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card, .panel { background: linear-gradient(145deg, rgba(23,24,35,.96), rgba(16,17,25,.95)); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 14px 45px rgba(0,0,0,.14); }
.metric-card { display: flex; flex-direction: column; min-height: 168px; padding: 20px; }
.metric-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--violet-light); background: rgba(117,82,239,.12); border-radius: 10px; font-size: 20px; }
.badge, .connection-state { padding: 5px 8px; color: #c8bdfd; background: rgba(117,82,239,.12); border-radius: 999px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.badge--ready, .connection-state--ready { color: #8df0ad; background: rgba(74,222,128,.10); }
.metric-card__label { color: var(--muted); font-size: 12px; }.metric-card__value { margin: 7px 0; font: 800 30px Montserrat, sans-serif; }.metric-card small { margin-top: auto; color: #707483; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-top: 16px; }
.panel { min-width: 0; overflow: hidden; }
.panel--wide { grid-column: 1 / -1; }
.panel__header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.panel__header h3 { margin: 0; font: 700 16px Montserrat, sans-serif; }
.empty-state { min-height: 278px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px; text-align: center; }
.empty-state--compact { min-height: 278px; }
.empty-state__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 15px; color: var(--violet-light); background: rgba(117,82,239,.12); border: 1px solid var(--border); border-radius: 14px; font-size: 25px; }
.empty-state h4 { margin: 0 0 9px; font: 700 15px Montserrat, sans-serif; }.empty-state p { max-width: 450px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.button { margin-top: 20px; padding: 11px 15px; border: 0; border-radius: 10px; font-size: 11px; font-weight: 700; }.button--disabled { color: #86899a; background: #242631; cursor: not-allowed; }
.table-wrap { overflow-x: auto; padding: 5px 22px 22px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 16px 10px; color: var(--muted); text-align: left; border-bottom: 1px solid var(--border); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 25px 10px; border-bottom: 1px solid var(--border); }.table-empty td { color: #747887; text-align: center; }

@media (max-width: 1050px) { .metrics { grid-template-columns: repeat(2, 1fr); }.dashboard-grid { grid-template-columns: 1fr; }.panel--wide { grid-column: auto; } }
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: 250px; transition: transform .25s ease; box-shadow: 15px 0 45px rgba(0,0,0,.35); }
  .sidebar--open { transform: translateX(0); }
  .menu-button { display: block; }
  .topbar { height: 78px; padding: 0 18px; }.topbar h1 { font-size: 17px; }.profile__text { display: none; }
  .content { padding: 28px 18px 45px; }.intro { align-items: start; }.date-chip { display: none; }
  .metrics { grid-template-columns: 1fr; }.metric-card { min-height: 150px; }
  .panel__header { align-items: flex-start; padding: 18px; }.connection-state { white-space: nowrap; }
  .empty-state { min-height: 240px; padding: 28px 20px; }.table-wrap { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
