/* ============================================
   OpenClaw Dashboard — Modern Green-Dark Theme
   Inspired by Donezo UI
   ============================================ */

:root {
  --bg: #0a0f1a;
  --bg2: #111827;
  --sidebar-bg: #0d1321;
  --card: #151d2e;
  --card-hover: #1a2438;
  --stroke: #1e2a42;
  --stroke-hover: #2d3f66;
  --txt: #e8edf5;
  --txt-secondary: #8b97b0;
  --muted: #5f6d87;
  --green: #22c55e;
  --green-dim: #16a34a;
  --green-bg: #0f2a1b;
  --green-glow: rgba(34, 197, 94, 0.15);
  --amber: #f59e0b;
  --amber-bg: #2a1f0a;
  --red: #ef4444;
  --red-bg: #2a0f0f;
  --blue: #3b82f6;
  --blue-bg: #0f1a2a;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --sidebar-w: 260px;
  --topbar-h: 70px;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2d3f66; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #3d5280; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--stroke);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green), #15803d);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--txt);
  display: block;
  letter-spacing: -0.3px;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

.sidebar-section {
  padding: 16px 12px 8px;
}
.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 0 8px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--txt-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.nav-item:hover {
  background: rgba(34, 197, 94, 0.08);
  color: var(--txt);
}
.nav-item.active {
  background: var(--green-glow);
  color: var(--green);
  font-weight: 600;
}
.nav-item.active svg { stroke: var(--green); }

/* Agent widget */
.agent-status-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(34,197,94,0.02));
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: var(--radius-sm);
}
.agent-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #15803d, #166534);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #86efac;
}
.agent-pulse {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: var(--green);
  border: 2px solid var(--sidebar-bg);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.agent-name { font-size: 13px; font-weight: 700; color: var(--txt); display: block; }
.agent-state { font-size: 11px; color: var(--green); display: block; }
.agent-info { display: flex; flex-direction: column; gap: 1px; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--stroke);
}

/* ============================================
   MOBILE
   ============================================ */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--stroke);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 90;
}
.hamburger {
  background: none;
  border: none;
  color: var(--txt);
  cursor: pointer;
  padding: 4px;
}
.mobile-brand {
  font-weight: 800;
  font-size: 16px;
  color: var(--green);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ============================================
   MAIN WRAPPER
   ============================================ */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  min-height: var(--topbar-h);
  border-bottom: 1px solid var(--stroke);
  background: rgba(13, 19, 33, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-left h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.topbar-sub {
  font-size: 13px;
  color: var(--txt-secondary);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  transition: all var(--transition);
}
.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}
.search-box svg { color: var(--muted); flex-shrink: 0; }
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--txt);
  font-family: inherit;
  font-size: 13px;
  width: 180px;
}
.search-box input::placeholder { color: var(--muted); }

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--txt-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--green); color: var(--green); }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.notif-badge:empty, .notif-badge[data-count="0"] { display: none; }

.owner-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 99px;
  cursor: default;
}
.owner-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #15803d);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.owner-name { font-size: 13px; font-weight: 600; }

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
  padding: 24px 28px 32px;
  flex: 1;
}
.panel { display: none; animation: fadeSlideIn 0.35s ease; }
.panel.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── GRIDS ── */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g1 { grid-template-columns: 1fr; }

/* ── CARDS ── */
.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--stroke-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.card:hover::before { opacity: 1; }

/* ── KPI CARDS ── */
.kpi-card {
  position: relative;
  overflow: hidden;
}
.kpi-card .kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.kpi-card .kpi-icon.green { background: var(--green-bg); color: var(--green); }
.kpi-card .kpi-icon.amber { background: var(--amber-bg); color: var(--amber); }
.kpi-card .kpi-icon.red { background: var(--red-bg); color: var(--red); }
.kpi-card .kpi-icon.blue { background: var(--blue-bg); color: var(--blue); }

.kpi-label {
  font-size: 13px;
  color: var(--txt-secondary);
  font-weight: 500;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 99px;
}
.kpi-trend.up { color: var(--green); background: rgba(34,197,94,0.1); }
.kpi-trend.down { color: var(--red); background: rgba(239,68,68,0.1); }
.kpi-trend.neutral { color: var(--amber); background: rgba(245,158,11,0.1); }

.kpi-card .kpi-decoration {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.05;
}
.kpi-decoration.green { background: var(--green); }
.kpi-decoration.amber { background: var(--amber); }
.kpi-decoration.red { background: var(--red); }
.kpi-decoration.blue { background: var(--blue); }

/* ── SECTION TITLES ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  margin-top: 24px;
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: -0.3px;
}
.section-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--green);
  background: rgba(34,197,94,0.08);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.section-action:hover { background: rgba(34,197,94,0.15); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge.ok { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.2); }
.badge.warn { background: rgba(245,158,11,0.12); color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }
.badge.risk { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 8px;
  background: var(--stroke);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), #4ade80);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.progress-bar .fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15));
}

/* ── DONUT CHART ── */
.donut-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.donut-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donut-center {
  position: absolute;
  text-align: center;
}
.donut-center .donut-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--txt);
}
.donut-center .donut-label {
  font-size: 11px;
  color: var(--txt-secondary);
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 24px;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── BAR CHART ── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 140px;
  padding-top: 10px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.bar-fill {
  width: 100%;
  max-width: 36px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--green), #15803d);
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}
.bar-fill:hover { opacity: 0.85; }
.bar-fill .bar-tooltip {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--stroke);
  color: var(--txt);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.bar-fill:hover .bar-tooltip { opacity: 1; }
