/* â”€â”€ Admin Dashboard â€” Liquid Glass â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
    color-scheme: dark;
  --bg: #050505;
  --text: rgba(255,255,255,.92);
  --text-muted: rgba(255,255,255,.48);
  --glass: rgba(255,255,255,.07);
  --glass-border: rgba(255,255,255,.16);
  --glass-highlight: rgba(255,255,255,.42);
  --glass-shadow: 0 18px 50px rgba(0,0,0,.45);
  --sidebar-w: 260px;
  --radius: 24px;
  --radius-md: 18px;
  --green: #6dffa0;
  --red: #ff6b6b;
  --yellow: #ffd166;
  --blue: #6bb8ff;
  --purple: #c084fc;
  --blur: 28px;
}

*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-thumb { background:rgba(255,255,255,.22); border-radius:999px; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

/* â”€â”€ Ambient Background â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(120,220,140,.07), transparent 55%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(255,255,255,.04), transparent 50%),
    radial-gradient(ellipse 45% 35% at 90% 30%, rgba(200,200,200,.04), transparent 50%),
    #050505;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35;
  animation: drift 20s ease-in-out infinite alternate;
}
.orb-a { width:40vw; height:40vw; top:-10%; left:-5%;
  background: radial-gradient(circle, rgba(100,220,130,.14), transparent 70%); }
.orb-b { width:30vw; height:30vw; top:35%; right:-8%;
  background: radial-gradient(circle, rgba(180,180,180,.08), transparent 70%); animation-delay:-7s; }
.orb-c { width:35vw; height:35vw; bottom:-15%; left:30%;
  background: radial-gradient(circle, rgba(255,255,255,.06), transparent 70%); animation-delay:-12s; }
@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(3%,4%,0) scale(1.07); }
}
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  animation: grainAnim .5s steps(2) infinite;
}
@keyframes grainAnim {
  0%   { background-position: 0 0; }
  50%  { background-position: 40px 20px; }
  100% { background-position: 80px 40px; }
}

/* â”€â”€ Glass Surfaces â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.glass-card, .glass-panel {
  position: relative;
  background: linear-gradient(155deg, rgba(255,255,255,.14), rgba(255,255,255,.04) 40%, rgba(255,255,255,.07)), rgba(18,18,18,.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  overflow: hidden;
  transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .35s ease, box-shadow .35s ease;
  will-change: transform;
}
.glass-card::before, .glass-panel::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 30%);
  opacity: .6;
  z-index: 1;
}
/* Mouse-tracking dynamic light refraction (Linear / Apple Liquid Glass) */
.glass-card::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(380px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(255,255,255,.09), transparent 65%);
  opacity: 0;
  transition: opacity .35s ease;
  z-index: 2;
}
.glass-card:hover::after {
  opacity: 1;
}

