:root {
  color-scheme: dark;
  --bg: #0f0f10;
  --panel: #1b1b1d;
  --accent: #f4c20d;
  --muted: #9b9b9f;
  --danger: #ff4d4f;
  --success: #2ecc71;
  --border: #2b2b2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: #fff;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #111113;
  border-bottom: 1px solid var(--border);
}

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

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

.profile-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #222;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.profile-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chat-avatar-small {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.chat-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-row.mine {
  flex-direction: row-reverse;
}

.brand {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  height: 28px;
  width: auto;
  display: inline-block;
}

.badge {
  background: var(--danger);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 6px;
}

.pill-button {
  background: var(--panel);
  color: #fff;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.pill-button.primary {
  background: var(--accent);
  color: #111;
  font-weight: 700;
  border: none;
}

.install-btn {
  background: #16a34a;
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 8px 18px;
}

.pill-button.disabled {
  opacity: 0.6;
  cursor: pointer;
}

.container {
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding: 24px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 8px 0;
  color: var(--accent);
}

.tuktuc-title {
  font-size: 42px;
  margin: 6px 0 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.tuktuc-title .tuk {
  color: #f4c20d;
}

.tuktuc-title .tuc {
  color: #ffffff;
}

.hero-taxi {
  width: min(320px, 80vw);
  display: block;
  margin: 8px auto 12px;
}

.footer-brand {
  position: fixed;
  right: 14px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d7d7dc;
  opacity: 0.85;
  z-index: 30;
}

.footer-brand img {
  height: 18px;
  width: auto;
}

.footer-actions {
  position: fixed;
  left: 14px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 30;
}

.suggest-btn {
  background: #2b66f6;
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 12px;
}

.suggestions-card {
  width: min(520px, 92vw);
}

.form {
  display: grid;
  gap: 14px;
}

.input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #121214;
  color: #fff;
}

label {
  font-size: 13px;
  color: var(--muted);
}

.map-wrapper {
  position: relative;
  height: 60vh;
  min-height: 360px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.floating-panel {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(18, 18, 20, 0.95);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  width: min(520px, 90%);
  z-index: 5;
}

.rides-float {
  position: absolute;
  left: 24px;
  top: 24px;
  width: min(420px, 90%);
  background: rgba(18, 18, 20, 0.95);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  z-index: 6;
  max-height: 75%;
  overflow-y: auto;
}

.rides-float-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rides-float-header .badge {
  background: var(--danger);
  color: #fff;
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
}

.rides-float.scrolling {
  animation: rides-scroll 18s linear infinite;
}

@keyframes rides-scroll {
  0% {
    scroll-behavior: auto;
  }
  100% {
    scroll-behavior: auto;
  }
}

.rides-float.hidden {
  display: none;
}

.floating-panel h3 {
  margin: 0 0 8px;
  color: var(--accent);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  background: #141416;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px;
}

.ride-card {
  background: #141416;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 14px;
}

.ride-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.ride-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ride-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2a2a2f;
  border: 2px solid var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
}

.ride-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.ride-name {
  color: var(--accent);
  font-weight: 700;
}

.ride-price {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #101113;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
}

.ride-price img {
  width: 26px;
  height: 26px;
}

.ride-price span {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.ride-price small {
  color: var(--muted);
}

.ride-meta {
  color: #e5e5e8;
  font-size: 13px;
  margin-bottom: 10px;
}

.ride-meta span {
  color: var(--muted);
}

.rounded-alert {
  background: #1b1b1f;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  color: #fff;
}

.modal-card.small {
  width: min(420px, 90vw);
}

.passenger-panel {
  display: grid;
  gap: 12px;
}

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

.btn-orange {
  background: #f4a51c;
  color: #111;
  border: none;
  font-weight: 700;
  min-width: 170px;
}

.btn-green {
  background: #22c55e;
  color: #0b0b0b;
  border: none;
  font-weight: 700;
  min-width: 170px;
}

.avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #222;
}

.avatar-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #101113;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 999px;
}

.price-pill img {
  width: 26px;
  height: 26px;
}

.price-pill span {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.price-pill small {
  color: var(--muted);
}

.neon-clock {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: #0b0b0f;
  border: 1px solid #1f1f2a;
  text-align: center;
  color: #fff;
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.2),
    0 0 25px rgba(255, 255, 255, 0.25),
    inset 0 0 10px rgba(255, 255, 255, 0.08);
}

.neon-clock #clock-time {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.7),
    0 0 14px rgba(255, 255, 255, 0.6);
}

.neon-clock #clock-date {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 2px;
  color: #dfe6ff;
}

.price-row {
  display: grid;
  gap: 10px;
}

.driver-info {
  display: grid;
  gap: 10px;
}

.driver-info .driver-header {
  align-items: center;
}

.driver-rating {
  margin-left: auto;
  text-align: center;
  display: grid;
  gap: 6px;
}

.driver-header.has-yape {
  justify-content: space-between;
  flex-wrap: wrap;
}

.driver-header.has-yape .driver-rating {
  margin-left: 0;
}

.yape-panel {
  display: grid;
  gap: 6px;
  text-align: center;
  min-width: 190px;
}

.yape-title {
  font-weight: 700;
  color: #fff;
}

