/* ══════════════════════════════════════════════════════════════════════════
   base.css — Global styles loaded by every page.
   Reset, navbar, container, controls, form elements, buttons, status bar,
   flash messages, no-data banner, version footer.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Reset / base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1117;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar {
  background: #1a1d27;
  border-bottom: 1px solid #2a2d3e;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-weight: 700;
  font-size: 16px;
  color: #4ade80;
  margin-right: 16px;
}
.nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: #e0e0e0; }
.nav-link.active { color: #e0e0e0; border-bottom-color: #4ade80; }

/* Right-aligned login/logout slot — margin-left:auto pushes it to the edge
   regardless of how many nav-links precede it. */
.nav-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.nav-auth-user { color: #78909c; text-decoration: none; transition: color 0.15s; }
.nav-auth-user:hover { color: #e0e0e0; }
.nav-auth-link {
  color: #94a3b8;
  text-decoration: none;
  border: 1px solid #2a2d3e;
  border-radius: 5px;
  padding: 3px 12px;
  transition: color 0.15s, border-color 0.15s;
}
.nav-auth-link:hover { color: #e0e0e0; border-color: #4ade80; }
.nav-auth-logout {
  background: none;
  border: 1px solid #2a2d3e;
  border-radius: 5px;
  padding: 3px 12px;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.nav-auth-logout:hover { color: #ef9a9a; border-color: #5b1a1a; }

/* ── Main container ───────────────────────────────────────────────────── */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}
.main-container--wide { max-width: 1800px; }

/* ── Controls panel ───────────────────────────────────────────────────── */
.controls-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 14px;
  position: sticky;
  top: 52px;
  z-index: 90;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.control-group label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
select, input[type="number"], input[type="text"], input[type="password"] {
  background: #0f1117;
  border: 1px solid #2a2d3e;
  border-radius: 5px;
  color: #e0e0e0;
  font-size: 13px;
  padding: 3px 10px;
  min-width: 120px;
  outline: none;
  transition: border-color 0.15s;
  height: 26px;
  box-sizing: border-box;
}
select:focus, input:focus { border-color: #4ade80; }

/* ── Custom combobox dropdown ────────────────────────────────────────── */
.combo-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  max-height: 440px;   /* ~20 items visible */
  overflow-y: auto;
  background: #3a3a3c;
  border: 1px solid #545456;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  z-index: 100;
  margin-top: 2px;
}
.combo-opt {
  padding: 4px 10px;
  font-size: 13px;
  color: #f0f0f0;
  cursor: pointer;
  white-space: nowrap;
}
.combo-opt:hover {
  background: #0058d0;
  color: #fff;
}

/* Hide native spin buttons — replaced by custom .num-stepper buttons */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* Custom number stepper — input flanked by − / + buttons, same height as selects */
.num-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #2a2d3e;
  border-radius: 5px;
  overflow: hidden;
  height: 26px;
  box-sizing: border-box;
}
.num-stepper input[type="number"] {
  border: none;
  border-radius: 0;
  width: 40px;
  min-width: 40px;
  text-align: center;
  padding: 0 2px;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
}
.num-stepper__btn {
  background: #1a1d27;
  color: #b0bec5;
  border: none;
  width: 26px;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.num-stepper__btn:hover { background: #2a2d3e; color: #e0e0e0; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary {
  background: #1b5e20;
  color: #e0e0e0;
  border: 1px solid #2e7d32;
  border-radius: 5px;
  padding: 3px 18px;
  height: 26px;
  box-sizing: border-box;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: #2e7d32; }
.btn-secondary {
  background: #1a1d27;
  color: #94a3b8;
  border: 1px solid #2a2d3e;
  border-radius: 5px;
  padding: 3px 16px;
  height: 26px;
  box-sizing: border-box;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: color 0.15s, border-color 0.15s;
}
.btn-secondary:hover { color: #e0e0e0; border-color: #4ade80; }
.btn-danger {
  background: #1a1d27;
  color: #ef9a9a;
  border: 1px solid #4e2020;
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-danger:hover { background: #4e2020; border-color: #EF5350; color: #EF5350; }

/* ── Status bar ───────────────────────────────────────────────────────── */
.status-bar {
  font-size: 12px;
  line-height: 16px;
  padding: 6px 12px;
  border-radius: 5px;
  margin-bottom: 10px;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-bar.info  { background: #1a2744; color: #90caf9; border: 1px solid #1e3a5f; }
.status-bar.warn  { background: #2e2200; color: #FFB74D; border: 1px solid #5a3e00; }
.status-bar.error { background: #3b1212; color: #ef9a9a; border: 1px solid #5b1a1a; }

/* ── Headings ─────────────────────────────────────────────────────────── */
h2 { font-size: 20px; color: #e0e0e0; }
h3 { font-size: 14px; color: #90caf9; margin-bottom: 10px; }
.help-text { font-size: 12px; color: #94a3b8; margin-bottom: 10px; line-height: 1.5; }

/* ── No-data banner ───────────────────────────────────────────────────── */
.no-data-banner {
  background: #1e2a1e;
  border: 1px solid #2e7d32;
  border-radius: 8px;
  color: #a5d6a7;
  font-size: 13px;
  line-height: 1.7;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.no-data-banner code {
  background: #0f1117;
  border: 1px solid #2a2d3e;
  border-radius: 4px;
  color: #4ade80;
  font-family: "Fira Mono", monospace;
  font-size: 12px;
  padding: 2px 8px;
}

.flash { padding: 10px 16px; border-radius: 5px; font-size: 13px; margin-bottom: 14px; }
.flash-ok   { background: #1b2e1b; color: #a5d6a7; border: 1px solid #2e7d32; }
.flash-warn { background: #2e2a14; color: #fff176; border: 1px solid #827717; }
.flash-error{ background: #3b1212; color: #ef9a9a; border: 1px solid #5b1a1a; }

/* ── Inline alert word highlight ──────────────────────────────────────── */
.alert-word {
  color: #FFB74D;
  font-weight: 700;
}

/* ── Version footer ───────────────────────────────────────────────────── */
.version-footer {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  color: #90a4ae;
  font-family: monospace;
  pointer-events: none;
  user-select: none;
  z-index: 9999;
  background: rgba(15, 17, 23, 0.80);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #2a2d3e;
}
