/* ============================================
   Fish Haus — Reef Dashboard Styles
   Dark ocean theme with glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== DESIGN TOKENS ===== */
:root {
  --bg-deep: #040a1a;
  --bg-ocean: #081424;
  --bg-surface: #0c1c32;
  --bg-card: rgba(12, 28, 50, 0.85);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-hover: rgba(255, 255, 255, 0.10);

  --accent-cyan: #00d4ff;
  --accent-teal: #06ffa5;
  --accent-purple: #a78bfa;
  --accent-gold: #fbbf24;
  --accent-coral: #f87171;
  --accent-pink: #f472b6;
  --accent-blue: #60a5fa;
  --accent-orange: #fb923c;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #4a5568;

  --status-good: #06ffa5;
  --status-warn: #fbbf24;
  --status-danger: #f87171;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow-cyan: 0 0 20px rgba(0, 212, 255, 0.15);
  --shadow-glow-teal: 0 0 20px rgba(6, 255, 165, 0.15);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== HEADER ===== */
#header {
  position: relative;
  background: linear-gradient(170deg, #0b1a3a 0%, #071230 40%, #04162e 70%, #061428 100%);
  padding: 4rem 1.5rem 6rem;
  text-align: center;
  overflow: hidden;
  min-height: 280px;
}

.header-content {
  position: relative;
  z-index: 2;
}

.header-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 0.3em 1.2em;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.header-title {
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 50%, var(--accent-teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.header-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Bubbles */
.bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.bubble {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 212, 255, 0.15), rgba(6, 255, 165, 0.05));
  animation: bubbleRise linear infinite;
  opacity: 0;
}

.bubble:nth-child(1) { width: 8px; height: 8px; left: 10%; animation-duration: 8s; animation-delay: 0s; }
.bubble:nth-child(2) { width: 12px; height: 12px; left: 25%; animation-duration: 10s; animation-delay: 1s; }
.bubble:nth-child(3) { width: 6px; height: 6px; left: 40%; animation-duration: 7s; animation-delay: 3s; }
.bubble:nth-child(4) { width: 10px; height: 10px; left: 55%; animation-duration: 9s; animation-delay: 2s; }
.bubble:nth-child(5) { width: 14px; height: 14px; left: 70%; animation-duration: 11s; animation-delay: 0.5s; }
.bubble:nth-child(6) { width: 7px; height: 7px; left: 82%; animation-duration: 8s; animation-delay: 4s; }
.bubble:nth-child(7) { width: 9px; height: 9px; left: 15%; animation-duration: 12s; animation-delay: 6s; }
.bubble:nth-child(8) { width: 5px; height: 5px; left: 90%; animation-duration: 9s; animation-delay: 3.5s; }

@keyframes bubbleRise {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  10%  { opacity: 0.6; }
  80%  { opacity: 0.3; }
  100% { transform: translateY(-400px) scale(0.4); opacity: 0; }
}

/* Waves */
.waves {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  z-index: 2;
}

.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
}

.wave path { fill: var(--bg-deep); }

.wave-1 { opacity: 0.15; animation: waveMove 8s ease-in-out infinite alternate; }
.wave-2 { opacity: 0.10; animation: waveMove 10s ease-in-out infinite alternate-reverse; }
.wave-3 { opacity: 0.25; animation: waveMove 6s ease-in-out infinite alternate; left: -20%; }

@keyframes waveMove {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-25%); }
}

/* ===== MAIN ===== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== SECTIONS ===== */
.section {
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease-out both;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== STATS RIBBON ===== */
.stats-ribbon {
  margin-top: -2rem;
  position: relative;
  z-index: 3;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tile-accent, var(--accent-cyan)), transparent);
  opacity: 0.6;
}

.stat-tile:hover {
  border-color: var(--glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-cyan);
}

.stat-tile .stat-icon {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  display: block;
}

.stat-tile .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}

.stat-tile .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 0.3rem;
}

/* ===== HEALTH SECTION ===== */
.health-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
}

.radar-wrap {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  max-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-wrap canvas {
  max-height: 350px;
}

.health-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.health-score-ring {
  position: relative;
  width: 160px;
  height: 160px;
}

.health-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--glass-border);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: var(--accent-teal);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s;
}