/* â”€â”€ Shell Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-shell { display: flex; min-height: 100dvh; position: relative; }

/* â”€â”€ Sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar {
  position: fixed; top: 14px; left: 14px; bottom: 14px; z-index: 100;
  display: flex; flex-direction: column;
  width: calc(var(--sidebar-w) - 8px); padding: 18px 12px;
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  background: linear-gradient(165deg, rgba(255,255,255,.14), rgba(255,255,255,.04) 38%, rgba(255,255,255,.06)), rgba(16,18,22,.88);
  border: 1px solid rgba(255,255,255,.2); border-radius: 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.38), inset 0 -1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
  -webkit-font-smoothing: antialiased;
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.2), transparent 26%); opacity: .7;
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; padding: 6px 6px; position: relative; z-index: 1; min-width: 0; }
.sidebar-brand img { width: 28px; height: auto; filter: brightness(0) invert(1); flex-shrink: 0; }
.sidebar-brand > span:not(.sidebar-badge) { font-size: 11px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto; padding: 2px 7px; border-radius: 999px;
  background: rgba(109,255,160,.18); border: 1px solid rgba(109,255,160,.35);
  color: var(--green); font-size: 8.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; flex-shrink: 0;
}
.sidebar-badge.badge-tecnico {
  background: rgba(107,184,255,.16); border-color: rgba(107,184,255,.35);
  color: var(--blue);
}
.sidebar-close-btn {
  display: none; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: var(--text); cursor: pointer;
  flex-shrink: 0; margin-left: 4px;
  transition: background .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-close-btn:hover, .sidebar-close-btn:active {
  background: rgba(255,255,255,.2);
  transform: scale(1.06);
}
.sidebar-nav {
  display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0;
  overflow-y: auto; padding: 4px 2px 8px; position: relative; z-index: 1;
}
.nav-group-label {
  padding: 10px 10px 4px; font-size: 10px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); opacity: .7;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px;
  padding: 8px 10px; border: 0; border-radius: 18px; background: transparent;
  color: var(--text-muted); font: inherit; font-size: 14px; font-weight: 500;
  text-align: left; cursor: pointer; text-decoration: none;
  transition: background .25s, color .25s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--text); }
.nav-item.is-active {
  background: linear-gradient(145deg, rgba(255,255,255,.2), rgba(255,255,255,.07));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 20px rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.14);
}
.sidebar-badge.badge-admin {
  background: rgba(109,255,160,.16); border-color: rgba(109,255,160,.35);
  color: var(--green);
}
.nav-icon {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 4px 10px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.3);
}
.nav-icon svg { width: 16px; height: 16px; display: block; }
.sidebar-footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1);
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px;
}
.role-chip {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); font-size: 12px;
}
.role-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); flex-shrink: 0; }
.role-chip-label { color: var(--text-muted); }
.role-chip-value { margin-left: auto; color: var(--text); font-weight: 600; font-size: 11px; font-family: "JetBrains Mono", monospace; }
.logout-btn {
  width: 100%; min-height: 42px; padding: 10px 16px; border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px; background: rgba(255,255,255,.06); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .25s, border-color .25s;
}
.logout-btn:hover { background: rgba(255,107,107,.15); color: var(--red); border-color: var(--red); }

/* â”€â”€ Overlay â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 85;
  background: rgba(0,0,0,.65); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.sidebar-overlay.is-open { display: block; }

/* â”€â”€ Main â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-main {
  flex: 1; margin-left: calc(var(--sidebar-w) + 8px); min-width: 0;
  display: flex; flex-direction: column; min-height: 100dvh;
  padding: 14px clamp(12px, 2.5vw, 28px) 28px;
}

/* â”€â”€ Header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; padding: 14px 20px; border-radius: 22px; flex-shrink: 0;
}
.header-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 10px; border: 1px solid var(--glass-border);
  border-radius: 14px; background: rgba(255,255,255,.06); cursor: pointer;
  flex-shrink: 0; transition: background .2s;
  position: relative; z-index: 95; -webkit-tap-highlight-color: transparent;
}
.header-toggle:hover { background: rgba(255,255,255,.1); }
.header-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--text); transition: all .25s; }
.header-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header-toggle.open span:nth-child(2) { opacity: 0; }
.header-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.header-copy { flex: 1; min-width: 0; }
.header-copy h1 {
  font-size: clamp(1.1rem, 2.2vw, 1.55rem); font-weight: 700; letter-spacing: -.025em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-meta { margin-top: 2px; color: var(--text-muted); font-size: 13px; }
.header-dot { margin: 0 5px; opacity: .45; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-btn {
  display: flex; align-items: center; gap: 7px; padding: 9px 16px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--text); font: inherit; font-size: 13px;
  cursor: pointer; text-decoration: none; transition: background .2s; white-space: nowrap;
}
.header-btn:hover { background: rgba(255,255,255,.12); }
.header-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* â”€â”€ Desktop Tabs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-tabs {
  display: flex; align-items: center; gap: 6px; margin-bottom: 20px; padding: 6px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 18px;
  background: rgba(255,255,255,.04); flex-wrap: wrap; flex-shrink: 0;
}
.tab-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0;
  border-radius: 12px; background: transparent; color: var(--text-muted);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .2s, color .2s; white-space: nowrap;
}
.tab-btn:hover { background: rgba(255,255,255,.07); color: var(--text); }
.tab-btn.is-active {
  background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.07));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 14px rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.14);
}
.tab-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.tab-count {
  padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.1);
  font-size: 10px; font-family: "JetBrains Mono", monospace;
}
.tab-btn.is-active .tab-count { background: rgba(255,255,255,.2); }

/* â”€â”€ Panels â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-content { flex: 1; min-height: 0; }
.panel { display: none; }
.panel.is-active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* â”€â”€ Bento Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.glass-card { padding: 20px; }
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

/* Stat Carousel Grid */
.stat-carousel {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.stat-carousel > .stat-card {
  grid-column: span 4;
}
@media (max-width: 1024px) {
  .stat-carousel > .stat-card {
    grid-column: span 6;
  }
}

/* ── Stat Cards (Luxury Glass & Neons) ────────────────────────── */
.stat-card {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 22px; min-height: 154px;
  position: relative; overflow: hidden;
  transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .35s ease, box-shadow .35s ease;
  will-change: transform;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.32);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 var(--glass-highlight);
}

