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

/* ==========================================================================
   ForestWatch — Elite Dark Command Center Design Tokens & Global System
   Inspired by high-tech GIS defense, wildfire telemetry & NASA FIRMS HUD.
   ========================================================================== */
:root {
  --forest: #10b981;
  --forest-dark: #064e3b;
  --forest-light: #34d399;
  --forest-glow: rgba(16, 185, 129, 0.35);

  --bg: #080d0a;
  --bg-deep: #050806;
  --surface: #0e1713;
  --surface-elevated: #14221b;
  --surface-card: rgba(14, 23, 19, 0.85);
  --surface-card-hover: rgba(20, 34, 27, 0.95);

  --ink: #ecf3ee;
  --ink-dim: #cbd8cf;
  --muted: #7e9889;
  --line: #1c2e24;
  --line-bright: #2d4a3b;
  --line-glow: rgba(16, 185, 129, 0.22);

  --lime: #84cc16;
  --lime-glow: rgba(132, 204, 22, 0.3);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.35);

  --font-main: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Roboto Mono', 'SF Mono', Consolas, monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.5), 0 0 16px rgba(16, 185, 129, 0.08);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.65), 0 0 24px rgba(16, 185, 129, 0.12);
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.65 var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Tactical Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--line-bright);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--forest);
  box-shadow: 0 0 8px var(--forest-glow);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.035em;
  color: #ffffff;
}

h1 { font-size: 34px; font-weight: 700; }
h2 { font-size: 26px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }

p {
  color: var(--muted);
  line-height: 1.7;
}

