/* ===================================================================
   TimberSentry — Tailwind-only stylesheet (drop-in replacement)
   Dark forest theme · satellite-ops aesthetic
   =================================================================== */

/* Site typography: Inter (UI-focused) across the application. */
/* Inter is loaded in header.php via Google Fonts link tag. */
/* ── Design tokens ─────────────────────────────────────────── */
:root {
  /* Increased contrast tokens */
  --bg:          #FFFFFF;
  --surface:     #F7FFF7;
  --surface-2:   #F0F7EF;
  --card:        #FFFFFF;
  --card-2:      #F8FFF8;
  --border:      rgba(27,94,32,0.10);
  --border-2:    rgba(27,94,32,0.18);
  --sidebar:     #06110A;
  --sidebar-w:   230px;
  --primary:     #103913;
  --primary-dk:  #0b2b0e;
  --accent:      #7FBF3A;
  --accent-2:    #BEE7A8;
  --muted:       #4b6f4f;
  --text:        #071f12; /* darker for stronger contrast */
  --text-2:      #355b3f;
  --red:         #B91C1C;
  --red-bg:      rgba(185,28,28,0.08);
  --yellow:      #BF7700;
  --yellow-bg:   rgba(191,119,0,0.08);
  --green:       #2E7D32;
  --green-bg:    rgba(46,125,50,0.08);
  --radius:      8px;
  --radius-lg:   14px;
  --shadow:      0 2px 12px rgba(12,24,10,0.10), 0 1px 3px rgba(12,24,10,0.06);
  --shadow-lg:   0 8px 28px rgba(12,24,10,0.13), 0 2px 6px rgba(12,24,10,0.07);
  --glow:        0 0 16px rgba(127,191,58,0.08);
  --mono:        'DM Mono', monospace;
  --sans:        'IBM Plex Sans', 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --serif:       "IBM Plex Serif", "Georgia", "Times New Roman", serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
  background-color: #fff !important;
  border-color: var(--border-2) !important;
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 14.5px; /* UI-target: 12–16px recommended for tables/forms */
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Subtle scanline texture removed */
/* body::before scanline texture removed per design request */

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); text-decoration: none; }

h1,h2,h3,h4,h5,h6 { color: var(--text); font-family: var(--sans); font-weight: 700; }
.content h1,.content h2,.content h3,.content h4 { color: var(--text); }

small, .small { color: var(--text-2); }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 1.4rem 1.1rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand h1 { display: none; }
.brand-logo {
  width: 144px; height: auto;
  filter: brightness(0) invert(1);
  opacity: .92;
  display: block;
}
.brand-icon { display: none; }

.sidebar-nav {
  list-style: none;
  flex: 1;
  padding: .6rem 0;
}

.sidebar-nav li a,
.sidebar-group-btn {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem 1rem;
  color: #c7d1c4; /* lighter gray for better contrast */
  font-size: .875rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all .15s;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--sans);
  text-align: left;
  border-left: 2px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-group-btn:hover {
  background: rgba(139,195,74,.12);
  color: #f9fff8;
  border-left-color: #7fbf3a;
  text-decoration: none;
}

.sidebar-nav li a.active,
.sidebar-group.grp-active > .sidebar-group-btn {
  background: rgba(127,191,58,.2);
  color: #ffffff;
  border-left-color: #d9f8b0;
  font-weight: 700;
}

.sidebar-footer .user-name,
.sidebar-footer .user-tier,
.btn-logout {
  color: #f0fdf4 !important;
  background: rgba(139,195,74,.07);
  color: var(--primary);
  border-left-color: var(--primary);
  text-decoration: none;
}

.nav-icon { flex-shrink: 0; opacity: .7; }
.sidebar-nav li a.active .nav-icon,
.sidebar-nav li a:hover .nav-icon { opacity: 1; }

/* Submenu */
.grp-chevron {
  margin-left: auto;
  width: .8rem; height: .8rem;
  transition: transform .25s;
  flex-shrink: 0;
  color: var(--muted);
}
.sidebar-group.grp-open .grp-chevron { transform: rotate(180deg); }

.sidebar-submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.sidebar-submenu.open { max-height: 200px; }

.sidebar-submenu li a {
  padding-left: 2.4rem !important;
  font-size: .825rem !important;
  color: #e8f1db !important; /* better contrast */
  border-left: 2px solid transparent;
}
.sidebar-submenu li a:hover,
.sidebar-submenu li a.active {
  color: #fff !important;
  background: rgba(127,191,58,.25); /* stronger hover/active background */
  border-left-color: #d9f8b0 !important;
  font-weight: 700 !important;
}