/* Themed neon auras */
.stat-card.users:hover {
  border-color: rgba(109,255,160,.4);
  box-shadow: 0 20px 50px -10px rgba(109,255,160,.22), inset 0 1px 0 rgba(109,255,160,.5);
}
.stat-card.farms:hover {
  border-color: rgba(107,184,255,.4);
  box-shadow: 0 20px 50px -10px rgba(107,184,255,.22), inset 0 1px 0 rgba(107,184,255,.5);
}
.stat-card.alerts:hover {
  border-color: rgba(255,107,107,.45);
  box-shadow: 0 20px 50px -10px rgba(255,107,107,.26), inset 0 1px 0 rgba(255,107,107,.6);
}
.stat-card.sensors:hover {
  border-color: rgba(255,209,102,.4);
  box-shadow: 0 20px 50px -10px rgba(255,209,102,.22), inset 0 1px 0 rgba(255,209,102,.5);
}
.stat-card.hectares:hover {
  border-color: rgba(192,132,252,.4);
  box-shadow: 0 20px 50px -10px rgba(192,132,252,.22), inset 0 1px 0 rgba(192,132,252,.5);
}
.stat-card.ia:hover {
  border-color: rgba(255,255,255,.45);
  box-shadow: 0 20px 50px -10px rgba(255,255,255,.18), inset 0 1px 0 rgba(255,255,255,.6);
}
.stat-card.cultivos:hover {
  border-color: rgba(255,209,102,.4);
  box-shadow: 0 20px 50px -10px rgba(255,209,102,.22), inset 0 1px 0 rgba(255,209,102,.5);
}

.stat-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; position: relative; z-index: 1;
}
.stat-icon {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  flex-shrink: 0; transition: transform .3s ease;
}
.stat-card:hover .stat-icon { transform: scale(1.06); }
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.icon-users    { background: rgba(109,255,160,.14); border: 1px solid rgba(109,255,160,.28); color: var(--green); box-shadow: 0 0 16px rgba(109,255,160,.15); }
.stat-icon.icon-farms    { background: rgba(107,184,255,.14); border: 1px solid rgba(107,184,255,.28); color: var(--blue); box-shadow: 0 0 16px rgba(107,184,255,.15); }
.stat-icon.icon-alerts   { background: rgba(255,107,107,.14); border: 1px solid rgba(255,107,107,.28); color: var(--red); box-shadow: 0 0 16px rgba(255,107,107,.2); }
.stat-icon.icon-sensors  { background: rgba(255,209,102,.14); border: 1px solid rgba(255,209,102,.28); color: var(--yellow); box-shadow: 0 0 16px rgba(255,209,102,.15); }
.stat-icon.icon-hectares { background: rgba(192,132,252,.14); border: 1px solid rgba(192,132,252,.28); color: var(--purple); box-shadow: 0 0 16px rgba(192,132,252,.15); }
.stat-icon.icon-ia       { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); color: var(--text); box-shadow: 0 0 16px rgba(255,255,255,.12); }
.stat-icon.icon-cultivos { background: rgba(255,209,102,.14); border: 1px solid rgba(255,209,102,.28); color: var(--yellow); box-shadow: 0 0 16px rgba(255,209,102,.15); }