/* ==========================================================================
   Header & Tactical Navigation Bar
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  background: rgba(8, 13, 10, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  gap: 20px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  position: relative;
  line-height: 1.1;
  white-space: nowrap;
  display: inline-flex;
  flex-direction: column;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand > span:not(.brand-icon) {
  font-weight: 400;
  color: var(--forest-light);
}

.brand-icon {
  font-size: 26px;
  color: var(--forest);
  vertical-align: middle;
  margin-right: 8px;
  display: inline-block;
  text-shadow: 0 0 14px var(--forest-glow);
  transform: translateY(-1px);
}

.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.24em;
  margin: 3px 0 0 35px;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-mono);
}

.header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.header nav a {
  padding: 7px 13px;
  border-radius: 20px;
  color: var(--ink-dim);
  transition: all 0.2s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.header nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.header nav a[aria-current="page"] {
  color: var(--forest-light);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  font-weight: 600;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.18);
}

/* User Account & Session Pill */
.account {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 5px 14px;
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.account span {
  font-family: var(--font-mono);
  color: var(--ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account span::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 8px var(--forest);
  animation: pulse-dot 2.2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.text-button:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #042114;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.01em;
}

.button:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #021a0f;
}

.button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.button.small {
  padding: 7px 15px;
  font-size: 12px;
  border-radius: 6px;
}

.button.lime {
  background: linear-gradient(135deg, #a3e635, #84cc16);
  color: #1a3300;
  border-color: rgba(190, 242, 100, 0.5);
  box-shadow: 0 4px 14px rgba(132, 204, 22, 0.3);
}

.button.lime:hover {
  background: linear-gradient(135deg, #bef264, #a3e635);
  box-shadow: 0 6px 20px rgba(132, 204, 22, 0.45);
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-bright);
  box-shadow: var(--shadow-sm);
}

.button.secondary:hover {
  background: var(--surface-elevated);
  border-color: var(--forest);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.button.full {
  width: 100%;
  margin-top: 18px;
}

/* Tactical Operator Verification Buttons */
.btn-confirm-alert {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #ffffff !important;
  border-color: rgba(248, 113, 113, 0.45) !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35) !important;
}

.btn-confirm-alert:hover {
  background: linear-gradient(135deg, #f87171, #ef4444) !important;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5) !important;
}

.btn-reject-alert {
  background: var(--surface) !important;
  color: var(--muted) !important;
  border-color: var(--line-bright) !important;
}

.btn-reject-alert:hover {
  background: var(--surface-elevated) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.btn-resolve-alert {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #022013 !important;
  border-color: rgba(52, 211, 153, 0.5) !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

.btn-resolve-alert:hover {
  background: linear-gradient(135deg, #34d399, #10b981) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
}

.tip {
  margin-top: 20px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-left: 3px solid var(--forest);
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 12px;
}

.tip strong {
  color: #ffffff;
  display: block;
  margin-bottom: 4px;
}

.tip p {
  margin: 0;
  font-size: 11px;
}

/* ==========================================================================
   Form Controls & Modern Dark Inputs
   ========================================================================== */
label:not(.dropzone):not(.cctv-check-pill):not(.cctv-card-check-pill) {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin: 16px 0 6px;
}

input:not([type=checkbox]):not([type=file]):not([type=radio]),
textarea,
select {
  display: block;
  width: 100%;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 14px;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:not([type=checkbox]):not([type=file]):not([type=radio]):focus,
textarea:focus,
select:focus {
  outline: none;
  background: #17281f;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 0 12px rgba(16, 185, 129, 0.2);
}

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

select {
  cursor: pointer;
}

/* Notice & Status Banners */
.notice {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 4px solid var(--amber);
  color: #fbbf24;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 12px;
  margin: 18px 0;
}

.notice p {
  color: inherit;
  margin: 4px 0 0;
}

.notice.green {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  border-left-color: var(--forest);
  color: var(--forest-light);
}

.notice .checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--ink);
  margin-top: 8px;
}

/* Messages / Toast */
.messages {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 4%;
  width: 100%;
}

.messages p, .errorlist {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid var(--amber);
  color: #fde68a;
  padding: 12px 18px;
  border-radius: 7px;
  font-size: 12px;
  margin: 8px 0;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Cards, Panels & Glassmorphic Containers
   ========================================================================== */
.workspace {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 4% 60px;
  flex: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--surface-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease;
}

.panel:hover {
  border-color: var(--line-bright);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.panel-heading > span {
  font-size: 9px;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
}

.panel-heading > a {
  font-size: 12px;
  color: var(--forest-light);
  font-weight: 600;
}

.panel-heading > a:hover {
  text-decoration: underline;
}

/* Page Heading */
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-heading .eyebrow {
  margin-bottom: 8px;
}

.page-heading h1 {
  font-size: 30px;
  margin-bottom: 6px;
  color: #ffffff;
}

.page-heading p {
  font-size: 13px;
  margin: 0;
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--forest-light);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.eyebrow.light {
  color: var(--forest-light);
}

.eyebrow i, .live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 10px var(--forest);
  animation: pulse-dot 2s infinite;
}

/* Mode Badges */
.mode-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.12);
  color: var(--forest-light);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 8px 14px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mode-badge.demo {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.mode-badge i {
  display: inline-block;
  background: currentColor;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

/* ==========================================================================
   Executive KPI Stats Cards
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 0 24px;
}

.stats article {
  background: var(--surface-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-bright);
  padding: 18px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
}

.stats article:hover {
  transform: translateY(-2px);
  border-top-color: var(--forest);
  border-color: var(--line-bright);
  box-shadow: var(--shadow-md);
}

.stats span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stats strong {
  display: block;
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #ffffff;
  margin: 8px 0;
  letter-spacing: -0.03em;
}

.stats small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.stats .amber {
  color: #fbbf24;
  text-shadow: 0 0 12px var(--amber-glow);
}

/* ==========================================================================
   Interactive Upload Dropzone & Tabs
   ========================================================================== */
.upload-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-deep);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.upload-tabs .tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.upload-tabs .tab-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.upload-tabs .tab-btn.active {
  background: var(--surface-elevated);
  color: var(--forest-light);
  border: 1px solid var(--line-bright);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.dropzone {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border: 2px dashed var(--line-bright);
  background: rgba(14, 23, 19, 0.5);
  border-radius: 10px;
  min-height: 190px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--forest);
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.dropzone .upload-symbol {
  font-size: 32px;
  color: var(--forest-light);
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 8px var(--forest-glow));
}

.dropzone strong {
  font-size: 13px;
  color: #ffffff;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.dropzone > span {
  font-size: 11px;
  color: var(--muted);
}

.dropzone img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin-top: 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

input[type=file] {
  font-size: 11px;
  max-width: 100%;
  margin: 10px 0;
  color: var(--muted);
}

/* URL Preview Elements */
.url-input-wrap {
  position: relative;
  margin: 6px 0 10px;
}

.url-input-wrap input {
  padding-right: 110px;
}

.btn-preview-url {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  background: var(--surface);
  border: 1px solid var(--line-bright);
  color: var(--forest-light);
  border-radius: 5px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-preview-url:hover {
  background: var(--forest);
  color: #031c10;
  border-color: var(--forest);
  box-shadow: 0 0 10px var(--forest-glow);
}

.url-help-text {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 14px;
  line-height: 1.6;
}

.url-help-text code {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--forest-light);
}

.url-preview-box {
  border: 1px dashed var(--line-bright);
  background: var(--bg-deep);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.url-preview-box img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 6px;
}

.url-preview-box span {
  font-size: 11px;
  color: var(--muted);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}

.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  margin: 0 !important;
  color: var(--ink);
  text-transform: none !important;
}

/* ==========================================================================
   Recent Runs & Observation List
   ========================================================================== */
.run-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  margin-bottom: 4px;
}

.run-row:hover {
  background: var(--surface-elevated);
  border-color: var(--line-bright);
  transform: translateX(3px);
}

.run-row > img {
  width: 64px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.run-row > div {
  flex: 1;
  min-width: 0;
}

.run-row strong {
  display: block;
  font-size: 13px;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.run-row small {
  font-size: 10px;
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  margin: 3px 0 4px;
}

.pill {
  display: inline-block;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--forest-light);
  border: 1px solid rgba(16, 185, 129, 0.28);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
}

.pill.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.pill.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   Observation Workspace & Detail View (Bằng chứng hiện trường)
   ========================================================================== */
.observation-workspace {
  max-width: 1080px;
}

.observation-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.observation-card .dropzone {
  min-height: 260px;
  background: rgba(8, 13, 10, 0.7);
}

.result-panel .result-image {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #030604;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

/* 3-Way Segmented View Toggle */
.segmented {
  display: inline-flex;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.segmented button {
  border: 0;
  background: transparent;
  padding: 7px 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.18s ease;
}

.segmented button:hover {
  color: #ffffff;
}

.segmented button.selected {
  background: var(--surface-elevated);
  color: var(--forest-light);
  border: 1px solid var(--line-bright);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Side by Side Split View */
.side-by-side-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.side-by-side-wrap figure {
  margin: 0;
  text-align: center;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.side-by-side-wrap figure img {
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  border-radius: 6px;
  background: #030604;
  display: block;
}

.side-by-side-wrap figcaption {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Telemetry Metrics Grid */
.observation-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.observation-metrics > div {
  padding: 14px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  transition: border-color 0.18s ease;
}

.observation-metrics > div:hover {
  border-color: var(--line-bright);
}

.observation-metrics span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  color: var(--muted);
  margin-bottom: 5px;
}

.observation-metrics strong {
  display: block;
  font-size: 14px;
  color: #ffffff;
  overflow-wrap: anywhere;
}

/* Detection list */
.detection-list {
  padding-top: 20px;
  font-size: 12px;
}

.detection-list h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.detection-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.detection-list strong {
  color: #ffffff;
}

.detection-list span {
  font-size: 11px;
  color: var(--forest-light);
  font-family: var(--font-mono);
}

/* Actions & Downloads */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Timeline */
.history-title {
  font-size: 15px;
  margin: 28px 0 14px;
  color: #ffffff;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--line-bright);
  margin-left: 6px;
}

.timeline li {
  position: relative;
  padding: 0 0 20px 20px;
  font-size: 11px;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  background: var(--forest);
  box-shadow: 0 0 10px var(--forest-glow);
  border-radius: 50%;
}

.timeline strong {
  color: #ffffff;
  display: block;
}

.timeline small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.timeline p {
  margin: 6px 0 0;
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

/* Navigation breadcrumbs */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.breadcrumb-bar .back {
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.breadcrumb-bar .back:hover {
  color: var(--forest-light);
}

.quick-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--forest-light);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.15s ease;
}

.quick-jump-btn:hover {
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 0 12px var(--forest-glow);
}

/* ==========================================================================
   Filter & Tables
   ========================================================================== */
.filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.filter label {
  margin: 0;
}

.filter select {
  width: auto;
  min-width: 180px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}

th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface-elevated);
  font-family: var(--font-mono);
}

td, th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Empty states */
.empty {
  padding: 48px 16px;
  text-align: center;
}

.empty > span {
  font-size: 42px;
  color: var(--forest-light);
  display: inline-block;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 12px var(--forest-glow));
}

.empty h3 {
  font-size: 16px;
  color: #ffffff;
  margin-top: 10px;
}

.empty p {
  font-size: 12px;
}

/* ==========================================================================
   Authentication & Google Sign-In
   ========================================================================== */
.login-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: calc(100vh - 140px);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 4%;
  gap: 40px;
  align-items: center;
}

.login-visual {
  background: linear-gradient(135deg, rgba(8, 13, 10, 0.85), rgba(8, 28, 18, 0.92)),
              url('../img/forest.jpg') center/cover,
              var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 80px 10%;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-visual::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--forest), var(--lime));
}

.login-visual h1 {
  font-size: 42px;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 16px;
}

.login-visual em {
  font-style: normal;
  color: var(--forest-light);
  text-shadow: 0 0 16px var(--forest-glow);
}

.login-card {
  max-width: 460px;
  width: 100%;
  padding: 40px 36px;
  background: var(--surface-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.login-card h2 {
  font-size: 28px;
  color: #ffffff;
  margin-bottom: 6px;
}

.login-card p {
  font-size: 13px;
  margin-bottom: 22px;
}

.button-google {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  width: 100%;
  transition: all 0.18s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.button-google:hover {
  background: #f9fafb;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.button-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--line);
}

.auth-divider:not(:empty)::before { margin-right: 14px; }
.auth-divider:not(:empty)::after { margin-left: 14px; }

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.auth-footer a {
  color: var(--forest-light);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-footer a:hover {
  color: #ffffff;
}

.auth-card-wide {
  max-width: 520px;
}

/* ==========================================================================
   Landing Page (Trang chủ)
   ========================================================================== */
.hero {
  min-height: 580px;
  background: linear-gradient(135deg, rgba(8, 13, 10, 0.9), rgba(5, 24, 15, 0.82)),
              url('../img/forest.jpg') center 55%/cover,
              var(--bg);
  position: relative;
  color: #ffffff;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 120px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

.hero-inner {
  padding: 90px 6% 110px;
  max-width: 1100px;
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(40px, 5.2vw, 72px);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 22px;
  color: #ffffff;
}

.hero h1 em {
  font-style: normal;
  color: var(--forest-light);
  text-shadow: 0 0 20px var(--forest-glow);
}

.hero p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-dim);
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-link {
  font-size: 13px;
  color: var(--ink-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid var(--line-bright);
  background: rgba(14, 23, 19, 0.5);
  transition: all 0.18s ease;
}

.hero-link:hover {
  color: #ffffff;
  background: var(--surface-elevated);
  border-color: var(--forest);
}

.hero-foot {
  position: absolute;
  bottom: 0;
  left: 6%;
  right: 6%;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
  color: var(--muted);
  z-index: 3;
}

.section {
  padding: 70px 6%;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10%;
  align-items: center;
}

.intro h2 {
  font-size: 34px;
  margin: 0;
  color: #ffffff;
}

.intro p {
  font-size: 14px;
  margin: 0;
  line-height: 1.8;
}

.features {
  padding-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.features article {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
}

.features article:hover {
  transform: translateY(-3px);
  border-color: var(--forest);
  box-shadow: var(--shadow-md);
}

.feature-number {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--forest-light);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 16px;
}

.features h3 {
  margin: 0 0 10px;
  color: #ffffff;
}

.features p {
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}

.closing {
  background: linear-gradient(135deg, #0b1a13, #062b1d);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 40px auto 60px;
  text-align: center;
  padding: 60px 20px;
  box-shadow: var(--shadow-md);
}

.closing h2 {
  font-size: 36px;
  margin: 12px 0 24px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 4%;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-deep);
  margin-top: auto;
}

.footer-brand {
  font-size: 16px;
  color: #ffffff;
  font-weight: 700;
}

/* ==========================================================================
   Responsive Rules
   ========================================================================== */
@media (max-width: 900px) {
  .header {
    padding: 0 4%;
    height: 68px;
  }
  .header nav {
    gap: 6px;
  }
  .account > span {
    display: none;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .login-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 30px 4%;
  }
  .login-visual {
    padding: 50px 8%;
  }
  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .features {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .header {
    height: auto;
    padding: 12px 4%;
    flex-wrap: wrap;
    gap: 10px;
  }
  .header nav {
    order: 3;
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
  .brand {
    font-size: 18px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .side-by-side-wrap {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 36px;
  }
  footer {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
