/* maia.run.place — Unified Design System
 * Shared across portal, dashboard, LLM, and all sub-pages.
 * Inspired by LLM dashboard: dark base, warm/cool accents, Inter font.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

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

:root {
  /* ── Backgrounds ── */
  --bg-base:          #0c1117;
  --bg-surface:       #151c24;
  --bg-card:          #1a2230;
  --bg-card-elevated: #1e2838;
  --bg-input:         #0c1117;

  /* ── Borders ── */
  --border-subtle:    rgba(40, 55, 75, 0.4);
  --border-input:     rgba(40, 55, 75, 0.6);
  --border-warm:      rgba(192, 96, 48, 0.2);
  --border-cool:      rgba(72, 144, 216, 0.15);

  /* ── Accents ── */
  --accent:               #c06030;
  --accent-bright:        #e07040;
  --accent-glow:          rgba(192, 96, 48, 0.35);
  --accent-text:          #ffcbb0;
  --accent-dim:           rgba(192, 96, 48, 0.15);
  --accent-blue:          #4890d8;
  --accent-blue-dim:      rgba(72, 144, 216, 0.2);
  --accent-blue-text:     #90c8f0;
  --accent-teal:          #60a8c0;
  --accent-green:         #4caf7a;
  --accent-red:           #d05050;
  --accent-amber:         #e09040;

  /* ── Text ── */
  --text-primary:   #e8edf2;
  --text-secondary: #8898aa;
  --text-muted:     #556070;
  --text-warm:      #ffe8d2;

  /* ── Typography ── */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* ── Radii ── */
  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-pill: 999px;

  /* ── Shadows ── */
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.2);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow-warm: 0 0 20px rgba(192, 96, 48, 0.06);
}

html { font-size: 14px; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle gradient overlay on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 20%, rgba(192, 96, 48, 0.03) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(72, 144, 216, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: rgba(60, 80, 110, 0.5);
}
.card.warm {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(145, 72, 31, 0.06) 100%);
  border-color: var(--border-warm);
}
.card.warm:hover {
  border-color: rgba(192, 96, 48, 0.35);
  box-shadow: var(--shadow-glow-warm);
}
.card.cool {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(72, 144, 216, 0.04) 100%);
  border-color: var(--border-cool);
}
.card.cool:hover {
  border-color: rgba(72, 144, 216, 0.25);
}
.card-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.4;
}
.btn:active { transform: scale(0.98); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* ── Inputs ── */
.input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.input:focus {
  border-color: var(--accent);
}
.input::placeholder {
  color: var(--text-muted);
}

/* ── Labels ── */
.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

/* ── Status badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-ok {
  background: rgba(76, 175, 122, 0.12);
  color: var(--accent-green);
}
.badge-error {
  background: rgba(208, 80, 80, 0.12);
  color: var(--accent-red);
}
.badge-idle {
  background: rgba(85, 96, 112, 0.15);
  color: var(--text-secondary);
}
.badge-warn {
  background: rgba(224, 144, 64, 0.12);
  color: var(--accent-amber);
}

/* ── Feedback messages ── */
.msg-error {
  padding: 0.6rem 0.8rem;
  background: rgba(208, 80, 80, 0.1);
  border: 1px solid rgba(208, 80, 80, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-size: 0.85rem;
}
.msg-success {
  padding: 0.6rem 0.8rem;
  background: rgba(76, 175, 122, 0.1);
  border: 1px solid rgba(76, 175, 122, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-green);
  font-size: 0.85rem;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
tbody td {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(40, 55, 75, 0.15);
  color: var(--text-secondary);
}
tbody tr:hover {
  background: rgba(72, 144, 216, 0.03);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: rgba(192, 96, 48, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(192, 96, 48, 0.35);
}

/* ── Status dot animation ── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(76, 175, 122, 0.5);
  animation: pulse-dot 2.5s ease-in-out infinite;
  display: inline-block;
}

/* ── Utility ── */
.mono { font-family: var(--font-mono); }
.text-warm { color: var(--accent-text); }
.text-cool { color: var(--accent-blue-text); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
