:root {
    /* DARK MODE (Standard) */
    --bg-page: radial-gradient(circle at top right, #1e293b, #0f172a);
    --bg-card: rgba(30, 38, 48, 0.7);
    --bg-control: rgba(255, 255, 255, 0.05);
    --accent-red: #b91c1c;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --battery-border: #475569;
    --btn-bg: #334155;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-y: auto; 
}

/* LIGHT MODE OVERRIDES */
body.light-mode {
    --bg-page: radial-gradient(circle at top right, #f1f5f9, #cbd5e1);
    --bg-card: rgba(183, 196, 222, 0.9);
    --bg-control: rgba(0, 0, 0, 0.05);
    --accent-red: #dc2626;
    --text-main: #0b0f16;
    --text-muted: #101214;
    --border-color: rgba(0, 0, 0, 0.1);
    --battery-border: #081931;
    --btn-bg: #445975;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body {
  background: var(--bg-page);
  color: var(--text-main);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}



.dashboard {
  width: 100%;
  box-sizing: border-box;
  margin: 5px;
  padding: 5px;
}

/* Header */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--accent-red);
    padding-bottom: 15px;
}

h1 {
    font-size: 1.8rem;
    margin: 0;
    letter-spacing: 2px;
    font-weight: 800;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 5px 0 0 0;
}

/* Grid Layout */

.grid-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;

  width: 100%;          /* nimmt 100% der Breite seines Elternknotens */
  box-sizing: border-box;
}

/* Karten Design */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    transition: background 0.3s ease;
}

.card h3 {
    margin-top: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

/* Batterie Visualisierung */
.battery-visual {
    width: 70px;
    height: 120px;
    border: 3px solid var(--battery-border);
    border-radius: 8px;
    margin: 20px auto;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 4px;
}

.battery-visual::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 7px;
    background: var(--battery-border);
    border-radius: 2px 2px 0 0;
}

.battery-level {
    width: 100%;
    background: linear-gradient(to top, var(--accent-red), #e83232);
    border-radius: 4px;
    transition: height 0.5s ease-out;
}

.percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 1.2rem;
    /* Im Light Mode Schatten entfernen oder anpassen */
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Buttons */
.mode-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 15px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.status-indicators {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 1px;
}

.mode-btn .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2a0a0a; /* colour if inactive */
}

/* Style for active Online button */
.mode-btn.active#btnOnline {
    border-color: #4caf50;
    color: #fff;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}
.mode-btn.active#btnOnline .status-dot {
    background: #4caf50;
    box-shadow: 0 0 8px #4caf50;
}

/* Style for active Sleep button */
.mode-btn.active#btnSleep {
    border-color: #ff9800;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.3);
}
.mode-btn.active#btnSleep .status-dot {
    background: #ff9800;
    box-shadow: 0 0 8px #ff9800;
}

.mode-btn:hover {
    transform: translateY(-2px);
    background: #1f2d50;
}

/* Status colours */
.batt-low { background: linear-gradient(to top, #ef4444, #f87171) !important; }
.batt-medium { background: linear-gradient(to top, #f59e0b, #fbbf24) !important; }
.batt-high { background: linear-gradient(to top, #22c55e, #4ade80) !important; }