@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #213c3a;
  background: #e5efeb;
  --green: #216a55;
  --green-dark: #164e3e;
  --green-light: #3e8870;
  --green-bg: #eaf3ee;
  --gold: #b38139;
  --gold-bg: #fdf5e8;
  --muted: #758d82;
  --border: rgba(255, 255, 255, 0.85);
  --card-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.45));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 92% 12%, rgba(168, 216, 204, 0.55), transparent 48%),
              radial-gradient(ellipse at 50% 80%, rgba(232, 217, 190, 0.48), transparent 52%),
              #e8efea;
  font-size: 13px;
  line-height: 1.5;
  color: #213c3a;
  min-height: 100vh;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  z-index: -1;
  pointer-events: none;
}
.g1 {
  width: 440px;
  height: 440px;
  background: rgba(143, 201, 183, 0.45);
  top: 4%;
  right: -90px;
}
.g2 {
  width: 500px;
  height: 500px;
  background: rgba(233, 207, 172, 0.35);
  bottom: -120px;
  left: 22%;
}

.glass {
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 14px 40px rgba(51, 92, 75, 0.05), inset 0 1px 1px #fff;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.shell {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  padding: 22px;
  gap: 32px;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 22px;
  height: calc(100vh - 44px);
  border-radius: 24px;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -1px;
  text-decoration: none;
  color: inherit;
  padding: 0 6px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

.brandmark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 44px;
  background: var(--green);
  color: #fff;
  border-radius: 14px;
  font-size: 32px;
  line-height: 1;
}

.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 2px;
}

.navlabel {
  font-size: 9px;
  letter-spacing: 2px;
  color: #8c9c96;
  margin: 32px 10px 14px;
  font-weight: 700;
}

.nav {
  padding: 13px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #557267;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 6px;
  transition: all 0.15s ease;
}

.nav:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--green-dark);
}

.nav.active {
  background: #ffffffd6;
  color: var(--green);
  box-shadow: 0 4px 14px rgba(33, 106, 85, 0.1);
  font-weight: 700;
}

.nav b {
  margin-left: auto;
  font-size: 9px;
  background: #e2efe9;
  padding: 3px 6px;
  border-radius: 6px;
}

.sidebar-bottom {
  margin-top: auto;
}

.side-card {
  background: linear-gradient(155deg, rgba(195, 222, 220, 0.4), rgba(233, 231, 204, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 18px;
  font-size: 11px;
}

.side-card strong {
  display: block;
  color: var(--green-dark);
  font-size: 11px;
  margin-bottom: 4px;
}

.side-card small {
  color: #6a8277;
  font-size: 10px;
  line-height: 1.4;
  display: block;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #216a5518;
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.profile small {
  display: block;
  font-size: 9px;
  color: var(--muted);
}

/* Main */
main {
  min-width: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  margin-bottom: 16px;
}

.breadcrumb {
  font-size: 12px;
  color: #7b8e86;
}

.breadcrumb span {
  padding: 0 10px;
}

.breadcrumb strong {
  color: #214136;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #ffffffa0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: var(--green-dark);
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #2bb673;
  border-radius: 50%;
  box-shadow: 0 0 8px #2bb67380;
}

/* Hero */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 18px 0 26px;
  gap: 20px;
}

.eyebrow {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--green);
  text-transform: uppercase;
}

h1 {
  font-size: 34px;
  line-height: 1.22;
  letter-spacing: -1.4px;
  font-weight: 700;
  margin: 8px 0 10px;
  color: #1a3830;
}

h1 span {
  color: #557d6f;
  font-weight: 600;
}

.hero p {
  color: #688277;
  font-size: 13px;
  margin: 0;
  max-width: 740px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn-action {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #274d3f;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
}

.btn-action:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-action.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green-dark);
}
.btn-action.primary:hover {
  background: var(--green-dark);
}

/* Top KPI Grid */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.kpi-card {
  padding: 20px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.kpi-card small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #728b80;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.kpi-card strong {
  display: block;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -1px;
  line-height: 1.1;
  color: #173b30;
}

.kpi-card .sub {
  display: block;
  font-size: 10px;
  color: var(--green);
  font-weight: 600;
  margin-top: 8px;
}

