/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Variables ─── */
:root {
  --bg:        #0A192F;
  --teal:      #2A7F6E;
  --gold:      #F4D03F;
  --card:      rgba(15,35,55,0.65);
  --border:    rgba(42,127,110,0.35);
  --text:      #e2e8f0;
  --muted:     #8ca3c0;
  --radius-lg: 24px;
  --radius-xl: 28px;
}

/* ─── Base ─── */
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Grid overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(42,127,110,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,127,110,.07) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ─── App Container ─── */
.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
  position: relative;
  z-index: 2;
}

/* ─── Side Navigation ─── */
.side-nav {
  position: fixed;
  left: 1.5rem; top: 50%;
  transform: translateY(-50%);
  background: rgba(10,25,47,.82);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 48px;
  padding: 1.2rem .75rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  z-index: 100;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: .35rem; cursor: pointer; color: #94a3b8;
  transition: color .2s, transform .2s;
}
.nav-item i { font-size: 1.35rem; color: var(--teal); transition: color .2s, text-shadow .2s; }
.nav-item span { font-size: .68rem; font-weight: 500; letter-spacing: 1px; }
.nav-item:hover { color: var(--gold); transform: translateX(3px); }
.nav-item:hover i { color: var(--gold); }
.nav-item.active { color: var(--gold); }
.nav-item.active i { color: var(--gold); text-shadow: 0 0 8px var(--gold); }

/* ─── Hero ─── */
.hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.hero-badge {
  display: inline-block;
  background: rgba(42,127,110,.15);
  border: 1px solid rgba(42,127,110,.4);
  border-radius: 999px;
  padding: .3rem 1.1rem;
  font-size: .82rem;
  color: var(--teal);
  letter-spacing: 1px;
  margin-bottom: 1.2rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #fff 30%, var(--teal));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.hero p { color: var(--muted); font-size: 1.1rem; margin-top: .7rem; }

/* ─── Dashboard ─── */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 2.2fr 1fr;
  gap: 1.4rem;
  margin-bottom: 3rem;
}
.panel {
  background: var(--card);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.panel-title {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  display: flex; align-items: center; gap: .5rem;
  border-bottom: 1px dashed var(--teal);
  padding-bottom: .6rem;
  margin-bottom: 1rem;
}

/* Log Panel */
.log-list {
  max-height: 290px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: .78rem;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) transparent;
}
.log-entry {
  padding: .35rem 0;
  border-bottom: 1px solid rgba(42,127,110,.15);
  color: #a8c4e0;
  line-height: 1.4;
}
.log-time { color: var(--teal); margin-right: .4rem; }
.log-warn { color: var(--gold); margin-right: .4rem; }
.log-sync { color: #9b87f5; margin-right: .4rem; }

/* Topology Panel */
.topology-panel {
  background: rgba(10,25,47,.55);
  border: 1px solid rgba(42,127,110,.45);
  border-radius: var(--radius-xl);
  padding: 1rem;
  backdrop-filter: blur(3px);
}
#topoCanvas {
  width: 100%; height: auto;
  display: block;
  border-radius: 16px;
  background: rgba(0,0,0,.18);
}

/* Health Panel */
.health-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem 0;
  border-bottom: 1px solid rgba(244,208,63,.15);
}
.health-card:last-child { border-bottom: none; }
.svc-name { font-size: .85rem; font-weight: 500; display: flex; align-items: center; gap: .5rem; }
.svc-name i { color: var(--teal); font-size: .8rem; }
.status-badge {
  display: flex; align-items: center; gap: .4rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .5px;
}
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal);
  transition: background .4s, box-shadow .4s;
}
.dot.warn { background: var(--gold); box-shadow: 0 0 6px var(--gold); }

/* ─── Content Sections ─── */
.sections { display: flex; flex-direction: column; gap: 1.1rem; }

.section {
  background: var(--card);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .25s;
  scroll-margin-top: 90px;
}
.section.open { border-color: rgba(42,127,110,.6); }

.sec-header {
  padding: 1.2rem 1.6rem;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
  transition: background .2s;
}
.sec-header:hover { background: rgba(42,127,110,.12); }
.section.open .sec-header { border-bottom: 1px dashed rgba(42,127,110,.35); }

.sec-title {
  font-size: 1.25rem; font-weight: 700;
  display: flex; align-items: center; gap: .8rem;
}
.sec-title i { color: var(--teal); font-size: 1.1rem; }

.sec-chevron {
  color: var(--teal); font-size: 1rem;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.section.open .sec-chevron { transform: rotate(180deg); }

.sec-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .42s cubic-bezier(.4,0,.2,1);
}
.section.open .sec-body { max-height: 1400px; }

.sec-content { padding: 1.4rem 1.6rem 1.6rem; color: #b8cfe6; }
.sec-content p { margin-bottom: .9rem; line-height: 1.7; }
.sec-content p:last-child { margin-bottom: 0; }

/* Value Cards */
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: .9rem; margin: 1.1rem 0;
}
.val-card {
  background: rgba(10,25,47,.5);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .9rem 1rem;
}
.val-card-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 600; color: var(--gold);
  margin-bottom: .4rem;
}
.val-card p { font-size: .78rem; margin: 0; color: var(--muted); }

