/* ═══════════════════════════════════════════════════════════════════
   HYDROSTACK COMMAND CENTER — ADMIN CSS v2.0
   Aesthetic: Industrial Telemetry / Tactical Command
   Fonts: Syne (display) + IBM Plex Mono (data) + DM Sans (body)
═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=IBM+Plex+Mono:wght@400;500;600&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ─── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
  --bg-base:        #05080F;
  --bg-dark:        #07090F;
  --surface:        #0D1117;
  --surface-2:      #121820;
  --surface-3:      #1A2332;
  --border:         #1E2D40;
  --border-bright:  #2A3F58;
  --text-main:      #E8EDF4;
  --text-muted:     #6B849A;
  --text-faint:     #3A4E62;
  --accent:         #F0A500;
  --accent-dim:     rgba(240,165,0,0.12);
  --accent-glow:    rgba(240,165,0,0.35);
  --teal:           #0EA5C9;
  --teal-dim:       rgba(14,165,201,0.1);
  --success:        #22C55E;
  --success-dim:    rgba(34,197,94,0.12);
  --danger:         #EF4444;
  --danger-dim:     rgba(239,68,68,0.12);
  --warning:        #F59E0B;
  --google-blue:    #4285F4;
  --font-display:   'Syne', sans-serif;
  --font-mono:      'IBM Plex Mono', monospace;
  --font-body:      'DM Sans', sans-serif;
  --radius:         6px;
  --radius-lg:      10px;
  --transition:     0.18s cubic-bezier(0.4,0,0.2,1);
}

/* ─── RESET & BASE ───────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* Grid atmosphere overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(240,165,0,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,165,0,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Ambient corner glow */
body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(240,165,0,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ─── SCREENS ────────────────────────────────────────────────────── */
.screen { display: none; height: 100vh; position: relative; z-index: 1; }
.screen.active { display: flex; }

/* ─── LOGIN SCREEN ───────────────────────────────────────────────── */
#login-screen {
  justify-content: center;
  align-items: center;
  background: var(--bg-base);
}

/* Scanning beam */
#login-screen::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scanH 4s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes scanH {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(100vh); opacity: 0; }
}

.login-card {
  background: var(--surface);
  padding: 48px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  width: 100%;
  max-width: 460px;
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  box-shadow: 0 0 80px rgba(240,165,0,0.08), 0 40px 80px rgba(0,0,0,0.6);
  animation: cardReveal 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(240,165,0,0.15), transparent, rgba(14,165,201,0.06));
  pointer-events: none;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 16px 0 8px;
  color: var(--text-main);
}

.login-card > p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ─── DASHBOARD LAYOUT ───────────────────────────────────────────── */
.layout-dashboard { flex-direction: row; }

/* ─── SIDEBAR ────────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.sidebar::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent-glow), transparent);
  opacity: 0.4;
}

.sidebar-header {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-menu li {
  padding: 11px 14px;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.nav-menu li:hover {
  background: var(--surface-2);
  color: var(--text-main);
  border-color: var(--border);
}

.nav-menu li.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(240,165,0,0.2);
}

.nav-menu li.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

/* ─── MAIN CONTENT ───────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  overflow-y: auto;
  min-width: 0;
}

/* Custom scrollbar */
.main-content::-webkit-scrollbar { width: 4px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }
.main-content::-webkit-scrollbar-thumb:hover { background: var(--accent-glow); }

/* ─── TOPBAR ─────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 36px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-main);
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ─── TAB CONTENT ────────────────────────────────────────────────── */
.tab-content { display: none; padding: 32px 36px; animation: tabIn 0.2s ease both; }
.tab-content.active { display: block; }

@keyframes tabIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── LOGO ───────────────────────────────────────────────────────── */
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── BADGE ──────────────────────────────────────────────────────── */
.badge {
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 3px;
  vertical-align: middle;
}

/* ─── STATUS INDICATOR ───────────────────────────────────────────── */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.dot.active {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-dim), 0 0 12px var(--success);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--success-dim), 0 0 8px var(--success); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0.06), 0 0 18px var(--success); }
}