/* Live Heartbeat / Radar Pulse for alerts */
.live-pulse {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 12px; height: 12px;
}
.pulse-ring {
  position: absolute; width: 100%; height: 100%; border-radius: 50%;
  background: var(--red); opacity: 0.8;
  animation: radar-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 8px var(--red);
}
@keyframes radar-ping {
  75%, 100% { transform: scale(2.6); opacity: 0; }
}

/* Trend Badges */
.trend-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  font-family: "JetBrains Mono", monospace; letter-spacing: .02em;
}
.trend-badge.up   { background: rgba(109,255,160,.12); color: var(--green); border: 1px solid rgba(109,255,160,.28); }
.trend-badge.down { background: rgba(255,107,107,.12); color: var(--red); border: 1px solid rgba(255,107,107,.28); }
.trend-badge.neutral { background: rgba(255,255,255,.07); color: var(--text-muted); border: 1px solid rgba(255,255,255,.14); }
.trend-badge svg { width: 11px; height: 11px; }

.stat-body {
  display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1;
}
.stat-label {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); position: relative; z-index: 1;
}
.stat-num-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 2px;
}
.stat-value {
  font-size: clamp(2rem, 3.8vw, 2.75rem); font-weight: 700;
  font-family: "JetBrains Mono", monospace; letter-spacing: -.04em;
  line-height: 1.05; position: relative; z-index: 1;
}
.stat-value.green  { color: var(--green); text-shadow: 0 0 20px rgba(109,255,160,.25); }
.stat-value.red    { color: var(--red); text-shadow: 0 0 20px rgba(255,107,107,.25); }
.stat-value.blue   { color: var(--blue); text-shadow: 0 0 20px rgba(107,184,255,.25); }
.stat-value.yellow { color: var(--yellow); text-shadow: 0 0 20px rgba(255,209,102,.25); }
.stat-value.purple { color: var(--purple); text-shadow: 0 0 20px rgba(192,132,252,.25); }
.stat-value.white  { color: var(--text); text-shadow: 0 0 20px rgba(255,255,255,.2); }

