/* Taxi Waheed App-Plattform – Design-System (dark premium) */
:root {
  --bg: #0b0d12; --bg-2: #10131a; --surface: #151923; --surface-2: #1c2130; --border: #262c3a; --border-2: #323a4d;
  --text: #e8eaf0; --muted: #9aa3b5; --dim: #6b7385;
  --accent: #f5c542; --accent-2: #ffd766; --accent-ink: #14110a;
  --ok: #3ddc84; --warn: #ffb547; --danger: #ff5c5c; --info: #4d9dff;
  --radius: 14px; --radius-s: 10px; --shadow: 0 10px 30px rgba(0,0,0,.45);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body.modal-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 0 0 12px; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 13px; } .tiny { font-size: 12px; } .bold { font-weight: 700; } .accent { color: var(--accent); } .ok { color: var(--ok); } .danger { color: var(--danger); } .warn { color: var(--warn); }
.center { text-align: center; } .right { text-align: right; } .mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .mt-s { margin-top: 8px; } .flex { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; } .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }

/* App-Shell */
.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(11,13,18,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); min-height: 56px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.topbar .brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.topbar .title { font-weight: 700; font-size: 17px; }
.content { flex: 1; padding: 16px; padding-bottom: calc(84px + var(--safe-b)); max-width: 720px; width: 100%; margin: 0 auto; }
.content.wide { max-width: none; }
.content.full { padding: 0; max-width: none; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: rgba(16,19,26,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding-bottom: var(--safe-b); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; color: var(--dim); font-size: 11px; font-weight: 600; position: relative; }
.bottomnav a .ico { font-size: 21px; line-height: 1; }
.bottomnav a.active { color: var(--accent); }
.bottomnav a .dot { position: absolute; top: 6px; right: calc(50% - 16px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }

/* Karten & Sektionen */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.tight { padding: 12px 14px; }
.card.accent { border-color: rgba(245,197,66,.45); box-shadow: 0 0 0 1px rgba(245,197,66,.15), var(--shadow); }
.card.danger-b { border-color: rgba(255,92,92,.5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; }
.hero { padding: 22px 18px; border-radius: 18px; background: linear-gradient(145deg, #1b2030 0%, #12151e 60%, #0f1218 100%); border: 1px solid var(--border-2); position: relative; overflow: hidden; margin-bottom: 16px; }
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(245,197,66,.22), transparent 65%); pointer-events: none; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 12px 14px; }
.stat .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; } .stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .stats.four { grid-template-columns: repeat(2, 1fr); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 13px 18px; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .08s, filter .15s, background .15s; min-height: 48px; text-align: center; }
.btn:active { transform: scale(.985); }
.btn:disabled, .btn.is-busy { opacity: .55; pointer-events: none; }
.btn.is-busy::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary { background: var(--accent); color: var(--accent-ink); } .btn-primary:hover { background: var(--accent-2); }
.btn-ok { background: var(--ok); color: #062512; } .btn-danger { background: var(--danger); color: #fff; } .btn-info { background: var(--info); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-2); } .btn-ghost:hover { border-color: var(--accent); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-block { width: 100%; } .btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; border-radius: 9px; } .btn-lg { padding: 17px 22px; font-size: 17px; min-height: 58px; border-radius: 14px; } .btn-xl { padding: 22px; font-size: 19px; min-height: 72px; border-radius: 16px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; } .btn-row .btn { flex: 1; }
.icon-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; font-size: 16px; }
.fab { position: fixed; right: 16px; bottom: calc(86px + var(--safe-b)); z-index: 25; width: 58px; height: 58px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font-size: 26px; border: 0; box-shadow: var(--shadow); cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 10px 8px; border-radius: 9px; font-weight: 700; font-size: 14px; cursor: pointer; }
.seg button.active { background: var(--accent); color: var(--accent-ink); }

/* Formulare */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.input, select.input, textarea.input { width: 100%; background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text); border-radius: 12px; padding: 13px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 48px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,197,66,.18); }
.input.has-value { border-color: rgba(61,220,132,.5); }
.input.is-busy { background-image: linear-gradient(90deg, transparent, rgba(245,197,66,.18), transparent); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa3b5' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.input { resize: vertical; min-height: 80px; }
.input-icon { position: relative; } .input-icon .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; } .input-icon .input { padding-left: 42px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.stepper { display: flex; align-items: center; gap: 0; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; }
.stepper button { width: 46px; height: 46px; border: 0; background: transparent; color: var(--accent); font-size: 22px; cursor: pointer; } .stepper span { flex: 1; text-align: center; font-weight: 700; }
.error-box { background: rgba(255,92,92,.12); border: 1px solid rgba(255,92,92,.4); color: #ffb3b3; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.info-box { background: rgba(77,157,255,.1); border: 1px solid rgba(77,157,255,.35); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.ok-box { background: rgba(61,220,132,.1); border: 1px solid rgba(61,220,132,.35); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }

/* Autocomplete */
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; max-height: 300px; overflow-y: auto; }
.ac-item { display: flex; gap: 10px; align-items: center; padding: 11px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: 0; } .ac-item.active, .ac-item:hover { background: rgba(245,197,66,.12); }
.ac-ico { width: 24px; text-align: center; } .ac-main { font-weight: 600; font-size: 15px; } .ac-sec { font-size: 12px; color: var(--muted); }

/* Listen */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 12px 14px; cursor: pointer; transition: border-color .15s; }
.item:hover { border-color: var(--border-2); } .item.active { border-color: var(--accent); }
.item .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-size: 18px; flex-shrink: 0; }
.item .body { flex: 1; min-width: 0; } .item .t { font-weight: 700; font-size: 15px; } .item .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item .end { text-align: right; flex-shrink: 0; font-weight: 700; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.badge-ok { background: rgba(61,220,132,.16); color: var(--ok); } .badge-warn { background: rgba(255,181,71,.16); color: var(--warn); } .badge-danger { background: rgba(255,92,92,.16); color: var(--danger); } .badge-info { background: rgba(77,157,255,.16); color: var(--info); } .badge-muted { background: rgba(154,163,181,.16); color: var(--muted); } .badge-accent { background: rgba(245,197,66,.18); color: var(--accent); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.route { display: grid; grid-template-columns: 22px 1fr; gap: 0 12px; }
.route .dot { width: 12px; height: 12px; border-radius: 50%; margin: 6px 5px; } .route .dot.a { background: var(--accent); } .route .dot.b { background: var(--ok); border-radius: 3px; }
.route .line { width: 2px; background: var(--border-2); margin: 0 auto; min-height: 16px; }
.route .addr { font-weight: 600; padding-bottom: 8px; } .route .lbl { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); } .empty .big { font-size: 42px; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 16px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { display: flex; gap: 10px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--border); } .timeline li:last-child { border: 0; } .timeline .t { color: var(--dim); min-width: 92px; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
.big-price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--accent); }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; } .progress > div { height: 100%; background: var(--accent); transition: width 1s linear; }

