:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --yellow: #facc15;
  --yellow-hover: #eab308;
  --green: #10b981;
  --red: #ef4444;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top center, #fef9c3 0%, var(--bg) 38%);
  color: var(--ink);
  min-height: 100vh;
  padding: 20px 16px 40px;
}

.hidden { display: none !important; }

.app-shell {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-shell.admin-shell {
  max-width: 860px;
}

/* TOPBAR */
.topbar {
  background: #0f172a;
  color: #ffffff;
  border-radius: 18px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  letter-spacing: 0.4px;
}

.taxi-tag {
  background: var(--yellow);
  color: #0f172a;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 8px;
}

.balance-chip {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fde047;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 99px;
}

/* CARDS */
.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-panel.auth-narrow {
  max-width: 440px;
  width: 100%;
  margin: 28px auto 0;
}

.card-panel.ride-panel {
  padding: 0;
  overflow: hidden;
  gap: 0;
}

.panel-head h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--ink);
}

.panel-head p {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

/* FORM FIELDS & BUTTONS */
.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.req { color: var(--red); }

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

input:focus,
select:focus {
  border-color: #0f172a;
  background: #ffffff;
}

.action-row {
  display: flex;
  gap: 10px;
}

.btn-primary,
.btn-secondary,
.btn-cancel,
.btn-cancel-soft,
.btn-mini {
  border: none;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
}

.btn-primary {
  flex: 1;
  padding: 13px 18px;
  font-size: 14.5px;
  background: var(--yellow);
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(250, 204, 21, 0.35);
}

.btn-primary:hover:not(:disabled) { background: var(--yellow-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  flex: 1;
  padding: 13px 16px;
  font-size: 14px;
  background: #0f172a;
  color: #ffffff;
}

.btn-secondary:hover:not(:disabled) { background: #1e293b; }

.btn-cancel,
.btn-cancel-soft {
  padding: 13px 16px;
  font-size: 13.5px;
  background: #fee2e2;
  color: #b91c1c;
}

.btn-mini {
  padding: 9px 14px;
  font-size: 12.5px;
  background: #e2e8f0;
  color: #0f172a;
  white-space: nowrap;
}

.btn-mini:hover { background: #cbd5e1; }

/* HARİTA & TAKSİ EKRANI */
.map-frame {
  position: relative;
  height: 280px;
  width: 100%;
  background: #e2e8f0;
}

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

.map-float-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.passenger-pill,
.float-btn {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
}

.passenger-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 72%;
}

.passenger-pill span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  flex-shrink: 0;
}

.float-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.map-float-bottom {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  padding: 5px;
  border-radius: 99px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

.mode-pill {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
}

.mode-pill.active {
  background: #0f172a;
  color: #ffffff;
}

.mode-pill.gps-pill {
  background: var(--yellow);
  color: #0f172a;
}

.ride-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.promo-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 13px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 12.5px;
  font-weight: 700;
}

.promo-status-bar.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.promo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.route-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  gap: 10px;
}

.route-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.addr-row {
  display: flex;
  gap: 8px;
}

.coords-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.coords-mini input {
  padding: 7px 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.search-dropdown {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 170px;
  overflow-y: auto;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.search-item {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-item:hover { background: #f8fafc; }
.search-item strong { font-size: 13px; }
.search-item span { font-size: 11.5px; color: var(--muted); }

.payment-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-head {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payment-row {
  display: flex;
  gap: 8px;
}

.card-add-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.card-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.ride-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.vehicles-wrap.collapsed { display: none; }

.vehicles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vehicle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.vehicle-card:hover { border-color: #94a3b8; }
.vehicle-card.selected {
  border-color: #0f172a;
  background: #fefce8;
}

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

.taxi-svg { width: 42px; height: 26px; flex-shrink: 0; }

.vehicle-left strong { display: block; font-size: 14px; }
.vehicle-left span { font-size: 11.5px; color: var(--muted); }
.vehicle-price { font-size: 14.5px; font-weight: 800; color: #0f172a; white-space: nowrap; }

.selected-vehicle-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fefce8;
  border: 1.5px solid var(--yellow);
}

.selected-vehicle-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.selected-vehicle-info strong { display: block; font-size: 14px; }
.selected-vehicle-info span { font-size: 12px; color: #475569; }

.trip-card {
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 15px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trip-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: #059669;
  letter-spacing: 0.6px;
}

.trip-top h3 { font-size: 16px; margin-top: 2px; }

.plate-badge {
  position: relative;
  padding: 5px 10px 5px 28px;
  border-radius: 8px;
  border: 2px solid #0f172a;
  background: #ffffff;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.6px;
}

.plate-badge::before {
  content: "TR";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 22px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.driver-meta { font-size: 13px; color: #334155; line-height: 1.6; }
.trip-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* TAKSİ FİYATLARI YÜKLENİYOR ANİMASYONU */
.fare-loader-wrap { display: flex; flex-direction: column; gap: 10px; }

.fare-loader-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fare-loader-top { display: flex; align-items: center; justify-content: space-between; }
.fare-loader-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 800; color: #fde047; }

.fare-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(253, 224, 71, 0.25);
  border-top-color: #fde047;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.fare-road {
  position: relative;
  height: 28px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.fare-road::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.28) 0 10px, transparent 10px 20px);
  transform: translateY(-50%);
}

.fare-road-taxi {
  position: absolute;
  left: -48px;
  display: flex;
  align-items: center;
  animation: taxiDrive 1.65s ease-in-out infinite;
}

@keyframes taxiDrive {
  0% { left: -46px; }
  100% { left: calc(100% + 10px); }
}

.fare-skeleton-card {
  height: 62px;
  border-radius: 14px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.fare-skel-left { display: flex; align-items: center; gap: 10px; }
.fare-skel-dot { width: 38px; height: 24px; border-radius: 8px; background: rgba(203, 213, 225, 0.75); }
.fare-skel-lines { display: flex; flex-direction: column; gap: 6px; }
.fare-skel-line { height: 10px; border-radius: 6px; background: rgba(203, 213, 225, 0.8); }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.vehicle-card.reveal { animation: fadeSlideIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 3D HARİTA TAKSİ İKONU */
.taxi-3d-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.taxi-3d-pulse {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(250, 204, 21, 0.35);
  border: 2px solid rgba(234, 179, 8, 0.8);
  animation: taxiRadar 1.8s ease-out infinite;
}

@keyframes taxiRadar {
  0% { transform: scale(0.65); opacity: 0.95; }
  100% { transform: scale(1.45); opacity: 0; }
}

.taxi-3d-svg {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
  transform: perspective(220px) rotateX(18deg);
}

.taxi-3d-label {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: #0f172a;
  color: #fde047;
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1.5px solid #fde047;
  white-space: nowrap;
}

/* ADMIN DASHBOARD */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  align-items: start;
}

.stock-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 99px;
  background: #dcfce7;
  color: #166534;
}

.stock-badge.empty {
  background: #fee2e2;
  color: #991b1b;
}

.stock-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 440px;
  overflow-y: auto;
}

.stock-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stock-item-meta { display: flex; flex-direction: column; gap: 3px; }
.stock-item-meta strong { font-size: 13.5px; color: var(--ink); }
.stock-item-meta span { font-size: 11.5px; color: var(--muted); }

.status-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 99px;
}

.status-tag.ready { background: #dcfce7; color: #166534; }
.status-tag.claimed { background: #e2e8f0; color: #475569; }

.mini-del-btn {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.prompt-box {
  padding: 12px;
  border-radius: 12px;
  background: #fef9c3;
  border: 1px solid #fde047;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-row { display: flex; gap: 8px; }

.log-mini {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 11px 13px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  max-height: 170px;
  overflow-y: auto;
  line-height: 1.5;
}

.hint { font-size: 13px; color: var(--muted); text-align: center; padding: 14px; }

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 11px 15px;
  border-radius: 12px;
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
}

.toast.error { background: var(--red); }

@media (max-width: 760px) {
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body { padding: 10px 8px 24px; }
  .split-2 { grid-template-columns: 1fr; }
  .map-frame { height: 240px; }
}


/* KART OTOMATİK SİLME BİLDİRİMİ & SÜRÜCÜ SOHBETİ */
.card-auto-notice {
  font-size: 12px;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 8px 11px;
  border-radius: 10px;
}

.btn-del-card {
  background: #fee2e2;
  color: #b91c1c;
}

.chat-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-head {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
}

.chat-messages {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px;
}

.chat-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 8px 0;
}

.chat-msg {
  max-width: 82%;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.35;
  word-break: break-word;
}

.chat-msg.self {
  align-self: flex-end;
  background: #0f172a;
  color: #ffffff;
}

.chat-msg.driver {
  align-self: flex-start;
  background: #fef08a;
  color: #0f172a;
  font-weight: 600;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}
