/* Layout */
body {
  margin: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  transition: background 0.3s, color 0.3s;
}

/* Sidebar / Navbar */
nav {
  width: 240px;
  background-color: #f4f4f4;
  color: #222;
  display: flex;
  flex-direction: column;
  padding-top: 10px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  transition: width 0.25s ease, background 0.3s, color 0.3s;
  overflow: hidden;
  flex-shrink: 0;
}
/* Icon-sidebar: collapses to 54px strip, not 0 */
body.nav-collapsed nav {
  width: 54px;
}

/* Full logo — visible when nav is expanded, click to collapse */
.nav-logo-full {
  display: flex;
  justify-content: center;
  cursor: pointer;
  padding-top: 6px;
}
.nav-logo-full img {
  width: 160px;
  margin: 4px auto 30px;
  transition: opacity 0.15s;
}
.nav-logo-full:hover img { opacity: 0.75; }

/* Icon logo — visible only when nav is collapsed, click to expand */
.nav-logo-icon {
  display: none;
  justify-content: center;
  padding: 14px 0;
  cursor: pointer;
}
.nav-logo-icon img {
  height: 38px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.15s;
}
.nav-logo-icon:hover img { opacity: 0.75; }

body.nav-collapsed .nav-logo-full { display: none; }
body.nav-collapsed .nav-logo-icon { display: flex; }

/* Hide nav links and user section in collapsed state */
body.nav-collapsed nav > a,
body.nav-collapsed .nav-dropdown,
body.nav-collapsed .nav-user-section { display: none; }

nav a {
  padding: 15px 20px;
  color: #444;
  text-decoration: none;
  display: block;
  font-weight: 500;
}

nav a:hover,
nav a.active {
  background-color: #ddd;
  color: #000;
}

/* Hauptinhalt */
.content {
  flex: 1;
  min-width: 0;
  padding: 40px;
  background-color: #f9fbfd;
  color: #111;
  transition: background 0.3s, color 0.3s;
  overflow-y: auto;
}
body.page-map .content {
  overflow: hidden;
  padding: 0;
}

/* Überschrift */
h1 {
  font-size: 2rem;
  margin-bottom: 30px;
}

/* Einstellungen */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid #3498db;
  color: #2c3e50;
  line-height: 1.3;
}

body.dark .section-title {
  color: #d0d8e0;
  border-left-color: #5dade2;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

input[type="number"],
select {
  padding: 10px;
  width: 100%;
  max-width: 320px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  background-color: #fff;
  color: #000;
  margin-bottom: 12px;
}

button {
  padding: 10px 18px;
  font-size: 1rem;
  background-color: #4CAF50;
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background-color: #45a049;
}

/* DARK THEME */
body.dark {
  background-color: #1e1e1e;
  color: #f0f0f0;
}

body.dark .content {
  background-color: #2a2a2a;
  color: #f0f0f0;
}

body.dark nav {
  background-color: #111;
  color: #fff;
}

body.dark nav a {
  color: #ccc;
}

body.dark nav a:hover,
body.dark nav a.active {
  background-color: #333;
  color: #fff;
}

body.dark input[type="number"],
body.dark select {
  background-color: #3a3a3a;
  color: #f0f0f0;
  border: 1px solid #666;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.tile {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
  font-weight: bold;
  transition: background 0.3s, color 0.3s;
}

body.dark .tile {
  background-color: #2d2d2d;
  color: #f0f0f0;
}

input[type="checkbox"] {
  transform: scale(1.3);
  margin: 6px 0 16px 0;
}

hr {
  border: none;
  border-top: 2px solid #ccc;
}

/* === Map Settings Tabs (admin_map_settings) === */

.msn-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(0,0,0,0.1);
  padding-bottom: 6px;
}

body.dark .msn-tabs {
  border-bottom-color: rgba(255,255,255,0.1);
}