.yape-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.yape-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.yape-number {
  background: #7b1fa2;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
}

.yape-hint {
  font-size: 12px;
  color: var(--muted);
}

.yape-modal-card {
  width: min(420px, 90vw);
  text-align: center;
}

.yape-modal-content {
  display: grid;
  gap: 12px;
  justify-items: center;
  font-weight: 700;
}

.yape-modal-content img {
  width: 64px;
  height: 64px;
}

.driver-stars {
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 2px;
}

.reviews-card {
  width: min(520px, 90vw);
  max-height: 50vh;
  overflow-y: auto;
}

.reviews-card .modal-header {
  position: sticky;
  top: 0;
  background: #1b1b1f;
  z-index: 2;
  padding-bottom: 10px;
}

.reviews-close {
  background: #ff4d4f;
  color: #ffd400;
  border-radius: 10px;
  padding: 4px 10px;
}

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

.driver-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  overflow: hidden;
  background: #222;
}

.driver-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.driver-title {
  font-weight: 700;
  color: var(--accent);
}

.driver-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}


.ride-card {
  background: #141416;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.ride-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ride-name {
  font-weight: 700;
  color: var(--accent);
}

.ride-price {
  background: #0f0f10;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}

.ride-meta {
  display: grid;
  gap: 6px;
  color: #d7d7da;
  font-size: 13px;
}

.ride-meta span {
  color: #9aa5a9;
  margin-right: 6px;
}

.ride-accept {
  width: 100%;
}

.list-item strong {
  color: var(--accent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-card {
  background: #1b1b1f;
  border-radius: 18px;
  padding: 20px;
  width: min(560px, 95vw);
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table th,
.table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.table img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.quick-access {
  margin-bottom: 16px;
}

.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pill-button.btn-green {
  background: #1aa850;
  border: none;
  color: #fff;
  font-weight: 700;
}

.pill-button.btn-blue {
  background: #2b66f6;
  border: none;
  color: #fff;
  font-weight: 700;
}

.pill-button.btn-purple {
  background: #7b3ff2;
  border: none;
  color: #fff;
  font-weight: 700;
}

.admin-hero {
  margin-bottom: 16px;
}

.admin-hero h2 {
  margin: 0;
  font-size: 22px;
  color: #fff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-card {
  background: #161618;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.dashboard-label {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-value {
  font-size: 22px;
  font-weight: 700;
}

.dashboard-meta {
  font-size: 12px;
}

.dashboard-meta.positive {
  color: #2ecc71;
}

.dashboard-meta.negative {
  color: #ff6b6b;
}

.admin-search {
  min-width: 220px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}

.pagination .page-info {
  color: var(--muted);
  font-size: 13px;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.driver-detail {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.driver-detail-stars {
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 2px;
}

.rating {
  display: flex;
  gap: 6px;
  font-size: 22px;
}

.rating button {
  background: transparent;
  border: none;
  color: #4a4a4f;
  cursor: pointer;
  font-size: 26px;
}

.rating[data-value="1"] button:nth-child(-n + 1),
.rating[data-value="2"] button:nth-child(-n + 2),
.rating[data-value="3"] button:nth-child(-n + 3),
.rating[data-value="4"] button:nth-child(-n + 4),
.rating[data-value="5"] button:nth-child(-n + 5) {
  color: var(--accent);
}

.cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pwa-banner {
  background: #141416;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.hidden {
  display: none;
}

#chat-input {
  border-radius: 999px;
}

.chat-card {
  padding: 0;
  overflow: hidden;
  background: #0b141a;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #202c33;
  border-bottom: 1px solid #1f2b33;
}

.chat-header .close-btn {
  margin-left: auto;
  color: #ff4d4f;
  font-weight: 700;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #3c4b57;
  display: grid;
  place-items: center;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}

.chat-title {
  font-weight: 600;
}

.chat-subtitle {
  font-size: 12px;
  color: #9aa5a9;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
  height: 400px;
  max-height: 400px;
  overflow-y: auto;
}

.chat-message {
  max-width: 78%;
  padding: 8px 10px;
  border-radius: 12px;
  background: #ffffff;
  color: #111;
  align-self: flex-start;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.chat-message.mine {
  background: #d9fdd3;
  align-self: flex-end;
}

.chat-message .sender {
  font-size: 11px;
  color: #5a5a5a;
  margin-bottom: 2px;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #202c33;
  border-top: 1px solid #1f2b33;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: #2a3942;
  color: #fff;
}

.chat-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #00a884;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.chat-emoji {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #2a3942;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}

.emoji-picker {
  position: absolute;
  bottom: 58px;
  left: 12px;
  background: #202c33;
  border: 1px solid #1f2b33;
  border-radius: 12px;
  padding: 10px;
  display: none;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  width: 240px;
  z-index: 10;
}

.emoji-picker.open {
  display: grid;
}

.emoji-picker button {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.chat-form {
  position: relative;
}

.map-icon {
  font-size: 22px;
  line-height: 22px;
}

#map .leaflet-marker-icon {
  background: transparent;
  border: none;
}

.map-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #1b1b1f;
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  z-index: 50;
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .floating-panel {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 14px;
  }
}
