/* OnyxCloud dashboard - design tokens
   Grounded in the subject: control rooms, oscilloscopes, analog
   gauges - not a generic SaaS dashboard look. */

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

:root {
  /* Base palette - deep instrument-panel navy, not pure black */
  --bg: #0F1720;
  --surface: rgba(26, 37, 48, 0.82);
  --surface-raised: rgba(33, 47, 61, 0.82);
  --border: #2C3B4A;
  --text-primary: #E8EDF2;
  --text-secondary: #8FA3B5;
  --text-muted: #5A6E80;

  /* Accent - oscilloscope cyan, precise and technical */
  --accent: #3DDBD9;
  --accent-dim: #2A9A98;

  /* Alarm zones - functional, matching OnyxAnalyzer exactly */
  --zone-green: #27AE60;
  --zone-yellow: #F1C40F;
  --zone-orange: #E67E22;
  --zone-red: #E60000;
  --zone-neutral: #4A5A68;

  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'Inter', sans-serif;

  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(61, 219, 217, 0.04), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(61, 219, 217, 0.03), transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
}

.topbar, .container { position: relative; z-index: 1; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
.mono { font-family: var(--font-mono); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout shell ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(26, 37, 48, 0.6);
  backdrop-filter: blur(8px);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-text { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.brand-tagline {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #ED2024; /* sampled directly from the logo's own red */
  white-space: nowrap;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.brand-logo {
  height: 72px;
  width: 72px;
  object-fit: contain;
}

.topbar nav { display: flex; gap: 20px; align-items: center; font-size: 14px; color: var(--text-secondary); }
.topbar nav a { color: var(--text-secondary); }
.topbar nav a:hover { color: var(--accent); }

.container { max-width: 1100px; margin: 0 auto; padding: 32px 28px 60px; }

.page-title { font-size: 26px; margin-bottom: 4px; }
.page-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }

.breadcrumb { color: var(--text-secondary); font-size: 13px; margin-bottom: 18px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 6px; color: var(--text-muted); }

/* ---- Cards / grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--accent-dim); transform: translateY(-2px); }

.card h3 { font-size: 16px; margin-bottom: 6px; }
.card .meta { color: var(--text-secondary); font-size: 13px; }

/* ---- Forms ---- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 380px;
  margin: 80px auto;
  backdrop-filter: blur(8px);
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 219, 217, 0.15);
}

button, .btn {
  display: inline-block;
  background: var(--accent);
  color: #05201F;
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}
button:hover, .btn:hover { background: #56E5E3; text-decoration: none; }
button:disabled { background: var(--text-muted); cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-raised); color: var(--text-primary); }

.error-msg {
  background: rgba(230, 0, 0, 0.1);
  border: 1px solid var(--zone-red);
  color: #FF8A8A;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* ---- Gauge dial (signature element) ---- */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.gauge-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  font-size: 12px;
  color: var(--text-secondary);
}
.gauge-legend .swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* ---- Data table ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
.value-cell { font-family: var(--font-mono); }

.zone-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