/* Badge Row */
.badge-row {
  display: flex; flex-wrap: wrap; gap: 1.1rem;
  border-top: 1px solid var(--border);
  padding-top: .9rem; margin-top: .5rem;
}
.badge-item { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.badge-item i { color: var(--teal); }

/* Service Cards */
.svc-cards { display: flex; flex-direction: column; gap: .9rem; margin: 1rem 0; }
.svc-card {
  display: flex; gap: 1rem;
  background: rgba(10,25,47,.4);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .9rem 1.1rem;
  transition: border-color .2s;
}
.svc-card:hover { border-color: rgba(42,127,110,.6); }
.svc-icon-box {
  width: 38px; height: 38px; flex-shrink: 0;
  background: rgba(42,127,110,.12);
  border: 1px solid rgba(42,127,110,.3);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal); font-size: .9rem;
}
.svc-card-body { flex: 1; }
.svc-card-title {
  font-size: .88rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: .4rem;
  margin-bottom: .2rem;
}
.svc-bullet { color: var(--gold); font-size: .7rem; }
.svc-short { font-size: .75rem; color: var(--gold); margin-bottom: .3rem; opacity: .85; }
.svc-detail { font-size: .78rem; color: var(--muted); line-height: 1.55; margin: 0; }

/* Innovation Grid */
.inno-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px,1fr));
  gap: .9rem; margin: 1rem 0;
}
.inno-card {
  background: rgba(10,25,47,.4);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .9rem 1rem;
  transition: border-color .2s;
}
.inno-card:hover { border-color: rgba(42,127,110,.55); }
.inno-title {
  font-size: .83rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .4rem;
}
.inno-title i { color: var(--gold); font-size: .8rem; }
.inno-card p { font-size: .77rem; color: var(--muted); margin: 0; line-height: 1.55; }

/* Callouts */
.callout {
  background: rgba(244,208,63,.06);
  border: 1px solid rgba(244,208,63,.25);
  border-radius: 14px;
  padding: .85rem 1rem;
  font-size: .83rem;
  color: rgba(244,208,63,.9);
  display: flex; gap: .6rem; align-items: flex-start;
  margin-top: .5rem;
}
.callout i { flex-shrink: 0; margin-top: 2px; }

.teal-callout {
  background: rgba(42,127,110,.07);
  border: 1px solid rgba(42,127,110,.25);
  border-radius: 14px;
  padding: .85rem 1rem;
  font-size: .83rem;
  color: rgba(42,127,110,.95);
  display: flex; gap: .6rem; align-items: flex-start;
  margin-top: .5rem;
}
.teal-callout i { flex-shrink: 0; margin-top: 2px; }

/* italic footer note inside section */
.sec-note {
  font-size: .82rem;
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: .9rem;
  margin-top: .5rem;
  color: var(--muted);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: .9rem; margin: 1rem 0;
}
.contact-card {
  background: rgba(10,25,47,.4);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}
.contact-card-title {
  font-size: .8rem; font-weight: 600;
  color: var(--gold);
  display: flex; align-items: center; gap: .4rem;
  margin-bottom: .7rem;
}
.contact-row {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .83rem; margin-bottom: .55rem; color: var(--muted);
}
.contact-row i { color: var(--teal); flex-shrink: 0; margin-top: 2px; font-size: .8rem; }
.contact-row a {
  color: var(--teal); text-decoration: none;
  border-bottom: 1px dashed var(--teal);
  transition: color .2s, border-color .2s;
}
.contact-row a:hover { color: var(--gold); border-color: var(--gold); }

/* ─── Footer ─── */
footer {
  margin-top: 3.5rem;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 1.8rem;
  text-align: center;
  font-size: .78rem;
  color: #4a6278;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
footer i { color: var(--teal); }

/* ─── Flash animation ─── */
@keyframes flashGold {
  0%   { box-shadow: 0 0 0 0 var(--gold); }
  40%  { box-shadow: 0 0 0 5px rgba(244,208,63,.4); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.flash { animation: flashGold .55s ease 2; }

/* ─── Responsive ─── */
@media (max-width: 1000px) {
  .side-nav { left: .7rem; padding: .8rem .5rem; gap: 1.2rem; }
  .nav-item span { display: none; }
  .app { padding-left: 3.5rem; padding-right: 1rem; }
}
@media (max-width: 780px) {
  .dashboard { grid-template-columns: 1fr; }
  .side-nav {
    top: auto; bottom: 1rem; left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    border-radius: 60px;
    gap: 1.5rem;
    padding: .6rem 1.2rem;
    background: rgba(10,25,47,.92);
  }
  .nav-item span { display: inline-block; font-size: .63rem; }
  .app { padding-left: 1rem; padding-right: 1rem; padding-bottom: 6rem; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: 2rem; }
  .card-grid-3, .inno-grid { grid-template-columns: 1fr; }
}
