:root {
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --line: #d9e3eb;
  --text: #102233;
  --muted: #6a7886;
  --blue: #1687d9;
  --blue-dark: #075a9b;
  --green: #12875d;
  --green-bg: #e7f7ef;
  --amber: #b76b00;
  --amber-bg: #fff2d8;
  --red: #c73535;
  --red-bg: #ffe9e8;
  --shadow: 0 16px 40px rgba(18, 41, 61, 0.08);
  font-family: "Inter", "Noto Sans Devanagari", "Nirmala UI", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #0d2234;
  color: #eaf4fb;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #d8f1ff;
  color: #08324f;
  font-weight: 800;
}

.brand strong,
.brand span,
.sync-card span,
.sync-card strong,
.sync-card small {
  display: block;
}

.brand span {
  color: #96b4c8;
  font-size: 12px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c9dce8;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover {
  background: #16364f;
  color: #ffffff;
}

.icon {
  width: 22px;
  text-align: center;
  color: #67c4ff;
}

.sync-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.sync-orbit {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(103, 196, 255, 0.25);
  border-top-color: #67c4ff;
  border-radius: 50%;
  animation: spin 4s linear infinite;
  margin-bottom: 14px;
}

.sync-card strong {
  margin: 8px 0 4px;
}

.sync-card small {
  color: #9fb9cb;
  line-height: 1.45;
}

.token-label {
  display: block;
  margin-top: 14px;
  color: #cfe5f4;
  font-size: 12px;
  font-weight: 700;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin: 7px 0 8px;
}

.token-row input {
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
}

.host-select {
  width: 100%;
  height: 34px;
  margin-top: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0 9px;
  font-size: 12px;
}

.host-select option {
  color: #102233;
}

.token-row input::placeholder {
  color: #8daabf;
}

.token-row button {
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: #67c4ff;
  color: #082438;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.docs-link {
  display: inline-block;
  margin-top: 7px;
  color: #9ed8ff;
  font-size: 12px;
  text-decoration: none;
}

.dashboard {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.topbar,
.panel-heading,
.metric-grid,
.workbench,
.lower-grid {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar p,
.panel-heading p,
.metric small,
.live-clock small {
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-button,
.segmented button,
select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
}

.live-clock {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 170px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: center;
  box-shadow: var(--shadow);
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(18, 135, 93, 0.12);
}

.live-clock small {
  grid-column: 2;
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.panel,
.map-panel,
.feed-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.metric {
  padding: 17px;
}

.metric span,
.event small,
.timeline-item small,
.pending-item small {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 6px 0 5px;
  font-size: 28px;
  letter-spacing: 0;
}

.metric.good strong {
  color: var(--green);
}

.metric.warn strong {
  color: var(--amber);
}

.metric.danger strong {
  color: var(--red);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.65fr);
  gap: 18px;
}

.map-panel,
.feed-panel,
.panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  font-size: 17px;
  line-height: 1.25;
}

.panel-heading.compact h2 {
  font-size: 16px;
}

.panel-heading p {
  font-size: 12px;
  margin-top: 4px;
}

.segmented {
  display: flex;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.segmented button {
  border: 0;
  background: transparent;
  height: 30px;
  border-radius: 6px;
  padding: 0 11px;
  font-size: 13px;
}

.segmented button.active {
  background: var(--blue);
  color: #ffffff;
}

.map-canvas {
  min-height: 420px;
  border-radius: 8px;
  border: 1px solid #cfe0eb;
  background:
    linear-gradient(90deg, rgba(22, 135, 217, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(22, 135, 217, 0.06) 1px, transparent 1px),
    #f5fafc;
  background-size: 38px 38px;
  position: relative;
  overflow: hidden;
}

.google-map-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 0;
}

.city-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.35;
  pointer-events: none;
}

.city-lines path {
  fill: none;
  stroke: #9ab6c9;
  stroke-width: 10;
  stroke-linecap: round;
  opacity: 0.75;
}

.geofence {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px dashed rgba(22, 135, 217, 0.46);
  color: var(--blue-dark);
  background: rgba(22, 135, 217, 0.08);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 20px;
  z-index: 2;
  pointer-events: none;
}

.zone-a {
  width: 240px;
  height: 135px;
  left: 10%;
  top: 16%;
}

.zone-b {
  width: 270px;
  height: 155px;
  right: 9%;
  bottom: 15%;
  border-color: rgba(18, 135, 93, 0.5);
  background: rgba(18, 135, 93, 0.08);
  color: var(--green);
}

.vehicle-marker-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.pin {
  position: absolute;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px;
  min-width: 96px;
  min-height: 34px;
  border: 2px solid #ffffff;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(11, 43, 67, 0.28);
  cursor: pointer;
  pointer-events: auto;
  padding: 4px 7px 4px 5px;
}

.pin::after {
  content: attr(data-tanker);
  position: absolute;
  left: 0;
  top: -28px;
  background: #102233;
  color: #ffffff;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.pin:hover::after {
  opacity: 1;
}

.tanker-mini-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: currentColor;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
}

.pin-label {
  color: #ffffff;
  font-size: 12px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.pin-good {
  background: var(--green);
}

.pin-warn {
  background: var(--amber);
}

.pin-danger {
  background: var(--red);
}

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 12px;
  z-index: 4;
}

.live-map-vehicles {
  position: absolute;
  right: 14px;
  top: 14px;
  width: min(250px, calc(100% - 28px));
  max-height: 188px;
  overflow: auto;
  display: grid;
  gap: 6px;
  z-index: 4;
}

.live-map-vehicles button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.live-map-vehicles button.active {
  border-color: var(--blue);
  color: var(--blue-dark);
  box-shadow: 0 0 0 2px rgba(22, 135, 217, 0.15);
}

.live-map-vehicles small {
  color: var(--muted);
  font-weight: 700;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
}

.good-dot {
  background: var(--green);
}

.warn-dot {
  background: var(--amber);
}

.danger-dot {
  background: var(--red);
}

.event-feed,
.shift-cards,
.timeline,
.pending-list {
  display: grid;
  gap: 10px;
}

.event,
.timeline-item,
.pending-item,
.shift-card {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 12px;
}

.event {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
}

.event-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  background: var(--blue);
}

