body{
    margin:0;
    font-family:Segoe UI, Arial, sans-serif;
    background:#08111f;
    color:#ffffff;
}

.container{
    padding:25px;
}

.page-header{
    font-size:48px;
    font-weight:700;
    color:#ffffff;
}

.page-title{
    font-size:42px;
    font-weight:700;
    margin-bottom:30px;
}

.app-header{
    display:flex;
    align-items:center;
    gap:20px;

    padding:15px 25px;
    
    background:#071122;
    border-bottom:1px solid #22344e;
}

.app-logo{
    height:70px;
    width:auto;
}

.vehicle-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
    gap:20px;
}

.vehicle-card{
    background:#1b2940;
    min-height:340px;
    border-radius:12px;
    padding:20px;
    border-left:6px solid #f0b90b;
}

.vehicle-card-torsten{
    border-left:6px solid #3b82f6;
}

.vehicle-card-partner{
    border-left:6px solid #ec4899;
}

.vehicle-image{
    width:100%;
    height:170px;

    object-fit:contain;

    background:#15233d;

    border-radius:8px;

    margin-bottom:15px;
}

.vehicle-title{
    font-size:22px;
    font-weight:700;
    margin-bottom:10px;
}

.vehicle-data{
    margin-top:5px;
}

.vehicle-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.back-link {
    display: inline-block;
    margin: 20px 0;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    color: #4da3ff;
    text-decoration: underline;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.detail-card {
    background: #13284a;
    padding: 22px;
}

.detail-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #ffffff;
}

.vehicle-image-wrapper {
    position: relative;
}

.vehicle-detail-image {
    width: 80%;
    display: block;
    margin: 0 auto 25px auto;

    object-fit: contain;
}

.ai-optimized-label {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);

    font-size: 10px;
    color: rgba(255,255,255,0.75);

    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);

    padding: 2px 8px;
    border-radius: 12px;

    letter-spacing: 0.5px;
    white-space: nowrap;

    pointer-events: none;
}

/* Toolbar */

.garage-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.garage-search {
    width: 250px;
    padding: 10px 12px;

    background: #0f1c35;
    color: white;

    border: 1px solid #2c446e;
    border-radius: 6px;
}

.garage-btn {
    display: inline-block;

    padding: 10px 16px;

    background: #f2f2f2;
    color: #111;

    border: none;
    border-radius: 6px;

    font-weight: 600;
    cursor: pointer;

    text-decoration: none;
    line-height: 1.2;
}

.garage-btn:hover {
    background: white;
}

/* Listenansicht */

.vehicle-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.vehicle-table th {

    background: #243451;
    color: white;

    text-align: left;

    padding: 12px;
    cursor: pointer;
}

.vehicle-table td {

    background: #182847;

    padding: 12px;

    border-bottom: 1px solid #2a3a59;
}

.vehicle-table tr:hover td {

    background: #20345c;
}

.color-badge {
    display: inline-block;
    min-width: 80px;
    text-align: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
}

/* Farben */

.color-weiss,
.color-weiß {
    background: #f5f5f5;
    color: #222;
    border: 1px solid #ccc;
}

.color-blau {
    background: #2563eb;
    color: #fff;
}

.color-schwarz {
    background: #111827;
    color: #fff;
}

.color-grau {
    background: #6b7280;
    color: #fff;
}

.color-silber {
    background: linear-gradient(135deg,#d1d5db,#9ca3af);
    color: #111;
}

.color-rot {
    background: #dc2626;
    color: #fff;
}

.color-grün,
.color-gruen {
    background: #16a34a;
    color: #fff;
}

.color-gelb {
    background: #eab308;
    color: #111827;
}

.vehicle-table th:nth-child(1),
.vehicle-table td:nth-child(1) {
    width: 100px;
}

.vehicle-table th:nth-child(2),
.vehicle-table td:nth-child(2) {
    width: 220px;
}

.vehicle-table th:nth-child(3),
.vehicle-table td:nth-child(3) {
    width: 75px;
}

.vehicle-table th:nth-child(4),
.vehicle-table td:nth-child(4) {
    width: 65px;
}

.vehicle-table th:nth-child(5),
.vehicle-table td:nth-child(5) {
    width: 70px;
}

.vehicle-table th:nth-child(6),
.vehicle-table td:nth-child(6) {
    width: 70px;
}

.vehicle-table th:nth-child(7),
.vehicle-table td:nth-child(7) {
    width: 170px;
}

.vehicle-table th:nth-child(8),
.vehicle-table td:nth-child(8) {
    width: 70px;
}

/* Verbrauchs-KPI-Kacheln */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.kpi-card {
    background: #15284a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px;
}

.kpi-card:hover {
    transform: translateY(-3px);
}

.kpi-label {
    color: #9ca3af;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.kpi-value {
    color: #ffffff;
    font-size: 1.7rem;
    font-weight: 700;
}

.chart-card {
    min-height: 300px;
    margin-bottom: 25px;
}

.chart-wrapper {
    position: relative;
    height: 260px;
    width: 100%;
}

.donut-card {
    min-height: 300px;
    justify-self: start;
}

.donut-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;

    font-size: 28px;
    font-weight: bold;

    color: white;
    text-align: center;
}

#costChart {
    max-height: 250px;
}

.donut-card {
    position: relative;
}

.donut-center {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    text-align: center;

    z-index: 10;  
}