.health-score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

#healthScoreNum {
  font-size: 2.8rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-teal);
  line-height: 1;
  display: block;
}

.health-score-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.health-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 260px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-param {
  flex: 1;
  color: var(--text-secondary);
}

.legend-grade {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.15em 0.5em;
  border-radius: var(--radius-sm);
  background: var(--glass);
}

/* ===== PARAMETER CARDS ===== */
.param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.param-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.param-card:hover {
  border-color: var(--glass-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.param-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.param-card-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.param-icon {
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--glass);
}

.param-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.param-unit {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.param-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25em 0.7em;
  border-radius: var(--radius-full);
}

.param-status.good    { color: var(--status-good); background: rgba(6, 255, 165, 0.1); }
.param-status.warn    { color: var(--status-warn); background: rgba(251, 191, 36, 0.1); }
.param-status.danger  { color: var(--status-danger); background: rgba(248, 113, 113, 0.1); }
.param-status.no-data { color: var(--text-muted); background: var(--glass); }

.param-reading {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.param-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.param-trend {
  font-size: 0.85rem;
  font-weight: 700;
}

.param-trend.up   { color: var(--accent-coral); }
.param-trend.down { color: var(--accent-teal); }
.param-trend.flat { color: var(--text-muted); }
/* Invert for params where higher is worse */
.param-trend.up.invert-good { color: var(--accent-teal); }
.param-trend.down.invert-good { color: var(--accent-coral); }

.param-range {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.param-chart-wrap {
  height: 100px;
  position: relative;
}

.param-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.param-no-data {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

/* ===== HEATMAP ===== */
.heatmap-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.heatmap-cell {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--glass-border);
  transition: var(--transition);
  cursor: default;
  position: relative;
}

.heatmap-cell:hover {
  transform: scale(1.3);
  z-index: 2;
}

.heatmap-cell.journal { background: var(--accent-purple); opacity: 0.7; }
.heatmap-cell.tested  { background: var(--accent-cyan); }
.heatmap-cell.future  { background: transparent; border: 1px dashed var(--text-muted); opacity: 0.5; }

.heatmap-cell[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.65rem;
  padding: 0.3em 0.6em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: 1px solid var(--glass-border);
  z-index: 10;
  pointer-events: none;
}

.heatmap-legend {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.hl-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hl-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

/* ===== JOURNAL TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent-purple) 50%, var(--glass-border) 100%);
}

.tl-entry {
  position: relative;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.4s ease-out both;
}

.tl-dot {
  position: absolute;
  left: -2rem;
  top: 0.3rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 3px solid var(--accent-cyan);
  z-index: 1;
  transition: var(--transition);
}

.tl-entry.journal-only .tl-dot { border-color: var(--accent-purple); }
.tl-entry.has-test .tl-dot { border-color: var(--accent-cyan); background: var(--accent-cyan); }

.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  transition: var(--transition);
}

.tl-card:hover {
  border-color: var(--glass-hover);
}

.tl-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tl-date .tl-day-name {
  color: var(--text-muted);
  font-weight: 500;
}

.tl-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.tl-tag {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.2em 0.5em;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tl-tag.tag-test       { color: var(--accent-cyan); background: rgba(0, 212, 255, 0.1); }
.tl-tag.tag-livestock  { color: var(--accent-teal); background: rgba(6, 255, 165, 0.1); }
.tl-tag.tag-equipment  { color: var(--accent-gold); background: rgba(251, 191, 36, 0.1); }
.tl-tag.tag-dosing     { color: var(--accent-purple); background: rgba(167, 139, 250, 0.1); }
.tl-tag.tag-water      { color: var(--accent-blue); background: rgba(96, 165, 250, 0.1); }
.tl-tag.tag-removal    { color: var(--accent-coral); background: rgba(248, 113, 113, 0.1); }

.tl-params {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.tl-param-chip {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.2em 0.5em;
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.tl-param-chip .chip-label {
  color: var(--text-muted);
  margin-right: 0.2em;
}

.tl-notes {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.tl-notes.collapsed {
  max-height: 4.8em;
  overflow: hidden;
  position: relative;
}

.tl-notes.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2em;
  background: linear-gradient(transparent, var(--bg-card));
}

.tl-expand-btn {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0;
  margin-top: 0.2rem;
  font-family: inherit;
}

.tl-expand-btn:hover {
  text-decoration: underline;
}

/* Scheduled / Future entries */
.scheduled-entries {
  margin-bottom: 2rem;
}

.scheduled-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.scheduled-card {
  background: var(--bg-card);
  border: 1px dashed var(--text-muted);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
  transition: var(--transition);
}

.scheduled-card:hover {
  opacity: 0.85;
}

.scheduled-card .tl-date {
  color: var(--text-muted);
}

.scheduled-card .planned-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: var(--radius-sm);
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  border: none;
  color: var(--bg-deep);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  animation: fabPulse 3s ease-in-out infinite;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 30px rgba(0, 212, 255, 0.5);
}

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3); }
  50%      { box-shadow: 0 4px 30px rgba(0, 212, 255, 0.5); }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 26, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Form */
.form-section {
  margin-bottom: 1rem;
}

.form-section label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.form-params-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.form-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.form-field label small {
  font-weight: 400;
  color: var(--text-muted);
}

input[type="date"],
input[type="number"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  transition: border-color 0.2s;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
}

textarea {
  resize: vertical;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  min-height: 80px;
}

.btn-submit {
  width: 100%;
  padding: 0.9rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  border: none;
  border-radius: var(--radius-md);
  color: var(--bg-deep);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-success {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(6, 255, 165, 0.15);
  color: var(--accent-teal);
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.form-success p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
/* ===== MAINTENANCE SCHEDULE ===== */
.maint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.maint-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.maint-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--maint-accent, var(--accent-cyan));
}

.maint-card:hover {
  border-color: var(--glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.maint-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.maint-card-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.maint-icon {
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--glass);
}

.maint-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.maint-freq {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.maint-urgency {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.maint-urgency.overdue { color: var(--status-danger); background: rgba(248, 113, 113, 0.15); }
.maint-urgency.today   { color: var(--accent-gold); background: rgba(251, 191, 36, 0.15); }
.maint-urgency.soon    { color: var(--accent-cyan); background: rgba(0, 212, 255, 0.1); }
.maint-urgency.later   { color: var(--text-muted); background: var(--glass); }

.maint-due {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.maint-due-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.maint-due-date {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.maint-due-countdown {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

.maint-progress-bar {
  height: 4px;
  background: var(--glass-border);
  border-radius: 2px;
  margin-top: 0.6rem;
  overflow: hidden;
}

.maint-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease-out;
  background: var(--maint-accent, var(--accent-cyan));
}

.maint-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.maint-last {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.maint-done-btn {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--maint-accent, var(--accent-cyan)) 45%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--maint-accent, var(--accent-cyan)) 12%, transparent);
  color: var(--text-primary);
  font: 700 0.7rem/1 'Inter', sans-serif;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.maint-done-btn:hover {
  background: var(--maint-accent, var(--accent-cyan));
  border-color: var(--maint-accent, var(--accent-cyan));
  color: var(--bg-deep);
  transform: translateY(-1px);
}

.maint-done-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.maint-card.urgency-overdue { --maint-accent: var(--status-danger); }
.maint-card.urgency-today   { --maint-accent: var(--accent-gold); }
.maint-card.urgency-soon    { --maint-accent: var(--accent-cyan); }
.maint-card.urgency-later   { --maint-accent: var(--accent-purple); }

.maint-card.urgency-overdue .maint-progress-fill { animation: pulseBar 1.5s ease-in-out infinite; }

@keyframes pulseBar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

footer a {
  color: var(--accent-cyan);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ===== LOADING ===== */
.loading-skeleton {
  background: linear-gradient(90deg, var(--glass) 25%, var(--glass-hover) 50%, var(--glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
  min-height: 200px;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #header {
    padding: 3rem 1rem 5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .health-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .param-grid {
    grid-template-columns: 1fr;
  }

  .maint-grid {
    grid-template-columns: 1fr;
  }

  .form-params-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .heatmap-cell {
    width: 22px;
    height: 22px;
  }

  .fab {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stat-tile {
    padding: 0.9rem 0.75rem;
  }

  .stat-tile .stat-value {
    font-size: 1.3rem;
  }

  .form-params-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--glass-hover);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
