/* Tokeny zgodne z PortaxTheme.cs (Desktop): jeden akcent, wspólne stany, jasna powłoka. */
:root {
  color-scheme: light;
  --navy: #0c1f35;
  --teal: #0f766e;
  --teal-dark: #0d645e;
  --teal-soft: #ecfdf5;
  --blue: #2d67d6;
  --blue-soft: #edf3ff;
  --amber: #b54708;
  --amber-soft: #fff4e5;
  --red: #b42318;
  --red-soft: #feecea;
  --green: #027a48;
  --green-soft: #e6f7ee;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ee;
  --field-line: #7e90a0;
  --placeholder: #69757f;
  --surface: #ffffff;
  --canvas: #f6f8fb;
  --pane: #f3f5f8;
  --pane-hover: #e8ecf1;
  --navy-soft: #eef1f6;
  --shadow: 0 18px 45px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif; }
button, input, select, output { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
h1, h2, h3, h4, p { margin-top: 0; overflow-wrap: anywhere; }
a { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.logo { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: var(--teal); font-size: 21px; font-weight: 900; box-shadow: 0 10px 24px rgba(11,143,131,.24); }
.logo-copy strong { display: block; font-size: 19px; line-height: 1; letter-spacing: -.03em; }
.logo-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

/* ============================ Logowanie ============================ */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr); background: #fff; }
.login-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(32px, 6vw, 78px); overflow: hidden; background: var(--navy); color: #fff; }
.login-story::before, .login-story::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-story::before { width: 520px; height: 520px; right: -230px; top: -210px; background: rgba(11,143,131,.22); }
.login-story::after { width: 360px; height: 360px; left: -180px; bottom: -220px; background: rgba(45,103,214,.16); }
.login-story .logo { position: relative; z-index: 1; }
.login-story .logo-copy span { color: #9eb1c2; }
.story-main { position: relative; z-index: 1; max-width: 760px; margin: 80px 0; }
.eyebrow { margin-bottom: 13px; color: var(--teal); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.login-story .eyebrow { color: #72d7cd; }
.story-main h1 { margin-bottom: 24px; font-size: clamp(44px, 6vw, 74px); line-height: .98; letter-spacing: -.06em; }
.story-main > p { max-width: 650px; color: #c3d0db; font-size: clamp(18px, 2vw, 22px); }
.bot-preview { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 34px; }
.bot-preview article { padding: 17px; border: 1px solid rgba(255,255,255,.13); border-radius: 15px; background: rgba(255,255,255,.055); backdrop-filter: blur(8px); }
.bot-preview strong { display: block; margin-bottom: 4px; }
.bot-preview span { color: #9eb1c2; font-size: 13px; }
.login-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; }
.login-foot span { padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: #afc0ce; font-size: 11px; font-weight: 800; }
.login-access { display: grid; place-items: center; min-height: 100vh; padding: clamp(24px, 5vw, 70px); background: #f7f9fb; }
.login-card { width: min(440px, 100%); padding: clamp(28px, 4vw, 44px); border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.login-card h2 { margin-bottom: 9px; font-size: 31px; letter-spacing: -.04em; }
.login-card > p { color: var(--muted); }
.login-card button { width: 100%; margin-top: 13px; }

label { display: block; margin: 20px 0 7px; color: var(--ink); font-size: 13px; font-weight: 800; }
/* Obramowanie pola jest jedynym znakiem, że pole tam jest, więc musi mieć kontrast 3:1
   (WCAG 1.4.11). Poprzednie #c8d5de dawało 1,50:1 — pole ledwo było widać. */
input, select { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--field-line); border-radius: 11px; color: var(--ink); background: #fff; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover { border-color: #5f7183; }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(45,103,214,.22); outline-offset: 2px; }
/* Podpowiedź w pustym polu to nadal tekst: 4,5:1, nie 2,4:1 jak wcześniej. */
input::placeholder { color: var(--placeholder); }
/* Pola wyboru: własna strzałka zamiast systemowej, żeby wyglądały jak reszta pól. */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
select:focus { border-color: var(--teal); }
select:disabled { color: var(--muted); background-color: var(--pane); cursor: not-allowed; }
select option { color: var(--ink); background: #fff; font-weight: 600; }
.button, button { min-height: 43px; padding: 10px 15px; border: 0; border-radius: 10px; color: #fff; background: var(--navy); font-weight: 800; }
button:hover { background: #13293f; }
button.primary { background: var(--teal); }
button.primary:hover { background: var(--teal-dark); }
button.secondary, .button.secondary { color: var(--navy); background: var(--navy-soft); }
button.secondary:hover { background: #dce7ee; }
button.ghost { color: var(--muted); background: transparent; border: 1px solid var(--line); }
button.ghost:hover { color: var(--ink); background: var(--canvas); }
button.danger { color: var(--red); background: var(--red-soft); }
button.danger:hover { background: #fdd9d5; }
.hint { color: var(--muted); font-size: 13px; }
.error { color: var(--red) !important; }
.linklike { width: auto !important; margin: 0 !important; padding: 0; border: 0; background: none !important; color: var(--muted); font-size: 12px; cursor: pointer; }
.linklike:hover { color: var(--ink); text-decoration: underline; }

.auth-head { margin-bottom: 18px; text-align: center; }
.auth-head .protected { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.auth-head .protected svg { width: 16px; height: 16px; color: var(--teal); }
.field-head { display: flex; align-items: center; justify-content: space-between; }
.id-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--teal); font-size: 12px; font-weight: 600; }
.id-badge svg { width: 14px; height: 14px; }
.field-line { display: flex; gap: 8px; align-items: stretch; }
.field-line input { flex: 1; min-width: 0; }
.prefix-chip { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; }
.id-hint { min-height: 18px; margin: 6px 2px 0; color: var(--muted); font-size: 12px; }

/* Sześć kratek na kod — jedyny sposób wpisywania kodu w całym portalu. */
.otp-boxes { display: flex; gap: 8px; justify-content: center; margin: 6px 0 4px; }
.otp-boxes input { width: 46px; height: 54px; padding: 0; border: 1px solid var(--field-line); border-radius: 12px; background: #fff; font-size: 22px; font-weight: 700; text-align: center; outline: none; }
.otp-boxes input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,143,131,.12); }
.code-actions { display: flex; justify-content: space-between; margin-top: 12px; }
.code-actions button { width: auto; margin: 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.code-actions button:hover { color: var(--ink); text-decoration: underline; }
.code-actions button:last-child { color: var(--teal); }
.security-note { display: flex; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.security-note svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--teal); }

.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 27, 24, .45); }

/* ============================ Powłoka panelu ============================ */
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; gap: 20px; height: 100vh; padding: 22px 14px 16px; border-right: 1px solid var(--line); background: var(--pane); }
.sidebar .logo { padding: 0 10px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-section { margin: 16px 10px 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.side-nav button { position: relative; display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--ink); background: transparent; font-size: 13.5px; font-weight: 700; text-align: left; }
.side-nav button svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.side-nav button:hover { background: var(--pane-hover); }
.side-nav button.active { background: var(--surface); box-shadow: 0 4px 14px rgba(16,24,40,.06); }
.side-nav button.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--teal); }
.side-nav button.active svg { color: var(--teal); }
.nav-dot { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--red); }
.nav-dot.ok { background: var(--green); }
.nav-dot.warn { background: var(--amber); }
.side-foot { margin-top: auto; }
.side-logout { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--muted); background: transparent; font-size: 13.5px; font-weight: 700; }
.side-logout svg { width: 18px; height: 18px; }
.side-logout:hover { color: var(--red); background: var(--red-soft); }

.app-body { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 32px 14px; background: var(--canvas); }
.top-bar h1 { margin: 0 0 2px; font-size: 26px; letter-spacing: -.04em; }
.top-office { margin: 0; color: var(--muted); font-size: 12.5px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.office-select { min-height: 42px; width: auto; max-width: 260px; padding: 8px 34px 8px 12px; border-radius: 11px; font-size: 12.5px; font-weight: 700; background-position: right 10px center; }
.user-pill { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: var(--teal); font-size: 11px; font-weight: 900; }
.user-pill strong { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.user-pill span { display: block; color: var(--muted); font-size: 10px; }

.app-main { flex: 1; min-width: 0; }
.view { width: min(1240px, 100%); margin: 0 auto; padding: 10px 32px 48px; }

.status-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 32px; border-top: 1px solid var(--line); color: var(--muted); background: var(--surface); font-size: 12px; }
.status-right { display: flex; align-items: center; gap: 16px; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #98a2b3; box-shadow: 0 0 0 4px rgba(152,162,179,.14); }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(2,122,72,.14); }

/* ============================ Panele i tabele ============================ */
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 7px 24px rgba(20,45,65,.04); }
.panel + .panel, .panel + section, section + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h3 { margin-bottom: 4px; font-size: 18px; letter-spacing: -.025em; }
.panel-head p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-actions { display: flex; gap: 8px; }
.text-link { color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; }
th, td { padding: 12px 16px; text-align: left; vertical-align: middle; }
th {
  position: sticky; top: 0; z-index: 1;
  color: var(--muted); background: #f8fafb;
  border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
th:first-child { border-top-left-radius: 14px; }
th:last-child { border-top-right-radius: 14px; }
td { border-bottom: 1px solid #eef1f5; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
/* Wiersz reaguje na kursor — inaczej długa tabela gubi się przy czytaniu w poprzek. */
tbody tr:hover td { background: #fafbfd; }
tbody tr.detail-row:hover td, tbody tr.detail-row td { background: var(--pane); }
/* Pierwsza kolumna to nazwa rzeczy, o którą chodzi w wierszu. */
tbody td:first-child { color: var(--ink); font-weight: 700; }
/* Kwoty i liczby czyta się kolumną, więc idą do prawej i tabularnie. */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.muted { color: var(--muted); font-weight: 400; }
/* Wiersz komunikatu ("brak danych", "pobieranie…") nie udaje rekordu. */
tbody tr.notice td { color: var(--muted); font-weight: 400; text-align: center; padding: 26px 16px; }
td .row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
td .row-actions button, td .row-actions a { min-height: 32px; padding: 6px 11px; border-radius: 8px; font-size: 11.5px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; }

.state { display: inline-flex; align-items: center; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.state.live, .state.done { color: var(--green); background: var(--green-soft); }
.state.wait { color: var(--amber); background: var(--amber-soft); }
.state.error { color: var(--red); background: var(--red-soft); }
.state.planned { color: var(--blue); background: var(--blue-soft); }
.state.off { color: var(--muted); background: var(--navy-soft); }

.empty-state { padding: 22px; border: 1px dashed #cdd9e1; border-radius: 13px; color: var(--muted); text-align: center; font-size: 12px; }
.card-list { display: grid; gap: 9px; }
.device-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.device-card h3 { margin: 0; font-size: 13px; }
.device-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.device-title button { min-height: 34px; padding: 6px 11px; font-size: 11px; }

.alert { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; padding: 13px 16px; border-radius: 13px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 700; }
.alert.warn { background: var(--amber-soft); color: var(--amber); }
.alert a { font-weight: 800; }

/* ============================ Pulpit ============================ */
.info-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.info-card { display: flex; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.info-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--teal); background: var(--teal-soft); }
.info-icon svg { width: 20px; height: 20px; }
.info-card span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.info-card strong { display: block; margin-top: 2px; font-size: 16px; letter-spacing: -.02em; }
.card-link { margin-left: auto; color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: underline; }
.pulpit-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; }
.pulpit-grid .panel { margin-top: 0; }

.usage-list { display: grid; gap: 13px; }
.usage-row span { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.usage-row span b { color: var(--ink); }
.usage-meter { height: 7px; overflow: hidden; border-radius: 99px; background: #edf1f4; }
.usage-meter i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.usage-meter i.warn { background: #e4a22e; }
.usage-meter i.full { background: var(--red); }
.mini-list { display: grid; gap: 8px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; font-size: 12.5px; }
.mini-row span { color: var(--muted); }

/* ============================ Subskrypcja ============================ */
.plan-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.plan-summary .panel { margin-top: 0; }
.plan-validity { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 18px; }
.plan-validity strong { font-size: 30px; letter-spacing: -.04em; }
.plan-validity span { color: var(--muted); font-size: 12.5px; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.module-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.module-card h4 { margin: 0 0 3px; font-size: 13px; }
.module-card p { margin: 0 0 8px; color: var(--muted); font-size: 11.5px; }

.configurator { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 22px; }
.config-block { margin-bottom: 20px; }
.config-label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafb; }
.segmented button { min-height: 36px; padding: 7px 14px; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12.5px; }
.segmented button.active { color: var(--teal-dark); background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.08); }
.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 700; }
.stepper-row:last-child { border-bottom: 0; }
.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.stepper button { min-height: 34px; width: 36px; padding: 0; border-radius: 9px; color: var(--ink); background: transparent; font-size: 17px; font-weight: 800; }
.stepper button:hover { background: var(--pane-hover); }
.stepper output { min-width: 44px; text-align: center; font-weight: 800; }
.module-options { display: grid; gap: 8px; }
.module-option { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.module-option input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--teal); flex: 0 0 auto; }
.module-option.disabled { cursor: default; background: #f8fafb; }
.module-option .module-copy { flex: 1; min-width: 0; }
.module-option .module-copy strong { display: block; font-size: 13px; }
.module-option .module-copy span { color: var(--muted); font-size: 11.5px; }
.module-price { color: var(--ink); font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.module-option.disabled .module-price { color: var(--muted); font-weight: 700; }

.quote-box { align-self: start; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #f8fafb; }
.quote-box h4 { margin-bottom: 12px; font-size: 14px; }
.quote-lines { display: grid; gap: 6px; margin-bottom: 14px; }
.quote-lines div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.quote-lines div b { color: var(--ink); font-weight: 700; white-space: nowrap; }
.quote-totals { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.quote-totals div { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 12.5px; }
.quote-totals strong { color: var(--ink); }
.quote-gross { padding-top: 4px; }
.quote-gross strong { font-size: 21px; letter-spacing: -.03em; }
.quote-box .primary { width: 100%; margin-top: 12px; }

/* ============================ Dane biura ============================ */
.biuro-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; align-items: start; }
.biuro-grid .panel { margin-top: 0; }
.field-pair { display: grid; grid-template-columns: minmax(0, .6fr) minmax(0, 1.4fr); gap: 12px; }
#billing-profile-form button { margin-top: 20px; }
.office-facts { display: grid; gap: 0; margin: 0; }
.office-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.office-facts div:last-child { border-bottom: 0; }
.office-facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.office-facts dd { margin: 0; font-size: 13px; font-weight: 700; }

/* ============================ Komputery ============================ */
.inline-form { display: grid; grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) auto auto; align-items: end; gap: 12px; }
.inline-form label { margin-top: 0; }
.inline-form input { min-height: 42px; padding: 9px 12px; }
.inline-form button { min-height: 42px; }
/* Rozwinięty wiersz tabeli: formularz siedzi na tle panelu, nie na białym wierszu. */
.detail-row td { padding: 16px; }

@media (max-width: 1120px) {
  .info-cards { grid-template-columns: 1fr; }
  .pulpit-grid, .plan-summary, .configurator, .biuro-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; height: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; flex-wrap: wrap; order: 3; flex-basis: 100%; padding-top: 8px; }
  .nav-section { display: none; }
  .side-foot { margin: 0 0 0 auto; }
  .top-bar { flex-wrap: wrap; padding: 16px 16px 10px; }
  .view { padding: 8px 16px 40px; }
  .status-bar { padding: 9px 16px; }
  .inline-form { grid-template-columns: 1fr; }
  /* Na wąskim ekranie tabela przewija się w swoim panelu; oddech przy krawędziach zostaje. */
  th, td { padding: 11px 12px; }
  .table-wrap { border-radius: 13px; }
  .office-select { max-width: 100%; }
}
@media (max-width: 820px) {
  .login-screen { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100dvh; }
  .login-story { min-height: auto; justify-content: flex-start; gap: 22px; padding: 18px 20px 24px; }
  .login-story::before { width: 320px; height: 320px; right: -150px; top: -170px; }
  .login-story::after { display: none; }
  .story-main { margin: 0; max-width: none; }
  .story-main .eyebrow { display: none; }
  .story-main h1 { margin-bottom: 6px; font-size: clamp(26px, 7vw, 34px); line-height: 1.02; letter-spacing: -.04em; }
  .story-main h1 br { display: none; }
  .story-main > p { margin: 0; font-size: 15px; line-height: 1.4; color: #b5c5d3; }
  .bot-preview, .login-foot { display: none; }
  .login-access { min-height: auto; padding: 22px 16px 44px; place-items: start center; }
  .login-card { padding: 24px 20px 26px; border-radius: 20px; }
  .login-card h2 { font-size: 27px; }
  .otp-boxes input { width: 40px; height: 48px; font-size: 19px; }
  .user-pill span { display: none; }
}