/* ─── BUTTONS ────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 9px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #FFB800;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 9px 20px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--border-bright);
  color: var(--text-main);
  background: var(--surface-2);
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--google-blue);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.btn-google:hover {
  background: #3b78dc;
  box-shadow: 0 4px 20px rgba(66,133,244,0.35);
  transform: translateY(-1px);
}

/* ─── INPUTS ─────────────────────────────────────────────────────── */
.input-group { margin-bottom: 16px; }

.input-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B849A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(240,165,0,0.03);
  box-shadow: 0 0 0 3px rgba(240,165,0,0.08);
}

input::placeholder, textarea::placeholder { color: var(--text-faint); }

/* ─── SECTION HEADERS ────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─── DATA TABLES ────────────────────────────────────────────────── */
.data-table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table thead tr {
  background: var(--bg-dark);
  border-bottom: 2px solid var(--border);
}

.data-table th {
  padding: 13px 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(30,45,64,0.7);
  font-size: 0.875rem;
  transition: background var(--transition);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: rgba(240,165,0,0.02); }

.data-table td:first-child {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

/* Empty state */
.data-table td[colspan] {
  text-align: center;
  color: var(--text-faint);
  font-style: italic;
  padding: 40px;
  font-size: 0.875rem;
}

/* ─── MODALS ─────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
  animation: modalBgIn 0.15s ease both;
}

@keyframes modalBgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 0 80px rgba(0,0,0,0.8), 0 0 40px rgba(240,165,0,0.06);
  animation: modalIn 0.25s cubic-bezier(0.16,1,0.3,1) both;
  position: relative;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.modal-content h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-content h3::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.modal-actions .btn-primary { flex: 1; }

/* ─── TOASTS ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 20px 22px;
  width: 340px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 20px rgba(240,165,0,0.06);
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s ease;
}

.toast.hidden {
  transform: translateX(calc(100% + 28px));
  opacity: 0;
  pointer-events: none;
}

.toast-header {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.toast p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.toast-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.toast-actions .btn-primary,
.toast-actions .btn-secondary {
  padding: 7px 14px;
  font-size: 0.8rem;
}

/* ─── FORM BUILDER CARD ──────────────────────────────────────────── */
.form-builder-card {
  background: var(--surface);
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.form-builder-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-builder-card h3::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--teal);
  border-radius: 2px;
}

.builder-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: all var(--transition);
  animation: rowIn 0.2s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.builder-row:hover {
  border-color: var(--border-bright);
}

.builder-row > div:first-child {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
}

.builder-row .q-label {
  flex: 2;
  background: transparent;
  border-color: var(--border);
  font-size: 0.875rem;
}

.builder-row .q-type {
  flex: 1;
  background: var(--bg-dark);
  border-color: var(--border);
  font-size: 0.8rem;
  min-width: 150px;
}

.builder-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
}

.builder-row label input[type="checkbox"] {
  width: auto;
  cursor: pointer;
  accent-color: var(--accent);
}

.builder-row .btn-secondary[style*="color: #FF3B30"],
.builder-row .btn-secondary[style*="color:#FF3B30"] {
  color: var(--danger) !important;
  border-color: var(--danger) !important;
  padding: 6px 10px;
  font-size: 0.75rem;
  opacity: 0.7;
  transition: all var(--transition);
}

.builder-row .btn-secondary[style*="color: #FF3B30"]:hover,
.builder-row .btn-secondary[style*="color:#FF3B30"]:hover {
  opacity: 1;
  background: var(--danger-dim) !important;
}

.dynamic-options-container {
  padding: 12px 14px;
  background: rgba(0,0,0,0.2);
  border-top: 1px dashed var(--border);
}

.dynamic-options-container .options-list > div {
  display: flex;
  gap: 8px;
  margin-bottom: 7px;
  align-items: center;
}

.dynamic-options-container .dyn-opt-val {
  background: var(--surface);
  border-color: var(--border);
  font-size: 0.825rem;
  padding: 7px 11px;
}

