* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: #EEF2F6;
  color: #1E293B;
  min-height: 100vh;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background-color: #FFFFFF;
  border-right: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  padding-left: 8px;
}

.logo-box {
  color: #2563EB;
  font-size: 18px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background-color: #F8FAFC;
  color: #1E293B;
}

.nav-item.active {
  background-color: #DBEAFE;
  color: #1D4ED8;
  font-weight: 600;
}

.nav-icon {
  font-size: 16px;
}

.badge {
  margin-left: auto;
  background: #EF4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  border-top: 1px solid #F1F5F9;
  padding-top: 16px;
  font-size: 13px;
  color: #64748B;
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logout-link {
  cursor: pointer;
  font-size: 12px;
  color: #94A3B8;
}

.logout-link:hover {
  color: #EF4444;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 20px 28px;
  overflow-y: auto;
  max-width: 1400px;
  margin: 0 auto;
}

/* Banner */
.car-banner {
  background: linear-gradient(135deg, #162444 0%, #1F3666 100%);
  border-radius: 18px;
  padding: 28px 32px 20px 32px;
  color: #FFFFFF;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.banner-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.model-title {
  font-size: 14px;
  font-weight: 500;
  color: #93C5FD;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.range-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.range-val {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}

.range-unit {
  font-size: 18px;
  font-weight: 600;
  color: #93C5FD;
}

.tags-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-chip {
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.tag-soc {
  background: #2563EB;
}

.status-subtitle {
  font-size: 12px;
  color: #94A3B8;
}

.status-online {
  color: #10B981;
  font-weight: 600;
}

.status-offline {
  color: #F87171;
  font-weight: 600;
}

.car-illustration {
  width: 240px;
  height: 90px;
}

.car-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Controls Toolbar */
.controls-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
}

.action-btn {
  background: #FFFFFF;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.action-btn:active {
  transform: translateY(0);
}

.action-wake {
  background: #3B82F6;
  color: white;
}

.action-wake .btn-text {
  color: white;
}

.btn-icon {
  font-size: 18px;
  margin-bottom: 4px;
}

.btn-text {
  font-size: 11px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
}

/* Widgets Section */
.widgets-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  letter-spacing: 0.8px;
  margin-top: 6px;
  margin-bottom: -6px;
}

.grid-row {
  display: grid;
  gap: 16px;
}

.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Card */
.card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-header {
  margin-bottom: 8px;
}

.card-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
}

.card-big-value {
  font-size: 28px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 10px;
}

.card-big-value .unit {
  font-size: 14px;
  font-weight: 600;
  color: #64748B;
  margin-left: 4px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: #E2E8F0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  background-color: #10B981;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.fill-fuel {
  background-color: #F59E0B;
}

.card-footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.footer-label {
  color: #64748B;
}

.badge-pill {
  background-color: #F1F5F9;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  color: #1E293B;
}

.badge-orange {
  background-color: #FEF3C7;
  color: #D97706;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
}

.badge-success {
  background-color: #D1FAE5;
  color: #059669;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}

.dual-stat-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #F1F5F9;
  padding-top: 10px;
  font-size: 12px;
}

.stat-col {
  display: flex;
  flex-direction: column;
}

.stat-prefix {
  color: #64748B;
  font-size: 11px;
}

.stat-val {
  font-weight: 700;
  color: #1E293B;
  margin-top: 2px;
}

.card-action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.in-tank-text {
  font-size: 12px;
  color: #64748B;
}

.card-mini-btn {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.card-mini-btn:hover {
  background: #DBEAFE;
}

.card-sub-info {
  font-size: 12px;
  color: #64748B;
}

/* Strips Group */
.strips-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.strip-item {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.strip-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.strip-icon {
  font-size: 20px;
}

.strip-title {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
}

.strip-desc {
  font-size: 12px;
  color: #64748B;
  margin-top: 2px;
}

.strip-action-btn {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #1E293B;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.strip-action-btn:hover {
  background: #E2E8F0;
}

.strip-action-btn.active {
  background: #10B981;
  color: white;
  border-color: #10B981;
}

.temp-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}

.step-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  cursor: pointer;
  font-weight: 700;
}

.temp-val {
  font-weight: 700;
  font-size: 14px;
}

.chevron {
  font-size: 18px;
  color: #94A3B8;
}

/* Map Widget */
.map-strip-container {
  background: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.map-strip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #F1F5F9;
}

.map-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-header-right {
  font-size: 12px;
  color: #64748B;
}

.car-map-view {
  width: 100%;
  height: 260px;
}

/* Events Log */
.events-card {
  max-height: 200px;
  overflow-y: auto;
  padding: 14px;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-row {
  display: flex;
  gap: 12px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #F8FAFC;
}

.event-time {
  color: #94A3B8;
  font-family: monospace;
}

.event-title {
  color: #334155;
  font-weight: 500;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1E293B;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* Responsive */
@media (max-width: 900px) {
  .cols-3 {
    grid-template-columns: 1fr;
  }
  .cols-2 {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.25s ease;
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  background: #FFFFFF;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 32px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.login-logo {
  font-size: 16px;
  font-weight: 700;
  color: #2563EB;
  margin-bottom: 6px;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
}

.login-sub {
  font-size: 13px;
  color: #64748B;
  margin-top: 4px;
  margin-bottom: 24px;
}

.btn-hello {
  width: 100%;
  background: #0078D4;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.35);
  transition: all 0.2s ease;
}

.btn-hello:hover {
  background: #106EBE;
  transform: translateY(-1px);
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #E2E8F0;
}

.login-divider span {
  padding: 0 12px;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #2563EB;
}

.btn-primary-login {
  width: 100%;
  background: #0F172A;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary-login:hover {
  background: #1E293B;
}

.login-error {
  margin-top: 14px;
  padding: 8px;
  background: #FEE2E2;
  color: #B91C1C;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.login-error.hidden {
  display: none;
}

.login-hint {
  margin-top: 18px;
  font-size: 11px;
  color: #94A3B8;
}

.login-hint code {
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #334155;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #94A3B8;
}

.setting-item h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.setting-item p {
  font-size: 12px;
  color: #64748B;
  line-height: 1.4;
  margin-bottom: 10px;
}

.btn-setup-hello {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-setup-hello:hover {
  background: #DBEAFE;
}

.input-text {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
}

.btn-action-pass {
  background: #0F172A;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.webauthn-status {
  font-size: 12px;
  margin-top: 8px;
  font-weight: 500;
}

/* ==================== LOGIN FULLSCREEN VIEW ==================== */
.login-page {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, #1E3A8A 0%, #0F172A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.login-page.hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

.login-links {
  margin-top: 16px;
  font-size: 13px;
}

.login-links a {
  color: #2563EB;
  text-decoration: none;
  font-weight: 500;
}

.login-links a:hover {
  text-decoration: underline;
}

/* ==================== TABS & PANES ==================== */
.tab-pane {
  display: block;
}

.tab-pane.hidden {
  display: none !important;
}

.tab-header {
  margin-bottom: 20px;
}

.tab-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0F172A;
}

.tab-subtitle {
  font-size: 13px;
  color: #64748B;
  margin-top: 4px;
}

/* ==================== WINTER PACKAGE CONTROLS ==================== */
.winter-card {
  margin-bottom: 24px;
}

.winter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  padding: 4px 0;
}

.winter-control {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.winter-control:hover {
  border-color: #CBD5E1;
  background: #F1F5F9;
}

.winter-control .control-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.winter-control .control-icon {
  font-size: 18px;
}

.winter-control .control-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.level-selector {
  display: flex;
  background: #E2E8F0;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.level-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.level-btn:hover {
  color: #0F172A;
}

.level-btn.active {
  background: #FFFFFF;
  color: #2563EB;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  font-weight: 700;
}

.level-btn.active-heat-1 {
  background: #FEF3C7;
  color: #B45309;
}

.level-btn.active-heat-2 {
  background: #FED7AA;
  color: #C2410C;
}

.level-btn.active-heat-3 {
  background: #FEE2E2;
  color: #B91C1C;
}

.toggle-btn {
  width: 100%;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.toggle-btn:hover {
  border-color: #94A3B8;
}

.toggle-btn.active {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #1D4ED8;
  box-shadow: 0 0 0 1px #3B82F6;
}

.toggle-btn.active-heat {
  background: #FEF2F2;
  border-color: #EF4444;
  color: #B91C1C;
  box-shadow: 0 0 0 1px #EF4444;
}

/* ==================== CHARTS & MOCKUPS ==================== */
.chart-mock {
  padding: 16px 0 8px 0;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  height: 140px;
  gap: 12px;
  padding: 0 8px 12px 8px;
  border-bottom: 1px solid #E2E8F0;
}

.c-bar {
  flex: 1;
  background: #93C5FD;
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 6px;
  transition: height 0.3s ease;
  min-height: 24px;
}

.c-bar span {
  font-size: 10px;
  font-weight: 700;
  color: #1E3A8A;
}

.c-bar.bar-volt {
  background: #FED7AA;
}

.c-bar.bar-volt span {
  color: #9A3412;
}

.c-bar.bar-active {
  background: #2563EB;
}

.c-bar.bar-active span {
  color: #FFFFFF;
}

.chart-legend {
  font-size: 11px;
  color: #64748B;
  margin-top: 10px;
  text-align: center;
}

/* ==================== GARAGE & SPECS ==================== */
.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13px;
  color: #475569;
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-row b {
  color: #0F172A;
}

/* ==================== EVENTS LIST ==================== */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
}

.event-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #F8FAFC;
  font-size: 13px;
  border: 1px solid #F1F5F9;
}

.event-time {
  font-family: monospace;
  font-size: 12px;
  color: #64748B;
  min-width: 65px;
}

.event-title {
  color: #1E293B;
}

.clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable:hover {
  background-color: #F8FAFC;
}

.strip-action-btn.active {
  background: #EF4444;
  color: #FFFFFF;
}


