/* ============================================================
   Panel-specific styles
   ============================================================ */

/* DASHBOARD */
.dash-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--gut-4);
  margin-bottom: var(--gut-5);
}
@media (max-width: 1100px) { .dash-hero { grid-template-columns: 1fr; } }

.hero-overview {
  background:
    radial-gradient(800px 300px at 10% 10%, var(--accent-soft) 0%, transparent 50%),
    linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--gut-5);
  position: relative;
  overflow: hidden;
}
.hero-overview .hero-mark {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}
.hero-overview h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin: 6px 0 4px;
  color: var(--paper-0);
  letter-spacing: -0.02em;
}
.hero-overview p { color: var(--paper-3); font-size: 13px; max-width: 50ch; margin: 0; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gut-3);
  margin-top: var(--gut-5);
}
.hero-stat {
  border-left: 2px solid var(--line);
  padding-left: var(--gut-3);
}
.hero-stat .hs-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--paper-3);
  text-transform: uppercase;
}
.hero-stat .hs-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--paper-0);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.hero-events {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero-events .he-head {
  padding: var(--gut-3) var(--gut-4);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hero-events .he-head h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: var(--paper-1);
}
.hero-events .he-list {
  flex: 1;
  overflow-y: auto;
  max-height: 240px;
}
.hero-events .he-list::-webkit-scrollbar { width: 4px; }
.hero-events .he-list::-webkit-scrollbar-thumb { background: var(--ink-4); }
.he-item {
  padding: 8px var(--gut-4);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.he-item:last-child { border-bottom: 0; }
.he-item .he-ts {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--paper-4);
  width: 60px;
  flex-shrink: 0;
}
.he-item .he-msg { flex: 1; color: var(--paper-1); }
.he-item .he-msg b { color: var(--paper-0); }

/* MIDDLEWARE GRID */
.mw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gut-3);
  margin-bottom: var(--gut-5);
}
.mw-card {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--gut-4);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
}
.mw-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--paper-4);
  transition: background var(--t-fast);
}
.mw-card.ok::after { background: var(--ok); }
.mw-card.warn::after { background: var(--warn); }
.mw-card.crit::after { background: var(--crit); }
.mw-card.off::after { background: var(--paper-4); }
.mw-card:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.mw-card .mw-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--paper-0);
  letter-spacing: -0.01em;
}
.mw-card .mw-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 6px 0;
}
.mw-card.ok .mw-status { color: var(--ok); }
.mw-card.warn .mw-status { color: var(--warn); }
.mw-card.crit .mw-status { color: var(--crit); }
.mw-card.off .mw-status { color: var(--paper-3); }
.mw-card .mw-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* SPLIT */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gut-4);
}
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

/* APPROVAL CARD */
.appr-card {
  background: var(--ink-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: var(--gut-4);
  display: flex;
  flex-direction: column;
  gap: var(--gut-3);
}
.appr-card.urgent { border-color: var(--crit-soft); box-shadow: 0 0 0 1px var(--crit-soft); }
.appr-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--gut-3);
}
.appr-head h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--paper-0);
}
.appr-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--gut-3);
}
.appr-meta b { color: var(--paper-1); font-weight: 500; }
.appr-payload {
  background: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-code);
  font-size: 11px;
  line-height: 1.6;
  color: var(--paper-1);
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}
.appr-actions {
  display: flex;
  gap: var(--gut-2);
  justify-content: flex-end;
}

/* AI CHAT (full panel mode) */
.ai-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gut-4);
  height: calc(100vh - var(--topbar-h) - 64px);
}
.ai-panel-stream {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--gut-5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--gut-4);
}
.ai-panel-stream::-webkit-scrollbar { width: 6px; }
.ai-panel-stream::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 3px; }
.ai-panel .ai-msg-body { font-size: 14px; }
.ai-empty {
  margin: auto;
  text-align: center;
  max-width: 480px;
  padding: var(--gut-8);
}
.ai-empty .ae-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}
.ai-empty h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--paper-0);
  margin: 8px 0 12px;
  letter-spacing: -0.02em;
}
.ai-empty p { color: var(--paper-3); margin: 0 0 var(--gut-5); }
.ai-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gut-2);
}
.ai-suggestion {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  color: var(--paper-2);
  transition: all var(--t-fast);
  cursor: pointer;
}
.ai-suggestion:hover { border-color: var(--accent-line); color: var(--paper-0); background: var(--ink-3); }
.ai-suggestion .as-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

/* MFA SETUP */
.mfa-setup {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--gut-5);
  align-items: flex-start;
}
.mfa-qr {
  background: white;
  padding: 12px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
}
.mfa-qr img { display: block; max-width: 180px; }
.mfa-secret {
  font-family: var(--font-code);
  font-size: 12px;
  background: var(--ink-0);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  word-break: break-all;
  color: var(--accent);
}

/* CHART (sparkline) */
.spark {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 8px;
}
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.spark .area { fill: var(--accent-soft); stroke: none; }

/* DIFF VIEWER */
.diff-view {
  font-family: var(--font-code);
  font-size: 11px;
  line-height: 1.6;
  background: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.diff-line { padding: 1px 12px; white-space: pre-wrap; word-break: break-all; }
.diff-line.add { background: rgba(94, 226, 160, 0.06); color: var(--ok); }
.diff-line.del { background: rgba(255, 107, 107, 0.06); color: var(--crit); }
.diff-line.ctx { color: var(--paper-3); }

/* PATCH ROWS */
.patch-row .severity-critical { color: var(--crit); }
.patch-row .severity-high { color: var(--warn); }
.patch-row .severity-medium { color: var(--info); }
.patch-row .severity-low { color: var(--paper-2); }

/* ANIMATED FLAGS */
.flag-new {
  background: var(--accent);
  color: var(--ink-0);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  padding: 1px 5px;
  border-radius: 2px;
  animation: flagPulse 2s ease-in-out infinite;
}
@keyframes flagPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

/* SECURITY EVENT SEVERITY */
.sev-critical { color: var(--crit); font-weight: 600; }
.sev-high { color: var(--warn); }
.sev-medium { color: var(--info); }
.sev-low { color: var(--paper-2); }
.sev-info { color: var(--paper-3); }