.form-builder-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─── REPORT SECTION ─────────────────────────────────────────────── */
.report-filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.report-filters .input-group {
  margin-bottom: 0;
  max-width: 320px;
  flex: 1;
}

/* ─── PDF EXPORT AREA ────────────────────────────────────────────── */
#pdf-export-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.pdf-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.pdf-report-meta h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 6px;
}

.report-meta-row {
  display: flex;
  gap: 24px;
  margin-bottom: 4px;
}

.report-meta-row span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.report-meta-row strong {
  color: var(--accent);
  font-weight: 600;
}

.pdf-watermark {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  text-align: right;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#pdf-export-area .data-table th {
  background: var(--bg-dark);
  font-size: 0.63rem;
}

#pdf-export-area .data-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.015);
}

/* ─── NOTIFICATION BADGE ─────────────────────────────────────────── */
.badge-new {
  background-color: var(--danger);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 7px;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 4px;
  border-radius: 3px;
  animation: badgePulse 1.8s cubic-bezier(0.4,0,0.6,1) infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.75; transform: scale(1.05); }
}

/* ─── STAT CARDS ─────────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.stat-body { min-width: 0; }

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ─── COPY LINK BUTTON ───────────────────────────────────────────── */
.btn-copy-link {
  background: transparent;
  color: var(--teal);
  border: 1px solid rgba(14,165,201,0.3);
  padding: 5px 12px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn-copy-link:hover {
  background: var(--teal-dim);
  border-color: var(--teal);
  box-shadow: 0 0 12px rgba(14,165,201,0.2);
}

/* ─── ENGINE GUIDE MODAL ─────────────────────────────────────────── */
#modal-engine-guide .modal-content {
  max-width: 640px;
  max-height: 82vh;
  overflow-y: auto;
}

#modal-engine-guide .modal-content::-webkit-scrollbar { width: 4px; }
#modal-engine-guide .modal-content::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

.guide-steps {
  list-style: none;
  counter-reset: steps;
  margin-bottom: 20px;
}

.guide-steps li {
  counter-increment: steps;
  padding: 12px 16px 12px 48px;
  position: relative;
  border-left: 2px solid var(--border);
  margin-bottom: 4px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: all var(--transition);
}

.guide-steps li:hover {
  border-left-color: var(--accent);
  color: var(--text-main);
}

.guide-steps li::before {
  content: counter(steps, decimal-leading-zero);
  position: absolute;
  left: 14px;
  top: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.code-block-wrapper {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.code-lang-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#engine-script-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--success);
  overflow-x: auto;
  white-space: pre-wrap;
  padding: 16px;
  line-height: 1.6;
  display: block;
}

/* ─── EMPTY MODULE MSG ───────────────────────────────────────────── */
#empty-module-msg {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-faint);
  font-size: 0.875rem;
}

/* ─── DIVIDER ────────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ─── UTILITY ────────────────────────────────────────────────────── */
.text-mono { font-family: var(--font-mono); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-status.active {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.2);
}

.badge-status.active::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

/* ═══════════════════════════════════════════════════════════════════
   PRINT / PDF EXPORT — PREMIUM EXECUTIVE OUTPUT
═══════════════════════════════════════════════════════════════════ */