/* SVG Micro-Sparklines */
.stat-sparkline {
  width: 90px; height: 32px; flex-shrink: 0; overflow: visible;
  opacity: .85; filter: drop-shadow(0 2px 5px currentColor);
  transition: opacity .3s, transform .3s;
}
.stat-card:hover .stat-sparkline { opacity: 1; transform: scale(1.04); }
.stat-sparkline path { stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.stat-hint {
  margin-top: 6px; color: var(--text-muted); font-size: 12px;
  position: relative; z-index: 1; line-height: 1.35;
}

/* â”€â”€ Card Head â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card-tag {
  padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1); color: var(--text-muted);
  font-size: 10px; font-family: "JetBrains Mono", monospace;
  letter-spacing: .06em; white-space: nowrap;
}

/* â”€â”€ Charts â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.chart-container {
  position: relative; z-index: 1; height: 220px; margin-top: 8px;
}
.chart-container canvas { width: 100% !important; height: 100% !important; }

/* â”€â”€ Activity Feed â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.activity-feed { display: flex; flex-direction: column; gap: 0; position: relative; z-index: 1; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.activity-item:last-child { border-bottom: 0; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px;
}
.activity-dot.dot-user   { background: var(--green); box-shadow: 0 0 8px rgba(109,255,160,.4); }
.activity-dot.dot-alert  { background: var(--red); box-shadow: 0 0 8px rgba(255,107,107,.4); }
.activity-dot.dot-farm   { background: var(--blue); box-shadow: 0 0 8px rgba(107,184,255,.4); }
.activity-dot.dot-sensor { background: var(--yellow); box-shadow: 0 0 8px rgba(255,209,102,.4); }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; line-height: 1.4; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-family: "JetBrains Mono", monospace; }

/* Segmented Control */
.segmented-ctrl {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  padding: 4px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.seg-btn:hover {
  color: var(--text);
}
.seg-btn.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Distribution Layout (Split Chart + Detailed Breakdown) */
.distribution-body {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1;
  min-height: 250px;
}
.chart-wrapper {
  position: relative;
  width: 190px;
  height: 190px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}
.chart-center-badge {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.chart-center-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  line-height: 1;
}
.chart-center-lbl {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}
.distribution-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.breakdown-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 14px;
  transition: all 0.2s ease;
}
.breakdown-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.breakdown-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.breakdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.breakdown-numbers {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
}
.breakdown-count {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.breakdown-pct {
  font-size: 11.5px;
  color: var(--text-muted);
}
.progress-bar-bg {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Activity Feed Scrollable Styling */
.activity-feed-scroll {
  flex: 1;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.activity-feed-scroll::-webkit-scrollbar {
  width: 4px;
}
.activity-feed-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.activity-feed-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.activity-feed-scroll .activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  margin-bottom: 0;
}
.activity-feed-scroll .activity-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}
.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-content {
  flex: 1;
  min-width: 0;
}
.activity-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.badge-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .distribution-body {
    flex-direction: column;
    align-items: center;
  }
  .chart-wrapper {
    width: 170px;
    height: 170px;
  }
}


/* â”€â”€ Staff Table (Improved) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.staff-toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.staff-search {
  flex: 1; min-width: 200px; padding: 10px 14px 10px 38px;
  background: rgba(0,0,0,.3); border: 1px solid var(--glass-border);
  border-radius: 12px; color: var(--text); font: inherit; font-size: 14px;
  transition: border-color .2s; -webkit-appearance: none;
}
.staff-search:focus { outline: none; border-color: rgba(255,255,255,.4); box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.staff-search::placeholder { color: rgba(255,255,255,.25); }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}

.staff-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; z-index: 1; }
.staff-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.staff-table th {
  padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.staff-table td { padding: 14px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.staff-table tr:last-child td { border-bottom: 0; }
.staff-table tr:hover td { background: rgba(255,255,255,.03); }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.12); font-size: 13px; font-weight: 600;
  color: var(--text); flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-date { font-size: 12px; color: var(--text-muted); font-family: "JetBrains Mono", monospace; white-space: nowrap; }
.user-location { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.role-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; font-family: "JetBrains Mono", monospace;
  letter-spacing: .04em; text-transform: uppercase;
}
.role-pill.admin     { background: rgba(109,255,160,.15); color: var(--green); border: 1px solid rgba(109,255,160,.3); }
.role-pill.tecnico   { background: rgba(107,184,255,.12); color: var(--blue); border: 1px solid rgba(107,184,255,.25); }
.role-pill.agricultor { background: rgba(255,209,102,.12); color: var(--yellow); border: 1px solid rgba(255,209,102,.25); }

.action-btn {
  padding: 6px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.action-btn:hover { background: rgba(255,255,255,.08); color: var(--text); border-color: rgba(255,255,255,.22); }
.action-btn.delete:hover { background: rgba(255,107,107,.12); color: var(--red); border-color: rgba(255,107,107,.3); }
.action-btn svg { width: 14px; height: 14px; display: block; }

/* â”€â”€ Form â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.form-card { padding: 24px; }
.form-grid { display: grid; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--text-muted); }
.form-control {
  padding: 12px 14px; background: rgba(0,0,0,.3); border: 1px solid var(--glass-border);
  border-radius: 12px; color: var(--text); font: inherit; font-size: 14px;
  transition: border-color .2s, box-shadow .2s; -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: rgba(255,255,255,.4); box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.form-control::placeholder { color: rgba(255,255,255,.25); }
select.form-control option { background: #1a1a1a; }

.submit-btn {
  width: 100%; min-height: 48px; padding: 0 20px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 14px;
  background: linear-gradient(145deg, rgba(109,255,160,.22), rgba(109,255,160,.07));
  color: var(--text); font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background .25s, transform .2s, box-shadow .2s; margin-top: 6px;
}
.submit-btn:hover {
  background: linear-gradient(145deg, rgba(109,255,160,.32), rgba(109,255,160,.12));
  transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
#staff-form-status { text-align: center; font-size: 13px; min-height: 20px; margin-top: 4px; }

/* â”€â”€ Map â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.map-container { position: relative; z-index: 1; height: 55vh; border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); }
.map-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 55vh; gap: 16px; color: var(--text-muted);
}
.map-placeholder svg { width: 56px; height: 56px; opacity: .3; }
.map-placeholder h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.map-placeholder p { font-size: 14px; text-align: center; max-width: 320px; line-height: 1.6; }
.soon-badge {
  padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06); font-size: 12px; font-weight: 600;
  font-family: "JetBrains Mono", monospace; letter-spacing: .08em;
}

/* â”€â”€ Finca List â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.finca-list { display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; max-height: 55vh; overflow-y: auto; }
.finca-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  cursor: pointer; transition: background .2s, border-color .2s;
}
.finca-item:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.finca-item.is-active { background: rgba(107,184,255,.08); border-color: rgba(107,184,255,.25); }
.finca-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(107,184,255,.12); border: 1px solid rgba(107,184,255,.2); color: var(--blue); flex-shrink: 0;
}
.finca-icon svg { width: 16px; height: 16px; }
.finca-info { flex: 1; min-width: 0; }
.finca-name { font-size: 13px; font-weight: 500; }
.finca-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* â”€â”€ Mobile Tabbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mobile-tabbar {
  display: none; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 70;
  justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255,255,255,.18); border-radius: 26px;
  background: linear-gradient(165deg, rgba(255,255,255,.16), rgba(255,255,255,.04) 40%, rgba(255,255,255,.08)), rgba(14,14,14,.75);
  box-shadow: 0 14px 44px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.32);
  backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
}
.mobile-tab {
  display: flex; flex: 1; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 4px; border: 0; border-radius: 14px; background: transparent;
  color: var(--text-muted); font: inherit; font-size: 10px; cursor: pointer; transition: color .2s;
}
.mobile-tab.is-active { color: var(--text); }
.mobile-tab-icon { display: grid; place-items: center; width: 36px; height: 26px; border-radius: 10px; transition: background .25s; }
.mobile-tab.is-active .mobile-tab-icon {
  background: linear-gradient(160deg, rgba(255,255,255,.26), rgba(255,255,255,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.mobile-tab-icon svg { width: 18px; height: 18px; }

/* â”€â”€ Empty / Skeleton / Toast â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; gap: 10px; color: var(--text-muted); text-align: center;
}
.empty-state svg { width: 40px; height: 40px; opacity: .3; }
.empty-state p { font-size: 14px; }
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.06) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(16px);
  padding: 12px 22px; border-radius: 14px; background: rgba(22,22,22,.9);
  border: 1px solid rgba(255,255,255,.15); box-shadow: 0 10px 30px rgba(0,0,0,.5);
  backdrop-filter: blur(20px); font-size: 14px; white-space: nowrap; z-index: 100;
  opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(109,255,160,.35); color: var(--green); }
.toast.error { border-color: rgba(255,107,107,.35); color: var(--red); }

/* ── Technician & Alert Components ────────────────────────────── */
.badge-tecnico {
  background: rgba(107,184,255,.18) !important;
  border: 1px solid rgba(107,184,255,.35) !important;
  color: var(--blue) !important;
}
.badge-severity {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  font-family: "JetBrains Mono", monospace; text-transform: uppercase;
}
.badge-critica { background: rgba(255,107,107,.18); border: 1px solid rgba(255,107,107,.35); color: var(--red); }
.badge-alta    { background: rgba(255,209,102,.18); border: 1px solid rgba(255,209,102,.35); color: var(--yellow); }
.badge-media   { background: rgba(107,184,255,.18); border: 1px solid rgba(107,184,255,.35); color: var(--blue); }
.badge-baja    { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: var(--text-muted); }

.sensor-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  font-family: "JetBrains Mono", monospace; text-transform: capitalize;
}
.sensor-pill.activo        { background: rgba(109,255,160,.14); border: 1px solid rgba(109,255,160,.28); color: var(--green); }
.sensor-pill.inactivo      { background: rgba(255,107,107,.14); border: 1px solid rgba(255,107,107,.28); color: var(--red); }
.sensor-pill.mantenimiento { background: rgba(255,209,102,.14); border: 1px solid rgba(255,209,102,.28); color: var(--yellow); }
.sensor-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.alert-card {
  position: relative;
  background: linear-gradient(155deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 50%, rgba(255,255,255,.04)), rgba(18,18,18,.7);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 10px;
  backdrop-filter: blur(20px);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.alert-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.alert-card.critica { border-left: 4px solid var(--red); }
.alert-card.alta    { border-left: 4px solid var(--yellow); }
.alert-card.media   { border-left: 4px solid var(--blue); }
.alert-card.baja    { border-left: 4px solid var(--text-muted); }
.alert-card-header  { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.alert-card-title   { font-size: 15px; font-weight: 600; color: var(--text); }
.alert-card-body    { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.alert-card-meta    { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; font-family: "JetBrains Mono", monospace; align-items: center; }
.alert-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.alert-card-meta .meta-icon { width: 14px; height: 14px; opacity: .85; color: var(--blue); flex-shrink: 0; }
.btn-resolver {
  padding: 6px 14px; border-radius: 10px;
  background: rgba(109,255,160,.12); border: 1px solid rgba(109,255,160,.28);
  color: var(--green); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .15s;
}
.btn-resolver:hover { background: rgba(109,255,160,.22); transform: scale(1.03); }

/* ── Responsive & Mobile Carousel ────────────────────────────── */
@media (max-width: 1024px) {
  .col-8  { grid-column: span 12; }
  .col-4  { grid-column: span 12; }
  .col-6  { grid-column: span 12; }
  .col-3  { grid-column: span 6; }
}

@media (max-width: 768px) {
  :root { color-scheme: dark; --blur: 16px; }

  /* Mobile Sidebar Drawer - Razor sharp, 100% opaque, high contrast */
  .sidebar {
    top: 10px; left: 10px; bottom: 10px;
    width: min(315px, 86vw);
    z-index: 100 !important;
    border-radius: 24px;
    background: linear-gradient(180deg, #181b22 0%, #121418 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translateX(calc(-100% - 30px));
    will-change: transform;
  }
  .sidebar::before {
    display: none !important;
  }
  .sidebar.open {
    transform: translate3d(0, 0, 0) !important;
  }
  .sidebar-close-btn {
    display: flex;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }
  .sidebar .nav-item {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 14.5px !important;
    font-weight: 500 !important;
    padding: 10px 12px !important;
    min-height: 48px !important;
  }
  .sidebar .nav-item:hover,
  .sidebar .nav-item:active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
  }
  .sidebar .nav-item.is-active {
    color: #ffffff !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  }
  .sidebar .nav-group-label {
    color: rgba(255, 255, 255, 0.55) !important;
    font-weight: 700 !important;
    letter-spacing: .12em !important;
  }
  .sidebar .role-chip {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
  }
  .sidebar .role-chip-label {
    color: rgba(255, 255, 255, 0.7) !important;
  }
  .sidebar .role-chip-value {
    color: #ffffff !important;
    font-weight: 700 !important;
  }
  .sidebar .logout-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
  }
  .sidebar-overlay {
    z-index: 85 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .admin-main { margin-left: 0; padding-bottom: 96px; padding-left: 12px; padding-right: 12px; }
  .header-toggle { display: flex; }
  .admin-tabs { display: none; }
  .mobile-tabbar { display: flex; }
  
  /* Luxury Mobile Carousel for Stat Cards */
  .stat-carousel {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 12px !important;
    grid-column: span 12 !important;
    padding: 4px 6px 14px 6px !important;
    margin: 0 -6px !important;
    scrollbar-width: none !important;
  }
  .stat-carousel::-webkit-scrollbar { display: none; }
  .stat-carousel > .stat-card {
    flex: 0 0 calc(80vw - 24px) !important;
    max-width: 310px !important;
    min-width: 240px !important;
    scroll-snap-align: start !important;
  }

  .col-3 { grid-column: span 12; }
  .col-4 { grid-column: span 12; }
  .welcome-card { flex-direction: column; gap: 14px; }
  .chart-container { height: 220px; }
}

@media (max-width: 480px) {
  .stat-value { font-size: 1.85rem; }
  .staff-table th:nth-child(4),
  .staff-table td:nth-child(4) { display: none; }
  .stat-carousel > .stat-card {
    flex: 0 0 84vw !important;
  }
}

/* ── Advanced Analytics & Interactive Charts ── */
.chart-container-lg {
  position: relative;
  width: 100%;
  height: 270px;
  flex: 1;
}
.chart-container-md {
  position: relative;
  width: 100%;
  height: 230px;
  flex: 1;
}
.chart-footer-metrics {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}
.chart-metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.chart-metric-val {
  font-size: 16px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
}
.chart-metric-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Operational KPI Cards Grid ── */
.ops-kpi-grid {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1024px) {
  .ops-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 580px) {
  .ops-kpi-grid {
    grid-template-columns: 1fr;
  }
}
.ops-kpi-card {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.12);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.ops-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.25);
}
.ops-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ops-kpi-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ops-kpi-val {
  font-size: 19px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.2;
}
.ops-kpi-lbl {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Sensor Tech Chips ── */
.sensor-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sensor-tech-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 11.5px;
  color: var(--text-muted);
}
.sensor-tech-chip strong {
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
}

/* ── Quick Actions in Header ── */
.header-btn.primary {
  background: rgba(109, 255, 160, 0.14);
  border-color: rgba(109, 255, 160, 0.35);
  color: var(--green);
  font-weight: 600;
}
.header-btn.primary:hover {
  background: rgba(109, 255, 160, 0.22);
}
.header-btn.secondary {
  background: rgba(107, 184, 255, 0.12);
  border-color: rgba(107, 184, 255, 0.3);
  color: var(--blue);
}
.header-btn.secondary:hover {
  background: rgba(107, 184, 255, 0.2);
}

/* ── Print / Executive Export Styles ── */
@media print {
  .sidebar, .sidebar-overlay, .admin-header .header-actions, .admin-tabs, .mobile-tabbar, .logout-btn {
    display: none !important;
  }
  .admin-main {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .ambient, .grain {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #111827 !important;
  }
  .glass-card, .glass-panel {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    page-break-inside: avoid;
    color: #111827 !important;
  }
  .stat-value, .chart-metric-val, .ops-kpi-val {
    color: #111827 !important;
  }
}