.event strong,
.timeline-item strong,
.pending-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.lower-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 18px;
  min-width: 0;
}

.shift-attendance-panel {
  padding: 16px;
}

.report-date-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.report-date-controls label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.report-date-controls button,
.report-date-controls input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--blue-dark);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.report-date-controls button {
  cursor: pointer;
}

.shift-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.shift-report-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.shift-report-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #081e69;
  color: #ffffff;
  padding: 12px;
}

.shift-report-title strong,
.shift-report-title span {
  display: block;
}

.shift-report-title strong {
  font-size: 18px;
}

.shift-report-title span {
  margin-top: 2px;
  color: #cfe3ff;
  font-size: 12px;
}

.shift-report-title em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.shift-report-card.afternoon .shift-report-title {
  background: #075a9b;
}

.shift-report-card.night .shift-report-title {
  background: #102233;
}

.shift-download-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.shift-download-actions button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--blue-dark);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.shift-download-actions button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.shift-report-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.shift-report-stats span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 8px;
  font-size: 12px;
}

.shift-report-stats b {
  display: block;
  color: var(--text);
  font-size: 20px;
}

.shift-report-table {
  overflow-x: auto;
  background: #ffffff;
}

.shift-report-table table {
  min-width: 640px;
}

.shift-report-table th,
.shift-report-table td {
  padding: 9px 8px;
  font-size: 12px;
}

.shift-report-table thead th {
  background: #081e69;
  color: #ffffff;
}

.marathi-status {
  display: inline-flex;
  justify-content: center;
  min-width: 58px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.marathi-status.on {
  background: var(--green-bg);
  color: var(--green);
}

.marathi-status.off {
  background: var(--red-bg);
  color: var(--red);
}

.marathi-status.pending {
  background: var(--amber-bg);
  color: var(--amber);
}

.shift-report-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.shift-report-footer strong {
  color: #081e69;
}

.table-panel,
.divider-panel {
  min-height: 310px;
}

.shift-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shift-card strong {
  display: block;
  font-size: 24px;
  margin-top: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 11px 9px;
  font-size: 13px;
}

td:first-child {
  min-width: 135px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.status.working {
  background: var(--green-bg);
  color: var(--green);
}

.status.breakdown {
  background: var(--red-bg);
  color: var(--red);
}

.status.incomplete {
  background: var(--amber-bg);
  color: var(--amber);
}

.timeline-item {
  position: relative;
  padding-left: 35px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.pending-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.priority {
  background: var(--red-bg);
  color: var(--red);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 14px;
  }

  .nav-list {
    display: flex;
  }

  .sync-card {
    min-width: 210px;
  }

  .workbench,
  .lower-grid,
  .shift-report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    gap: 14px;
  }

  .brand {
    justify-content: flex-start;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-item {
    width: 100%;
    min-width: 0;
  }

  .sync-card {
    min-width: 0;
  }

  .dashboard {
    padding: 14px;
  }

  .topbar,
  .panel-heading,
  .shift-report-footer,
  .report-date-controls,
  .pending-item {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .shift-cards {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .segmented {
    width: 100%;
  }

  .ghost-button,
  .live-clock,
  .segmented button,
  select {
    width: 100%;
  }

  .map-canvas {
    min-height: 340px;
  }

  h1 {
    font-size: 22px;
  }
}