@media print {
  /* Reset everything for print context */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 11pt !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* Hide everything except the export area */
  .sidebar, .topbar, .main-content > *:not(#tab-reports),
  .report-filters, .btn-primary[onclick*="generatePDF"],
  #sync-toast, .modal { display: none !important; }

  .main-content {
    overflow: visible !important;
    padding: 0 !important;
    background: white !important;
  }

  #tab-reports { display: block !important; padding: 0 !important; }
  #pdf-export-area {
    background: #ffffff !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* ─── html2pdf / @media print PDF CANVAS ─────────────────────────── */
#pdf-export-area {
  /* These print styles also apply when html2pdf renders */
}

/* .pdf-print-canvas: scoped print styles injected into the PDF area */
.pdf-print-canvas body,
.pdf-print-canvas { font-family: 'DM Sans', sans-serif; }

/*
  The actual premium print design is applied via a class
  toggled by JS before calling html2pdf. Fallback CSS below
  keeps it functional at all times.
*/

/* Executive print wrapper — applied by html2pdf/print media */
@media print {

  #pdf-export-area {
    padding: 0 !important;
    font-family: 'Helvetica Neue', Arial, sans-serif !important;
  }

  .pdf-report-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16pt !important;
    margin-bottom: 16pt !important;
    border-bottom: 2pt solid #111827 !important;
    page-break-inside: avoid !important;
  }

  .pdf-report-meta h3 {
    font-size: 16pt !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: #111827 !important;
    margin-bottom: 6pt !important;
  }

  .report-meta-row span {
    font-family: 'Courier New', monospace !important;
    font-size: 8pt !important;
    color: #6B7280 !important;
    display: inline-block;
    margin-right: 16pt;
  }

  .report-meta-row strong { color: #B45309 !important; }

  .pdf-watermark {
    font-family: 'Courier New', monospace !important;
    font-size: 7pt !important;
    color: #9CA3AF !important;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto !important;
  }

  .data-table thead {
    display: table-header-group !important; /* repeat on each page */
  }

  .data-table thead tr {
    background: #F3F4F6 !important;
    border-bottom: 1.5pt solid #111827 !important;
  }

  .data-table th {
    font-family: 'Courier New', monospace !important;
    font-size: 7pt !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.12em !important;
    color: #374151 !important;
    padding: 8pt 10pt !important;
    border-right: 0.5pt solid #E5E7EB;
  }

  .data-table td {
    padding: 9pt 10pt !important;
    font-size: 9pt !important;
    color: #1F2937 !important;
    border-bottom: 0.5pt solid #E5E7EB !important;
    vertical-align: top;
    line-height: 1.5;
    border-right: 0.5pt solid #F3F4F6;
    page-break-inside: avoid !important;
  }

  .data-table tbody tr { page-break-inside: avoid !important; }

  /* Alternating rows for scanability */
  .data-table tbody tr:nth-child(even) td {
    background-color: #FAFAFA !important;
  }

  /* Inspector name column — accent color in print */
  .data-table td strong { color: #B45309 !important; font-weight: 700 !important; }

  /* Date/time column */
  .data-table td:first-child {
    font-family: 'Courier New', monospace !important;
    font-size: 8pt !important;
    color: #6B7280 !important;
    white-space: nowrap;
    min-width: 80pt;
  }

  /* No page break after header */
  .pdf-report-header + * { page-break-before: avoid !important; }

  /* Prevent orphan/widow rows */
  .data-table tbody tr:last-child td { border-bottom: 1pt solid #111827 !important; }

  /* Footer rule */
  #pdf-export-area::after {
    content: 'HYDROSTACK FIELD OPERATIONS — CONFIDENTIAL';
    display: block;
    margin-top: 24pt;
    font-family: 'Courier New', monospace;
    font-size: 7pt;
    color: #9CA3AF;
    text-align: center;
    letter-spacing: 0.2em;
    border-top: 0.5pt solid #E5E7EB;
    padding-top: 8pt;
  }
}
/* FORCE DROPDOWN OPTIONS TO MATCH THEME (Fixes browser default whiteouts) */
select option {
    background: var(--bg-dark);
    color: var(--text-main);
}

/* ─── PDF LIGHT MODE TRICK ───────────────────────────────────────── */
/* html2pdf takes a literal screenshot. We force high-contrast colors right before it fires */
.pdf-light-mode {
    background: #ffffff !important;
    color: #111827 !important;
}
.pdf-light-mode h3, .pdf-light-mode .section-title { color: #111827 !important; }
.pdf-light-mode .data-table th {
    background: #F3F4F6 !important;
    color: #374151 !important;
    border-bottom: 2px solid #111827 !important;
}
.pdf-light-mode .data-table td {
    color: #1F2937 !important;
    border-color: #E5E7EB !important;
}
.pdf-light-mode .report-meta-row span, .pdf-light-mode .pdf-watermark {
    color: #6B7280 !important;
}