/* ============================================================================
   Płatności kartami — wygląd w systemie wizualnym The Company
   Źródło: thecompany-pl/flota-app design-system/tokens.css i reguły UI Scout
   (te same co w tc-dostepy i cowork-booking): granat #121635, czerwień #DC143C
   tylko jako akcent, Roboto, zero zaokrągleń i cieni, struktura z linii 1 px,
   statusy = kwadrat 8 px + etykieta (granat / granat 35 % / czerwień).
   ========================================================================== */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/fonts/roboto-latin-ext.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/fonts/roboto-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --navy: #121635;
  --red: #DC143C;
  --white: #ffffff;
  --page: #eef0f4;
  --surface-2: #f8f9fb;
  --line: rgba(18, 22, 53, .12);
  --line-strong: rgba(18, 22, 53, .25);
  --input: rgba(18, 22, 53, .55);
  --muted: rgba(18, 22, 53, .62);
  --text-2: rgba(18, 22, 53, .70);
  --row-hover: rgba(18, 22, 53, .03);
  --status-mid: rgba(18, 22, 53, .35);
  --status-weak: rgba(220, 20, 60, .45);
  --danger: #b91c1c;
  --on-navy: rgba(255, 255, 255, .70);
  --on-navy-line: rgba(255, 255, 255, .18);
  --sidebar-w: 236px;
  --gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--navy);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--navy); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* --- Znak „the company” ------------------------------------------------------------ */
.logo { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 300; letter-spacing: -.01em; text-decoration: none; color: inherit; }
.logo b { font-weight: 500; }
.mark { width: 9px; height: 9px; background: var(--red); display: inline-block; }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--muted); }