.kpi-card.highlight {
  background: linear-gradient(135deg, rgba(230, 246, 239, 0.85), rgba(240, 250, 245, 0.6));
  border-color: #8ed3b890;
}
.kpi-card.highlight strong {
  color: var(--green-dark);
}

.kpi-card.gold {
  background: linear-gradient(135deg, rgba(255, 247, 230, 0.85), rgba(255, 252, 245, 0.6));
  border-color: #e5c89890;
}
.kpi-card.gold strong {
  color: #9c6c21;
}

/* Two-column layout */
.layout-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
}

/* Control Panel */
.controls-panel {
  padding: 24px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-head h2 {
  font-size: 15px;
  font-weight: 750;
  margin: 0;
  letter-spacing: -0.3px;
  color: #17382d;
}

.tag-step {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  background: #216a5518;
  color: var(--green);
  padding: 3px 8px;
  border-radius: 6px;
}

.fleet-selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fleet-option {
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s;
}

.fleet-option:hover {
  background: rgba(255, 255, 255, 0.7);
}

.fleet-option.active {
  background: #e7f4ee;
  border-color: #6fb59b;
  box-shadow: inset 0 0 0 1px #6fb59b;
}

.fleet-option strong {
  display: block;
  font-size: 12px;
  color: #1e4235;
}

.fleet-option small {
  display: block;
  font-size: 10px;
  color: #6e867b;
}

.fleet-badge {
  font-size: 10px;
  font-weight: 750;
  background: #ffffffa0;
  padding: 4px 9px;
  border-radius: 8px;
  color: var(--green-dark);
}

.slider-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #496357;
}

.slider-label output {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
}

input[type="range"] {
  width: 100%;
  height: 5px;
  border-radius: 10px;
  appearance: none;
  background: linear-gradient(to right, #408d74 var(--fill, 50%), #d1ded6 var(--fill, 50%));
  cursor: pointer;
  margin: 6px 0;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #327e65;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.range-marks {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #8c9f95;
}

/* Two-column inputs inside controls */
.param-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
}

.input-card label {
  display: block;
  font-size: 10px;
  color: #6c867b;
  margin-bottom: 4px;
}

.input-card input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  color: #1a3c31;
  outline: none;
}

