/* Version v0.0.44 - GOLDEN MASTER STYLE */
* { box-sizing: border-box; }

:root {
    --bg-app: #0b0c15;
    --glass-bg: rgba(30, 34, 48, 0.85);
    --glass-border: rgba(255, 255, 255, 0.12);
    --txt-main: #ffffff;
    --txt-muted: #a0a0a0;
    --pv: #ff9f0a;
    --load: #30d158;
    --batt: #0a84ff;
    --grid: #ff453a;
    --accent: #ffd54f;
    --danger: #f44336;
}



body {
    background: var(--bg-app);
    background-image: radial-gradient(circle at 50% 0%, #1c233f 0%, #050505 80%);
    background-attachment: fixed;
    color: var(--txt-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
}

/* --- LOGIN PAGE (Wieder da!) --- */
body.login-page {
    display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh;
}
.login-card {
    width: 100%; max-width: 400px; padding: 40px; margin: 20px;
    background: var(--glass-bg); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5); text-align: center;
}
.brand-logo { font-size: 2rem; font-weight: 800; margin-bottom: 30px; display: flex; align-items: center; justify-content: center; gap: 10px; color:#fff; }
.input-icon-wrap { position: relative; margin-bottom: 20px; width: 100%; }
.input-icon-wrap span { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #aaa; font-size: 20px; }
.input-icon-wrap input {
    width: 100%; padding: 12px 12px 12px 45px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.4);
    color: #fff; outline: none; font-size: 1rem;
}
.btn-primary {
    width: 100%; padding: 12px; border-radius: 10px; border: none;
    background: #fff; color: #000; font-weight: 700; font-size: 1rem; cursor: pointer; margin-top: 10px;
}
.btn-primary:hover { background: var(--accent); }

/* --- APP LAYOUT --- */
body:not(.login-page) { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

header.topbar {
    height: 60px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
    background: rgba(20, 24, 36, 0.98); border-bottom: 1px solid var(--glass-border); flex-shrink: 0; z-index: 100;
}
.brand { font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; color:#fff; gap:5px; }
.menu-btn { cursor: pointer; color: #fff; margin-right: 15px; display: none; }

.layout-wrapper { display: flex; flex: 1; overflow: hidden; position: relative; width: 100%; }

aside.main-sidebar {
    width: 260px; background: rgba(15, 17, 26, 0.95);
    background-image: radial-gradient(circle at 50% 0%, #1d2c67 0%, #1b1b1e 80%);
    border-right: 1px solid var(--glass-border);
    display: flex; flex-direction: column; padding: 20px 10px; overflow-y: auto; flex-shrink: 0;
}
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px; margin-bottom: 2px;
    color: var(--txt-muted); text-decoration: none; font-weight: 500; border-radius: 10px; transition: 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(255, 159, 10, 0.15); color: var(--pv); border-left: 3px solid var(--pv); }
.nav-cat { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: #555; margin: 25px 0 5px 15px; font-weight: 700; }

main { flex: 1; overflow-y: auto; padding: 20px; width: 100%; position: relative; }

/* --- DASHBOARD GRAFIK --- */
.sys-name-display { text-align: center; font-size: 1.8rem; font-weight: 700; margin: 10px 0 20px 0; color: #fff; text-shadow: 0 2px 10px #000; }
.ems-d { width: 100%; max-width: 1290px; aspect-ratio: 1290/789; position: relative; margin: 0 auto 30px auto; border-radius: 20px; border: 1px solid var(--glass-border); box-shadow: 0 10px 40px rgba(0,0,0,0.5); background: #000; overflow: hidden; display: block; }
.stage { width: 100%; max-width: 372px; aspect-ratio: 372/642; position: relative; margin: 0 auto; border-radius: 20px; border: 1px solid var(--glass-border); overflow: hidden; background: #000; }
.house_b, .house { width: 100%; height: 100%; object-fit: contain; opacity: 0.9; display: block; }

.bp-only-pc { display: block !important; } .bp-only-phone { display: none !important; }
@media (max-width: 1100px) {
    .bp-only-pc { display: none !important; } .bp-only-phone { display: block !important; }
    .menu-btn { display: block; }
    aside.main-sidebar { position: absolute; left: 0; top: 0; bottom: 0; transform: translateX(-100%); z-index: 200; background: #111; transition: 0.3s; }
    aside.main-sidebar.open { transform: translateX(0);    height: 90%;
    }
    .menu-overlay.show { opacity: 1; pointer-events: auto; }
    /* Mobile Positions */
    .stage .card { width: 90px; }
    .stage .pos-wx { top: 15px; left: 15px; padding: 6px 10px; }
    .stage .pos-pv { top: 8%; right: 5px; }
    .stage .pos-home { top: 35%; left: 80%; transform: translateX(-50%); }
    .stage .pos-bat { top: 29%; left: 5%; }
    .stage .pos-grid { top: 72%; right: 0%; }
}

/* Widgets Dashboard */
.card { position: absolute; z-index: 5; text-align: center; }
.pos-wx {
    position: absolute; width: max-content; display: flex; flex-direction: column; align-items: center;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(15px); border-radius: 16px; padding: 10px;
    border: 1px solid rgba(255,255,255,0.15);
}
.wx-ico-s { font-size: 32px; color: #ddd; display: block; margin-bottom: 2px; }
.wx-txt-b { font-size: 1.4rem; font-weight: 700; color: #fff; line-height: 1; }
.wx-line-sub { font-size: 0.75rem; color: #ccc; margin-top: 4px; }
.wx-tom-row { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.15); width: 100%; font-size: 0.8rem; color: #ccc; }

/* Gauges */
.gauge { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6)); }
.gcap { stroke-linecap: round; } .g-bg { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 2; }
.g-val { fill: #fff; font-weight: 700; font-size: 14px; text-anchor: middle; font-family: sans-serif; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.g-pv { stroke: var(--pv); fill:none; stroke-width:2; } .g-load { stroke: var(--load); fill:none; stroke-width:2; }
.g-batt { stroke: var(--batt); fill:none; stroke-width:2; } .g-grid { fill:none; stroke-width:2; stroke: var(--grid); }
.ms { font-family: 'Material Icons'; font-size: 24px; text-anchor: middle; dominant-baseline: middle; fill: currentColor; }

/* CHIPS (Werte) */
.chip-day { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 4px 12px; font-size: 0.75rem; color: #fff; display: inline-block; margin-top: -12px; font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,0.4); }

/* Dashboard Positions Desktop */
.ems-d .pos-wx { top: 30px; left: 30px; }
.ems-d .card { width: 180px; }
.ems-d .pos-pv { top: 5%; right: 33%; }
.ems-d .pos-home { top: 42%; left: 51%; transform: translateX(-50%); }
.ems-d .pos-bat { top: 57%; left: 3%; }
.ems-d .pos-grid { top: 69%; right: 5%; }

/* Battery Icon */
.bicon { transform: translate(40px, 40px); } .bskin { stroke: rgba(255,255,255,0.8); fill: none; stroke-width:2; }
.btop { fill: rgba(255,255,255,0.8); } .bfbody { stroke: rgba(42, 161, 255, 0.2); fill: none; }
.bfill { fill: var(--batt); transition: height 0.5s, y 0.5s; filter: drop-shadow(0 0 5px var(--batt)); }

/* Wires */
.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flow { fill: none; stroke: currentColor; stroke-width: 2; stroke-dasharray: 6 10; animation: dash 1s linear infinite; opacity: 0.8; filter: drop-shadow(0 0 3px currentColor); }
.flow-pv { color: var(--pv); } .flow-home { color: var(--load); } .flow-batt-in { color: #6ec1ff; } .flow-batt-out { color: #2dd4bf; }
@keyframes dash { to { stroke-dashoffset: -16; } }

/* --- SETTINGS / FORM STYLES --- */
.form-wrap { max-width: 900px; margin: 0 auto; }
.form-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px; padding: 25px; margin-bottom: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.form-h { font-size: 1rem; font-weight: 700; margin: 0 0 15px 0; color: var(--pv); border-bottom: 1px solid var(--glass-border); padding-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.form-f { display: flex; flex-direction: column; gap: 6px; }
.form-f label { font-size: 0.85rem; color: var(--txt-muted); margin-left: 2px; }
.form-f input, .form-f select { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(0, 0, 0, 0.4); color: #fff; outline: none; font-size: 1rem; transition: 0.2s; }
.form-f input:focus { border-color: var(--pv); background: rgba(0, 0, 0, 0.6); }

/* Buttons & Toggles */
.btn-icon { background: var(--pv); color: #000; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.btn-icon.del { background: rgba(244, 67, 54, 0.2); color: var(--danger); border: 1px solid var(--danger); }
.toggle-line { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.03); padding: 12px; border-radius: 10px; border: 1px solid var(--glass-border); }
.nr-toggle { position: relative; width: 50px; height: 28px; }
.nr-toggle input { display: none; }
.nr-toggle span { position: absolute; inset: 0; background: #333; border-radius: 30px; border: 1px solid #555; transition: 0.3s; cursor: pointer; }
.nr-toggle span:before { content: ''; position: absolute; height: 22px; width: 22px; left: 3px; top: 2px; background: #fff; border-radius: 50%; transition: 0.3s; }
.nr-toggle input:checked + span { background: var(--load); border-color: var(--load); }
.nr-toggle input:checked + span:before { transform: translateX(22px); }

.promo-wrap { background: linear-gradient(135deg, rgba(244, 67, 54, 0.15), rgba(0,0,0,0)); border: 1px solid rgba(244, 67, 54, 0.4); padding: 20px; border-radius: 12px; margin-top: 15px; display: none; }
.promo-head { color: var(--danger); font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; text-transform: uppercase; }
.promo-badge { background: var(--danger); color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; }
.promo-text { color: #ffcdd2; margin-bottom: 15px; font-size: 0.9rem; }
.promo-cta { display: inline-block; padding: 8px 16px; background: var(--pv); color: #000; font-weight: 700; border-radius: 8px; text-decoration: none; font-size: 0.85rem; }
.plan-pill { display: inline-block; padding: 6px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; background: rgba(46, 125, 50, 0.3); color: #4caf50; border: 1px solid #4caf50; margin-bottom: 20px; }
.plan-pill.free { background: rgba(100,100,100,0.3); color: #aaa; border-color: #666; }
.dbtable { width: 100%; border-collapse: collapse; color: #fff; }
.dbtable th { text-align: left; padding: 15px; color: var(--txt-muted); border-bottom: 1px solid var(--glass-border); }
.dbtable td { padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.05); }

/* Scan Area */
#scanArea { margin-top: 30px; border-top: 1px solid var(--glass-border); padding-top: 20px; }
.scan-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.scan-name { font-weight: bold; color: #fff; display: block; }
.scan-ip { font-size: 0.8rem; color: #aaa; }
//* --- NOTIFICATIONS (v0.0.49 FIXED) --- */
.notif-wrapper { position: relative; display: flex; align-items: center; height: 100%; }

/* Die Glocke */
.notif-btn {
    background: transparent; border: none; color: #aaa; cursor: pointer;
    position: relative; padding: 8px; transition: 0.2s; display: flex; align-items: center;
}
.notif-btn:hover, .notif-wrapper.active .notif-btn { color: #fff; }
.notif-btn .material-icons { font-size: 24px; }

/* Der rote Punkt (Badge) */
.notif-badge {
    position: absolute; top: 3px; right: 3px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 1;
    padding: 3px 5px; border-radius: 10px;
    border: 2px solid var(--bg-app); /* Macht den Rand sauberer */
    display: none;
}
.notif-badge.show { display: block; animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* Das Dropdown Panel (Korrigiert) */
.notif-panel {
    position: absolute; top: 60px; right: 0; /* Bündig mit rechtem Rand */
    width: 360px; max-width: 92vw; /* Responsive Breite */
    background: rgba(25, 29, 42, 0.98); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-top: none;
    border-bottom-left-radius: 16px; border-bottom-right-radius: 16px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    display: none; flex-direction: column; z-index: 2000; max-height: 80vh;
    transform-origin: top right;
}
.notif-panel.open { display: flex; animation: slideDownPanel 0.25s ease-out; margin-right: 20px;}

/* Header & Footer des Panels */
.notif-header {
    padding: 15px; border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; color: #fff; font-size: 1rem; background: rgba(0,0,0,0.2);
}
.notif-mark-all { font-size: 0.8rem; color: var(--pv); cursor: pointer; transition:0.2s; }
.notif-mark-all:hover { text-decoration: underline; filter: brightness(1.2); }

/* Liste & Scrollbar */
.notif-list { overflow-y: auto; flex: 1; padding: 0; margin: 0; list-style: none; }
/* Dark Scrollbar */
.notif-list::-webkit-scrollbar { width: 6px; }
.notif-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.notif-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.notif-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* List Items */
.notif-item {
    padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer; transition: background 0.2s; position: relative; border-left: 4px solid transparent;
}
.notif-item:hover { background: rgba(255,255,255,0.05); }
/* Ungelesen: Heller & farbiger Rand */
.notif-item.unread { background: rgba(255, 255, 255, 0.02); }
.notif-item.unread.type-info { border-left-color: var(--batt); }
.notif-item.unread.type-warning { border-left-color: var(--accent); }
.notif-item.unread.type-error { border-left-color: var(--danger); }
.notif-item.unread.type-success { border-left-color: var(--load); }
/* Gelesen: Dunkler */
.notif-item.read { opacity: 0.5; filter: grayscale(0.5); }

.n-title { font-size: 0.95rem; font-weight: 700; color: #fff; display: block; margin-bottom: 4px; }
.notif-item.read .n-title { font-weight: 500; }
.n-msg { font-size: 0.85rem; color: #ccc; display: block; line-height: 1.4; }
.n-time { font-size: 0.7rem; color: #777; margin-top: 8px; display: block; text-align: right; }

/* Mobile Anpassung für das Panel */
@media (max-width: 480px) {
    .notif-panel {

    }
}

/* Animationen */
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes slideDownPanel { from { opacity: 0; transform: translateY(-10px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.topbar-right { display: flex; align-items: center; gap: 20px; height: 100%; }
/* Auf kleinen Handys Abstände verringern */
@media (max-width: 480px) { .topbar-right { gap: 12px; } .brand { font-size: 1.2rem; } }

/* Version v0.0.48 - Widgets & Menu BG */
/* ... (Vorheriger Code bleibt bis "aside.main-sidebar") ... */

/* --- SIDEBAR (Updated BG) --- */
aside.main-sidebar {
    width: 260px;
    /* Transparenter Hintergrund, damit der Body-Gradient durchscheint, oder eigener Gradient */
    background: rgba(15, 17, 26, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex; flex-direction: column; padding: 20px 10px; overflow-y: auto; flex-shrink: 0;
}

/* ... (Restlicher Code bis "Dashboard Graphics") ... */

/* --- WIDGET GRID (Neu) --- */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%; max-width: 1290px; margin: 0 auto 30px auto;
}

/* --- A2H CARDS (Apple Style Widgets) --- */
.a2h-card {
    background: var(--glass-bg);
    background-image: radial-gradient(circle at 50% 0%, #1d2c67 0%, #1b1b1e 80%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    display: flex; flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative; overflow: hidden;
}

.a2h-row { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.a2h-icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
}
.a2h-icon--fc { background: linear-gradient(135deg, #ffcc00, #ff9500); }
.a2h-icon--pv { background: linear-gradient(135deg, #30d158, #0a84ff); }
.a2h-icon--bat { background: linear-gradient(135deg, #32d74b, #28cd41); }
.a2h-icon--status { background: linear-gradient(135deg, #0a84ff, #5e5ce6); }

.a2h-main { flex: 1; }
.a2h-title { font-size: 0.9rem; font-weight: 600; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px; display: flex; justify-content: space-between; }
.a2h-value { font-size: 1.6rem; font-weight: 700; color: #fff; margin-top: 2px; }

.a2h-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }

/* Forecast Grid */
.a2h-forecast-grid { display: flex; gap: 10px; margin-top: 5px; }
.a2h-forecast-item { flex: 1; background: rgba(255,255,255,0.05); padding: 10px; border-radius: 12px; text-align: center; }
.a2h-forecast-item .label { font-size: 0.75rem; color: #aaa; margin-bottom: 2px; }
.a2h-forecast-item .value { font-size: 1.1rem; font-weight: 700; color: #fff; }

/* Progress Bar */
.a2h-progress { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.a2h-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease-out; }
.fill-orange { background: var(--pv); }
.fill-bat-orange { background: var(--batt); }
.fill-green{ background: green;}

.a2h-legend { display: flex; justify-content: space-between; font-size: 0.8rem; color: #ccc; }
.a2h-sub { font-size: 0.85rem; color: #ccc; margin-top: 5px; display: flex; justify-content: space-between; }

/* Live Lists (Battery/Status) */
.bat-live-list, .status-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 170px; overflow-y: auto; }
.bat-live-line, .status-line {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.03); padding: 8px 12px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 5px;
}
.bli-meta, .bcl-meta { display: flex; gap: 10px; color: #aaa; font-size: 0.75rem; }
.bli-power { font-weight: 700; color: var(--load); }

/* Status Dots */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.status-online { background: var(--load); box-shadow: 0 0 5px var(--load); }
.status-offline { background: var(--danger); box-shadow: 0 0 5px var(--danger); }

/* Tooltips */
.has-tip { position: relative; display: inline-block; margin-left: 5px; }
.tip-btn { background: rgba(255,255,255,0.2); border: none; color: #fff; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tip-box {
    position: absolute; bottom: 100%; right: 0; width: 200px;
    background: #222; border: 1px solid #444; padding: 10px;
    border-radius: 8px; font-size: 0.75rem; color: #ddd; z-index: 10; display: none; text-transform: none; font-weight: normal;
}
.has-tip:hover .tip-box { display: block; }
/* --- SCROLLBAR STYLING (v0.0.69) --- */
/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Firefox (Standard Property) */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) rgba(0,0,0,0.1); }

/* Menü-Spezifisch für noch cleaneren Look */
aside.main-sidebar::-webkit-scrollbar-track { background: transparent; }
/* --- SMART DEVICE TILES (v0.0.71) --- */
.full-width-widget { grid-column: 1 / -1; } /* Ganze Breite im Grid */

.smart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.tile {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    position: relative;
}
.tile:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.3); }

.tile .name {
    font-size: 0.85rem; font-weight: 600; color: #fff;
    text-align: center; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 8px; padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Gauge Container */
.gauge-wrap { position: relative; width: 80px; height: 80px; margin: 5px 0; cursor: pointer; }
canvas.gauge-cv { display: none; } /* Wir nutzen SVG */
.gicon {
    position: absolute; left: 50%; top: 87%; transform: translate(-50%, -50%);
    font-size: 24px; color: #555; transition: color 0.3s;
}
.gicon.on { color: var(--pv); text-shadow: 0 0 10px rgba(255, 159, 10, 0.4); }
.gicon.off { color: #666; }

/* SVG Styles */
.gauge-svg text { font-family: sans-serif; font-weight: 700; fill: #fff; font-size: 14px; text-shadow: 0 2px 4px #000; }

/* Secondary Value (Budget/Temp) */
.secondary { height: 20px; font-size: 0.8rem; font-weight: 700; color: #aaa; margin-bottom: 5px; }

/* Switches */
.switch-col { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 5px; }
.v-switch-label {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.75rem; color: #ccc; cursor: pointer; user-select: none;
    background: rgba(0,0,0,0.2); padding: 4px 8px; border-radius: 8px;
}
.v-switch {
    appearance: none; width: 32px; height: 18px;
    background: #444; border-radius: 10px; position: relative;
    outline: none; cursor: pointer; transition: 0.3s;
}
.v-switch:checked { background: var(--load); }
.v-switch::before {
    content: ""; position: absolute; left: 2px; top: 2px;
    width: 14px; height: 14px; background: #fff; border-radius: 50%;
    transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.v-switch:checked::before { left: 16px; }
/* --- AUTARKY DESIGN (v0.0.78) --- */
.aut-sep {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 12px 0;
}

/* Das dunkle Input-Feld (Bild 2) */
.aut-input-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1); /* Dunkler Hintergrund */
    border-radius: 8px; /* Abgerundete Ecken */
    padding: 8px 12px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s;
}
.aut-input-box:focus-within {
    border-color: var(--pv);
    background: rgba(255, 255, 255, 0.15);
}

.aut-input-box .edit-icon {
    font-size: 16px;
    color: #aaa;
    cursor: pointer;
}

.aut-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.aut-input-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
    width: 60px;
    outline: none;
    font-family: inherit;
}

/* Platzhalter Farbe */
.aut-input-box input::placeholder { color: #666; }

.aut-input-box .unit {
    color: #aaa;
    font-size: 0.85rem;
    font-weight: normal;
}

/* Ersparnis Text rechts unten */
.aut-savings {
    text-align: right;
    font-size: 0.85rem;
    color: #ccc;
    margin-top: 6px;
}
.aut-savings strong { color: var(--load); } /* Grün */
/* --- POPUP STYLES (Fixed v0.0.85) --- */
.a2h-popup-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.a2h-popup-backdrop.open { opacity: 1; pointer-events: auto; }

.a2h-popup-card {
    background: #1c1e26;
    background: linear-gradient(145deg, #1f232e, #14161b);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px; padding: 25px; width: 90%; max-width: 380px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    color: #fff; text-align: left;
    transform: scale(0.95); transition: transform 0.3s ease;
}
.a2h-popup-backdrop.open .a2h-popup-card { transform: scale(1); }

.a2h-popup-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.a2h-icon--popup { font-size: 32px; background: -webkit-linear-gradient(45deg, #FFD700, #FF8C00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.a2h-popup-titles { flex: 1; margin-left: 15px; }
.a2h-popup-title { font-size: 1.1rem; font-weight: 700; line-height: 1.2; color: #fff; }
.a2h-popup-subtitle { font-size: 0.8rem; color: #aaa; margin-top: 2px; }

.a2h-close { background: transparent; border: none; color: #888; font-size: 24px; cursor: pointer; padding: 0; line-height: 1; }
.a2h-close:hover { color: #fff; }

.a2h-popup-body { font-size: 0.95rem; line-height: 1.5; color: #ccc; margin-bottom: 25px; }
.pv-delta { font-weight: 600; color: #fff; margin-bottom: 8px; display: block; }
.pv-advice { border-left: 3px solid var(--pv); padding-left: 10px; color: #eee; font-style: italic; }

.a2h-btn-ok {
    background: #fff; color: #000; border: none; width: 100%; padding: 12px;
    border-radius: 10px; font-weight: 700; font-size: 1rem; cursor: pointer;
    transition: background 0.2s;
}
.a2h-btn-ok:hover { background: #ddd; }
/* MOBILE NOTIFICATION FIX */
@media (max-width: 768px) {
    /* Zwingt das Dropdown in die Bildschirmbreite */
    .dropdown-menu.dropdown-menu-end.dropdown-list {
        right: -60px !important; /* Etwas nach rechts schieben */
        left: auto !important;
        width: 320px !important; /* Feste Breite für Mobile */
        max-width: 95vw !important; /* Niemals breiter als Screen */
    }

    .notif-item .n-msg {
        white-space: normal !important; /* Textumbruch erlauben */
        overflow: visible !important;
        text-overflow: clip !important;
    }
}

/* --- PROMO CARDS (v0.2.0) --- */
.promo-wrap {
    background: linear-gradient(135deg, #1c2230, #141822);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 20px;
    text-align: center; color: #fff;
    margin-top: 15px; position: relative; overflow: hidden;
}
.promo-wrap::before {
    content: ""; position: absolute; top:0; left:0; width:100%; height:4px;
    background: linear-gradient(90deg, #FFD700, #ff9f0a);
}
.promo-icon {
    font-size: 36px; color: #FFD700; margin-bottom: 12px;
    background: rgba(255, 215, 0, 0.1); border-radius: 50%; padding: 12px;
    display: inline-flex;
}
.promo-title {
    font-size: 1.1rem; font-weight: 700; margin-bottom: 10px;
    color: #fff;
}
.promo-features {
    text-align: left; margin: 15px auto; max-width: 280px;
    list-style: none; padding: 0; color: #ccc; font-size: 0.9rem;
}
.promo-features li {
    margin-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
.promo-features li svg {
    width: 16px; height: 16px; fill: #4caf50; flex-shrink: 0;
}
.promo-btn {
    display: inline-block; background: #00bcd4; color: #fff; text-decoration: none;
    padding: 10px 20px; border-radius: 20px; font-weight: 700; font-size: 0.9rem;
    transition: background 0.2s, transform 0.1s; margin-top: 5px;
}
.promo-btn:hover { background: #00acc1; transform: translateY(-2px); }
.promo-price {
    font-size: 0.85rem; color: #888; margin-top: 10px;
}
/* --- GROUP CARDS (v0.3.0) --- */
.group-card {
    background: #161b22; /* Etwas dunkler als die Widgets */
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    margin-bottom: 25px;
    overflow: hidden;
}

.group-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.group-title {
    font-size: 1.1rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px;
}

.group-body {
    padding: 20px;
    display: none; /* Default zu, wird per JS geöffnet */
}

/* Grid innerhalb der Gruppen */
.group-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* System Status - 3 Spalten Layout */
.status-grid-cols {
    display: grid; gap: 10px;
    grid-template-columns: 1fr; /* Mobile: 1 Spalte */
}
@media (min-width: 900px) {
    .status-grid-cols {
        grid-template-columns: repeat(3, 1fr); /* Desktop: 3 Spalten */
    }
}
/* --- LAYOUT HELPER (v0.3.1) --- */
/* Zwingt eine Card im Grid über die volle Breite (alle Spalten) */
.full-width-widget {
    grid-column: 1 / -1;
    width: 100%;
}

/* Optional: Damit die schmalen Header "hübscher" aussehen wenn zugeklappt */
.group-card {
    transition: all 0.3s ease;
}

/* --- FOOTER & SPACING (v1.0.0 Master) --- */

/* Footer Design */
/* --- FOOTER & SPACING (v1.3.3 - Scrollbar) --- */

/* Footer Design - Nicht mehr fixiert! */
.a2h-footer {
    position: relative; /* WICHTIG: Damit er im normalen Fluss ist */
    width: 100%;
    background: #0f1420;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #6c757d;
    text-align: center;
    padding: 20px 0;
    font-size: 0.85rem;
    margin-top: 40px; /* Abstand zum Inhalt darüber */
    z-index: 10;
}

.a2h-footer a {
    color: #888;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.a2h-footer a:hover {
    color: #fff;
}

/* Abstandshalter zurücksetzen (wir brauchen keine 100px mehr) */
.dashboard-wrapper,
.form-wrap,
.view-container {
    padding-bottom: 20px !important;
    min-height: 80vh; /* Sorgt dafür, dass der Footer nicht zu weit oben hängt bei wenig Inhalt */
    display: flex;
    flex-direction: column;
}

/* Mobile Anpassung falls nötig */
@media (max-width: 768px) {
    .a2h-footer {
        font-size: 0.75rem;
        padding: 10px 0;
    }
}
/* --- TOOLTIP LINKS (v1.3.0) --- */
.tip-links {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}

.tip-links a {
    color: #42A5F5;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.tip-links a::before {
    content: "arrow_forward";
    font-family: 'Material Icons';
    font-size: 16px;
    margin-right: 6px;
}

.tip-links a:hover {
    text-decoration: underline;
    color: #64b5f6;
}
/* --- SUBMENU STYLES (v1.4.2) --- */
.nav-submenu {
    display: none; /* Standardmäßig ausgeblendet */
    background: rgba(0, 0, 0, 0.15); /* Etwas dunkler */
    padding-left: 0;
}

.nav-submenu.open {
    display: block; /* Eingeblendet wenn aktiv */
}

.nav-submenu .nav-item {
    padding-left: 52px; /* Einrücken der Unterpunkte */
    font-size: 0.9rem;
    border-left: 2px solid transparent;
}

.nav-submenu .nav-item.active {
    border-left: 2px solid #ff9f0a;
    background: rgba(255, 159, 10, 0.1);
}

.nav-item-parent {
    cursor: pointer;
    justify-content: space-between;
}

.nav-arrow {
    font-size: 18px;
    transition: transform 0.3s;
    color: #666;
}

.nav-item-parent.open .nav-arrow {
    transform: rotate(180deg);
}
/* --- TOPBAR SETTINGS MENU (v1.5.0) --- */
.settings-wrapper {
    position: relative;
    margin-left: 10px;
}

.settings-btn {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s, color 0.3s;
}

.settings-btn:hover, .settings-wrapper.active .settings-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Das Dropdown Panel */
.settings-panel {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    width: 250px;
    background: #1e1e1e; /* Dunkler Hintergrund passend zum Theme */
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: hidden;
    padding: 5px 0;
}

.settings-panel.open {
    display: block;
}

/* Die Links im Dropdown */
.settings-panel .nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.settings-panel .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.settings-panel .nav-item.active {
    border-left: 3px solid #ff9f0a;
    background: rgba(255, 159, 10, 0.1);
    color: #ff9f0a;
}

.settings-panel .nav-icon {
    margin-right: 15px;
    font-size: 20px;
    color: #888;
}

.settings-panel .nav-item:hover .nav-icon {
    color: #fff;
}

/* Trennlinie für Logout */
.settings-divider {
    height: 1px;
    background: #333;
    margin: 5px 0;
}

/* --- INVERTER SETTINGS LAYOUT (v1.5.1) --- */
.config-container {
    display: flex;
    flex-wrap: wrap; /* Erlaubt Umbruch auf Mobile */
    gap: 20px;
    align-items: flex-start;
}

.config-main {
    flex: 1; /* Nimmt den meisten Platz */
    min-width: 300px; /* Mindestbreite bevor Umbruch */
}

.config-sidebar {
    width: 320px; /* Feste Breite für Gateways auf Desktop */
    flex-shrink: 0;
}

/* Auf Mobile: Sidebar nimmt volle Breite */
@media (max-width: 1100px) {
    .config-sidebar {
        width: 100%;
        order: -1; /* Gateways auf Mobile evtl. nach oben? Oder weglassen für unten */
    }
}

/* Fix für den unsichtbaren Back-Button */
.btn-back {
    color: #fff !important;
    border-color: #666 !important;
}
.btn-back:hover {
    background: rgba(255,255,255,0.1) !important;
}

/* --- APPLE STYLE FORMS (v1.6) --- */

/* 1. Eingabefelder (Inputs) */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #8e8e93; /* Apple Light Gray Text */
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.08); /* Dunkel, aber transparent */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px; /* Apple Rounded Corners */
    padding: 12px 15px;
    font-size: 1rem;
    color: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box; /* Wichtig für Padding */
}

.form-control:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.12);
    border-color: #0a84ff; /* Apple Blue Focus */
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

/* 2. Dynamische Überschrift (Template Name) */
.template-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0a84ff; /* Apple Blue */
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: none; /* Standardmäßig aus */
}

/* 3. Apple Switches (Toggle) */
.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.switch-label {
    font-size: 1rem;
    color: #fff;
    font-weight: 400;
}

.apple-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
    flex-shrink: 0; /* Verhindert Stauchen */
}

.apple-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #3a3a3c; /* Apple Dark Switch Off */
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: #30d158; /* Apple Green */
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* --- STATUS PILL (v1.8) --- */
.status-pill-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
}
.status-pill-container::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.status-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 0.85rem;
    color: #ccc;
    display: flex;
    align-items: center;
}

.status-item strong {
    margin-left: 5px;
    color: #fff;
}

/* Farben je nach Status */
.status-item.limit-ok {
    border-color: rgba(48, 209, 88, 0.3);
    color: #30d158;
}
.status-item.limit-warn {
    border-color: rgba(255, 159, 10, 0.3);
    color: #ff9f0a;
}
.status-item.limit-err {
    border-color: rgba(255, 69, 58, 0.5);
    color: #ff453a;
    background: rgba(255, 69, 58, 0.1);
}
/* --- FIX FORM SELECT DROPDOWN (v1.0) --- */
select.form-control {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    appearance: none; /* Entfernt Standard-Pfeil (optional) */
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right .7em top 50%;
    background-size: .65em auto;
    padding-right: 1.5em;
}

/* Optionen im Dropdown dunkel machen */
select.form-control option {
    background-color: #1e1e2d; /* Dunkler Hintergrund für die Liste */
    color: #fff;
}
/* --- GAUGE FIXES (Positioning & Response) --- */

/* 1. Chip näher an die Gauge rücken */
.card.pos-home .chip-day,
.card.pos-pv .chip-day,
.card.pos-grid .chip-day,
.card.pos-bat .chip-day {
    margin-top: -10px; /* Zieht den Text nach oben */
    position: relative;
    z-index: 10;
}

@media(max-width:1350px){
    .ems-d .card {
        width: 126px;
    }
}

/* 2. Responsive Gauges für Screens unter 1100px */
@media (max-width: 1100px) {
    /* Container etwas verkleinern */
    .ems-d {
        transform: scale(0.85); /* Alles auf 85% skalieren */
        transform-origin: top center;
        margin-bottom: -50px; /* Platz unten ausgleichen */
    }

    /* Gauge Größe anpassen */
    .card svg.gauge {
        width: 100px;  /* Kleiner als Standard (oft 120px) */
        height: 100px;
    }

    /* Text im SVG anpassen, damit er nicht rausfliegt */
    .g-val { font-size: 12px; }
    .ms { font-size: 20px; }

    /* Icon Größe */
    .material-icons.wx-ico-s { font-size: 24px; }
}

/* Optional: Noch kleiner für Tablets (unter 800px) */
@media (max-width: 800px) {
    .ems-d {
        transform: scale(0.7);
    }
}
/* Update für Notification Items */
/* Update für Notification Items (Dein Code + Farben) */
.notif-item {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    background: transparent;
    transition: background 0.2s;

    /* Standard Rand links (damit der Text nicht springt, wenn Farbe kommt) */
    border-left: 4px solid transparent;
}

/* Hover Effekt */
.notif-item:hover {
    background: rgba(255,255,255,0.03);
}

/* --- FARB-INDIKATOREN (Linker Rand & Leichter Hintergrund) --- */

/* Success (Grün) */
.notif-item.type-success {
    border-left-color: #2ecc71; /* Grün */
}
.notif-item.type-success.unread {
    background: rgba(46, 204, 113, 0.1); /* Leichter Grüner Hintergrund nur wenn ungelesen */
}

/* Error (Rot) */
.notif-item.type-error {
    border-left-color: #e74c3c; /* Rot */
}
.notif-item.type-error.unread {
    background: rgba(231, 76, 60, 0.1);
}

/* Warning (Gelb/Orange) */
.notif-item.type-warning {
    border-left-color: #f1c40f; /* Gelb */
}
.notif-item.type-warning.unread {
    background: rgba(241, 196, 15, 0.1);
}

/* Info (Blau) */
.notif-item.type-info {
    border-left-color: #3498db; /* Blau */
}
.notif-item.type-info.unread {
    background: rgba(52, 152, 219, 0.1);
}

/* Gelesen Status (Ausgegraut / Standard) */
.notif-item.read {
    opacity: 0.6; /* Gelesene Nachrichten etwas blasser */
    border-left-color: #555; /* Neutraler Rand */
    background: transparent;
}

/* Load More Button Styling */
#notif-load-more {
width: 100%;
padding: 10px;
background: rgba(255,255,255,0.05);
border: none;
color: #aaa;
cursor: pointer;
font-size: 0.85rem;
margin-top: 5px;
}
#notif-load-more:hover {
background: rgba(255,255,255,0.1);
color: white;
}

.n-visual {
    flex-shrink: 0;      /* Bild darf nicht schrumpfen */
    width: 40px;
    display: flex;
    justify-content: center;
}

.n-img {
    width: 40px;
    height: 40px;
    object-fit: cover;   /* Bild beschneiden damit es quadratisch bleibt */
    border-radius: 6px;  /* Ecken abrunden */
    background: rgba(255,255,255,0.1);
}

.n-icon {
    font-size: 28px;     /* Größe für Icons */
    margin-top: 2px;
}

.n-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.n-msg {
    white-space: normal; /* Zeilenumbrüche erlauben */
    line-height: 1.4;
    color: #ccc;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Device Toolbar (Universal) */
.device-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Fixierter "Gesamt" Button */
.ds-item.fixed-item {
    flex-shrink: 0;
    z-index: 2;
    background: #1e1e1e;
    box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    margin-right: 0;
}

/* Trennlinie */
.ds-separator {
    width: 1px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    margin: 0 15px;
    flex-shrink: 0;
}

/* Scrollbarer Bereich */
.device-list-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    flex-grow: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 10px;
}
.device-list-scroll::-webkit-scrollbar { display: none; }

/* Items */
.ds-item {
    min-width: 90px;
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    user-select: none;
}
.ds-item:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.3); }
.ds-item.active { background: rgba(255, 255, 255, 0.05); border-color: var(--active-color, #ff9f0a); }
.ds-item.active .ds-icon { color: var(--active-color, #ff9f0a); }
.ds-icon { font-size: 24px; color: #666; }
.ds-name { font-size: 0.75rem; font-weight: 600; color: #ccc; white-space: nowrap; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }

/* Grid Layout für Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media(min-width: 1000px) {
    .charts-grid { grid-template-columns: 1fr 1fr; }
    .chart-full { grid-column: 1 / -1; }
}
/* --- DEVICE TOOLBAR RESPONSIVE --- */

/* Standard (Desktop): Nebeneinander Scrollbar */
.solar-toolbar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 25px;
    scrollbar-width: none; /* Firefox ausblenden */
}
.solar-toolbar::-webkit-scrollbar { display: none; } /* Chrome ausblenden */

/* Chip Design (Basis) */
.dev-chip {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-sub);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center; /* Mittig für Mobile wichtig */
    gap: 8px;
}
.dev-chip:hover { border-color: var(--solar-orange); color: #fff; }
.dev-chip.active { background: var(--solar-orange); color: #000; border-color: var(--solar-orange); }

/* --- MOBILE ONLY (Breakpoint z.B. 600px) --- */
@media (max-width: 600px) {
    .solar-toolbar {
        flex-direction: column; /* Untereinander */
        overflow-x: visible;    /* Kein Scrollen nötig */
    }

    .dev-chip {
        width: 100%;       /* Volle Breite */
        padding: 12px;     /* Etwas größer für Finger */
        font-size: 1rem;
    }
}

/* Fix für Responsive Gauges */
/* Fix for Responsive Gauges */
.card svg.gauge {
    width: 100%;
    height: auto;
    max-height: 100%;
    display: block;
    /* Ensure aspect ratio is preserved */
    aspect-ratio: 1 / 1;
}

/* Ensure the card shrinks properly on mobile */
.card {
    min-width: 0; /* Critical for flexbox/grid shrinking */
    flex: 1 1 0; /* Allow flex items to shrink */
}

/* Specific fix for the gauge container to prevent overflow */
.pos-pv, .pos-home, .pos-grid, .pos-bat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Hide anything that spills out */
}
/* --- SOLAR & BATTERY SPECIFICS (Add to style.css) --- */

/* Wrapper für den Tacho (Doughnut Chart) */
.gauge-wrapper {
    position: relative;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: -10px;
}

/* Text im Tacho */
.gauge-val {
    position: absolute;
    bottom: 40px;
    text-align: center;
    pointer-events: none; /* Klicks durchlassen */
}
.gv-num { font-size: 2.2rem; font-weight: 700; color: #fff; line-height: 1; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.gv-unit { font-size: 0.9rem; color: #aaa; }

/* Min/Max Werte unter dem Tacho */
.gauge-meta {
    display: flex;
    justify-content: space-between;
    width: 70%;
    font-size: 0.8rem;
    color: #888;
    margin-top: -15px;
    padding: 0 10px;
}

/* Toolbar Anpassung für a2h-Design */
.solar-toolbar, .bat-toolbar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 25px;
    scrollbar-width: none; /* Firefox */
}
.solar-toolbar::-webkit-scrollbar, .bat-toolbar::-webkit-scrollbar { display: none; } /* Chrome */

/* Die Chips etwas anpassen, damit sie zum Glass-Look passen */
.dev-chip {
    background: rgba(255,255,255,0.05); /* Glass Effekt */
    border: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.dev-chip:hover { background: rgba(255,255,255,0.1); color: #fff; }
.dev-chip.active {
    background: rgba(255, 159, 10, 0.15); /* Orange Tint */
    border-color: #ff9f0a;
    color: #ff9f0a;
}
/* Für Batterie View (Grün) */
.battery-view .dev-chip.active {
    background: rgba(48, 209, 88, 0.15);
    border-color: #30d158;
    color: #30d158;
}

/* Charts Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    width: 100%;
}
.grid-full { grid-column: 1 / -1; }

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr !important; }
    .dev-chip { width: 100%; }
}
@media(max-width:1350px){
    .ems-d .card {
        width: 126px;
    }
}

/* Lokale Einbindung der aktuellen Google Material Icons */
@font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    /* Passe den Pfad an, je nachdem wo deine Datei liegt.
     Hier: Ein Ordner hoch aus 'css', dann* in 'fonts' */
    src: url('../MaterialIcons-Regular.woff2') format('woff2');
}

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;

    line-height: 1;
    letter-spacing: normal;
    text-transform: none;

    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;

    /* Das hier sorgt für den "runden, sauberen" Style von Google: */
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optional: Eine Hilfsklasse, falls du Icons an Text anpassen musst */
.material-icons.md-18 { font-size: 18px; }
.material-icons.md-24 { font-size: 24px; }
.material-icons.md-36 { font-size: 36px; }
.material-icons.md-48 { font-size: 48px; }

@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    /* Font-Weight auf 400 für ein sauberes, klares Design */
    font-weight: 400;
    /* Pfad zu deinem neuen Download */
    src: url('../Material_Symbols_Outlined.woff2') format('woff2');
}

.material-icons,
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal;
    font-style: normal;

    line-height: 1;
    letter-spacing: normal;
    text-transform: none;

    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;

    /* Perfekte Kantenglättung und Ligatur-Aktivierung */
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