.msn-tab {
  padding: 7px 18px;
  border-radius: 8px 8px 0 0;
  border: none;
  background: transparent;
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.msn-tab:hover {
  background: rgba(0,0,0,0.06);
  color: #333;
}

.msn-tab.msn-tab-active {
  background: var(--accent, #3498db);
  color: #fff;
}

body.dark .msn-tab { color: #aaa; }
body.dark .msn-tab:hover { background: rgba(255,255,255,0.08); color: #eee; }

/* === ADMIN UI Erweiterungen === */
.device-card {
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
  background: #fefefe;
}

body.dark .device-card {
  background: #2e2e2e;
  border-color: #444;
}

textarea,
input[type="text"],
input[type="number"],
input[type="file"],
input[type="email"],
input:not([type]),
select {
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  background: white;
}

body.dark textarea,
body.dark input,
body.dark select {
  background: #3a3a3a;
  color: #f0f0f0;
  border-color: #555;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

button.danger {
  background-color: #e74c3c;
  color: white;
}

button.danger:hover {
  background-color: #c0392b;
}

button.small {
  font-size: 0.8rem;
  padding: 4px 10px;
}

#opacity-control input[type=range] {
  width: 140px;
}

/* ============================================================================
   NEU: STATISTIK-TILES (v2.1)
   ============================================================================ */

.stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.stat-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.7;
  text-align: center;
}

/* Stat-Farben */
.stat-online {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
}

body.dark .stat-online {
  background: linear-gradient(135deg, #2d7a30 0%, #1d5d20 100%);
}

.stat-offline {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
}

body.dark .stat-offline {
  background: linear-gradient(135deg, #a33c2c 0%, #7d2a1f 100%);
}

.stat-battery-good {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  color: white;
}

.stat-battery-medium {
  background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
  color: white;
}

.stat-battery-low {
  background: linear-gradient(135deg, #e67e22 0%, #ca6f1e 100%);
  color: white;
}

.battery-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================================================
   NEU: DEVICE CARDS (v2.1)
   ============================================================================ */

.device-header {
  margin-bottom: 15px;
}

.device-status {
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 500;
  margin-left: 10px;
}

.status-online {
  background-color: #d4edda;
  color: #155724;
}

.status-idle {
  background-color: #fff3cd;
  color: #856404;
}

.status-offline {
  background-color: #f8d7da;
  color: #721c24;
}

body.dark .status-online {
  background-color: #1d4d23;
  color: #d4edda;
}

body.dark .status-idle {
  background-color: #5a4a1f;
  color: #fff3cd;
}

body.dark .status-offline {
  background-color: #5a1f23;
  color: #f8d7da;
}

/* ============================================================================
   NEU: FORM GRID LAYOUT (v2.1)
   ============================================================================ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 5px;
}

/* ============================================================================
   NEU: TEAM-SELECT (v2.1)
   ============================================================================ */

.team-select {
  font-weight: 600;
  border-width: 2px;
  cursor: pointer;
}

.team-select option {
  padding: 8px;
  font-weight: 600;
}

/* Team-Farben */
.team-option-admin {
  background-color: #9B59B6;
  color: white;
}

.team-option-usarmy {
  background-color: #0052A5;
  color: white;
}

.team-option-vietcong {
  background-color: #DA251D;
  color: white;
}

.team-option-neutral {
  background-color: #808080;
  color: white;
}

.team-option-orga {
  background-color: #FFD700;
  color: black;
}

body.dark .team-select {
  background-color: #3a3a3a;
  color: #f0f0f0;
}

/* ============================================================================
   NEU: ICON PREVIEW (v2.1)
   ============================================================================ */

.icon-select-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-select-wrapper select {
  flex: 1;
  margin-bottom: 0;
}

.icon-preview {
  height: 32px;
  width: 32px;
  object-fit: contain;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 2px;
  background: white;
}

body.dark .icon-preview {
  border-color: #555;
  background: #2a2a2a;
}

/* ============================================================================
   ICON SIZE CONSTRAINTS (Prevent oversized icons in admin)
   ============================================================================ */

.device-card img,
.section img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.device-card select[name="icon"] + img {
  max-width: 32px;
  max-height: 32px;
}

/* ============================================================================
   RESPONSIVE GRID ANPASSUNGEN
   ============================================================================ */

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .battery-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   KOMPAKTES ADMIN-PANEL (v3.0)
   ============================================================================ */

/* --- Stat Chips --- */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.chip-online  { background: #d4edda; border-color: #4CAF50; color: #155724; }
.chip-offline { background: #f8d7da; border-color: #e74c3c; color: #721c24; }
.chip-bg      { background: #d4edda; border-color: #27ae60; color: #155724; }
.chip-bm      { background: #fff3cd; border-color: #f39c12; color: #856404; }
.chip-bl      { background: #fde8d8; border-color: #e67e22; color: #7d4e1f; }

.sci   { font-size: 0.9rem; }
.scv   { font-size: 1rem; font-weight: 700; margin: 0 2px; }
.scv-sm { font-size: 0.75rem; font-weight: 500; }
.scl   { font-size: 0.72rem; opacity: 0.75; }

body.dark .stat-chip   { background: #2d2d2d; border-color: #444; color: #ddd; }
body.dark .chip-online  { background: #1d4d23; border-color: #4CAF50; color: #d4edda; }
body.dark .chip-offline { background: #5a1f23; border-color: #e74c3c; color: #f8d7da; }
body.dark .chip-bg      { background: #1d4d23; border-color: #27ae60; color: #d4edda; }
body.dark .chip-bm      { background: #5a4a1f; border-color: #f39c12; color: #fff3cd; }
body.dark .chip-bl      { background: #5a3010; border-color: #e67e22; color: #fde8d8; }

/* --- Action Bar --- */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.action-bar form { margin: 0; }

/* --- Small Buttons --- */
.btn-sm {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.92rem;
  font-weight: 500;
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.6;
}

.btn-sm:hover             { background: #43a047; }
.btn-sm.btn-danger        { background: #e74c3c; }
.btn-sm.btn-danger:hover  { background: #c0392b; }
.btn-sm.btn-neutral       { background: #7f8c8d; }
.btn-sm.btn-neutral:hover { background: #636e72; }

/* --- Device List --- */
.device-list {
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

body.dark .device-list { border-color: #444; }

.device-row { border-bottom: 1px solid #eee; }
.device-row:last-child { border-bottom: none; }
body.dark .device-row { border-bottom-color: #3a3a3a; }

.device-row > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: #fafafa;
  transition: background 0.1s;
}

.device-row > summary::-webkit-details-marker { display: none; }
.device-row > summary::marker { display: none; }
.device-row > summary:hover { background: #f0f0f0; }

body.dark .device-row > summary       { background: #2a2a2a; }
body.dark .device-row > summary:hover { background: #333; }

.device-row[open] > summary {
  background: #f0f4ff;
  border-bottom: 1px solid #ddd;
}

body.dark .device-row[open] > summary {
  background: #252d3a;
  border-bottom-color: #444;
}

/* Status dot */
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-online  { background: #2ecc71; box-shadow: 0 0 4px #2ecc71; }
.dot-idle    { background: #f1c40f; box-shadow: 0 0 4px #f1c40f; }
.dot-offline { background: #e74c3c; }

/* Device name */
.dname {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Metadata container */
.dmeta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Team badge */
.tbadge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: #95a5a6;
  color: #fff;
  white-space: nowrap;
}

body.dark .tbadge { background: #555; }

.tbadge-new { background: #e67e22 !important; color: #fff !important; }

/* Pool Warning Banner (Dashboard) */
.pool-warning {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  background: #e67e22;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.pool-warning-link { color: #fff; text-decoration: underline; white-space: nowrap; }
.pool-warning-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 1rem; padding: 0 2px; opacity: 0.8; }
.pool-warning-close:hover { opacity: 1; }

/* Pool-Sektion im Admin-Tracker */
.pool-section { margin-bottom: 24px; }
.pool-section-title { color: #e67e22 !important; border-left-color: #e67e22 !important; }
.device-row-pool { border-left: 3px solid #e67e22; }

/* Activate / Warning Buttons */
.btn-sm.btn-activate       { background: #27ae60; }
.btn-sm.btn-activate:hover { background: #1e8449; }
.btn-sm.btn-warning        { background: #f39c12; }
.btn-sm.btn-warning:hover  { background: #d68910; }

/* Timestamp */
.dtime {
  font-size: 0.75rem;
  opacity: 0.6;
  white-space: nowrap;
  font-family: monospace;
}

/* Arrow */
.darrow {
  font-size: 0.6rem;
  opacity: 0.45;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.device-row[open] .darrow { transform: rotate(90deg); }

/* Last known values strip */
.device-last-vals {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  font-family: monospace;
}

body.dark .device-last-vals {
  color: #999;
  border-bottom-color: #3a3a3a;
}

/* Edit form (inside open details) */
.device-edit-form {
  padding: 12px;
  background: #fff;
}

body.dark .device-edit-form { background: #252525; }

/* Two-column layout: fields left, info+buttons right */
.device-edit-body {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.device-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 280px;
}

.device-edit-fields .form-group { margin-bottom: 0; }

.device-edit-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 1px solid #ddd;
  padding-left: 16px;
}

body.dark .device-edit-panel { border-left-color: #3a3a3a; }

@media (max-width: 768px) {
  .device-edit-body { flex-direction: column; }
  .device-edit-panel { border-left: none; padding-left: 0; border-top: 1px solid #ddd; padding-top: 10px; }
  body.dark .device-edit-panel { border-top-color: #3a3a3a; }
}

/* Edit row grid */
.edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 10px;
  margin-bottom: 10px;
}

.edit-row.edit-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Wide field — spans extra column */
.fg-wide { grid-column: span 2; }

@media (max-width: 768px) {
  .edit-row,
  .edit-row.edit-row-3 {
    grid-template-columns: 1fr;
  }
  .fg-wide { grid-column: span 1; }
  .dmeta   { display: none; }
}

/* --- Add Section (collapsible) --- */
.add-section { margin-bottom: 8px; }

.add-section > summary {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 5px 12px;
  background: #eaf4ea;
  border: 1px solid #b2dfb2;
  border-radius: 6px;
  color: #2d6a2d;
  transition: background 0.1s;
}

.add-section > summary::-webkit-details-marker { display: none; }
.add-section > summary::marker { display: none; }
.add-section > summary:hover { background: #d8eed8; }

body.dark .add-section > summary {
  background: #1d3a1d;
  border-color: #2d6a2d;
  color: #a8d8a8;
}
body.dark .add-section > summary:hover { background: #223322; }

/* Add form */
.add-form {
  margin-top: 10px;
  padding: 12px;
  background: #f9fff9;
  border: 1px solid #ddd;
  border-radius: 6px;
}

body.dark .add-form {
  background: #1e2a1e;
  border-color: #3a4a3a;
}

/* ============================================================================
   ADMIN TOP v3.5 — Titelzeile mit Werkzeugen + Dashboard-Stat-Grid darunter
   ============================================================================ */

/* Titelzeile: h1 links, Werkzeuge rechts */
.admin-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.admin-h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

/* Werkzeuge */
.tool-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.tool-row form  { margin: 0; }
.tool-row label { margin-bottom: 0; }

/* Spezifischer Selektor überschreibt globales button{} */
.tool-row button, .tool-row label.tbtn {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 500;
  background: transparent;
  color: #555;
  border: 1px solid #c0c0c0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.6;
}

.tool-row button:hover,
.tool-row label.tbtn:hover          { background: #e8e8e8; color: #222; border-color: #888; }
.tool-row button.tbtn-danger        { color: #c0392b; border-color: #e74c3c; }
.tool-row button.tbtn-danger:hover  { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.tool-row button.tbtn-muted         { color: #999; border-color: #ccc; }
.tool-row button.tbtn-muted:hover   { background: #eee; color: #666; border-color: #aaa; }

body.dark .tool-row button,
body.dark .tool-row label.tbtn               { color: #aaa; border-color: #555; }
body.dark .tool-row button:hover,
body.dark .tool-row label.tbtn:hover         { background: #383838; color: #fff; border-color: #777; }
body.dark .tool-row button.tbtn-danger       { color: #e74c3c; border-color: #e74c3c; }
body.dark .tool-row button.tbtn-danger:hover { background: #e74c3c; color: #fff; }
body.dark .tool-row button.tbtn-muted        { color: #666; border-color: #444; }
body.dark .tool-row button.tbtn-muted:hover  { background: #444; color: #aaa; }

/* Dashboard Stat-Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 14px 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  text-align: center;
  gap: 5px;
  cursor: default;
  user-select: none;
}

.sc-icon  { font-size: 1.3rem; line-height: 1; }
.sc-num   { font-size: 2.4rem; font-weight: 700; line-height: 1.1; }
.sc-vsm   { font-size: 1.1rem; }
.sc-label { font-size: 0.65rem; opacity: 0.55; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }

/* Farbe nur auf der Zahl — alle Karten haben neutralen Hintergrund */
.sc-online  .sc-num { color: #27ae60; }
.sc-online  .sc-icon { color: #27ae60; }
.sc-offline .sc-num { color: #e74c3c; }
.sc-offline .sc-icon { color: #e74c3c; }
.sc-bg      .sc-num { color: #27ae60; }
.sc-bm      .sc-num { color: #e67e22; }
.sc-bl      .sc-num { color: #e74c3c; }

body.dark .stat-card { background: #2d2d30; border-color: #3e3e42; color: #d8d8d8; box-shadow: none; }

body.dark .sc-online  .sc-num  { color: #4ddb78; }
body.dark .sc-online  .sc-icon { color: #4ddb78; }
body.dark .sc-offline .sc-num  { color: #ff6b6b; }
body.dark .sc-offline .sc-icon { color: #ff6b6b; }
body.dark .sc-bg      .sc-num  { color: #4ddb78; }
body.dark .sc-bm      .sc-num  { color: #ffb74d; }
body.dark .sc-bl      .sc-num  { color: #ff8a65; }

/* ============================================================================
   DEVICE INFO PANEL v3.1 — Batterie-Balken + HDOP-Badge
   ============================================================================ */

.dev-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 8px;
}

.di-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.45;
  display: block;
  margin-bottom: 3px;
  font-weight: 700;
}

.di-val       { font-size: 0.88rem; }
.di-val-lg    { font-size: 1rem; font-weight: 600; }
.mono         { font-family: 'Courier New', monospace; }

.di-batt-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.di-batt-left   { flex: 1; }
.di-hdop-right  { flex-shrink: 0; text-align: center; }

.batt-track {
  height: 10px;
  background: #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  margin: 5px 0 3px;
}

body.dark .batt-track { background: #3a3a3a; }

.batt-fill {
  height: 100%;
  border-radius: 5px;
  min-width: 4px;
  transition: width 0.4s ease;
}

.batt-high { background: #27ae60; }
.batt-med  { background: #f39c12; }
.batt-low  { background: #e74c3c; }

.batt-val {
  font-size: 0.85rem;
  font-weight: 700;
}

.hdop-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
  white-space: nowrap;
  display: inline-block;
}

.hc-good { background: #d4edda; color: #155724; }
.hc-med  { background: #fff3cd; color: #856404; }
.hc-bad  { background: #f8d7da; color: #721c24; }

body.dark .hc-good { background: #1d4d23; color: #d4edda; }
body.dark .hc-med  { background: #5a4a1f; color: #fff3cd; }
body.dark .hc-bad  { background: #5a1f23; color: #f8d7da; }

/* ============================================================================
   GPS SIGNAL BARS (v3.2)
   ============================================================================ */

.gps-signal { }

.sig-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  flex-shrink: 0;
}

.signal-bar {
  width: 9px;
  border-radius: 2px 2px 1px 1px;
  background: #bbb;
  transition: background 0.3s;
}

body.dark .signal-bar { background: #555; }

.signal-bar.sb1 { height: 8px; }
.signal-bar.sb2 { height: 13px; }
.signal-bar.sb3 { height: 18px; }
.signal-bar.sb4 { height: 24px; }

/* Active bar colors per signal class */
.sig-excellent .sb-on { background: #27ae60; }
.sig-good      .sb-on { background: #27ae60; }
.sig-ok        .sb-on { background: #f39c12; }
.sig-poor      .sb-on { background: #e67e22; }
.sig-bad       .sb-on { background: #e74c3c; }

.sig-text {
  font-size: 0.82rem;
  font-weight: 700;
}

.sig-hdop {
  font-size: 0.62rem;
  opacity: 0.5;
  font-family: monospace;
  margin-top: 1px;
}

/* Label colors */
.sig-excellent .sig-text { color: #27ae60; }
.sig-good      .sig-text { color: #27ae60; }
.sig-ok        .sig-text { color: #e67e22; }
.sig-poor      .sig-text { color: #e74c3c; }
.sig-bad       .sig-text { color: #e74c3c; }

body.dark .sig-excellent .sig-text { color: #2ecc71; }
body.dark .sig-good      .sig-text { color: #2ecc71; }
body.dark .sig-ok        .sig-text { color: #f1c40f; }
body.dark .sig-poor      .sig-text { color: #e67e22; }
body.dark .sig-bad       .sig-text { color: #e74c3c; }

body.dark .sig-excellent .sb-on { background: #2ecc71; }
body.dark .sig-good      .sb-on { background: #2ecc71; }
body.dark .sig-ok        .sb-on { background: #f1c40f; }
body.dark .sig-poor      .sb-on { background: #e67e22; }
body.dark .sig-bad       .sb-on { background: #e74c3c; }

/* ============================================================================
   LOGIN PAGE (v4.0)
   ============================================================================ */

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 20px;
}

.login-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 36px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

body.dark .login-box {
  background: #2d2d30;
  border-color: #3a3a3a;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.login-title {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #1a1a2e;
}

body.dark .login-title {
  color: #e8eaf0;
}

.login-sub {
  margin: 0 0 24px;
  font-size: 0.9rem;
  text-align: center;
  color: #888;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}

body.dark .login-field label {
  color: #aaa;
}

.login-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 7px;
  font-size: 0.95rem;
  background: #fafafa;
  color: #222;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.login-field input:focus {
  outline: none;
  border-color: #3498db;
  background: #fff;
}

body.dark .login-field input {
  background: #1e1e21;
  border-color: #4a4a4a;
  color: #d0d8e0;
}

body.dark .login-field input:focus {
  border-color: #5dade2;
  background: #252528;
}

.login-remember {
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #666;
}

body.dark .login-remember {
  color: #aaa;
}

.login-remember label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.login-btn {
  width: 100%;
  padding: 11px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.login-btn:hover {
  background: #217dbb;
}

/* === NAV: User Info + Logout Button === */

.nav-user-section {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(0,0,0,0.12);
}

body.dark .nav-user-section {
  border-top-color: rgba(255,255,255,0.1);
}

.nav-user-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.nav-username {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dark .nav-username {
  color: #aaa;
}

.nav-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #888;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.nav-settings-btn:hover {
  background: rgba(0,0,0,0.08);
  color: #333;
}

body.dark .nav-settings-btn {
  color: #888;
}

body.dark .nav-settings-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #eee;
}

.nav-logout {
  width: 100%;
  padding: 8px 12px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.nav-logout:hover {
  background: #c0392b;
}

/* === NAV: Admin Dropdown === */

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  background: rgba(0,0,0,0.06);
}

body.dark .nav-dropdown-menu {
  background: rgba(255,255,255,0.05);
}

.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-menu a {
  padding: 10px 20px 10px 36px;
  font-size: 0.88rem;
  font-weight: 400;
  color: #555;
}

body.dark .nav-dropdown-menu a {
  color: #bbb;
}

.nav-dropdown-menu a:hover {
  background: rgba(0,0,0,0.08);
  color: #000;
}

body.dark .nav-dropdown-menu a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* === Admin Sub-Nav (Tab-Leiste) === */

.admin-subnav {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0;
  flex-wrap: wrap;
}

body.dark .admin-subnav {
  border-bottom-color: #3a3a3a;
}

.admin-subnav a {
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #555;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

body.dark .admin-subnav a {
  color: #aaa;
}

.admin-subnav a:hover {
  color: #2c3e50;
  border-bottom-color: #bbb;
}

body.dark .admin-subnav a:hover {
  color: #ddd;
  border-bottom-color: #666;
}

.admin-subnav a.active {
  color: #2980b9;
  border-bottom-color: #2980b9;
  font-weight: 600;
}

body.dark .admin-subnav a.active {
  color: #5dade2;
  border-bottom-color: #5dade2;
}

/* === Flash Messages === */
.flash {
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 500;
}
.flash-success { background: rgba(39,174,96,0.12); color: #27ae60; border-left: 3px solid #27ae60; }
.flash-error   { background: rgba(231,76,60,0.12); color: #e74c3c; border-left: 3px solid #e74c3c; }
.flash-info    { background: rgba(52,152,219,0.12); color: #2980b9; border-left: 3px solid #2980b9; }
.flash-warning { background: rgba(243,156,18,0.12); color: #f39c12; border-left: 3px solid #f39c12; }
body.dark .flash-success { background: rgba(39,174,96,0.18); color: #2ecc71; }
body.dark .flash-error   { background: rgba(231,76,60,0.18); color: #e74c3c; }
body.dark .flash-info    { background: rgba(52,152,219,0.18); color: #3498db; }
body.dark .flash-warning { background: rgba(243,156,18,0.18); color: #f1c40f; }

/* Admin titlebar sub-nav (v2.7.0) */
.admin-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.admin-h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}
.admin-subnav-top {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.admin-subnav-top a {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: #555;
  background: #efefef;
  transition: background 0.15s, color 0.15s;
}
.admin-subnav-top a:hover {
  background: #e0e0e0;
  color: #111;
}
.admin-subnav-top a.asn-active {
  background: #2c3e50;
  color: #fff;
}
body.dark .admin-subnav-top a {
  color: #bbb;
  background: #2e2e2e;
}
body.dark .admin-subnav-top a:hover {
  background: #3a3a3a;
  color: #fff;
}
body.dark .admin-subnav-top a.asn-active {
  background: #4a90d9;
  color: #fff;
}