/* Karte */
.map { width: 100%; height: 260px; background: var(--bg-2); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.map.tall { height: 46vh; min-height: 300px; } .map.full { height: 100%; border: 0; border-radius: 0; }
.map-wrap { position: relative; } .map-overlay { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 5; }
.map-fallback { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; padding: 20px; text-align: center; }

/* Modal / Sheet / Toast */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .2s; }
.modal-overlay.show { opacity: 1; }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow); transform: translateY(12px); transition: transform .2s; }
.modal-overlay.show .modal { transform: none; }
.modal-overlay.sheet { align-items: flex-end; padding: 0; } .modal-overlay.sheet .modal { border-radius: 20px 20px 0 0; max-width: 720px; padding-bottom: var(--safe-b); transform: translateY(40px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0; } .modal-body { padding: 16px 18px 18px; } .modal-text { font-size: 16px; }
#tw-toasts { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(94vw, 460px); pointer-events: none; }
.toast { background: var(--surface-2); border: 1px solid var(--border-2); border-left: 4px solid var(--info); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; transform: translateY(-8px); transition: all .25s; }
.toast.show { opacity: 1; transform: none; } .toast-error { border-left-color: var(--danger); } .toast-ok { border-left-color: var(--ok); } .toast-warn { border-left-color: var(--warn); }
#tw-offline { position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: var(--danger); color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 6px; }

/* Auth-Screen */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 20px; max-width: 440px; margin: 0 auto; }
.auth .logo-big { width: 68px; height: 68px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: 26px; margin-bottom: 18px; box-shadow: 0 12px 40px rgba(245,197,66,.25); }
.auth h1 { font-size: 28px; margin-bottom: 4px; } .auth .sub { color: var(--muted); margin-bottom: 26px; }

/* Tabellen (Portal) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; } .tbl tr:last-child td { border: 0; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: rgba(245,197,66,.05); }
.tbl td.r, .tbl th.r { text-align: right; } .tbl td.nowrap { white-space: nowrap; }

/* Portal-Layout (Desktop mit Sidebar) */
.portal { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex-shrink: 0; background: var(--bg-2); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; padding: 6px 10px 18px; font-size: 16px; }
.sidebar .brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 2px; position: relative; }
.sidebar nav a:hover { background: var(--surface); color: var(--text); } .sidebar nav a.active { background: rgba(245,197,66,.12); color: var(--accent); }
.sidebar nav a .ico { width: 22px; text-align: center; } .sidebar nav a .dot { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.sidebar .foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--dim); }
.portal-main { flex: 1; min-width: 0; padding: 20px 24px 40px; }
.portal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; } .toolbar .input { width: auto; min-width: 140px; min-height: 40px; padding: 8px 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
@media (max-width: 1080px) { .live-grid { grid-template-columns: 1fr; } .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .portal { flex-direction: column; } .sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center; padding: 8px 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); } .sidebar .brand { padding: 0 8px 0 4px; white-space: nowrap; } .sidebar nav { display: flex; gap: 2px; } .sidebar nav a { white-space: nowrap; padding: 8px 10px; font-size: 13px; } .sidebar nav a .ico { display: none; } .sidebar .foot { display: none; } .portal-main { padding: 14px; } .grid2, .grid3 { grid-template-columns: 1fr; } }

/* Balken-Charts (reines CSS) */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 10px; } .bars .bar { flex: 1; background: linear-gradient(180deg, var(--accent), rgba(245,197,66,.4)); border-radius: 4px 4px 0 0; position: relative; min-width: 6px; }
.bars .bar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--dim); } .bars .bar:hover::after { content: attr(data-v); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border-2); padding: 2px 6px; border-radius: 6px; font-size: 11px; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 120px 1fr 80px; align-items: center; gap: 10px; font-size: 13px; padding: 5px 0; } .hbar .track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; } .hbar .track div { height: 100%; background: var(--accent); border-radius: 5px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media print { .topbar, .bottomnav, .sidebar, .fab, #tw-toasts { display: none !important; } body { background: #fff; color: #000; } }
