/* EV Charger Monitoring Dashboard - Design System */
:root {
    --bg-base: #0b0f19;
    --bg-surface: #151d30;
    --bg-main: #0f172a;
    --primary: #0284c7; /* Electric Blue */
    --primary-hover: #0369a1;
    --primary-light: rgba(2, 132, 199, 0.1);
    --accent-emerald: #10b981; /* Neon Green */
    --accent-emerald-light: rgba(16, 185, 129, 0.1);
    --accent-amber: #f59e0b; /* Charging Idle / Warning */
    --accent-red: #ef4444; /* Offline */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.1);
    --border-glow: rgba(2, 132, 199, 0.35);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --font-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================= HEADER & NAV ================= */
header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 48px;
    object-fit: contain;
}

.header-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.header-title span {
    color: var(--accent-emerald);
}
.logo-dark {
    color: var(--text-main) !important;
}
.logo-light {
    color: var(--accent-emerald) !important;
}
.logo-version-tag {
    background: var(--bg-surface) !important;
    color: var(--accent-emerald) !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    font-size: 0.75rem !important;
    margin-left: 6px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    font-weight: 800 !important;
    letter-spacing: normal !important;
    border: 1.5px solid var(--border) !important;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--text-main);
    background-color: var(--primary);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* ================= MAIN CONTENT ================= */
main {
    flex: 1;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= WELCOME BANNER ================= */
.welcome-banner {
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(2, 132, 199, 0.15) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--border-glow) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-banner h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.welcome-banner p {
    color: var(--text-muted);
    font-weight: 500;
}

/* ================= GRID SYSTEM ================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ================= CARDS ================= */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.3);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.emerald {
    background-color: var(--accent-emerald-light);
    color: var(--accent-emerald);
}

.stat-icon.amber {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
}

.stat-details h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-details span {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
}

/* ================= TELEMETRY DIAL ================= */
.telemetry-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.dial-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #0f172a;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.dial-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dial-bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.dial-progress-circle {
    stroke: url(#dial-grad);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.dial-text-container {
    z-index: 2;
}

.dial-val {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.dial-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ================= CHARGER LIST ================= */
.charger-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.charger-item {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 1.5fr 2fr 1fr;
    align-items: center;
    gap: 1.5rem;
    transition: border-color 0.25s ease;
}

.charger-item:hover {
    border-color: var(--border-glow);
}

.charger-info h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.charger-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.charger-status-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.charger-progress-bar {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.charger-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent-emerald) 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.8s ease;
}

.charger-progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    width: fit-content;
    margin-left: auto;
}

.badge.available {
    background-color: var(--accent-emerald-light);
    color: var(--accent-emerald);
}

.badge.charging {
    background-color: rgba(2, 132, 199, 0.15);
    color: var(--primary);
    animation: pulseBadge 2s infinite;
}

.badge.finished {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.badge.offline {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

@keyframes pulseBadge {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* ================= LOAD OPTIMIZER ================= */
.optimizer-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-header strong {
    font-family: var(--font-heading);
}

.slider-val {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.slider-input {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border-radius: 3px;
    -webkit-appearance: none;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary);
    transition: background-color 0.25s;
}

.priority-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Switch Toggle styles */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .switch-slider {
    background-color: var(--accent-emerald);
}

input:checked + .switch-slider:before {
    transform: translateX(24px);
}

/* ================= TABLES ================= */
.table-container {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th, td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

th {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background-color: rgba(255, 255, 255, 0.02);
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* ================= WHATSAPP FLOAT ================= */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 2px 2px 15px rgba(37, 211, 102, 0.5);
    background-color: #20ba5a;
}

/* ================= FOOTER ================= */
.footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    padding: 3rem 2rem;
    flex-wrap: wrap;
}

.footer-logo {
    height: 48px;
    margin-bottom: 1rem;
    object-fit: contain;
}

.footer-left {
    flex: 2;
    min-width: 300px;
}

.footer-left p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 450px;
}

.footer-center {
    flex: 1;
    min-width: 150px;
}

.footer-center h3, .footer-right h3 {
    font-family: var(--font-heading);
    color: var(--accent-emerald);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.footer-center a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    transition: color 0.25s ease;
}

.footer-center a:hover {
    color: var(--accent-emerald);
}

.footer-right {
    flex: 1;
    min-width: 250px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-right p {
    margin-bottom: 0.75rem;
}

.footer-bottom {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}