/* Sidebar footer */
.sidebar-footer {
  padding: .85rem 1rem;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
}
.user-name {
  font-weight: 600;
  color: var(--text);
  font-size: .875rem;
}
.user-tier {
  font-size: .6rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: var(--mono);
}
.badge-free  { background: rgba(100,116,139,.25); color: #94a3b8; border: 1px solid rgba(100,116,139,.3); }
.badge-pro   { background: rgba(251,146,60,.2);  color: #fb923c; border: 1px solid rgba(251,146,60,.3); }
.badge-elite { background: rgba(167,139,250,.2); color: #a78bfa; border: 1px solid rgba(167,139,250,.3); }

.btn-logout {
  display: block;
  text-align: center;
  padding: .4rem;
  font-size: .8rem;
  color: var(--text-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  transition: all .15s;
  font-family: var(--mono);
  letter-spacing: .04em;
}
.btn-logout:hover {
  background: rgba(139,195,74,.08);
  color: var(--primary);
  border-color: rgba(139,195,74,.35);
  text-decoration: none;
}

/* Improve contrast for sidebar footer on dark sidebar backgrounds */
.sidebar-footer {
  background: rgba(0,0,0,0.06);
  color: #dbeeda;
}
.sidebar-footer .user-name { color: #e7f7e7; }
.sidebar-footer .user-tier { color: #08320a; background: rgba(127,191,58,0.14); border-color: rgba(127,191,58,0.22); }
.btn-logout {
  color: #e7f7e7;
  border-color: rgba(127,191,58,0.22);
  background: rgba(0,0,0,0.03);
}
.btn-logout:hover {
  background: rgba(127,191,58,0.12);
  color: #072a11;
  border-color: rgba(127,191,58,0.36);
}

@media (max-width: 900px) {
  /* ensure sign-out remains legible on small screens */
  .sidebar-footer .user-name, .btn-logout { color: #e7f7e7 !important; }
}

/* Sidebar divider & labels */
.sidebar-divider {
  border-top: 1px solid var(--border);
  margin: .4rem .85rem;
  list-style: none;
}
.sidebar-stand-label {
  display: flex; align-items: center; gap: .4rem;
  padding: .35rem 1rem;
  font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted);
  list-style: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono);
}
.sidebar-sub { padding-left: 2.2rem !important; font-size: .84rem !important; }

/* ── Mobile topbar ──────────────────────────────────────────── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  padding: 0 1rem;
  gap: .75rem;
}
.mobile-topbar-brand { display: flex; align-items: center; flex: 1; }
.mobile-topbar-brand img {
  height: 26px; width: auto;
  filter: brightness(0) invert(1);
  opacity: .9;
}
.hamburger-btn {
  background: none; border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: .3rem .45rem;
  border-radius: var(--radius);
  transition: background .15s;
  line-height: 1;
}
.hamburger-btn:hover { background: rgba(139,195,74,.08); color: var(--primary); }

/* Mobile logout button: hidden by default (desktop) */
/* mobile logout styles removed (logout moved to sidebar) */

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 149;
  backdrop-filter: blur(4px);
}
.sidebar-backdrop.active { display: block; }

/* ── Main content ───────────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-w);
  padding: 1.75rem 2rem;
  min-height: 100vh;
}

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.page-header h2 { font-size: 1.35rem; font-weight: 700; }
.page-header .subtitle { color: var(--text-2); font-size: .9rem; margin-top: .2rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  padding: 1rem;
  color: var(--text) !important;
}
.card * { box-sizing: border-box; }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid var(--border) !important;
  background: rgba(255,255,255,.02) !important;
  color: var(--text) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}
.card-header h3 { font-size: .95rem; margin: 0; }
.card-body { padding: 1.1rem; color: var(--text); }

/* ── Stats row ──────────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: .85rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--card) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 130px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border-2);
}
 .stat-green::after  { background: var(--green); box-shadow: 0 0 8px rgba(139,195,74,.45); }
.stat-yellow::after { background: var(--yellow); box-shadow: 0 0 8px rgba(251,191,36,.6); }
.stat-red::after    { background: var(--red); box-shadow: 0 0 8px rgba(248,113,113,.6); }

.stat-value { font-size: 1.7rem; font-weight: 800; font-family: var(--mono); }
.stat-label { font-size: .72rem; color: var(--text-2); margin-top: .2rem; text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); }
.stat-green  .stat-value { color: var(--green); }
.stat-yellow .stat-value { color: var(--yellow); }
.stat-red    .stat-value { color: var(--red); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .48rem 1.1rem;
  border: none;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  font-family: var(--sans);
  letter-spacing: .01em;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--primary-dk);
  color: #fff;
  border: 1px solid rgba(139,195,74,.18);
  box-shadow: 0 0 14px rgba(139,195,74,.12);
}
.btn-primary:hover {
  background: #15803d;
  color: #fff;
  box-shadow: 0 0 20px rgba(139,195,74,.18);
}
.btn-success  { background: #166534; color: #e6f7e8; border: 1px solid rgba(139,195,74,.25); }
.btn-success:hover  { background: #14532d; color: #fff; }
.btn-danger   { background: rgba(248,113,113,.15); color: var(--red); border: 1px solid rgba(248,113,113,.3); }
.btn-danger:hover   { background: rgba(248,113,113,.25); color: #fca5a5; }
.btn-outline  { background: transparent; color: var(--text-2); border: 1px solid var(--border-2); }
.btn-outline:hover  { background: rgba(139,195,74,.04); color: var(--primary); border-color: rgba(139,195,74,.18); }
.btn-brand    { background: var(--primary-dk); color: #fff; border: none; }
.btn-brand:hover { background: #14532d; color: #fff; }

.btn-block { display: flex; width: 100%; }
.btn-sm  { padding: .3rem .75rem; font-size: .8rem; }
.btn-xs  { padding: .18rem .55rem; font-size: .73rem; border-radius: 4px; }
.btn-lg-cta { padding: .62rem 1.4rem; font-size: .95rem; border-radius: 10px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: .9rem; }
.form-group label,
.form-label,
label { display: block; font-weight: 700; font-size: .86rem; margin-bottom: .28rem; color: var(--text); text-transform: uppercase; letter-spacing: .05em; font-family: var(--mono); }

.form-group input,
.form-group select,
.form-group textarea,
.form-control,
.form-select {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border-2) !important;
  border-radius: var(--radius);
  font-size: .9rem;
  background: var(--card) !important;
  color: var(--text) !important;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--sans);
}

/* Ensure native dropdown indicator appears aligned at the end */
.form-select,
.form-group select {
  appearance: menulist;
  -webkit-appearance: menulist;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1rem) center, calc(100% - .75rem) center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

.form-group input:focus,
.form-group select:focus,
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: rgba(139,195,74,.5) !important;
  box-shadow: 0 0 0 3px rgba(139,195,74,.06) !important;
  background: var(--card) !important;
  color: var(--text) !important;
}
.form-control::placeholder { color: var(--muted) !important; opacity: 1; }

.select option { background: var(--card); color: var(--text); }
.form-select-sm { padding: .22rem .5rem; font-size: .82rem; border: 1px solid var(--border-2); border-radius: 4px; background: var(--card); color: var(--text); }

.form-check-input {
  background-color: rgba(0,0,0,.4) !important;
  border-color: var(--border-2) !important;
}
.form-check-input:checked {
  background-color: var(--primary-dk) !important;
  border-color: var(--primary-dk) !important;
}
.form-range, .form-range::-webkit-slider-thumb, .form-range::-moz-range-thumb { accent-color: var(--primary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: .65rem; margin-top: .85rem; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: .85rem; font-size: .875rem; }
.alert-danger  { background: var(--red-bg);    color: #fca5a5; border: 1px solid rgba(248,113,113,.25); }
.alert-success { background: var(--green-bg);  color: var(--green); border: 1px solid rgba(139,195,74,.18); }
.alert-warning { background: var(--yellow-bg); color: #fde68a; border: 1px solid rgba(251,191,36,.25); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  font-family: var(--mono);
  text-transform: uppercase;
}
.badge-outline  { border: 1px solid var(--border-2); color: var(--text-2); }
.badge-green    { background: rgba(139,195,74,.12);  color: var(--green); border: 1px solid rgba(139,195,74,.18); }
.badge-red      { background: rgba(248,113,113,.15); color: #fca5a5; border: 1px solid rgba(248,113,113,.25); }
.badge-yellow   { background: rgba(251,191,36,.15);  color: #fde68a; border: 1px solid rgba(251,191,36,.25); }
.badge-gray     { background: rgba(100,116,139,.15); color: #94a3b8; border: 1px solid rgba(100,116,139,.25); }
.badge-info     { background: rgba(56,189,248,.12);  color: #7dd3fc; border: 1px solid rgba(56,189,248,.25); }
.badge-fire     { background: rgba(248,113,113,.18); color: var(--red); border: 1px solid rgba(248,113,113,.3); animation: badge-pulse 2s infinite; }
.badge.bg-success  { background: rgba(139,195,74,.12)  !important; color: var(--green) !important; }
.badge.bg-warning  { background: rgba(251,191,36,.15)  !important; color: #fde68a !important; }
.badge.bg-danger   { background: rgba(248,113,113,.15) !important; color: #fca5a5 !important; }
.badge.bg-secondary{ background: rgba(100,116,139,.15) !important; color: #94a3b8 !important; }

@keyframes badge-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(248,113,113,.4); }
  50%      { box-shadow: 0 0 0 4px rgba(248,113,113,0); }
}

/* ── Health dots ─────────────────────────────────────────────── */
.health-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.health-green   { background: var(--green);  box-shadow: 0 0 6px rgba(74,222,128,.6); }
.health-yellow  { background: var(--yellow); box-shadow: 0 0 6px rgba(251,191,36,.5); }
.health-red     { background: var(--red);    box-shadow: 0 0 6px rgba(248,113,113,.5); animation: pulse-red 1.4s infinite; }
.health-unknown { background: var(--muted); }

@keyframes pulse-red {
  0%,100% { box-shadow: 0 0 4px rgba(248,113,113,.3); }
  50%      { box-shadow: 0 0 12px rgba(248,113,113,.7); }
}

/* ── Tables ─────────────────────────────────────────────────── */
.table, .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
  color: var(--text);
  border-color: var(--border);
}
.table > :not(caption) > * > * {
  background-color: transparent !important;
  border-color: var(--border);
  color: var(--text);
}
.table th, .data-table thead th {
  text-align: left;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #ffffff;
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border-2);
  background: #1B5E20 !important;
  font-family: var(--mono);
}
.table td, .data-table tbody td {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr, .data-table tbody tr { transition: background .1s; }
.table tbody tr:hover,
.table-hover > tbody > tr:hover > *,
.data-table tbody tr:hover { background: rgba(74,222,128,.04) !important; }

.verdict-cell { max-width: 480px; white-space: normal; word-wrap: break-word; line-height: 1.5; font-size: .875rem; }

/* ── Source badges ───────────────────────────────────────────── */
.badge-scan     { background: rgba(56,189,248,.12); color: #7dd3fc; border: 1px solid rgba(56,189,248,.25); }
.badge-baseline { background: rgba(100,116,139,.12); color: #94a3b8; border: 1px solid rgba(100,116,139,.25); }
tr.row-baseline { opacity: .7; }

/* ── Map ────────────────────────────────────────────────────── */
.map-container {
  width: 100%; height: 380px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

#stands-map.map-container {
  height: 520px;
}

.leaflet-control-attribution {
  font-size: 0.75rem !important;
  line-height: 1.2 !important;
  opacity: 0.88;
}

.leaflet-control-attribution img,
.leaflet-control-attribution svg,
.leaflet-control-attribution .leaflet-control-attribution-icon,
.leaflet-control-attribution::before,
.leaflet-control-attribution::after {
  display: none !important;
}


/* Fix Leaflet Draw toolbar icons (CDN spritesheet path) */
.leaflet-draw-toolbar a,
.leaflet-draw-actions a,
.leaflet-draw-toolbar a.leaflet-disabled {
  background-image: url('https://unpkg.com/leaflet-draw@1.0.4/dist/images/spritesheet.svg') !important;
  background-repeat: no-repeat !important;
  background-size: 300px 30px !important;
  background-color: #fff !important;
  color: transparent !important;
  width: 34px !important;
  height: 34px !important;
  display: inline-block !important;
  border: 1px solid #aaa !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 5px rgba(0,0,0,0.22) !important;
  margin-bottom: 3px !important;
  transition: background-color 0.15s, box-shadow 0.15s !important;
}
.leaflet-draw-toolbar a:hover {
  background-color: #e8f4fd !important;
  border-color: #1e88e5 !important;
  box-shadow: 0 2px 8px rgba(30,136,229,0.28) !important;
}
.leaflet-draw-toolbar a span { display: none !important; }
.leaflet-draw-toolbar a.leaflet-disabled { opacity: 0.38 !important; }
.leaflet-draw-toolbar { box-shadow: 0 2px 10px rgba(0,0,0,0.18) !important; border-radius: 6px !important; overflow: hidden; }
.leaflet-draw-section { padding: 4px !important; background: #f0f4f8 !important; border-radius: 6px; }


.goes-fdcc-square-icon {
  pointer-events: auto;
  line-height: 0;
}
.viirs-multisat-rhombus {
  pointer-events: auto;
  line-height: 0;
}
/* IMSR incident marker */
.imsr-incident-marker,
.imsr-incident-square {
  pointer-events: auto;
}
.imsr-incident-square {
  width: 16px;
  height: 16px;
  border: 2px solid #00bcd4;
  background-color: rgba(0, 188, 212, 0.2);
  border-radius: 2px;
  transform: translate(-50%, -50%);
}/* ── Map opacity toolbar ─────────────────────────────────────── */
.map-opacity-toolbar {
  margin: .6rem 0 .85rem;
  padding: .55rem .8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem;
  font-size: .82rem;
  color: var(--text-2);
}
.map-opacity-left { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.map-opacity-label { font-weight: 700; font-family: var(--mono); color: var(--text); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.map-opacity-range { width: 160px; accent-color: var(--primary); cursor: pointer; }
.map-coords-display { font-size: .78rem; color: var(--muted); white-space: nowrap; font-family: var(--mono); }

/* Floating variant: position inside the .map-container */
.map-opacity-toolbar.map-opacity-toolbar-floating {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  z-index: 1200;
  box-shadow: 0 6px 18px rgba(2,6,23,0.35);
}





.auth-brand { text-align: center; margin-bottom: 1.4rem; }
.auth-brand h1 { font-size: 1.5rem; color: var(--text); }
.brand-icon-lg { display: none; }
.logo-auth { width: 200px; height: auto; object-fit: contain; display: block; margin: 0 auto .65rem; filter: brightness(0) invert(1); opacity: .9; }
.auth-tagline { color: var(--text-2); font-size: .875rem; margin-top: .2rem; }
.auth-form { margin-top: .85rem; }
.auth-link { text-align: center; margin-top: 1.1rem; font-size: .875rem; color: var(--text-2); }

/* ── Stands layout ──────────────────────────────────────────── */
.stands-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.25rem; align-items: start; }
.stand-list { display: flex; flex-direction: column; gap: .45rem; }
.stand-item {
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
  transition: border-color .15s, box-shadow .15s;
}
.stand-item:hover { border-color: var(--border-2); box-shadow: var(--glow); }
.stand-item-bs { transition: background .12s; }
.stand-item-bs:hover { background: rgba(74,222,128,.04); }
.stand-item-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .2rem; }
.stand-item-name { font-weight: 600; font-size: .9rem; }
.stand-item-meta { font-size: .75rem; color: var(--text-2); margin-bottom: .45rem; }
.stand-item-actions { display: flex; gap: .35rem; }

/* ── Detail row ─────────────────────────────────────────────── */
.detail-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.detail-map-card .map-container, .detail-chart-card canvas { height: 300px; }

/* ── Upload form ─────────────────────────────────────────────── */
.upload-form { margin-top: .85rem; }
.upload-row { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.file-input { display: none; }
.file-label { font-size: .82rem; color: var(--text-2); }
.upload-progress { margin-top: .65rem; }
.progress-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: .3rem; }
.progress-fill { height: 100%; background: var(--primary-dk); width: 0; transition: width .4s ease; box-shadow: 0 0 6px rgba(74,222,128,.5); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--text-2); }

/* ── Loading overlay ─────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; justify-content: center; align-items: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}
.loading-spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(74,222,128,.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  box-shadow: 0 0 20px rgba(74,222,128,.3);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 1rem; right: 1rem;
  z-index: 10000;
  display: flex; flex-direction: column; gap: .45rem;
}
.toast {
  padding: .7rem 1.1rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn .28s ease;
  max-width: 380px;
  border: 1px solid var(--border-2);
  backdrop-filter: blur(10px);
}
.toast-success { background: rgba(22,101,52,.9);  border-color: rgba(74,222,128,.3); }
.toast-error   { background: rgba(127,29,29,.9);  border-color: rgba(248,113,113,.3); }
.toast-warning { background: rgba(120,53,15,.9);  border-color: rgba(251,191,36,.3); color: #fde68a; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Verdict card ───────────────────────────────────────────── */
.verdict-card { border-left: 3px solid var(--muted); }
.verdict-card h4 { margin-bottom: .45rem; font-size: .9rem; }
.verdict-text { font-size: .95rem; }
.verdict-green  { border-left-color: var(--green); }
.verdict-yellow { border-left-color: var(--yellow); }
.verdict-red    { border-left-color: var(--red); }

/* ── Radar panel ─────────────────────────────────────────────── */
.radar-panel .card-header { background: rgba(30,64,175,.08) !important; }
.radar-layout { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; }
.radar-chip-col { display: flex; flex-direction: column; gap: .85rem; min-width: 0; }
.radar-chip-wrap { text-align: center; }
.radar-chip-img { max-width: 256px; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); display: block; image-rendering: pixelated; }
.radar-chip-legend { font-size: .72rem; color: var(--text-2); margin-top: .35rem; line-height: 1.6; font-family: var(--mono); }
.radar-slider-wrap { max-width: 256px; width: 100%; }
.radar-slider-label { display: block; font-size: .72rem; color: var(--text-2); margin-bottom: .35rem; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radar-time-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px; background: var(--border); outline: none; cursor: pointer; accent-color: var(--primary); }
.radar-time-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); cursor: pointer; border: 2px solid var(--bg); box-shadow: 0 0 6px rgba(74,222,128,.5); }
.radar-slider-ticks { display: flex; justify-content: space-between; margin-top: .3rem; flex-wrap: wrap; gap: 2px; }
.radar-tick { font-size: .65rem; color: var(--muted); cursor: pointer; padding: 2px 3px; border-radius: 3px; transition: background .12s, color .12s; white-space: nowrap; font-family: var(--mono); }
.radar-tick:hover  { color: var(--text); background: var(--border); }
.radar-tick.active { color: var(--primary); font-weight: 700; }
.radar-slider-stats { display: flex; flex-wrap: wrap; gap: .3rem .55rem; font-size: .7rem; color: var(--text-2); margin-top: .45rem; padding: .4rem .55rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--mono); }
.rss-item { display: inline-flex; gap: .22rem; align-items: center; }
.rss-item strong { color: var(--text); font-weight: 700; }
.rss-divider { color: var(--border-2); }
.radar-stat-table th { width: 150px; font-weight: 500; color: var(--text-2); padding: .3rem .5rem; vertical-align: top; }
.radar-stat-table td { padding: .3rem .5rem; }

/* ── Fire alert ──────────────────────────────────────────────── */
.fire-alert-card .card-header,
.fire-alert-header { background: rgba(248,113,113,.07) !important; border-bottom: 1px solid rgba(248,113,113,.2) !important; }
.fire-alert-row { display: flex; align-items: center; gap: .85rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.fire-alert-row:last-child { border-bottom: none; }
.fire-alert-stand { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fire-alert-meta { font-size: .8rem; color: var(--text-2); display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.fire-alert-meta .sep { color: var(--border-2); }
.fire-clear { display: flex; align-items: center; gap: .45rem; font-size: .84rem; color: var(--green); padding: .1rem 0; }
.fire-icon { font-size: 20px; text-shadow: 0 0 4px rgba(251,191,36,.7); line-height: 1; }

@keyframes fire-ring-pulse {
  0%   { opacity: .55; transform: scale(1); }
  60%  { opacity: .15; transform: scale(1.55); }
  100% { opacity: .55; transform: scale(1); }
}
.fire-pulse-ring { animation: fire-ring-pulse 1.6s ease-in-out infinite; }

/* ── Thermometers ────────────────────────────────────────────── */
.thermo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: .85rem; }
.thermo-card { border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem; background: var(--card); }
.thermo-meta { margin-bottom: .85rem; }
.thermo-name { display: block; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-family: var(--mono); }
.thermo-val { display: block; font-size: 1.55rem; font-weight: 800; line-height: 1.15; font-family: var(--mono); }
.thermo-zone-text { display: block; font-size: .72rem; color: var(--text-2); margin-top: .15rem; line-height: 1.3; }
.thermo-outer { position: relative; height: 20px; }
.thermo-track { height: 100%; border-radius: 10px; overflow: hidden; }
.thermo-ndvi { background: linear-gradient(to right, #D32F2F 0%,#D32F2F 20%,#F57C00 20%,#F57C00 40%,#FBC02D 40%,#FBC02D 60%,#8BC34A 60%,#8BC34A 80%,#2E7D32 80%,#2E7D32 100%); }
.thermo-vci  { background: linear-gradient(to right, #D32F2F 0%,#D32F2F 30%,#F57C00 30%,#F57C00 50%,#FBC02D 50%,#FBC02D 70%,#2E7D32 70%,#2E7D32 100%); }
.thermo-divider { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.35); }
.thermo-marker { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 3px; height: 28px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 2px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4); z-index: 3; }
.thermo-axis { position: relative; height: 1rem; margin-top: 3px; font-size: .64rem; color: var(--muted); font-family: var(--mono); }
.thermo-axis span { position: absolute; }
.thermo-zone-row { position: relative; height: .9rem; margin-top: 1px; font-size: .6rem; color: var(--muted); font-family: var(--mono); }
.thermo-zone-row span { position: absolute; }

/* ── Insights ────────────────────────────────────────────────── */
.insights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .85rem; }
.insight-item { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem .95rem; background: var(--surface); }
.insight-item.insight-review { border-color: rgba(251,146,60,.35); background: rgba(251,146,60,.07); }
.insight-item.insight-stable { border-color: rgba(74,222,128,.2); background: rgba(74,222,128,.05); }
.insight-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; gap: .45rem; }
.insight-label { font-weight: 700; font-size: .88rem; color: var(--text); }
.insight-badge { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 20px; font-family: var(--mono); }
.insight-badge-stable { background: rgba(74,222,128,.15); color: #86efac; }
.insight-badge-review { background: rgba(251,146,60,.18); color: #fb923c; }
.insight-message { font-size: .82rem; color: var(--text-2); line-height: 1.45; margin-top: .2rem; }

/* NDVI coloring */
.ndvi-optimal  { color: var(--primary); font-weight: 700; font-family: var(--mono); }
.ndvi-healthy  { color: var(--green); font-family: var(--mono); }
.ndvi-moderate { color: #a3e635; font-family: var(--mono); }
.ndvi-stressed { color: var(--yellow); font-family: var(--mono); }
.ndvi-cutover  { color: #f87171; font-weight: 700; font-family: var(--mono); }
.ndvi-critical { color: var(--red); font-weight: 700; font-family: var(--mono); }

/* ── Stand detail page ──────────────────────────────────────── */
.sd-page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; flex-wrap: wrap; gap: .65rem; }
.sd-head-right { display: flex; gap: .45rem; align-items: center; }

.view-toggle { display: flex; border-bottom: 1px solid var(--border-2); gap: 0; flex-shrink: 0; }
.view-tab { background: none; border: none; padding: .48rem 1.2rem; font-size: .875rem; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; white-space: nowrap; font-family: var(--sans); }
.view-tab:hover { color: var(--text); }
.view-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

.lo-tooltip { display: flex; align-items: center; gap: .65rem; background: rgba(74,222,128,.07); border: 1px solid rgba(74,222,128,.18); border-radius: var(--radius); padding: .55rem .9rem; font-size: .84rem; color: var(--accent-2); margin-bottom: 1.1rem; flex-wrap: wrap; }
.lo-tooltip-close { background: none; border: 1px solid rgba(74,222,128,.25); border-radius: 4px; padding: 2px 10px; font-size: .78rem; color: var(--primary); cursor: pointer; white-space: nowrap; font-family: var(--mono); }
.lo-tooltip-close:hover { background: rgba(74,222,128,.12); }

.lo-header-strip { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.25rem; gap: .85rem; flex-wrap: wrap; }
.lo-stand-name { margin: 0; font-size: 1.4rem; }
.lo-header-meta { font-size: .82rem; font-weight: 400; color: var(--text-2); margin-left: .2rem; }
.lo-header-scan { font-size: .82rem; color: var(--text-2); text-align: right; line-height: 1.5; }

.lo-meta-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.lo-meta-chip { display: inline-flex; align-items: center; gap: .22rem; font-size: .74rem; font-weight: 600; padding: .18rem .6rem; border-radius: 20px; background: rgba(74,222,128,.08); color: var(--text-2); border: 1px solid var(--border); font-family: var(--mono); }

.lo-stamp-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.lo-stamp { display: inline-flex; align-items: center; gap: .25rem; border-radius: 20px; padding: .2rem .65rem; font-size: .72rem; font-weight: 800; letter-spacing: .04em; cursor: default; font-family: var(--mono); }
.stamp-green  { background: rgba(74,222,128,.12); color: #86efac; border: 1px solid rgba(74,222,128,.22); }
.stamp-orange { background: rgba(251,146,60,.12); color: #fb923c; border: 1px solid rgba(251,146,60,.22); }
.stamp-grey   { background: rgba(100,116,139,.1); color: var(--muted); border: 1px solid var(--border); }

.lo-status-card { border-radius: var(--radius-lg); padding: 1.1rem 1.35rem; border-left: 4px solid; margin-bottom: .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.lo-status-green   { background: rgba(74,222,128,.08);  color: #86efac; border-color: rgba(74,222,128,.5); }
.lo-status-yellow  { background: rgba(251,191,36,.08);  color: #fde68a; border-color: rgba(251,191,36,.5); }
.lo-status-red     { background: rgba(248,113,113,.08); color: #fca5a5; border-color: rgba(248,113,113,.5); }
.lo-status-unknown { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.lo-status-headline { font-size: 1.3rem; font-weight: 800; margin: 0 0 .35rem; line-height: 1.3; }
.lo-status-subtext { font-size: 1rem; margin: 0; opacity: .75; }

.lo-cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .85rem; margin-bottom: 1.1rem; }
.lo-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .8rem .95rem; text-align: center; transition: transform .15s, box-shadow .15s; }
.lo-card:hover { transform: translateY(-2px); box-shadow: var(--glow); border-color: var(--border-2); }
.lo-card-empty { opacity: .5; }
.lo-card-icon { font-size: 1.5rem; line-height: 1; margin-bottom: .2rem; }
.lo-card-name { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: .45rem; font-family: var(--mono); }
.lo-card-status { font-size: 1.15rem; font-weight: 800; font-family: var(--mono); }
.lo-stable { color: var(--green); }
.lo-watch  { color: #fb923c; }
.lo-nodata { color: #fde68a; background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.2); border-radius: 4px; padding: .12rem .5rem; font-size: .84rem; font-weight: 600; }
.lo-card-message { font-size: .79rem; color: var(--text-2); line-height: 1.5; margin-top: .4rem; }

.lo-map-cards-grid { display: grid; grid-template-columns: 1fr 2fr; gap: .85rem; margin-bottom: 1.25rem; }
.lo-side-panel { display: grid; grid-auto-rows: min-content; gap: .85rem; }
.lo-map-card { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }

.lo-fire-line { display: flex; align-items: center; gap: .55rem; padding: .7rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); font-size: .88rem; color: var(--text-2); margin-bottom: 1.1rem; }
.lo-fire-active { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.3); color: #fde68a; font-weight: 600; }
.lo-fire-icon { font-size: 1rem; flex-shrink: 0; }

.lo-advisory-box { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--primary-dk); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1.1rem; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.lo-advisory-empty { border-left-color: rgba(251,146,60,.5); background: rgba(251,146,60,.05); }
.lo-advisory-label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); margin-bottom: .55rem; font-family: var(--mono); }
.lo-advisory-empty .lo-advisory-label { color: var(--muted); }
.lo-advisory-text { font-size: 1rem; line-height: 1.7; margin: 0; color: var(--text); }
.lo-availability { font-size: .84rem; color: var(--text-2); line-height: 1.65; margin-bottom: 1.25rem; }

.lo-action-bar { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: .85rem; }

.dv-stand-meta { font-size: .8rem; font-weight: 400; color: var(--text-2); margin-left: .35rem; }
.dv-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .85rem; }
.dv-index-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; transition: transform .15s, box-shadow .15s; }
.dv-index-item:hover { transform: translateY(-1px); box-shadow: var(--glow); border-color: var(--border-2); }
.dv-index-name { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: .35rem; line-height: 1.4; font-family: var(--mono); }
.dv-index-sub { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .67rem; font-family: var(--mono); opacity: .65; margin-top: 2px; }
.dv-index-value { font-size: 1.45rem; font-weight: 800; font-family: var(--mono); line-height: 1.1; margin-bottom: .3rem; }
.dv-index-context { font-size: .77rem; color: var(--text-2); line-height: 1.4; }
.dv-threshold-note { font-size: .7rem; margin-top: .18rem; opacity: .75; font-family: var(--mono); }
.dv-index-range { display: flex; gap: .65rem; font-size: .7rem; color: var(--muted); font-family: var(--mono); margin-top: .25rem; }

/* ── Info icon ──────────────────────────────────────────────── */
.info-icon { display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem; font-size: .7rem; border-radius: 50%; background: rgba(74,222,128,.1); color: var(--text-2); margin-left: .3rem; cursor: help; border: 1px solid var(--border); }
.info-icon:hover { background: rgba(74,222,128,.18); color: var(--primary); }

/* ── Compliance ──────────────────────────────────────────────── */
.compliance-advisory-banner { background: rgba(251,191,36,.08); border-left: 3px solid rgba(251,191,36,.45); padding: .65rem .9rem; font-size: .84rem; border-radius: var(--radius); margin-bottom: 1.1rem; color: #fde68a; }

.risk-badge { display: inline-block; padding: .18rem .55rem; border-radius: 20px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-family: var(--mono); }
.risk-low               { background: rgba(74,222,128,.12);  color: #86efac; }
.risk-medium            { background: rgba(251,191,36,.12);  color: #fde68a; }
.risk-high              { background: rgba(248,113,113,.12); color: #fca5a5; }
.risk-insufficient_data { background: rgba(100,116,139,.1);  color: var(--muted); }
.risk-unknown           { background: rgba(100,116,139,.1);  color: var(--muted); }

.sfi-tag-badge   { display: inline-block; padding: .12rem .45rem; border-radius: 20px; font-size: .72rem; font-weight: 700; font-family: var(--mono); }
.sfi-tag-obj-1   { background: rgba(56,189,248,.12);  color: #7dd3fc; }
.sfi-tag-obj-2   { background: rgba(251,191,36,.12);  color: #fde68a; }
.sfi-tag-obj-3   { background: rgba(74,222,128,.12);  color: #86efac; }
.sfi-tag-obj-9   { background: rgba(167,139,250,.12); color: #c4b5fd; }
.sfi-tag-obj-10  { background: rgba(248,113,113,.12); color: #fca5a5; }

.atfs-trigger-badge { display: inline-block; padding: .12rem .45rem; border-radius: 20px; font-size: .72rem; font-weight: 700; font-family: var(--mono); }
.atfs-trigger-routine            { background: rgba(100,116,139,.1); color: var(--muted); }
.atfs-trigger-fire_proximity     { background: rgba(248,113,113,.12); color: #fca5a5; }
.atfs-trigger-threshold_crossed  { background: rgba(251,191,36,.12); color: #fde68a; }

.atfs-status-badge { display: inline-block; padding: .12rem .45rem; border-radius: 20px; font-size: .72rem; font-weight: 700; font-family: var(--mono); }
.atfs-status-open              { background: rgba(248,113,113,.15); color: #fca5a5; }
.atfs-status-acknowledged      { background: rgba(251,191,36,.15);  color: #fde68a; }
.atfs-status-resolved          { background: rgba(74,222,128,.15);  color: #86efac; }
.atfs-status-no_action_required { background: rgba(100,116,139,.1); color: var(--muted); }

.sfi-filter-row { display: flex; align-items: center; gap: .45rem; font-size: .875rem; }
.btn-outline-muted { border: 1px solid var(--border-2); color: var(--muted); background: transparent; }
.btn-outline-muted:hover { background: var(--surface); color: var(--text-2); }
.sfi-tab-btn.active { background: var(--primary-dk); color: #fff; border-color: var(--primary-dk); }

/* ── EUDR ───────────────────────────────────────────────────── */
.eudr-progress-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.35rem; margin-bottom: 1.1rem; }
.eudr-step-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; font-size: .875rem; }
.eudr-naip-row { display: flex; gap: 1.25rem; margin-bottom: .85rem; flex-wrap: wrap; }
.eudr-naip-label { font-size: .76rem; font-weight: 700; color: var(--muted); margin-bottom: .3rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.eudr-naip-img { width: 220px; height: 160px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.eudr-insufficient-banner { background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.3); border-radius: var(--radius); padding: .55rem .85rem; font-size: .82rem; color: #fde68a; margin-top: .65rem; }

/* ── Compliance dashboard ───────────────────────────────────── */
.compliance-notification-card { border-radius: var(--radius); overflow: hidden; }
.sfi-summary-grid { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: .45rem; }
.sfi-summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .9rem; min-width: 120px; text-align: center; }
.sfi-summary-count { font-size: .78rem; color: var(--muted); margin-top: .3rem; font-family: var(--mono); }
.fire-alert-mini-card { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.2); border-radius: var(--radius); padding: .65rem .9rem; min-width: 140px; }
.fire-alert-mini-name { font-weight: 700; margin-bottom: .3rem; }

/* ── Billing ────────────────────────────────────────────────── */
.billing-plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.25rem; margin-bottom: 1.75rem; }
.billing-plan-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.35rem; display: flex; flex-direction: column; position: relative; }
.billing-plan-current { border-color: rgba(74,222,128,.4); box-shadow: 0 0 20px rgba(74,222,128,.1); }
.billing-plan-current-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--primary-dk); color: #fff; font-size: .68rem; font-weight: 800; padding: .18rem .7rem; border-radius: 20px; white-space: nowrap; font-family: var(--mono); letter-spacing: .05em; }
.billing-plan-name { font-size: 1.2rem; font-weight: 700; margin-bottom: .3rem; }
.billing-plan-price { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-bottom: .45rem; font-family: var(--mono); }
.billing-plan-desc { font-size: .84rem; color: var(--text-2); margin-bottom: .85rem; }
.billing-plan-features { list-style: none; padding: 0; margin: 0 0 1.25rem; flex: 1; }
.billing-plan-features li { font-size: .84rem; padding: .22rem 0; color: var(--text-2); }

/* ── Stands import tools ─────────────────────────────────────── */
.card-header-hint { font-size: .76rem; color: var(--muted); font-weight: 400; display: block; margin-top: 2px; }
.import-tool-section { margin-bottom: 4px; }
.import-tool-label { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.import-tool-badge { display: inline-block; background: rgba(74,222,128,.12); color: var(--primary); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 9px; border-radius: 4px; border: 1px solid rgba(74,222,128,.22); font-family: var(--mono); }
.import-tool-badge-elite { background: rgba(167,139,250,.12); color: #a78bfa; border-color: rgba(167,139,250,.22); }
.import-tool-desc { font-size: .8rem; color: var(--muted); }
.import-tool-divider { border-top: 1px solid var(--border); margin: 14px 0; }
.import-tool-upgrade { display: flex; align-items: flex-start; gap: 9px; background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 10px 12px; font-size: .8rem; color: var(--text-2); line-height: 1.5; }
.import-tool-upgrade span { font-size: 1.1rem; flex-shrink: 0; }
.import-tool-upgrade a { color: var(--primary); font-weight: 700; }
.stand-explainer { font-size: .8rem; }
.stand-explainer summary { cursor: pointer; color: var(--muted); padding: 3px 0; user-select: none; list-style: none; }
.stand-explainer summary::-webkit-details-marker { display: none; }
.stand-explainer-body { padding: 10px 4px 4px; color: var(--text-2); line-height: 1.6; border-left: 2px solid var(--primary-dk); padding-left: 12px; margin-top: 7px; }
.stand-explainer-body ul { padding-left: 1.1rem; margin: 5px 0; }
.stand-explainer-body li { margin-bottom: 3px; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 2000; backdrop-filter: blur(5px); }
.modal-overlay[hidden] { display: none !important; }
.modal-panel { background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(550px, 94vw); max-height: 90vh; overflow-y: auto; animation: modalIn .2s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.35rem .65rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); line-height: 1; transition: color .15s; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.1rem 1.35rem; }
.modal-body .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin-bottom: .85rem; }
.modal-body .form-group label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); }
.modal-body .form-control { width: 100%; padding: .48rem .7rem; border: 1px solid var(--border-2); border-radius: var(--radius); font-size: .88rem; font-family: var(--sans); transition: border-color .15s; background: var(--card); color: var(--text); }
.modal-body .form-control:focus { outline: none; border-color: rgba(74,222,128,.45); box-shadow: 0 0 0 3px rgba(74,222,128,.1); }
.modal-footer { display: flex; justify-content: flex-end; gap: .65rem; padding-top: .85rem; border-top: 1px solid var(--border); margin-top: .45rem; }

/* ── Control panel (alert settings) ────────────────────────── */
.cp-header { background: linear-gradient(120deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 1.1rem 1.35rem; margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .85rem; color: var(--text); }
.cp-header-left { display: flex; flex-direction: column; gap: .3rem; }
.cp-title { font-size: 1.15rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: .55rem; margin: 0; }
.cp-status-row { display: flex; align-items: center; gap: .45rem; }
.cp-status-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px rgba(74,222,128,.7); animation: pulse 2s ease-in-out infinite; }
.cp-status-text { font-size: .7rem; font-family: var(--mono); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.cp-meta { font-size: .72rem; font-family: var(--mono); color: var(--muted); letter-spacing: .07em; text-transform: uppercase; align-self: flex-end; }
.cp-section-label { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-family: var(--mono); color: var(--accent); margin-bottom: 0; padding: 0 .65rem; display: flex; align-items: center; gap: .4rem; }
.cp-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); border-radius: 1px; }
.cp-card-wrap { margin-bottom: .85rem; }
.cp-card-wrap .card { margin-bottom: 0; }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 4px rgba(74,222,128,.4); }
  50%      { box-shadow: 0 0 12px rgba(74,222,128,.8); }
}

/* ── Bootstrap utility overrides ──────────────────────────── */
.text-dark      { color: var(--text) !important; }
.text-muted, .small.text-muted { color: var(--text-2) !important; }
.text-secondary { color: var(--text-2) !important; }
.text-success   { color: var(--green) !important; }
.text-danger    { color: var(--red) !important; }
.text-brand     { color: var(--primary) !important; }
.bg-white       { background-color: var(--card) !important; }
.bg-light       { background-color: var(--surface) !important; }
.bg-brand       { background-color: var(--primary-dk) !important; }
.mono { font-family: var(--mono); font-size: .9em; }

.border, .border-bottom, .border-top, .border-start, .border-end { border-color: var(--border) !important; }

/* Bootstrap modal */
.modal-content  { background: var(--card); border-color: var(--border-2); color: var(--text); }
.modal-header, .modal-footer { border-color: var(--border); }

/* Bootstrap dropdown */
.dropdown-menu  { background: var(--card); border-color: var(--border-2); }
.dropdown-item  { color: var(--text); }
.dropdown-item:hover { background: rgba(74,222,128,.08); color: var(--primary); }

/* ── Icon boxes ─────────────────────────────────────────────── */
.ts-icon-box     { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ts-icon-box-sm  { width: 2rem; height: 2rem; border-radius: .45rem; }
.ts-icon-box-md  { width: 2.4rem; height: 2.4rem; border-radius: .65rem; }
.ts-icon-box-lg  { width: 3.25rem; height: 3.25rem; border-radius: 50%; }
.ts-icon-brand   { background: rgba(74,222,128,.12); color: var(--primary); }
.ts-icon-blue    { background: rgba(56,189,248,.1);  color: #7dd3fc; }
.ts-icon-green   { background: rgba(74,222,128,.1);  color: var(--green); }
.ts-icon-orange  { background: rgba(251,146,60,.1);  color: #fb923c; }
.ts-icon-red     { background: rgba(248,113,113,.1); color: var(--red); }
.ts-icon-indigo  { background: rgba(99,102,241,.1);  color: #a5b4fc; }
.ts-icon-yellow  { background: rgba(251,191,36,.1);  color: #fde68a; }
.ts-icon-emerald { background: rgba(52,211,153,.1);  color: #6ee7b7; }
.ts-svg-3   { width: .75rem;  height: .75rem; }
.ts-svg-3-5 { width: .875rem; height: .875rem; }
.ts-svg-4   { width: 1rem;    height: 1rem; }
.ts-svg-5   { width: 1.25rem; height: 1.25rem; }
.ts-svg-6   { width: 1.5rem;  height: 1.5rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stands-layout { grid-template-columns: 1fr; }
  .detail-row    { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .lo-map-cards-grid { grid-template-columns: 1fr; }
  .lo-side-panel { grid-row: 2; }
  .radar-layout  { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .28s ease; z-index: 150; }
  .sidebar.sidebar-open { transform: translateX(0); }
  .content { margin-left: 0; padding: .75rem; padding-top: calc(52px + .75rem); }
  .stats-row { flex-wrap: wrap; }
  .stat-card { min-width: calc(50% - .425rem); }
  .sd-page-head { flex-direction: column; align-items: flex-start; }
  .view-toggle  { width: 100%; }
  /* Reduce map heights on mobile so the viewport isn't dominated by maps */
  #stands-map.map-container { height: 300px; }
  .map-container { height: 280px; }
  .view-tab     { flex: 1; text-align: center; padding: .48rem .35rem; font-size: .8rem; }
  .lo-header-strip { flex-direction: column; align-items: flex-start; }
  .lo-status-headline { font-size: 1.15rem; }
  .lo-cards-row { grid-template-columns: 1fr 1fr; }
  .dv-index-grid { grid-template-columns: 1fr 1fr; }
}

/* Prevent horizontal overflow on small devices and ensure topbar is on top */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .mobile-topbar { z-index: 9999; }
}

/* Aggressive mobile fixes to prevent layout overflow/auto-zoom on small devices
   - override inline min-widths that cause the page to exceed viewport width
   - force large images/tables to shrink to available width
   These rules apply only on narrow viewports to avoid affecting desktop layout. */
@media (max-width: 768px) {
  /* override inline min-width declarations that drive overflow */
  [style*="min-width"] { min-width: 0 !important; }

  /* make tables and wide components responsive */
  table, .el-table, .radar-chip-img, .logo-auth, .modal-panel, .lo-header-strip, .lo-cards-row, .stat-card { max-width: 100% !important; width: 100% !important; }
  .el-table { min-width: 0 !important; overflow-x: auto; }

  /* images and SVG */
  img, svg { max-width: 100% !important; height: auto !important; }

  /* ensure mobile topbar always visible */
  .mobile-topbar { left: 0; right: 0; width: 100%; box-sizing: border-box; }
}

/* Place hamburger to left of logo and tighten spacing on mobile */
@media (max-width: 768px) {
  .mobile-topbar { display: flex; align-items: center; gap: .5rem; }
  .mobile-topbar .hamburger-btn { order: 0; margin-left: 0; margin-right: .45rem; }
  .mobile-topbar .mobile-topbar-brand { order: 1; flex: 1; }
  .mobile-topbar .mobile-topbar-brand img { height: 26px; width: auto; }
}
@media (max-width: 600px) {
  .modal-body .form-row { grid-template-columns: 1fr; }
  .lo-meta-row { gap: .25rem; }
  .form-row { grid-template-columns: 1fr; }
}

/* Show logout control in the mobile topbar */
@media (max-width: 768px) {
  /* mobile logout styles removed (logout moved to sidebar) */
}