/* ============================================================
   CSMS — Professional SaaS Dashboard Design System
   Clean Modern Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #1d4ed8;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-width: 260px;

  --bg-body: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f8fafc;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --blue: #3b82f6;
  --blue-light: #dbeafe;
  --blue-dark: #1e40af;
  --green: #10b981;
  --green-light: #d1fae5;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --red: #ef4444;
  --red-light: #fee2e2;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --cyan: #06b6d4;
  --cyan-light: #cffafe;

  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --ease: all .2s cubic-bezier(.4,0,.2,1);

  --bs-primary: #3b82f6;
  --bs-primary-rgb: 59,130,246;
  --bs-success: #10b981;
  --bs-success-rgb: 16,185,129;
  --bs-danger: #ef4444;
  --bs-danger-rgb: 239,68,68;
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245,158,11;
  --bs-info: #06b6d4;
  --bs-info-rgb: 6,182,212;
}

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: var(--ease); }
a:hover { color: var(--blue-dark); }

h1,h2,h3,h4,h5,h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  transition: transform .3s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-hover) transparent;
}
.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-brand img {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  object-fit: contain;
}
.sidebar-brand-text {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
}
.sidebar-brand-badge {
  font-size: 9px;
  font-weight: 600;
  background: var(--sidebar-active);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #475569;
  padding: 12px 12px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: var(--sidebar-text);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--ease);
  margin-bottom: 1px;
  text-decoration: none;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}
.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  box-shadow: 0 2px 8px rgba(29,78,216,.35);
}
.sidebar-link i { width: 20px; text-align: center; font-size: 15px; opacity: .85; }
.sidebar-link.active i { opacity: 1; }
.sidebar-link .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  color: var(--sidebar-text);
  font-size: 11px;
  text-transform: capitalize;
}
.sidebar-logout {
  background: none;
  border: none;
  color: var(--sidebar-text);
  padding: 4px;
  cursor: pointer;
  transition: var(--ease);
  border-radius: var(--radius-sm);
}
.sidebar-logout:hover { color: var(--red); background: rgba(239,68,68,.1); }

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin .3s ease;
}

/* ── Top Bar ───────────────────────────────────────────────── */
.top-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.top-bar-left { display: flex; align-items: center; gap: 16px; }
.top-bar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -.3px;
}
.top-bar-right { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  display: none;
}

