/* =============================================================
   BLACK PARTNER · APLIKACJA KIEROWCY (mobile, 390px)
   aplikacja-kierowcy.css — samodzielny plik, bez zależności.
   Klasy w stylu BEM: .blok, .blok__element, .blok--wariant
   ============================================================= */

/* ---------- 1. TOKENY ---------- */
:root {
  --bg:        #0b0b10;
  --card:      #13131a;
  --card-2:    #1a1a23;
  --line:      #23232e;
  --line-2:    #2e2e3b;
  --text:      #ececf1;
  --text-2:    #a9a9b6;
  --text-3:    #75757f;
  --accent:    #8b6ee0;
  --accent-bg: #1f1a30;
  --ok:        #5ec48f;
  --ok-bg:     #13241b;
  --danger:    #d9635f;
  --danger-bg: #2a1616;
  --warn:      #cfa14a;
  --warn-bg:   #2a2213;
  --font:      'Outfit', system-ui, sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, monospace;
  --r:         14px;
  --r-sm:      10px;
  --tabbar-h:  64px;
}

/* ---------- 2. BAZA ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
html, body, .sheet__panel { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, .sheet__panel::-webkit-scrollbar { display: none; width: 0; height: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.hidden { display: none !important; }

/* ---------- 3. OBUDOWA APLIKACJI ---------- */
.app {
  position: relative;
  max-width: 390px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.screen {
  flex: 1;
  padding: 18px 16px calc(var(--tabbar-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.screen--auth { padding-bottom: 32px; justify-content: center; }

/* Nagłówek ekranu */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 2px; }
.topbar__title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.topbar__meta { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.topbar__logo { height: 26px; width: auto; opacity: .9; }
.topbar__back {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 8px 6px 2px; margin-left: -2px;
  background: none; border: 0; color: var(--accent); font-size: 15px;
}

.label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.section-title { font-size: 13px; color: var(--text-2); margin: 6px 2px -4px; font-weight: 500; }

/* ---------- 4. KARTY ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}
.card--flush { padding: 0; overflow: hidden; }

/* ---------- 5. BANERY OSTRZEŻEŃ ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; text-align: left;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid;
  background: none;
}
.banner__icon { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.banner__body { flex: 1; min-width: 0; }
.banner__title { font-size: 14px; font-weight: 500; }
.banner__text { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.banner__chev { flex: none; color: var(--text-3); align-self: center; }
.banner--warn   { background: var(--warn-bg);   border-color: #4a3b1c; }
.banner--warn .banner__icon, .banner--warn .banner__title { color: var(--warn); }
.banner--danger { background: var(--danger-bg); border-color: #4a2523; }
.banner--danger .banner__icon, .banner--danger .banner__title { color: var(--danger); }

/* ---------- 6. START: HERO + WYKRES ---------- */
.hero__value { font-size: 44px; font-weight: 500; margin-top: 6px; line-height: 1; }
.hero__currency { font-size: 20px; color: var(--text-2); margin-left: 4px; }
.hero__meta { font-size: 13px; color: var(--text-2); margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero__meta .num { color: var(--text); }

.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 18px; }
.chart__col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart__track { position: relative; width: 100%; height: 84px; display: flex; align-items: flex-end; }
.chart__bar { width: 100%; border-radius: 6px 6px 3px 3px; background: #2b2640; min-height: 3px; }
.chart__bar--today { background: var(--accent); }
.chart__bar--future { background: none; border: 1px dashed var(--line-2); height: 100%; }
.chart__value { position: absolute; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--accent); white-space: nowrap; }
.chart__day { font-size: 11px; color: var(--text-3); }
.chart__day--today { color: var(--text); font-weight: 600; }

/* Platformy */
.platforms { display: flex; flex-direction: column; }
.platform { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.platform:first-of-type { border-top: 0; padding-top: 4px; }
.platform__name { font-size: 15px; font-weight: 500; }
.platform__rides { font-size: 12px; color: var(--text-3); margin-left: 6px; font-weight: 400; }
.platform__amount { font-size: 15px; text-align: right; }
.platform__bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--card-2); overflow: hidden; }
.platform__fill { height: 100%; background: var(--accent); border-radius: 4px; }

/* Prognoza wypłaty */
.payout { display: flex; flex-direction: column; gap: 6px; }
.payout__value { font-size: 30px; color: var(--ok); }
.payout__note { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.payout .btn { margin-top: 8px; }

/* ---------- 7. PRZYCISKI ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  font-size: 15px; font-weight: 500;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--ghost { background: none; }
.btn--danger { background: none; border-color: #4a2523; color: var(--danger); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn__spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- 8. STATUSY (BADGE) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: var(--card-2); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok      { background: var(--ok-bg);     color: var(--ok); }
.badge--warn    { background: var(--warn-bg);   color: var(--warn); }
.badge--danger  { background: var(--danger-bg); color: var(--danger); }
.badge--accent  { background: var(--accent-bg); color: var(--accent); }
.badge--muted   { background: var(--card-2);    color: var(--text-3); }

/* ---------- 9. ROZLICZENIA: TYGODNIE ---------- */
.week { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.week--open { border-color: var(--line-2); }
.week__head { width: 100%; display: grid; grid-template-columns: 1fr auto 16px; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0; text-align: left; }
.week__title { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.week__range { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.week__amount { font-size: 15px; text-align: right; }
.week__amount-label { display: block; font-family: var(--font); font-size: 10.5px; color: var(--text-3); letter-spacing: 0; margin-bottom: 2px; }
.week__chev { color: var(--text-3); transition: transform .2s; }
.week--open .week__chev { transform: rotate(90deg); }
.week__body { padding: 0 16px 16px; border-top: 1px solid var(--line); }

.breakdown { display: flex; flex-direction: column; }
.breakdown__group { padding-top: 14px; }
.breakdown__caption { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.breakdown__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; font-size: 14px; }
.breakdown__row--sub { padding-left: 12px; font-size: 13px; color: var(--text-2); }
.breakdown__row--sum { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-weight: 500; }
.breakdown__hint { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.breakdown__minus { color: var(--danger); }
.breakdown__total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding: 14px; border-radius: var(--r-sm);
  background: var(--ok-bg); border: 1px solid #1f3d2c;
}
.breakdown__total-label { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--ok); }
.breakdown__total-value { font-size: 22px; color: var(--ok); }
.week__actions { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.week__note { font-size: 12px; color: var(--text-3); text-align: center; }

/* ---------- 10. LISTY (dokumenty, menu, faktury, historia) ---------- */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list__item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 12px 14px;
  background: none; border: 0; border-top: 1px solid var(--line);
  text-align: left;
}
.list__item:first-child { border-top: 0; }
.list__item:active { background: var(--card-2); }
.list__body { flex: 1; min-width: 0; }
.list__title { font-size: 15px; font-weight: 500; line-height: 1.25; }
.list__sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; line-height: 1.35; }
.list__sub--warn { color: var(--warn); }
.list__sub--danger { color: var(--danger); }
.list__side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list__chev { flex: none; color: var(--text-3); }
.list__amount { font-size: 15px; }
.list__amount--plus { color: var(--danger); }
.list__amount--minus { color: var(--ok); }

.summary { display: flex; gap: 8px; flex-wrap: wrap; }

/* Menu „Więcej” */
.menu-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--card-2); color: var(--accent); }

/* ---------- 11. AUTO ---------- */
.car { display: flex; flex-direction: column; gap: 14px; }
.plate {
  align-self: flex-start;
  display: inline-flex; align-items: stretch;
  border-radius: 6px; overflow: hidden;
  background: #f4f4f0; color: #111;
  border: 2px solid #111; box-shadow: 0 0 0 1px #3a3a44;
}
.plate__eu { background: #1f43a8; color: #fff; font-size: 10px; font-weight: 600; padding: 4px 5px; display: flex; align-items: flex-end; }
.plate__number { font-family: var(--mono); font-size: 24px; font-weight: 500; padding: 4px 12px; letter-spacing: .04em; }
.car__model { font-size: 20px; font-weight: 500; }
.car__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { background: var(--card-2); border-radius: var(--r-sm); padding: 10px 12px; }
.kv__label { font-size: 11.5px; color: var(--text-3); }
.kv__value { font-size: 15px; margin-top: 3px; }

.rent { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rent > :first-child { flex: 1; min-width: 0; }
.rent__price { flex: none; text-align: right; white-space: nowrap; }
.rent__value { font-size: 20px; }
.rent__note { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

/* ---------- 12. DŁUG ---------- */
.debt__value { font-size: 38px; color: var(--danger); margin-top: 6px; }
.debt__value--zero { color: var(--ok); }
.debt__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* ---------- 13. KONTO ---------- */
.profile { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); font-size: 18px; font-weight: 600; }
.profile__name { font-size: 18px; font-weight: 500; }
.profile__meta { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.plan { display: flex; flex-direction: column; gap: 8px; }
.plan__option { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.plan__option--active { border-color: var(--accent); background: var(--accent-bg); }
.plan__name { font-size: 15px; font-weight: 500; }
.plan__desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.plan__note { font-size: 12px; color: var(--text-3); }

/* ---------- 14. FORMULARZE ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; color: var(--text-2); }
.field__control {
  display: flex; align-items: center; gap: 8px;
  min-height: 50px; padding: 0 14px;
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px;
}
.field__control { position: relative; }
.field__cal { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-right: -8px; border: 0; border-radius: 8px; background: none; color: var(--text-3); }
.field__cal:hover { color: var(--accent); background: var(--card); }
.field__native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.field__control:focus-within { border-color: var(--accent); }
.field__control--error { border-color: var(--danger); }
.field__input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 16px; padding: 12px 0; color-scheme: dark; }
.field__input::placeholder { color: var(--text-3); }
.field__suffix { color: var(--text-3); font-size: 14px; }
.field__toggle { background: none; border: 0; color: var(--text-3); font-size: 13px; padding: 6px 0 6px 8px; }
.field__hint { font-size: 12px; color: var(--text-3); }
.field__error { font-size: 12.5px; color: var(--danger); }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; }
.segmented__item { min-height: 42px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-size: 15px; }
.segmented__item--active { background: var(--accent); color: #fff; font-weight: 500; }

.rules { display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.rules__item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.rules__mark { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; }
.rules__item--ok { color: var(--ok); }
.rules__item--ok .rules__mark { border-color: var(--ok); background: var(--ok); color: var(--bg); }

/* Wybór zdjęcia / pliku */
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picker__btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 96px; border-radius: 12px;
  border: 1px dashed var(--line-2); background: var(--card-2);
  font-size: 14px; color: var(--text); cursor: pointer;
}
.picker__btn svg { color: var(--accent); }
.picker__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.preview { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); }
.preview__thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #23232e; display: grid; place-items: center; color: var(--text-3); font-size: 11px; flex: none; }
.preview__body { flex: 1; min-width: 0; }
.preview__name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview__size { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.preview__remove { background: none; border: 0; color: var(--text-3); font-size: 13px; padding: 8px; }

.progress { height: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.progress__fill { height: 100%; background: var(--accent); transition: width .15s linear; }

/* ---------- 15. LOGOWANIE ---------- */
.auth { display: flex; flex-direction: column; gap: 28px; }
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.auth__logo { width: 180px; height: auto; }
.auth__caption { font-size: 11px; letter-spacing: .14em; color: var(--text-3); text-transform: uppercase; }
.auth__title { margin: 0; font-size: 24px; font-weight: 600; }
.auth__text { margin: 6px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.auth__alert { padding: 12px 14px; border-radius: 12px; background: var(--danger-bg); border: 1px solid #4a2523; color: var(--danger); font-size: 13.5px; }
.auth__foot { text-align: center; font-size: 13px; color: var(--text-3); line-height: 1.5; }

/* ---------- 16. PUSTE STANY ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 20px; }
.empty__icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--card-2); color: var(--text-3); margin-bottom: 6px; }
.empty__title { font-size: 16px; font-weight: 500; }
.empty__text { font-size: 13.5px; color: var(--text-3); line-height: 1.45; max-width: 280px; }
.empty .btn { margin-top: 10px; }

/* ---------- 17. SKELETON (ładowanie) ---------- */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, #17171f 0%, #20202a 50%, #17171f 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
.skeleton--line { height: 12px; }
.skeleton--big { height: 44px; width: 70%; margin-top: 10px; }
.skeleton--block { height: 84px; margin-top: 18px; }

/* ---------- 18. TAB BAR ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 390px; height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(11,11,16,.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.tabbar__item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: none; border: 0; color: var(--text-3); font-size: 10.5px; }
.tabbar__item--active { color: var(--accent); }
.tabbar__dot { position: absolute; top: 9px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }

/* ---------- 19. ARKUSZ (bottom sheet) ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); animation: fade .2s ease; }
.sheet__panel {
  position: relative; width: 100%; max-width: 390px; max-height: 92vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding: 10px 16px 24px;
  display: flex; flex-direction: column; gap: 16px;
  animation: up .25s ease;
}
.sheet__grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 2px; }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet__title { margin: 0; font-size: 19px; font-weight: 600; }
.sheet__sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.sheet__close { background: var(--card-2); border: 0; width: 32px; height: 32px; border-radius: 50%; color: var(--text-2); display: grid; place-items: center; flex: none; }
.reason { padding: 14px; border-radius: 12px; background: var(--danger-bg); border: 1px solid #4a2523; }
.reason__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--danger); }
.reason__text { font-size: 14px; line-height: 1.45; margin-top: 6px; }
.reason__meta { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* ---------- 20. TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 14px); transform: translateX(-50%);
  max-width: 358px; width: calc(100% - 32px);
  padding: 12px 14px; border-radius: 12px;
  background: #22222c; border: 1px solid var(--line-2);
  font-size: 14px; z-index: 30; animation: fade .2s ease;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
