/* MINI METRO HOME CHARGER INSTALLATION PORTAL — glassmorphism theme */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
body { min-height: 100vh; color: #e5e7eb;
  background: linear-gradient(-45deg, #0f172a, #134e4a, #1e1b4b, #0e7490);
  background-size: 400% 400%; animation: bgShift 18s ease infinite; }
@keyframes bgShift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: rgba(255,255,255,0.09); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
  padding: 32px; width: 100%; max-width: 460px; text-align: center; }
.card h1 { font-size: 20px; margin: 10px 0 4px; color: #fff; }
.card p { color: #cbd5e1; font-size: 14px; }
.brand-logo { width: 76px; height: 76px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }
.role-chips { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:18px; }
.role-chip { padding:7px 14px; border-radius:20px; font-size:12px; background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.16); color:#cbd5e1; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 250px; margin: 14px; padding: 16px; border-radius: 20px; align-self: flex-start;
  background: rgba(15,23,42,0.55); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 12px; }
.sidebar .brand img { width: 40px; height: 40px; }
.sidebar .brand h3 { font-size: 12px; line-height: 1.3; color: #fff; letter-spacing: .3px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; color: #cbd5e1;
  text-decoration: none; border-radius: 12px; cursor: pointer; font-size: 14px; margin-bottom: 4px; }
.sidebar a:hover, .sidebar a.active { background: linear-gradient(135deg,#4f46e5,#0891b2); color: #fff; transform: translateX(2px); }
.sidebar .submenu { margin: 0 0 6px 12px; border-left: 2px solid rgba(255,255,255,.12); padding-left: 8px; }
.sidebar .submenu a { font-size: 13px; padding: 8px 10px; }
.sidebar .group-label { padding: 6px 12px; color: #94a3b8; font-size: 12px; }
.main { flex: 1; padding: 24px; position: relative; overflow-x: auto; }
.main::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.05;
  background: url('../logo.svg') center/380px no-repeat; }
.panel { position: relative; z-index: 1; animation: slideUp .4s ease; }
.panel h2 { color: #fff; margin-bottom: 6px; }
.panel h3 { color: #e2e8f0; margin: 14px 0 8px; }
.section-subtitle { color: #94a3b8; font-size: 13px; margin-bottom: 14px; }

.app.collapsed .sidebar { display: none; }
.nav-toggle { display: none; width: 46px; height: 46px; font-size: 20px; margin-bottom: 14px; border-radius: 14px;
  background: rgba(255,255,255,0.12); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,0.18); color: #fff; cursor: pointer; }
.app.collapsed .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
.top-toggle { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,.18); color:#fff;
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 18px; margin-bottom: 10px; }

input, select, textarea, button { width: 100%; padding: 11px; font-size: 15px; border-radius: 10px; color: #f1f5f9;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); outline: none; }
input::placeholder, textarea::placeholder { color: #94a3b8; }
select option { color: #0f172a; }
.form-row { display: grid; grid-template-columns: 215px 1fr; align-items: center; gap: 10px; margin: 8px 0; }
.form-row label { text-align: right; color: #cbd5e1; font-size: 14px; font-weight: 500; }
.hint { color: #94a3b8; font-size: 12px; }
.link { color: #93c5fd; }
label.chk { display: inline-flex; align-items: center; gap: 8px; width: auto; }
label.chk input { width: auto; }

button.primary, .btn-primary { background: linear-gradient(135deg,#4f46e5,#0891b2); border: none; color: #fff; font-weight: 600; cursor: pointer; transition: transform .15s; }
button.primary:hover, .btn-primary:hover { transform: translateY(-2px); }
.btn-secondary { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color:#e5e7eb; cursor: pointer; }
.btn-analytics { border: none; color: #fff; cursor: pointer; font-weight: 600; }
.powerbi-btn { background: linear-gradient(135deg,#f2c811,#e0a800); color: #1f2937; }
.gemini-btn { background: linear-gradient(135deg,#8b5cf6,#4f46e5); }
button.danger { background: #dc2626; border: none; color: #fff; cursor: pointer; width: auto; padding: 8px 14px; }
button.danger:disabled { background: #6b7280; cursor: not-allowed; opacity: .6; }
button.mini { width: auto; padding: 7px 12px; margin: 2px; background: rgba(255,255,255,.1); cursor: pointer; }
button.mini:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Digit-block inputs (mobile 10 / chassis 5) ===== */
/* .digit-blocks { display: flex; gap: 6px; flex-wrap: wrap; } */
/* ===== Digit-block inputs (mobile 10 / chassis 5) ===== */
.digit-blocks { 
  display: flex; 
  gap: 4px; /* Reduced gap slightly to leave more space for inputs */
  flex-wrap: nowrap; /* Prevents input boxes from dropping into a second row */
  width: 100%; /* Ensures the container utilizes full available width */
}

.digit-blocks input { 
  flex: 1 1 0; /* Flex grow and shrink equally so all 10 fit dynamically */
  min-width: 0; /* Prevents inputs from breaking past container boundaries */
  height: 46px; 
  text-align: center; 
  font-size: 17px; 
  font-weight: 700; 
  border-radius: 8px; 
  padding: 0; 
}
/* .digit-blocks input { width: 38px; height: 46px; text-align: center; font-size: 17px; font-weight: 700; border-radius: 10px; padding: 0; } */
.chassis-blocks { display: flex; gap: 10px; }
.chassis-blocks input { width: 52px; height: 56px; text-align: center; font-size: 22px; font-weight: 700; border-radius: 12px; padding: 0; }

.scope-note { font-size: 12px; margin-top: 4px; }
.scope-note.state { color: #4ade80; }
.scope-note.all { color: #fcd34d; }

.toolbar-row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:10px; }
.toolbar-row input.search { max-width: 360px; }
.toolbar-row button { width:auto; padding:9px 14px; cursor:pointer; }

/* ===== Executive dashboard ===== */
.dash-header-row { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:12px; margin-bottom:14px; }
.live-indicator-box { display:flex; align-items:center; gap:8px; padding:8px 14px; border-radius:20px;
  background: rgba(34,197,94,.12); border:1px solid rgba(34,197,94,.3); }
.pulse-dot { width:9px; height:9px; border-radius:50%; background:#22c55e; animation: pulse 1.8s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.6)} 70%{box-shadow:0 0 0 10px rgba(34,197,94,0)} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }
.timestamp-label { font-size:12px; color:#cbd5e1; }
.dash-toolbar, .analysts-toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:18px; }
.dash-toolbar button { width:auto; padding:9px 14px; cursor:pointer; }
.toolbar-group { display:flex; gap:8px; flex-wrap:wrap; }
.toolbar-group.border-left { padding-left:10px; border-left:1px solid rgba(255,255,255,.15); }

.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
.kpi-grid.core-analytics-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpi, .kpi-card { padding: 18px; border-radius: 16px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 8px 20px rgba(0,0,0,.25); transition: transform .18s; cursor: pointer; }
.kpi:hover, .kpi-card:hover { transform: translateY(-4px); }
.kpi-card { display:flex; gap:14px; align-items:flex-start; }
.kpi-card .kpi-icon { font-size:26px; line-height:1; }
.kpi h3, .kpi-info h3 { font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; font-weight:600; }
.kpi .num, .kpi-info .num { font-size: 30px; font-weight: 700; color: #fff; margin-top: 4px; }
.kpi-card.alert-variant { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.08); }
.trend { font-size:11px; }
.trend.up { color:#4ade80; } .trend.down { color:#fca5a5; } .trend.neutral { color:#94a3b8; }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-grid.professional-chart-layout { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.chart-box { padding: 18px; border-radius: 16px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); }
.chart-box.main-trend { grid-column: 1 / -1; }
.chart-header h3 { font-size: 14px; color: #e2e8f0; margin: 0 0 10px; }
.chart-container { position: relative; height: 260px; }
.chart-container canvas { max-height: 260px; }

.predict-banner { display:flex; flex-wrap:wrap; gap:18px; align-items:center; justify-content:space-between;
  padding:16px 20px; border-radius:16px; margin-bottom:18px;
  background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(6,182,212,.16)); border:1px solid rgba(255,255,255,.16); }
.predict-main { font-size:15px; color:#e5e7eb; }
.predict-main b { color:#fff; font-size:22px; }
.predict-chips { display:flex; gap:10px; flex-wrap:wrap; }
.chip { padding:6px 12px; border-radius:20px; font-size:12px; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.16); }

.sla-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:16px; }
.sla-card { padding:16px; border-radius:14px; text-align:center; cursor:pointer; border:1px solid; }
.sla-card .n { font-size:28px; font-weight:700; color:#fff; }
.sla-card.green { background:rgba(34,197,94,.12); border-color:rgba(34,197,94,.35); }
.sla-card.amber { background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.35); }
.sla-card.red   { background:rgba(239,68,68,.14);  border-color:rgba(239,68,68,.4); }
.sla-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.sla-dot.green{background:#22c55e}.sla-dot.amber{background:#f59e0b}.sla-dot.red{background:#ef4444}
tr.row-red td { background: rgba(239,68,68,.07); }
tr.row-amber td { background: rgba(245,158,11,.06); }

.heatmap { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; }
.heat-cell { padding:12px; border-radius:12px; border:1px solid rgba(255,255,255,.14); color:#fff; }
.heat-cell .c { font-size:12px; opacity:.9; }
.heat-cell .v { font-size:20px; font-weight:700; }

.table-wrap { overflow-x: auto; border-radius: 14px; max-height: 70vh; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; background: rgba(255,255,255,0.05); border-radius: 14px; overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: left; font-size: 13px; white-space: nowrap; color: #e5e7eb; }
th { background: rgba(79,70,229,0.45); color: #fff; position: sticky; top: 0; z-index: 2; }
tr.filter-row th { background: rgba(79,70,229,0.2); padding: 6px 8px; top: 38px; }
tr.filter-row input { padding: 6px 8px; font-size: 12px; }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge.open { background: rgba(22,163,74,.25); color: #4ade80; }
.badge.closed { background: rgba(59,130,246,.25); color: #93c5fd; }
.badge.cancelled { background: rgba(220,38,38,.25); color: #fca5a5; }
.badge.new { background: rgba(245,158,11,.25); color:#fcd34d; }
.badge.reviewed { background: rgba(59,130,246,.25); color:#93c5fd; }
.badge.actioned { background: rgba(22,163,74,.25); color:#4ade80; }
.badge.dp { background: rgba(139,92,246,.25); color:#c4b5fd; }

.dealer-card { text-align: left; padding: 14px 16px; margin-bottom: 10px; border-radius: 14px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); }
.dealer-card b { color: #fff; }

.bell-wrap { position: relative; margin-bottom: 10px; }
#bellBtn { width:auto; padding:9px 14px; cursor:pointer; background:rgba(255,255,255,.1); }
#bellCount { display:none; align-items:center; justify-content:center; min-width:19px; height:19px; padding:0 5px;
  border-radius:10px; background:#ef4444; color:#fff; font-size:11px; font-weight:700; margin-left:6px; }
.bell-panel { position:absolute; z-index:50; top:48px; left:0; width:330px; max-height:420px; overflow-y:auto;
  background:rgba(15,23,42,.98); border:1px solid rgba(255,255,255,.18); border-radius:16px; box-shadow:0 18px 50px rgba(0,0,0,.5); }
.bell-head { display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px solid rgba(255,255,255,.1); }
.bell-head b { color:#fff; font-size:14px; }
.bell-head button { width:auto; padding:5px 10px; font-size:12px; cursor:pointer; }
.notif { padding:12px 14px; border-bottom:1px solid rgba(255,255,255,.07); cursor:pointer; }
.notif:hover { background:rgba(255,255,255,.05); }
.notif.unread { border-left:3px solid #6366f1; background:rgba(99,102,241,.09); }
.notif-title { color:#fff; font-size:13px; font-weight:600; }
.notif-body { color:#cbd5e1; font-size:12px; margin-top:2px; }
.notif-time { color:#94a3b8; font-size:11px; margin-top:4px; }

.toast { position: fixed; top: 20px; right: 20px; background: rgba(220,38,38,.94); color: #fff;
  padding: 15px 22px; border-radius: 12px; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,.4);
  z-index: 9999; max-width: 420px; animation: shake .5s, fadeIn .3s; }
.toast.ok { background: rgba(22,163,74,.94); }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }
@keyframes fadeIn { from{opacity:0;transform:translateY(-10px)} to{opacity:1} }
@keyframes slideUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
.fade-in { animation: fadeIn .4s ease; }

#progressBar { position: fixed; top: 0; left: 0; height: 4px; width: 0;
  background: linear-gradient(90deg,#22c55e,#06b6d4,#6366f1); z-index: 10000; transition: width .2s ease; }
.saving-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 9997; }
.saving-box { background: rgba(20,26,46,.96); border: 1px solid rgba(255,255,255,.18); border-radius: 16px;
  padding: 22px 30px; color: #fff; text-align: center; min-width: 260px; }
.saving-box .track { height: 8px; border-radius: 8px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 12px; }
.saving-box .fill { height: 100%; width: 30%; border-radius: 8px; background: linear-gradient(90deg,#22c55e,#06b6d4,#6366f1); animation: indet 1s ease-in-out infinite; }
@keyframes indet { 0%{margin-left:-30%} 100%{margin-left:100%} }

.popup-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 10001; animation: fadeIn .25s ease; }
.popup { background: rgba(20,26,46,.97); border: 1px solid rgba(255,255,255,.18); border-radius: 20px;
  padding: 30px; text-align: center; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.popup .big { font-size: 46px; margin-bottom: 8px; }
.popup h2 { color: #fff; margin-bottom: 6px; }
.popup p { color: #cbd5e1; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 9998; animation: fadeIn .25s ease; padding: 16px; }
.modal { width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto; padding: 26px; border-radius: 20px;
  background: rgba(20,26,46,0.97); border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal h2 { color: #fff; margin-bottom: 6px; }
.modal .kv { display: grid; grid-template-columns: 165px 1fr; gap: 6px; font-size: 13px; margin: 4px 0; color: #cbd5e1; }
.modal .kv b { color: #fff; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.modal .actions button { width: auto; }
.close-x { float: right; width: auto; background: transparent; border: none; color: #94a3b8; font-size: 22px; cursor: pointer; }

/* ===== Public pages: tracking + 3rd-party portal ===== */
.track-wrap, .tp-wrap { max-width: 700px; margin: 0 auto; padding: 24px 16px; }
.track-card, .tp-card { background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.16); border-radius:20px;
  padding: 26px; backdrop-filter: blur(18px); box-shadow: 0 12px 40px rgba(0,0,0,.35); margin-bottom: 18px; }
.vendor-strip { display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:14px 18px; border-radius:16px; margin-bottom:16px;
  background: linear-gradient(135deg, rgba(34,197,94,.2), rgba(6,182,212,.16)); border:1px solid rgba(255,255,255,.18); }
.vendor-strip .vn { color:#fff; font-weight:700; font-size:16px; }
.vendor-strip .vp { color:#cbd5e1; font-size:14px; }
.vendor-strip a { color:#fff; text-decoration:none; background:rgba(255,255,255,.14); padding:7px 14px; border-radius:20px; font-size:13px; }
.timeline { list-style:none; margin: 22px 0 8px; padding: 0; }
.timeline li { position: relative; padding: 0 0 26px 42px; }
.timeline li::before { content:'✓'; position:absolute; left:0; top:0; width:28px; height:28px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:700;
  background: rgba(255,255,255,.1); color:#64748b; border:1px solid rgba(255,255,255,.2); }
.timeline li::after { content:''; position:absolute; left:13px; top:30px; bottom:0; width:2px; background:rgba(255,255,255,.14); }
.timeline li:last-child::after { display:none; }
.timeline li.done::before { background: linear-gradient(135deg,#22c55e,#0891b2); color:#fff; border-color:transparent; }
.timeline li.done .t-label { color:#fff; font-weight:600; }
.timeline .t-label { color:#94a3b8; }
.timeline .t-time { display:block; font-size:12px; color:#94a3b8; margin-top:2px; }

.back-link { display: inline-block; margin-top: 14px; color: #93c5fd; text-decoration: none; font-size: 14px; }
.hidden { display: none; }

@media (max-width: 980px) { .kpi-grid { grid-template-columns: repeat(2,1fr); } .sla-grid { grid-template-columns:1fr; } }
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; margin: 10px; }
  .chart-grid, .chart-grid.professional-chart-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row label { text-align: left; }
  .modal .kv { grid-template-columns: 1fr; }
  .bell-panel { width: 290px; }
}
@media (max-width: 560px) {
  .digit-blocks { gap: 2px; } /* Shrinks spacing on small screens */
  .digit-blocks input { height: 40px; font-size: 14px; } /* Scales down height/text cleanly */
  .chassis-blocks input { width: 44px; height: 48px; font-size: 18px; }
}

/* Drag and Drop Sidebar Feedback */
#sidebarNavList a[draggable="true"] {
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#sidebarNavList a.dragging {
  opacity: 0.4;
  background: rgba(99, 102, 241, 0.25) !important;
  border: 1px dashed #6366f1;
  cursor: grabbing;
}