.price-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.price-input-grid .input-card { padding: 9px 10px; }
.price-input-grid .input-card span { display: block; color: #6c867b; font-size: 9px; }
.price-input-grid .input-card input { font-size: 13px; }
.energy-note { margin: -13px 0 0; color: #758d82; font-size: 10px; }
.pnl-model-tabs { display:flex; gap:8px; padding:6px; border:1px solid rgba(255,255,255,.85); border-radius:14px; background:rgba(255,255,255,.5); width:max-content; max-width:100%; }
.pnl-model-tab { border:0; border-radius:10px; padding:10px 18px; background:transparent; color:#5d7569; font:700 12px Manrope,sans-serif; cursor:pointer; }
.pnl-model-tab.active { background:#fff; color:var(--green); box-shadow:0 2px 8px rgba(0,0,0,.06); }
.partner-controls { padding:20px 22px; border-radius:20px; }
.partner-controls[hidden], .partner-table-wrap[hidden] { display:none!important; }
.partner-input-grid { display:grid; grid-template-columns:repeat(4,minmax(130px,1fr)); gap:10px; margin-top:16px; }
.partner-model-switch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:14px 0 4px; }
.partner-model-option { border:1px solid #dce8e1; border-radius:12px; background:rgba(255,255,255,.58); color:#526d60; padding:10px 12px; text-align:left; font:750 12px Manrope,sans-serif; cursor:pointer; }
.partner-model-option small { display:block; margin-top:4px; font-size:10px; font-weight:500; }
.partner-model-option.active { border-color:#408d74; background:#edf6f1; color:#1c664e; box-shadow:0 0 0 1px #408d74 inset; }
.partner-mode-field[hidden] { display:none!important; }
.partner-input-grid .input-card span { display:block; color:#6c867b; font-size:9px; }
.partner-input-grid .input-card input { width:100%; border:0; background:transparent; font-size:13px; font-weight:750; color:#1a3c31; outline:none; }
.partner-input-grid .input-card input[type="range"] { display:block; height:18px; margin:8px 0 0; padding:0; border:0; background:linear-gradient(to right,#408d74 var(--fill,50%),#d1ded6 var(--fill,50%)); cursor:ew-resize; touch-action:pan-y; pointer-events:auto; position:relative; z-index:2; }
.partner-input-grid .input-card input[type="range"]::-webkit-slider-thumb { appearance:none; width:18px; height:18px; border-radius:50%; background:#fff; border:3px solid #327e65; box-shadow:0 2px 6px rgba(0,0,0,.18); }
.partner-input-grid .input-card input[type="range"]::-moz-range-thumb { width:12px; height:12px; border-radius:50%; background:#fff; border:3px solid #327e65; box-shadow:0 2px 6px rgba(0,0,0,.18); }
.partner-margin { margin-top:14px; color:#537365; font-size:11px; font-weight:700; }
@media(max-width:850px){.partner-input-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pnl-model-tabs{width:100%}.pnl-model-tab{flex:1;padding:10px 8px}}
.nav-icon { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 560px) { .price-input-grid { grid-template-columns: 1fr; } }

/* Right Content: Report & Breakdown */
.report-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Period Switcher */
.period-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  padding: 6px;
}

.toggle-group {
  display: flex;
  gap: 4px;
}

.toggle-btn {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  color: #5d7569;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-btn.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.period-note {
  font-size: 11px;
  color: #6a8277;
  padding-right: 10px;
}

/* P&L Statement Table */
.statement-card {
  padding: 24px;
  border-radius: 22px;
}

.statement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.statement-table th {
  text-align: left;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1px;
  color: #7d968b;
  padding: 0 12px 14px;
  border-bottom: 1px solid rgba(190, 214, 203, 0.5);
}

.statement-table th:last-child,
.statement-table td:last-child {
  text-align: right;
}

.statement-table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(220, 235, 227, 0.5);
  color: #27483e;
}

.statement-table tr.group-head td {
  background: rgba(235, 245, 240, 0.6);
  font-weight: 800;
  color: var(--green-dark);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding-top: 10px;
  padding-bottom: 10px;
}

.statement-table tr.highlight-row td {
  font-weight: 750;
  background: rgba(255, 255, 255, 0.5);
}

.statement-table tr.profit-row td {
  background: linear-gradient(90deg, #d8f1e680, #e9f6ef60);
  font-size: 14px;
  font-weight: 800;
  color: var(--green-dark);
  border-top: 2px solid #57a88b;
  border-bottom: 2px solid #57a88b;
}

.statement-table .indent {
  padding-left: 28px;
  color: #557267;
}

.statement-table .dim {
  color: #7b9489;
  font-size: 10px;
}

/* 100d Bar chart */
.bar-visual-card {
  padding: 22px 24px;
  border-radius: 20px;
}

.bar-visual-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.bar-visual-head strong {
  font-size: 13px;
  color: #19382e;
}

.breakdown-bar {
  display: flex;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 14px;
}

.bar-slice {
  height: 100%;
  transition: width 0.3s ease;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 16px;
  font-size: 11px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4a675b;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Time-slot Schedule Cards */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.slot-card {
  padding: 16px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-time {
  font-size: 11px;
  font-weight: 800;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slot-time span {
  background: #216a5518;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9px;
}

.slot-title {
  font-size: 12px;
  font-weight: 700;
  color: #1b3d32;
}

.slot-desc {
  font-size: 10px;
  color: #657e72;
  line-height: 1.4;
  margin: 0;
}

/* Fleet List Accordion / Table */
.fleet-modal-card {
  padding: 24px;
  border-radius: 22px;
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 14px;
}

.vehicle-pill {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 12px;
}

.car-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e7f2ed;
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}

.car-meta strong {
  display: block;
  font-size: 11px;
  color: #193c30;
}

.car-meta span {
  display: block;
  font-size: 10px;
  color: #708a7e;
}

.tag-active {
  margin-left: auto;
  font-size: 9px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 6px;
  background: #2cb47920;
  color: #1d7e52;
}

.tag-standby {
  margin-left: auto;
  font-size: 9px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 6px;
  background: #b5833420;
  color: #946519;
}

/* Print view */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .sidebar, .hero-actions, .period-nav, .glow {
    display: none !important;
  }
  .shell {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .glass {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
  }
  .layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsiveness */
@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 210px 1fr;
    gap: 20px;
  }
  .layout-grid {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 850px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
  .slots-grid {
    grid-template-columns: 1fr;
  }
}

