:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --ink: #0b2340;
  --muted: #6f7f93;
  --line: #e4ebf3;
  --navy: #061d37;
  --teal: #12d4cb;
  --cyan: #0ab7ed;
  --blue: #2463f4;
  --violet: #5c42f2;
  --success: #16a779;
  --warning: #f2a12e;
  --danger: #e25561;
  --shadow: 0 18px 50px rgba(19, 47, 83, .08);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(28, 192, 227, .08), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 264px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #061d37 0%, #07172a 100%);
  color: #dbe9f8;
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand {
  min-height: 76px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand img { width: 210px; max-height: 62px; object-fit: contain; object-position: left center; filter: brightness(1.65); }

.nav-section { margin: 9px 0 15px; }
.nav-label { margin: 0 12px 8px; color: #7088a3; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  margin: 3px 0;
  border-radius: 11px;
  color: #aebfd1;
  font-size: 14px;
  font-weight: 600;
  transition: .18s ease;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active {
  color: white;
  background: linear-gradient(90deg, rgba(13, 198, 217, .22), rgba(49, 96, 240, .15));
  box-shadow: inset 3px 0 0 var(--teal);
}
.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: 11px; letter-spacing: .08em; }
.sidebar-footer span { margin-top: 2px; font-size: 11px; color: #7187a0; }
.environment-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(18,212,203,.11); }

.main-content { min-width: 0; padding: 28px 34px 48px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
.eyebrow, .panel-kicker, .hero-badge { font-size: 10px; font-weight: 900; letter-spacing: .14em; color: #6f849d; }
h1 { margin: 4px 0 3px; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.035em; }
.topbar-subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-button {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.org-pill { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.org-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; font-weight: 900; background: linear-gradient(145deg, var(--teal), var(--blue)); }
.org-pill strong, .org-pill span { display: block; white-space: nowrap; }
.org-pill strong { font-size: 12px; }
.org-pill span { margin-top: 2px; font-size: 10px; color: var(--muted); }

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  align-items: center;
  border-radius: 24px;
  color: white;
  background:
    radial-gradient(circle at 78% 48%, rgba(24, 218, 211, .25), transparent 14rem),
    linear-gradient(120deg, #071b35 0%, #0a315b 58%, #0b416b 100%);
  box-shadow: 0 24px 70px rgba(10, 38, 73, .16);
}
.hero-panel::after { content: ""; position: absolute; inset: auto -110px -190px auto; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.hero-badge { display: inline-block; margin-bottom: 12px; padding: 7px 10px; border: 1px solid rgba(80,235,226,.35); border-radius: 999px; color: #7ef0e8; background: rgba(10,203,210,.08); }
.hero-panel h2 { margin: 0; max-width: 700px; font-size: clamp(30px, 4vw, 50px); line-height: 1.03; letter-spacing: -.045em; }
.hero-panel h2 span { background: linear-gradient(90deg, #40e0d1, #36b9ff, #7a70ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-panel p { max-width: 700px; margin: 18px 0 0; color: #b6c9df; line-height: 1.65; font-size: 14px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border: 0; border-radius: 11px; font-size: 13px; font-weight: 800; cursor: pointer; }
.btn-primary { color: #05213c; background: linear-gradient(90deg, #39e0d1, #58c7ff); box-shadow: 0 10px 28px rgba(18,212,203,.18); }
.btn-secondary { color: #e8f6ff; border: 1px solid rgba(255,255,255,.17); background: rgba(255,255,255,.07); }

.hero-visual { position: relative; min-height: 210px; }
.data-core { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); display: grid; place-items: center; width: 86px; height: 86px; border-radius: 24px; font-weight: 900; font-size: 27px; background: linear-gradient(145deg, rgba(18,212,203,.95), rgba(37,94,242,.95)); box-shadow: 0 0 50px rgba(18,212,203,.24); }
.data-orbit { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-16deg); border: 1px solid rgba(100,232,232,.28); border-radius: 50%; }
.orbit-a { width: 190px; height: 112px; }
.orbit-b { width: 255px; height: 160px; transform: translate(-50%,-50%) rotate(22deg); }
.node { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #55e9dd; box-shadow: 0 0 0 5px rgba(85,233,221,.11), 0 0 30px rgba(85,233,221,.35); }
.node-a { top: 24px; left: 50%; }
.node-b { right: 27px; top: 55%; }
.node-c { left: 30px; top: 60%; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.kpi-card { display: flex; align-items: center; gap: 14px; padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.92); box-shadow: 0 8px 28px rgba(20,45,76,.04); }
.kpi-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 13px; color: #0b6f8f; font-weight: 900; background: #e8f9fb; }
.alert-card .kpi-icon { color: #b07115; background: #fff5e3; }
.kpi-card span, .kpi-card strong, .kpi-card small { display: block; }
.kpi-card span { color: var(--muted); font-size: 11px; font-weight: 700; }
.kpi-card strong { margin-top: 2px; font-size: 26px; line-height: 1; letter-spacing: -.04em; }
.kpi-card small { margin-top: 5px; color: #9aa8b8; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.panel-wide { grid-column: 1 / -1; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-header h3, .intelligence-panel h3 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.02em; }
.text-link { color: #167dba; font-size: 12px; font-weight: 800; }
.counter-chip { min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; color: #0d7d91; background: #e9fafb; font-size: 11px; font-weight: 900; }
.domain-list { display: grid; gap: 8px; }
.domain-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid #edf1f6; border-radius: 13px; background: #fbfdff; }
.domain-symbol { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: white; font-weight: 900; background: linear-gradient(145deg, #19cfc5, #2e68ed); }
.domain-main strong, .domain-main span { display: block; }
.domain-main strong { font-size: 13px; }
.domain-main span { margin-top: 3px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: #7c8b9d; background: #f1f5f9; padding: 5px 7px; border-radius: 7px; }
.status-badge { padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-badge.success { color: #158265; background: #e9f9f2; }
.status-badge.muted { color: #788596; background: #f1f4f7; }
.empty-state { padding: 36px 18px; text-align: center; border: 1px dashed #cad7e5; border-radius: 15px; background: #fbfdff; }
.empty-icon { margin: auto auto 8px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #0e8ba4; background: #e7faf9; font-size: 20px; }
.empty-state h4 { margin: 6px 0; font-size: 15px; }
.empty-state p { max-width: 580px; margin: 0 auto 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.compact-empty { min-height: 165px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.compact-empty strong { color: var(--ink); margin-top: 8px; font-size: 13px; }
.compact-empty span { margin-top: 4px; max-width: 350px; font-size: 11px; line-height: 1.5; }
.checkmark, .plug-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 50%; font-size: 18px; font-weight: 900; }
.checkmark { color: var(--success); background: #eaf9f4; }
.plug-icon { color: #1382b0; background: #e9f7fc; }
.review-list, .connector-list { display: grid; gap: 8px; }
.review-item, .connector-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef2f6; }
.review-item:last-child, .connector-item:last-child { border-bottom: 0; }
.review-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.review-item strong, .review-item span, .connector-item strong, .connector-item span { display: block; }
.review-item strong, .connector-item strong { font-size: 12px; }
.review-item span, .connector-item span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.connector-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #0a7890; background: #e7f9fb; font-size: 10px; font-weight: 900; }
.status-dot { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; }
.status-dot.on { background: var(--success); box-shadow: 0 0 0 4px rgba(22,167,121,.10); }
.status-dot.off { background: #a9b3c0; }

.intelligence-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: linear-gradient(120deg, #f6fbff, #f2fffd); }
.ai-copy { max-width: 720px; }
.ai-copy p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.ai-copy .btn-secondary { color: #0b4966; border-color: #cce7ef; background: #e9f7fb; }
.ai-status { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid #dff0f5; border-radius: 15px; background: rgba(255,255,255,.7); }
.ai-ring { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: conic-gradient(var(--teal), var(--blue), var(--violet), var(--teal)); padding: 3px; }
.ai-ring span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; color: var(--navy); font-weight: 900; background: white; }
.ai-status strong, .ai-status span { display: block; }
.ai-status strong { font-size: 13px; }
.ai-status span { margin-top: 2px; color: var(--muted); font-size: 10px; }

.copilot-drawer { position: fixed; z-index: 30; top: 0; right: -460px; width: min(440px, 94vw); height: 100vh; display: flex; flex-direction: column; background: #fff; box-shadow: -28px 0 70px rgba(6,29,55,.18); transition: right .25s ease; }
.copilot-drawer.open { right: 0; }
.drawer-backdrop { position: fixed; z-index: 20; inset: 0; background: rgba(3,20,38,.34); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.copilot-header { height: 72px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.copilot-header > div { display: flex; align-items: center; gap: 10px; }
.copilot-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: linear-gradient(145deg, var(--teal), var(--blue)); }
.copilot-body { flex: 1; padding: 22px; overflow: auto; background: #f9fbfe; }
.assistant-message { padding: 15px; border: 1px solid #e0e9f2; border-radius: 14px; background: white; }
.assistant-message strong { font-size: 13px; }
.assistant-message p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.prompt-suggestions { display: grid; gap: 8px; margin-top: 12px; }
.prompt-suggestions button { text-align: left; padding: 11px 12px; border: 1px solid #dce7f1; border-radius: 10px; color: #245274; background: white; cursor: pointer; }
.copilot-input { display: flex; gap: 8px; padding: 14px 16px 5px; border-top: 1px solid var(--line); }
.copilot-input input { flex: 1; height: 42px; padding: 0 12px; border: 1px solid #d8e2ec; border-radius: 11px; background: #f7f9fc; }
.copilot-input button { width: 42px; border: 0; border-radius: 11px; color: white; background: #3978f4; }
.copilot-note { padding: 4px 16px 14px; color: #8998a9; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 88px 1fr; }
  .sidebar { padding: 20px 12px; }
  .brand img { width: 64px; height: 58px; object-fit: cover; object-position: left; }
  .nav-label, .nav-item span, .sidebar-footer div:not(.environment-dot) { display: none; }
  .nav-item { justify-content: center; font-size: 18px; }
  .sidebar-footer { justify-content: center; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 8px 10px; }
  .brand { min-height: auto; margin: 0 8px 0 0; padding: 0 10px 0 0; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.08); }
  .brand img { width: 48px; height: 44px; }
  .nav-section { display: flex; margin: 0; }
  .nav-item { min-width: 42px; margin: 0 2px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 20px 15px 34px; }
  .topbar { align-items: flex-start; }
  .topbar-actions .icon-button { display: none; }
  .org-pill { max-width: 170px; }
  .org-pill > div { overflow: hidden; }
  .org-pill strong, .org-pill span { overflow: hidden; text-overflow: ellipsis; }
  .hero-panel { padding: 28px 22px; min-height: auto; }
  .kpi-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
  .domain-row { grid-template-columns: 38px minmax(0,1fr) auto; }
  .domain-key { display: none; }
  .intelligence-panel { align-items: flex-start; flex-direction: column; }
}