/* --- Układ po zalogowaniu: pionowa nawigacja + ekran --------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--navy); color: var(--white);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar__head { padding: 26px 22px 22px; border-bottom: 1px solid var(--on-navy-line); }
.sidebar .logo { color: var(--white); }
.sidebar__sub { margin-top: 14px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-navy); font-weight: 500; }
.sidebar__nav { padding: 14px 0; display: flex; flex-direction: column; overflow-y: auto; flex: 1; }
.sidebar__nav a {
  display: block; padding: 10px 22px; color: var(--on-navy); text-decoration: none; font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar__nav a:hover { color: var(--white); background: rgba(255, 255, 255, .05); }
.sidebar__nav a.active { color: var(--white); font-weight: 500; border-left-color: var(--red); background: rgba(255, 255, 255, .06); }
.sidebar__nav a.nav-new {
  margin: 0 22px 14px; padding: 9px 14px; border: 1px solid var(--on-navy-line); color: var(--white); font-weight: 500; text-align: center;
}
.sidebar__nav a.nav-new:hover, .sidebar__nav a.nav-new.active { background: var(--white); color: var(--navy); border-color: var(--white); }
.sidebar__foot { padding: 16px 22px 22px; border-top: 1px solid var(--on-navy-line); font-size: 12px; }
.sidebar__user { display: flex; justify-content: space-between; gap: 10px; }
.sidebar__user-name { color: var(--white); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-email { color: var(--on-navy); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user > div { min-width: 0; display: flex; flex-direction: column; }
.sidebar__foot form { margin: 0; }
.sidebar__signout { padding: 0; border: 0; background: none; color: var(--on-navy); font: inherit; font-size: 12px; cursor: pointer; }
.sidebar__signout:hover { color: var(--white); text-decoration: underline; }
.sidebar__role { margin-top: 10px; color: var(--on-navy); }
.sidebar__role b { color: var(--white); font-weight: 500; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; background: var(--white); border-bottom: 1px solid var(--line);
  padding: 18px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.topbar__title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.topbar__title h1 { font-size: 24px; line-height: 1.2; font-weight: 300; }
.screen { padding: 26px var(--gutter) 48px; max-width: 1240px; }

/* --- Ekrany bez logowania (logowanie, akceptacja z maila) ---------------------------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--page); }
.login__panel { width: 100%; max-width: 480px; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--red); padding: 40px 40px 32px; }
.login__panel.wide { max-width: 640px; }
.login__brand { color: var(--navy); font-size: 22px; }
.login__panel > .eyebrow { margin-top: 6px; }
.login__title { font-size: 22px; font-weight: 300; margin: 32px 0 12px; line-height: 1.25; }
.login__body { color: var(--text-2); margin-bottom: 24px; line-height: 1.65; }
.login__body strong { color: var(--navy); font-weight: 500; }
.login__foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* --- Typografia ekranu ----------------------------------------------------------------- */
h2.section { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; font-weight: 500; color: var(--red); margin: 0 0 14px; }
.hint { color: var(--text-2); }
.sub { color: var(--muted); font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.ref { font-variant-numeric: tabular-nums; }

/* --- Bloki: komunikat, „co dalej”, panel -------------------------------------------------- */
.panel { border: 1px solid var(--line); background: var(--white); padding: 20px 22px; margin-bottom: 20px; }
.note { border-left: 3px solid var(--navy); background: var(--surface-2); padding: 12px 16px; margin-bottom: 20px; }
.note.action { border-left-color: var(--red); }
.note strong { font-weight: 500; }
.error { border-left: 3px solid var(--danger); background: #fef2f2; color: var(--danger); padding: 10px 14px; margin: 0 0 16px; }
.dev { border-left: 3px solid var(--status-mid); background: var(--surface-2); padding: 10px 14px; margin-top: 16px; }

/* --- Status: kwadrat 8 px + etykieta ------------------------------------------------------- */
.status { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; white-space: nowrap; }
.dot { width: 8px; height: 8px; flex: none; display: inline-block; background: var(--status-mid); }
.dot.done { background: var(--navy); }
.dot.muted, .dot.info { background: var(--status-mid); }
.dot.wait, .dot.todo { background: var(--status-weak); }
.dot.bad { background: var(--red); }

/* --- Przyciski i pola ------------------------------------------------------------------------ */
button, .btn {
  font: inherit; font-size: 13px; font-weight: 500; padding: 9px 16px; border: 1px solid var(--navy);
  background: var(--navy); color: var(--white); cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap;
}
button:hover, .btn:hover { background: rgba(18, 22, 53, .85); }
button:disabled { opacity: .45; cursor: wait; }
.btn--outline { background: var(--white); color: var(--navy); }
.btn--outline:hover { background: var(--row-hover); }
.btn--danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: #fef2f2; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.stack { display: grid; gap: 18px; }
label { display: grid; gap: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--text-2); }
fieldset { border: 1px solid var(--line); padding: 12px 16px 14px; margin: 0; display: grid; gap: 8px; }
legend { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--text-2); padding: 0 6px; }
label.radio, label.check { display: flex; align-items: baseline; gap: 8px; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--navy); font-weight: 400; }
label.radio input, label.check input { accent-color: var(--navy); }
input[type=email], input[type=search], input[type=text], textarea, select {
  font: inherit; font-size: 14px; color: var(--navy); padding: 9px 12px; border: 1px solid var(--input); border-radius: 0;
  background: var(--white); width: 100%; text-transform: none; letter-spacing: 0;
}
input::placeholder, textarea::placeholder { color: rgba(18, 22, 53, .40); }
select {
  appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: right 14px center, right 9px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.field-hint { font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; line-height: 1.5; }
.field-error { font-size: 12px; color: var(--danger); text-transform: none; letter-spacing: 0; font-weight: 500; }
.row2 { display: grid; grid-template-columns: 140px 1fr; gap: 14px; }
.pln { color: var(--navy); font-weight: 500; }
[hidden] { display: none !important; }

/* --- Formularz zgłoszenia ---------------------------------------------------------------------- */
.form-wrap { max-width: 760px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 26px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.steps li { counter-increment: step; padding: 14px 16px; border-right: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.steps li:last-child { border-right: 0; }
.steps li::before { content: counter(step); display: block; font-size: 28px; font-weight: 100; color: var(--navy); line-height: 1; margin-bottom: 8px; }

/* --- Filtry i tabela transakcji ------------------------------------------------------------------ */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 20px; }
.filters input[type=search] { flex: 1 1 280px; max-width: 420px; }
table.tx { width: 100%; border-collapse: collapse; }
.tx th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--muted);
  padding: 0 12px 10px; border-bottom: 2px solid var(--navy);
}
.tx td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
.tx tbody tr:hover { background: var(--row-hover); }
.tx td:first-child, .tx th:first-child { padding-left: 0; }
.tx .desc { font-weight: 500; text-decoration: none; }
.tx .desc:hover { text-decoration: underline; }
.tx td[data-label="Nr"], .tx td[data-label="Data"] { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx .status { white-space: normal; align-items: baseline; }
.tx .status .dot { position: relative; top: -1px; }
.empty { padding: 40px 0; color: var(--muted); border-top: 2px solid var(--navy); }
.more { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* --- Szczegóły transakcji ------------------------------------------------------------------------- */
.amount { font-size: 40px; font-weight: 100; line-height: 1.1; font-variant-numeric: tabular-nums; }
dl.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0; margin: 0 0 26px; border-top: 1px solid var(--line); }
.field { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
.field dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--muted); }
.field dd { margin: 4px 0 0; }
.files { list-style: none; margin: 0 0 6px; padding: 0; border-top: 1px solid var(--line); }
.files li { padding: 10px 0; border-bottom: 1px solid var(--line); }
form.upload { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 16px; }
form.upload .hint { flex-basis: 100%; }
form.upload input[type=file] { font: inherit; font-size: 13px; }
.decide { border: 1px solid var(--line); border-top: 3px solid var(--red); padding: 20px 22px; margin-bottom: 22px; }
.decide h2 { font-size: 16px; font-weight: 500; margin-bottom: 6px; }
dl.compact { grid-template-columns: repeat(2, 1fr); }

/* --- Podgląd poczty (tryb deweloperski) ----------------------------------------------------------- */
.mail { border: 1px solid var(--line); padding: 16px 18px; margin-bottom: 20px; }
.mail h2 { font-size: 15px; font-weight: 500; margin: 6px 0 12px; }
.mail-body { border: 1px dashed var(--line-strong); }

/* --- Telefon ----------------------------------------------------------------------------------------- */
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar__head { padding: 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .sidebar__sub { margin-top: 0; }
  .sidebar__nav { flex-direction: row; flex-wrap: wrap; padding: 8px 10px; gap: 2px; }
  .sidebar__nav a { padding: 8px 12px; border-left: 0; border-bottom: 2px solid transparent; }
  .sidebar__nav a.active { border-bottom-color: var(--red); }
  .sidebar__nav a.nav-new { margin: 0 6px 0 0; padding: 7px 12px; }
  .sidebar__foot { padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .sidebar__role { margin-top: 0; }
  .topbar { position: static; padding: 16px; }
  .screen { padding: 18px 16px 40px; }
  .login__panel { padding: 28px 22px; }
  .row2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(2) { border-right: 0; }
  .steps li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  table.tx, .tx tbody, .tx tr, .tx td { display: block; width: 100%; }
  .tx thead { display: none; }
  .tx tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .tx td { border: 0; padding: 3px 0; }
  .tx td::before { content: attr(data-label); display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .tx .num { text-align: left; }
  dl.grid, dl.compact { grid-template-columns: 1fr; }
}