/* Connection badge */
.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--green-light);
  color: #065f46;
}
.connection-badge.disconnected {
  background: var(--red-light);
  color: #991b1b;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background: var(--green); animation: pulse-dot 2s infinite; }
.status-dot.offline { background: var(--red); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  padding: 24px 32px 32px;
  flex: 1;
}
.main-content .container,
.page-content .container {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: var(--ease);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 16px 20px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h6,
.card-header .font-weight-bold {
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}
.card-body { padding: 20px; }
.card-footer {
  background: var(--bg-body);
  border-top: 1px solid var(--border-light);
  padding: 10px 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── KPI / Stat Cards ──────────────────────────────────────── */
.stat-card { position: relative; overflow: hidden; }
.stat-card .card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.stat-card .stat-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-card .stat-icon.green { background: var(--green-light); color: var(--green); }
.stat-card .stat-icon.amber { background: var(--amber-light); color: var(--amber); }
.stat-card .stat-icon.red { background: var(--red-light); color: var(--red); }
.stat-card .stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-card .stat-icon.cyan { background: var(--cyan-light); color: var(--cyan); }
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -.5px;
}

/* Legacy KPI border support */
.border-left-primary { border-left: 4px solid var(--blue) !important; }
.border-left-success { border-left: 4px solid var(--green) !important; }
.border-left-info { border-left: 4px solid var(--cyan) !important; }
.border-left-warning { border-left: 4px solid var(--amber) !important; }
.border-left-danger { border-left: 4px solid var(--red) !important; }

/* ── Tables ────────────────────────────────────────────────── */
.table { margin-bottom: 0; font-size: 13px; }
.table thead th {
  background: var(--bg-body);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  padding: 10px 16px;
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.table tbody tr:hover { background: var(--bg-card-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  transition: var(--ease);
  letter-spacing: 0;
  text-transform: none;
  border: 1px solid transparent;
}
.btn:focus { box-shadow: 0 0 0 3px rgba(59,130,246,.25); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-warning { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-outline-primary { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-outline-primary:hover { background: var(--blue); color: #fff; }
.btn-outline-secondary { border-color: var(--border); color: var(--text-secondary); background: transparent; }
.btn-outline-secondary:hover { background: var(--bg-body); border-color: var(--text-muted); color: var(--text-secondary); }
.btn-light { background: var(--bg-body); border-color: var(--border); color: var(--text-secondary); }
.btn-light:hover { background: var(--border); color: var(--text-secondary); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-control, .form-select {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: var(--ease);
}
.form-control:focus, .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  background: var(--bg-card);
}
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.input-group-text {
  background: var(--bg-body);
  border-color: var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: .2px;
}
.badge.bg-primary { background: var(--blue) !important; }
.badge.bg-success { background: var(--green) !important; }
.badge.bg-danger { background: var(--red) !important; }
.badge.bg-warning { background: var(--amber) !important; color: #fff !important; }
.badge.bg-info { background: var(--cyan) !important; }
.badge.bg-secondary { background: #64748b !important; }

/* Status badges with dot */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}
.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
}
.status-badge.available { background: var(--green-light); color: #065f46; }
.status-badge.available::before { background: var(--green); }
.status-badge.charging { background: var(--blue-light); color: var(--blue-dark); }
.status-badge.charging::before { background: var(--blue); animation: pulse-dot 1.5s infinite; }
.status-badge.preparing { background: var(--amber-light); color: #92400e; }
.status-badge.preparing::before { background: var(--amber); }
.status-badge.faulted { background: var(--red-light); color: #991b1b; }
.status-badge.faulted::before { background: var(--red); }
.status-badge.unavailable, .status-badge.offline { background: #f1f5f9; color: #475569; }
.status-badge.unavailable::before, .status-badge.offline::before { background: #94a3b8; }
.status-badge.finishing { background: var(--purple-light); color: #5b21b6; }
.status-badge.finishing::before { background: var(--purple); }

/* ── Modals ────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border-light);
  padding: 20px 24px;
}
.modal-header .modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer {
  border-top: 1px solid var(--border-light);
  padding: 16px 24px;
}

/* ── Page Title (hidden — shown in top-bar now) ────────────── */
.page-title { display: none; }

/* ── Charts ────────────────────────────────────────────────── */
.chart-container { position: relative; width: 100%; }

/* ── Live Monitoring Panel ─────────────────────────────────── */
.live-panel {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: #fff;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,.08);
}
.live-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.live-panel-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-panel-title .live-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}
.live-metric {
  text-align: center;
  padding: 16px;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.06);
}
.live-metric-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.5px;
}
.live-metric-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}
.live-metric-unit { font-size: 14px; font-weight: 400; color: #94a3b8; }

/* ── OCPP Command Center ──────────────────────────────────── */
.ocpp-charger-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--ease);
  display: flex;
  align-items: center;
  gap: 12px;
}
.ocpp-charger-item:hover { background: var(--bg-card-hover); }
.ocpp-charger-item.selected { background: var(--blue-light); border-left: 3px solid var(--blue); }
.ocpp-charger-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ocpp-charger-dot.connected { background: var(--green); }
.ocpp-charger-dot.disconnected { background: var(--text-muted); }

.command-response {
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  color: #e2e8f0;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.command-response *,
.command-response h6,
.command-response pre,
.command-response span,
.command-response div {
  color: inherit !important;
  background: transparent !important;
  font-family: inherit;
  font-size: inherit;
  white-space: pre-wrap;
  margin: 0;
  padding: 0;
}
.command-response .text-danger { color: #fca5a5 !important; }
.command-response .resp-label {
  color: #93c5fd !important;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.command-log {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.log-entry {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}
.log-entry.success { background: rgba(16,185,129,.05); border-left: 3px solid var(--green); }
.log-entry.error { background: rgba(239,68,68,.05); border-left: 3px solid var(--red); }
.log-entry .timestamp { color: var(--text-muted); }
.log-entry .command { color: var(--blue); font-weight: 500; }
.log-entry .status { font-weight: 600; }
.log-entry .details { color: var(--text-secondary); }

/* ── Tabs ──────────────────────────────────────────────────── */
.nav-tabs {
  border-bottom: 2px solid var(--border-light);
  gap: 0;
}
.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--ease);
  border-radius: 0;
}
.nav-tabs .nav-link:hover { color: var(--text-primary); border-color: var(--border); }
.nav-tabs .nav-link.active {
  color: var(--blue);
  border-color: var(--blue);
  background: transparent;
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-md);
  border: none;
  font-size: 13px;
  padding: 12px 16px;
}
.alert-success { background: var(--green-light); color: #065f46; }
.alert-danger { background: var(--red-light); color: #991b1b; }
.alert-warning { background: var(--amber-light); color: #92400e; }
.alert-info { background: var(--cyan-light); color: #155e75; }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner-border { color: var(--blue); }

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
}

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}
.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: #fff;
}
.login-left-content { max-width: 440px; }
.login-left h1 {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.login-left p { font-size: 16px; color: #94a3b8; line-height: 1.7; }
.login-features {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-feature-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: rgba(59,130,246,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 16px;
  flex-shrink: 0;
}
.login-feature-text { font-size: 14px; color: #cbd5e1; }
.login-right {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-card);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}
.login-form-container { width: 100%; max-width: 360px; }
.login-form-container h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.login-form-container .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.login-form-container .form-control {
  padding: 12px 14px;
  font-size: 14px;
}
.login-form-container .btn-primary {
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: .3; }
.empty-state h5 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ── Configuration table ───────────────────────────────────── */
.config-table .config-key {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12px;
  color: var(--blue);
}
.config-table .config-readonly { color: var(--text-muted); font-size: 11px; }
.config-table .config-value {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Charger Cards ─────────────────────────────────────────── */
.charger-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  padding: 20px;
  transition: var(--ease);
  position: relative;
}
.charger-card:hover { box-shadow: var(--shadow-md); }
.charger-card.in-use { border-left: 3px solid var(--blue); }
.charger-card.faulted { border-left: 3px solid var(--red); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}
.fa-spin { animation: fa-spin 1s infinite linear; }
@keyframes fa-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.fade-in { animation: fadeIn .3s ease; }

/* ── Footer ────────────────────────────────────────────────── */
.app-footer {
  padding: 16px 32px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Sidebar overlay for mobile ────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1040;
  display: none;
}
.sidebar-overlay.show { display: block; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .sidebar-toggle { display: block; }
  .main-content { margin-left: 0; }
  .top-bar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .login-left { display: none; }
  .login-right { width: 100%; border-radius: 0; }
}
@media (max-width: 576px) {
  .stat-card .stat-value { font-size: 20px; }
  .live-metric-value { font-size: 22px; }
  .top-bar-title { font-size: 16px; }
}

/* ── Misc helpers ──────────────────────────────────────────── */
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.font-weight-bold { font-weight: 600; }
.opacity-50 { opacity: .5; }
