@layer base {
  :root { color-scheme: dark; }
  * { box-sizing: border-box; }
  html, body { width: 100%; min-width: 0; max-width: 100%; overflow-x: hidden; }
  body { font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif; min-height: 100dvh; -webkit-text-size-adjust: 100%; }
  button, input, select, textarea { font: inherit; }
  .font-display { font-family: 'Playfair Display', Georgia, serif; }
}

@layer components {
  .sidebar { background-image: linear-gradient(180deg, rgba(255,255,255,.018), transparent 32%); }
  .brand-mark { position: relative; overflow: hidden; border: 1px solid rgba(234,185,79,.24); box-shadow: 0 8px 24px rgba(0,0,0,.24); }
  .brand-mark img { position: relative; z-index: 1; display: block; opacity: 1; }
  .brand-mark::after { content: ''; position: absolute; z-index: 2; pointer-events: none; width: 80%; height: 40%; left: 6%; top: -12%; transform: rotate(-35deg); background: rgba(255,255,255,.16); filter: blur(10px); }
  .nav-item { display: flex; width: 100%; align-items: center; gap: .75rem; border-radius: .9rem; padding: .75rem; color: #8d8b87; font-size: .875rem; font-weight: 600; text-align: left; transition: background .2s, color .2s; }
  .nav-item:hover { background: rgba(255,255,255,.045); color: #e7e5e4; }
  .nav-active { background: rgba(234,185,79,.10); box-shadow: inset 0 0 0 1px rgba(234,185,79,.12); color: #f9dc8a; }
  .mobile-tab { flex: 1; border-radius: .75rem; padding: .65rem .85rem; color: #9e9b97; font-size: .8125rem; font-weight: 700; transition: .2s; }
  .mobile-tab.is-active { background: #292825; color: #f9dc8a; box-shadow: 0 4px 16px rgba(0,0,0,.16); }
  .eyebrow { display: flex; align-items: center; gap: .5rem; color: #eab94f; font-size: .6875rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
  .eyebrow span { width: 1.5rem; height: 1px; background: currentColor; opacity: .8; }
  .field-label { display: block; color: #aaa7a1; font-size: .75rem; font-weight: 700; letter-spacing: .01em; }
  .input-wrap { position: relative; display: block; margin-top: .5rem; }
  .input-icon { position: absolute; z-index: 1; left: .85rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); fill: none; stroke: #827d74; pointer-events: none; }
  .input-suffix { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); color: #827d74; font-size: .75rem; font-weight: 700; pointer-events: none; }
  input, select, textarea { width: 100%; border: 1px solid rgba(255,255,255,.09); border-radius: .85rem; background: rgba(255,255,255,.035); color: #f5f5f4; outline: none; transition: border-color .2s, background .2s, box-shadow .2s; }
  input, select { height: 3rem; padding: 0 .85rem 0 2.65rem; font-size: .875rem; }
  #distance { padding-right: 2.45rem; }
  input::placeholder, textarea::placeholder { color: #68655f; }
  input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.15); }
  input:focus, select:focus, textarea:focus { border-color: rgba(234,185,79,.6); background: rgba(234,185,79,.035); box-shadow: 0 0 0 3px rgba(234,185,79,.10); }
  input[type='date'], input[type='time'] { color-scheme: dark; }
  select { appearance: none; cursor: pointer; }
  textarea { min-height: 10rem; padding: .85rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; line-height: 1.5; }
  .stat-card { position: relative; overflow: hidden; min-height: 116px; border: 1px solid rgba(255,255,255,.07); border-radius: 1.25rem; padding: 1.05rem 1.15rem; background: rgba(255,255,255,.027); }
  .stat-card::after { content: ''; position: absolute; right: -1rem; top: -1rem; width: 4rem; height: 4rem; border-radius: 50%; background: rgba(234,185,79,.035); filter: blur(12px); }
  .stat-label { display: block; color: #88847e; font-size: .6875rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .stat-value { position: relative; z-index: 1; margin-top: .6rem; font-family: 'Playfair Display', Georgia, serif; font-size: 1.85rem; font-weight: 700; line-height: 1; }
  .stat-sub { display: block; margin-top: .45rem; color: #706d68; font-size: .6875rem; }
  .ride-card { padding: 1.25rem; transition: background .2s; }
  .ride-card:hover { background: rgba(255,255,255,.018); }
  .route-dot { position: relative; width: .8rem; flex: 0 0 .8rem; }
  .route-dot::before { content: ''; display: block; width: .55rem; height: .55rem; margin-left: .12rem; border: 1.5px solid #eab94f; border-radius: 50%; }
  .route-dot::after { content: ''; position: absolute; top: .75rem; bottom: -.75rem; left: .38rem; border-left: 1px dashed rgba(255,255,255,.18); }
  .route-dot.end::before { border-color: #f5f5f4; background: #f5f5f4; }
  .route-dot.end::after { display: none; }
  .status-pill { display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px; padding: .35rem .6rem; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  .status-pending { background: rgba(251,191,36,.10); color: #fcd34d; box-shadow: inset 0 0 0 1px rgba(251,191,36,.15); }
  .status-accepted { background: rgba(52,211,153,.09); color: #6ee7b7; box-shadow: inset 0 0 0 1px rgba(52,211,153,.15); }
  .status-cancelled { background: rgba(248,113,113,.09); color: #fca5a5; box-shadow: inset 0 0 0 1px rgba(248,113,113,.15); }
  .status-completed { background: rgba(56,189,248,.10); color: #7dd3fc; box-shadow: inset 0 0 0 1px rgba(56,189,248,.16); }
  .status-dot { width: .36rem; height: .36rem; border-radius: 50%; background: currentColor; }
  .modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 1.25rem; background: rgba(7,7,6,.74); backdrop-filter: blur(8px); }
  .modal-card { position: relative; width: min(100%, 36rem); border: 1px solid rgba(255,255,255,.11); border-radius: 1.5rem; padding: 1.5rem; background: #1b1b19; box-shadow: 0 26px 80px rgba(0,0,0,.55); }
  .toast { position: fixed; z-index: 60; left: 50%; bottom: 1.25rem; display: flex; width: calc(100% - 2rem); max-width: 25rem; align-items: center; gap: .75rem; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.11); border-radius: 1rem; padding: .75rem; background: #242320; box-shadow: 0 20px 50px rgba(0,0,0,.42); animation: toast-in .32s ease-out; }
  .animate-in { animation: view-in .36s ease-out both; }
  .animate-pop { animation: pop-in .24s ease-out both; }
}

@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 640px) { .ride-card { padding: 1.5rem 1.75rem; } .modal-card { padding: 1.75rem; } }
@media (max-width: 639px) {
  *, *::before, *::after { min-width: 0; }
  .app-shell, main, section, form, aside, .ride-card { min-width: 0; max-width: 100%; width: 100%; }
  main { overflow: visible !important; }
  body { overflow-x: hidden; }
  header { flex-wrap: wrap; gap: .75rem; padding: .8rem .85rem 1rem !important; }
  header > div { min-width: 0; max-width: 100%; }
  header > div:last-child { margin-left: auto; }
  main > .relative.z-10 { padding: 0 .85rem 1.5rem !important; }
  .mobile-tab { padding: .55rem .65rem; font-size: .75rem; }
  .app-view > .mb-8 { margin-bottom: 1rem !important; }
  .app-view h1 { font-size: 2rem !important; line-height: 1.08 !important; }
  .app-view h2 { line-height: 1.2; }
  .app-view .mt-4 { margin-top: .65rem !important; }
  .app-view .mb-6 { margin-bottom: .9rem !important; }
  .app-view .p-8, .app-view .p-7, .app-view .p-6 { padding: 1rem !important; }
  .app-view .p-5 { padding: .85rem !important; }
  .app-view .rounded-3xl { border-radius: 1.25rem !important; }
  .app-view .rounded-2xl { border-radius: 1rem !important; }
  .app-view .grid.gap-5 { gap: .8rem !important; }
  .app-view .grid.gap-4 { gap: .7rem !important; }
  .app-view figure img { max-height: 9.5rem; }
  input, select { height: 2.75rem; font-size: .8125rem; }
  button, a { max-width: 100%; overflow-wrap: anywhere; }
  button { min-height: 2.6rem; white-space: normal; }
  .field-label, .input-wrap, input, select, button { max-width: 100%; }
  #vehicle-step button { min-width: 0; }
  #vehicle-step img { flex: 0 0 4.5rem; width: 4.5rem; height: 3.5rem; }
  #vehicle-step span { min-width: 0; overflow-wrap: anywhere; }
  [role='tablist'][aria-label='Status das corridas'] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; overflow: visible; padding: .5rem .5rem 0; }
  [role='tablist'][aria-label='Status das corridas'] [data-ride-tab] { min-width: 0; width: 100%; padding: .55rem .3rem; line-height: 1.2; overflow-wrap: anywhere; text-align: center; white-space: normal; }
  .ride-card p.truncate, #driver-calendar p.truncate, #customer-history p.truncate { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .ride-card .shrink-0, #driver-calendar .shrink-0, #customer-history .shrink-0 { max-width: 100%; }
  #driver-calendar > section, #driver-calendar article, #customers-list > article { min-width: 0; max-width: 100%; }
  #driver-calendar input[type='date'] { width: min(100%, 11rem); max-width: 100%; min-width: 0; }
  .status-pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  #customer-live-map { width: 100%; max-width: 100%; max-height: 42vh; }
  #customer-live-map { height: 210px; min-height: 210px; border-radius: .75rem; overflow: hidden; touch-action: none; }
  .live-map-shell { height: 190px; }
  #customer-live-tracking { margin-top: 1rem !important; padding: .75rem !important; }
  #customer-live-tracking .mt-3 { margin-top: .65rem !important; }
  #customer-live-tracking .p-2 { padding: .35rem !important; }
  #customer-live-tracking .text-sm { font-size: .875rem !important; }
  .toast { bottom: calc(1rem + env(safe-area-inset-bottom)); }
}
.live-map-shell { position: relative; height: 280px; width: 100%; max-width: 100%; overflow: hidden; border-radius: .75rem; }
#customer-live-map { width: 100%; max-width: 100%; height: 100%; min-height: 0; overflow: hidden; touch-action: none; }
.leaflet-container { width: 100%; height: 100%; background: #dfe9e5; font: 11px/1.3 "DM Sans", sans-serif; }
.leaflet-control-zoom a { color: #18332d !important; }
.live-map-car-icon, .live-map-pickup-icon, .live-map-destination-icon { background: transparent; border: 0; }
.live-map-car-icon span { display: grid; place-items: center; width: 30px; height: 30px; border: 3px solid #ecfdf5; border-radius: 50%; background: #10b981; color: white; box-shadow: 0 0 0 7px rgba(16,185,129,.25), 0 2px 8px rgba(0,0,0,.35); font-size: 14px; }
.live-map-pickup-icon span, .live-map-destination-icon span { display: block; width: 16px; height: 16px; border: 3px solid white; border-radius: 50%; background: #eab94f; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.live-map-destination-icon span { background: #ef4444; }
.map-loading-fallback { display: grid; place-content: center; height: 100%; padding: 1rem; text-align: center; background: linear-gradient(135deg,#19302d,#10211f); color: #d1fae5; font-size: .8rem; line-height: 1.5; }
.map-loading-fallback span { color: #9ca3af; font-size: .7rem; }
.live-map-center { position: absolute; top: .55rem; right: .55rem; z-index: 1000; min-height: 0; border: 1px solid rgba(16,185,129,.28); border-radius: .65rem; background: rgba(10,30,27,.9); padding: .45rem .6rem; color: #a7f3d0; font: 700 10px/1.2 "DM Sans", sans-serif; box-shadow: 0 4px 14px rgba(0,0,0,.25); backdrop-filter: blur(8px); }
.live-map-center:hover { background: rgba(16,185,129,.2); color: #ecfdf5; }
@media (max-width: 639px) {
  .live-map-shell { height: 210px; max-width: 100%; }
  #customer-live-map { height: 210px; min-height: 210px; max-height: none; width: 100%; max-width: 100%; }
  .live-map-center { top: .45rem; right: .45rem; padding: .4rem .5rem; font-size: 9px; }
}
.section-kicker { color: #d8a940; font-size: .64rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.booking-choice-group { min-width: 0; }
#booking-form.is-vehicle-step > :first-child { display: none; }
#booking-form.is-vehicle-step > .grid { display: block; }
#booking-form.is-vehicle-step > .grid > *:not(#vehicle-step):not(#disposal-hours-field):not(#distance) { display: none !important; }
#booking-form.is-vehicle-step #vehicle-step { display: block !important; }
.booking-option-grid, .booking-vehicle-grid { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.booking-option-card, .booking-vehicle-card { display: flex; min-width: 0; width: 100%; align-items: center; gap: .8rem; border: 1px solid rgba(255,255,255,.09); border-radius: .9rem; padding: .72rem .8rem; background: rgba(0,0,0,.16); color: #d6d3d1; text-align: left; transition: border-color .2s, background .2s, box-shadow .2s, transform .2s; }
.booking-option-card:hover, .booking-vehicle-card:hover { border-color: rgba(234,185,79,.4); background: rgba(234,185,79,.06); }
.booking-option-card.is-selected, .booking-vehicle-card.is-selected { border-color: rgba(234,185,79,.72); background: rgba(234,185,79,.10); box-shadow: inset 0 0 0 1px rgba(234,185,79,.15), 0 8px 22px rgba(0,0,0,.16); }
.booking-option-card:active, .booking-vehicle-card:active { transform: translateY(1px); }
.booking-option-card strong, .booking-vehicle-card strong { display: block; color: #fff; font-size: .78rem; line-height: 1.25; }
.booking-option-card small, .booking-vehicle-card small { display: block; margin-top: .3rem; color: #9c9891; font-size: .67rem; line-height: 1.4; }
.booking-option-icon { display: grid; flex: 0 0 1.8rem; height: 1.8rem; place-items: center; border-radius: .6rem; background: rgba(234,185,79,.12); color: #f9dc8a; font-size: .95rem; font-weight: 800; }
.booking-vehicle-card img { width: 5.25rem; height: 3.4rem; flex: 0 0 5.25rem; border-radius: .65rem; object-fit: cover; object-position: center; filter: brightness(.72) contrast(1.12); }
.booking-vehicle-card em { display: block; margin: 0 0 0 auto; color: #f9dc8a; font-size: .92rem; font-style: normal; font-weight: 800; white-space: nowrap; }
.booking-card-check { display: grid; width: 1.15rem; height: 1.15rem; flex: 0 0 1.15rem; margin-left: auto; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; color: transparent; font-size: .65rem; }
.booking-vehicle-card.is-selected .booking-card-check { border-color: #eab94f; background: #eab94f; color: #21190b; }
.request-tab { min-height: 0; border-radius: 999px; background: transparent; transition: background .2s, color .2s, box-shadow .2s; }
.request-tab.is-active { background: #243b72 !important; box-shadow: 0 5px 16px rgba(0,0,0,.22); color: #fff !important; }
@media (max-width: 639px) {
  .booking-option-grid, .booking-vehicle-grid { grid-template-columns: 1fr; gap: .45rem; }
  .booking-option-card, .booking-vehicle-card { padding: .7rem; }
  .booking-vehicle-card img { width: 4.75rem; height: 3.1rem; flex-basis: 4.75rem; }
  .booking-vehicle-card em { font-size: .8rem; }
  #submit-booking { position: sticky; bottom: .75rem; z-index: 5; box-shadow: 0 10px 28px rgba(0,0,0,.4); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