.donut-value {
    font-size: 30px;
    font-weight: 700;
    color: white;
}

.donut-label {
    color: #9ca3af;
}

.donut-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #04152f;
    border-right: 1px solid rgba(255,255,255,.08);
    padding: 20px;
}

.main-content {
    flex: 1;
    padding: 20px;
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 40px;
}

.sidebar-logo-img {
    width: 75px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 14px 16px;

    color: #c5d4ef;
    text-decoration: none;

    border-radius: 12px;

    font-size: 15px;
    font-weight: 500;

    transition: .2s;
}

.nav-item:hover {
    background: #173a75;
}

.nav-item.active {
    background: #2454c6;
    color: white;
}

.page-header {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 25px;
}

.stats-grid {
    display:grid;
    grid-template-columns:repeat(6,1fr);
    gap:20px;
    margin-bottom:25px;
}

.stat-card {
    background:#142a56;
    border-radius:14px;
    padding:20px;
    display:flex;
    align-items:center;
    gap:15px;
}

.stat-icon {
    width:50px;
    height:50px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
}

.blue { background:#2563eb; }
.green { background:#23b26d; }
.orange { background:#f59e0b; }
.purple { background:#8b5cf6; }
.cyan { background:#06b6d4; }

.stat-value {
    font-size:32px;
    font-weight:700;
}

.chart-card,
.info-card {
    background:#142a56;
    border-radius:14px;
    padding:20px;
}

.price-card {
    background: #132a55;
    border-radius: 14px;
    padding: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.modern-card {
    display: flex;
    align-items: center;
    gap: 18px;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.blue { background:#2563eb; }
.green { background:#16a34a; }
.orange { background:#f59e0b; }
.purple { background:#8b5cf6; }
.cyan { background:#06b6d4; }
.red { background:#ef4444; }

.kpi-subtitle {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.location-row {
    display: grid;
    grid-template-columns: 110px 1fr 55px;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress-home {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg,#22c55e,#16a34a);
    border-radius: 999px;
}

.cost-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    height: 100%;
}

.cost-legend {
    width: 220px;
}

.legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.home {
    background: #22c55e;
}

.legend-dot.public {
    background: #f59e0b;
}

.btn-white {
    display: inline-block;
    padding: 10px 16px;
    background: #f2f2f2;
    color: #111;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-white:hover {
    background: #e5e5e5;
}

.charge-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.charge-home {
    background: #22c55e;
    color: white;
}

.charge-public {
    background: #f59e0b;
    color: white;
}

.table-footer {
    text-align: center;
    padding-top: 15px;
}

.table-footer a {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
}

.table-footer a:hover {
    color: #bfdbfe;
}

.info-row .kpi-card {
    min-height: 140px;
}

/* =========================================================
   Verbrauchsseite - finales Dashboard-Grid
   ========================================================= */

.consumption-dashboard {
    display: grid !important;

    grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);

    grid-template-areas:
        "energy cost"
        "locations metrics"
        "sessions price";

    gap: 20px;
    margin-top: 20px;
    align-items: stretch;
}

/* alle Karten im Verbrauchs-Dashboard sauber ins Grid zwingen */
.consumption-dashboard > .kpi-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box;
    margin: 0 !important;
}

/* feste Positionen */
.energy-card {
    grid-area: energy;
}

.cost-card {
    grid-area: cost;
}

.locations-card {
    grid-area: locations;
}

.metrics-card {
    grid-area: metrics;
}

.sessions-card {
    grid-area: sessions;
}

.price-card-inline {
    grid-area: price;
}

/* Diagramm */
.consumption-dashboard .chart-wrapper {
    height: 260px;
    width: 100%;
}

/* Kostenverteilung */
.consumption-dashboard .cost-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    height: 100%;
}

.consumption-dashboard .donut-wrapper {
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}

.consumption-dashboard .cost-legend {
    width: 220px;
    margin-left: 0;
}

/* Höhe der mittleren Karten */
.locations-card,
.metrics-card {
    min-height: 180px;
}

/* Tabelle + Strompreis unten */
.sessions-card {
    min-width: 0;
}

.price-card-inline {
    min-width: 260px;
}

/* Mobile Ansicht erst wirklich spät stapeln */
@media (max-width: 900px) {
    .consumption-dashboard {
        grid-template-columns: 1fr;

        grid-template-areas:
            "energy"
            "cost"
            "locations"
            "metrics"
            "sessions"
            "price";
    }
}

.consumption-layout {
    display: grid;

    grid-template-columns: 2fr 1fr;

    grid-template-areas:
        "energy cost"
        "locations metrics"
        "sessions price";

    gap: 20px;
}

.price-layout {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
}

.price-icon {
    width: 72px;
    height: 72px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 32px;

    border: 2px solid rgba(59,130,246,.4);
    background: rgba(59,130,246,.08);
}

.price-value {
    font-size: 44px;
    font-weight: 700;
    color: white;
}

.price-subtitle {
    color: #9ca3af;
    margin-top: 4px;
}

.price-last-change {
    margin: 20px 0;
    color: #9ca3af;
}

.price-card-inline .btn-white {
    width: 100%;
}

.price-card-inline input {

    width: 100%;

    box-sizing: border-box;

    padding: 10px;

    margin-bottom: 12px;

    border-radius: 8px;

    border: 1px solid #334155;

    background: #0f172a;

    color: white;
}