.bar-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* ── HEALTH TABLE ── */
.health-table {
  width: 100%;
  border-spacing: 0;
}
.health-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
}
.health-table td {
  padding: 14px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(30,42,66,0.5);
  vertical-align: middle;
}
.health-table tr {
  transition: background var(--transition);
  cursor: pointer;
}
.health-table tbody tr:hover {
  background: rgba(34,197,94,0.04);
}
.health-table .project-name-cell {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.project-dot.ok { background: var(--green); }
.project-dot.warn { background: var(--amber); }
.project-dot.risk { background: var(--red); }

.mini-progress {
  width: 80px;
  height: 6px;
  background: var(--stroke);
  border-radius: 99px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
.mini-progress .fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), #4ade80);
  transition: width 1s ease;
}

/* ── PRIORITIES ── */
.priority-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.priority-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(30,42,66,0.4);
  transition: all var(--transition);
}
.priority-item:last-child { border-bottom: none; }
.priority-item:hover { padding-left: 4px; }
.priority-number {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.priority-text {
  font-size: 13px;
  color: var(--txt);
  line-height: 1.5;
  padding-top: 2px;
}

/* ── PROJECT CARDS (Projects tab) ── */
.project-card {
  cursor: pointer;
}
.project-card .project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.project-card .project-title {
  font-size: 16px;
  font-weight: 700;
}
.project-card .project-objective {
  font-size: 13px;
  color: var(--txt-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}
.project-card .project-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}
.project-card .project-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.project-stat-value { font-size: 18px; font-weight: 800; }
.project-stat-label { font-size: 11px; color: var(--muted); }

.project-card .project-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.project-card .progress-percent {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  min-width: 36px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(59,130,246,0.1);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,0.15);
}

.project-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.project-kpi-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(30,42,66,0.5);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.project-kpi-val { font-size: 18px; font-weight: 800; color: var(--txt); }
.project-kpi-key { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.project-risks {
  margin-top: 12px;
}
.risk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--txt-secondary);
}
.risk-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

.project-next-action {
  margin-top: 14px;
  padding: 12px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.12);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.project-next-action strong {
  color: var(--green);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

/* ── FILTER ROW ── */
.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 7px 16px;
  border-radius: 99px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--txt-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--green); color: var(--txt); }
.filter-btn.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* ── OPS BOARD ── */
.ops-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ops-column {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px;
}
.ops-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}
.ops-col-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ops-col-count {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ops-col-count.todo { background: var(--blue-bg); color: var(--blue); }
.ops-col-count.doing { background: var(--amber-bg); color: var(--amber); }
.ops-col-count.done { background: var(--green-bg); color: var(--green); }

.ops-item {
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
  transition: all var(--transition);
  cursor: default;
}
.ops-item:last-child { margin-bottom: 0; }
.ops-item:hover {
  border-color: var(--stroke-hover);
  transform: translateX(2px);
}

.ops-cadence-bar {
  margin-bottom: 20px;
}
.cadence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cadence-title { font-size: 14px; font-weight: 600; }
.cadence-value { font-size: 14px; font-weight: 800; color: var(--green); }

/* ── INTEL CARDS ── */
.intel-card {
  padding: 0;
  overflow: hidden;
}
.intel-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--stroke);
}
.intel-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.intel-icon.alerts { background: var(--red-bg); color: var(--red); }
.intel-icon.watch { background: var(--blue-bg); color: var(--blue); }
.intel-icon.opps { background: var(--green-bg); color: var(--green); }
.intel-card-title { font-size: 15px; font-weight: 700; }
.intel-card-body { padding: 16px 20px; }
.intel-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(30,42,66,0.4);
  font-size: 13px;
  line-height: 1.5;
  color: var(--txt-secondary);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.intel-item:last-child { border-bottom: none; }
.intel-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.intel-bullet.red { background: var(--red); }
.intel-bullet.blue { background: var(--blue); }
.intel-bullet.green { background: var(--green); }

/* ── NOTIFICATION DROPDOWN ── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
  animation: fadeSlideIn 0.2s ease;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  font-weight: 700;
  font-size: 14px;
}
.notif-list { max-height: 280px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30,42,66,0.3);
  font-size: 13px;
  line-height: 1.5;
  color: var(--txt-secondary);
  transition: background var(--transition);
}
.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item:last-child { border-bottom: none; }
.notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── TOOLTIP ── */
.tooltip {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--stroke-hover);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--txt);
  pointer-events: none;
  z-index: 9999;
  max-width: 250px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: fadeSlideIn 0.15s ease;
}

/* ── ANIMATED COUNTER ── */
.counter-animate {
  display: inline-block;
  transition: transform 0.1s;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .ops-columns { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .mobile-topbar { display: flex; }

  .main-wrapper {
    margin-left: 0;
    padding-top: 52px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }
  .topbar-right {
    width: 100%;
    flex-wrap: wrap;
  }
  .search-box { flex: 1; min-width: 0; }
  .search-box input { width: 100%; }

  main { padding: 16px; }

  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .ops-columns { grid-template-columns: 1fr; }

  .kpi-value { font-size: 28px; }
  .card { padding: 16px; }

  .health-table-wrapper { overflow-x: auto; }
  .health-table { min-width: 500px; }

  .donut-container { flex-direction: column; }
  .donut-legend { margin-left: 0; margin-top: 16px; flex-direction: row; flex-wrap: wrap; }
}
