/* ═════════════════════════════════════════════════════════════
   RATO Review Portal — redesign 2026
   Sidebar + czysty tokenowy design. Zastępuje style.css.
   ═════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Brand (kolory z logo RATO) */
  --rato-navy: #1e1852;
  --rato-navy-hover: #2a2369;
  --rato-navy-deep: #15103f;
  --rato-red: #e5203a;
  --rato-red-hover: #d01a32;
  --rato-red-soft: #f04358;

  /* Neutrale */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f4f5f7;

  /* Tekst */
  --ink-900: #0f1324;
  --ink-800: #1b2037;
  --ink-700: #3b4257;
  --ink-600: #525b71;
  --ink-500: #6a7387;
  --ink-400: #8a93a8;
  --ink-300: #b5bcca;

  /* Linie */
  --line: rgba(15, 19, 36, 0.08);
  --line-strong: rgba(15, 19, 36, 0.14);

  /* Semantyczne */
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --ok-ink: #076a50;

  --warn: #d97706;
  --warn-soft: #fffbeb;
  --warn-ink: #854f0b;

  --danger: #dc2626;
  --danger-soft: #fef1f1;
  --danger-ink: #a32d2d;

  --info: #3b60e5;
  --info-soft: #eef2ff;
  --info-ink: #2f3b9e;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Cienie */
  --shadow-sm: 0 1px 2px rgba(15, 19, 36, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 19, 36, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 19, 36, 0.1);

  /* Układ */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: transparent; color: inherit; }
img { max-width: 100%; display: block; }

/* ═════════════════════════════════════════════════════════
   SHELL — grid sidebar + main
   ═════════════════════════════════════════════════════════ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  align-items: stretch;
}

.main {
  min-width: 0;
  padding: 28px 40px 60px;
  background: var(--bg);
}

/* ═════════════════════════════════════════════════════════
   SIDEBAR
   ═════════════════════════════════════════════════════════ */
.sidebar {
  background: var(--rato-navy);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.brand {
  padding: 20px 22px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  background: #fff;
  padding: 5px 8px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.brand-logo .r { color: var(--rato-navy); }
.brand-logo .t { color: var(--rato-red); }

.brand-title {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-group-label {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  padding: 18px 22px 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.nav-group-label:first-of-type { padding-top: 6px; }

.nav-list {
  list-style: none;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  transition: background 0.1s ease, color 0.1s ease;
  gap: 10px;
  width: 100%;
  text-align: left;
  line-height: 1.3;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.10); color: #fff; font-weight: 500; }

.nav-item-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.nav-item-label svg { flex-shrink: 0; opacity: 0.9; }

.nav-count {
  background: var(--rato-red);
  color: #fff;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  font-weight: 500;
}
.nav-count.muted {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12.5px; color: #fff; font-weight: 500; line-height: 1.2; }
.sidebar-user-meta { font-size: 11px; color: rgba(255, 255, 255, 0.5); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-logout {
  color: rgba(255, 255, 255, 0.5);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-logout:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

/* Awatar (używany też w sidebarze) */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rato-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }

/* Przełącznik profilu w sidebarze */
.sidebar-switch {
  padding: 0 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-switch-select {
  width: 100%;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12px;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.sidebar-switch-select:hover { background: rgba(255, 255, 255, 0.1); }
.sidebar-switch-select:focus { border-color: rgba(255, 255, 255, 0.3); box-shadow: none; }
.sidebar-switch-select option { background: var(--rato-navy-deep); color: #fff; }
.sidebar-switch-btn {
  width: 100%;
  padding: 7px 10px;
  background: var(--rato-red);
  border: 1px solid var(--rato-red);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.05s ease;
}
.sidebar-switch-btn:hover { background: #c11630; }
.sidebar-switch-btn:active { transform: translateY(1px); }
.sidebar-switch-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.sidebar-nav { padding-bottom: 16px; }

/* ═════════════════════════════════════════════════════════
   PAGE HEADER & SECTIONS
   ═════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  line-height: 1.2;
}
.page-subtitle {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 12px;
  color: var(--ink-500);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--ink-500); }
.breadcrumb a:hover { color: var(--rato-navy); }
.breadcrumb .sep { margin: 0 6px; color: var(--ink-300); }

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 14px;
}
.section-head-bar {
  width: 3px;
  height: 18px;
  border-radius: 2px;
  flex-shrink: 0;
  background: var(--rato-navy);
}
.section-head-bar.red   { background: var(--rato-red); }
.section-head-bar.navy  { background: var(--rato-navy); }
.section-head-bar.muted { background: rgba(15, 19, 36, 0.22); }
.section-head-bar.ok    { background: var(--ok); }

.section-head-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
.section-head-rule { flex: 1; height: 1px; background: var(--line); }
.section-head-right { margin-left: auto; font-size: 12px; color: var(--ink-500); }

/* ═════════════════════════════════════════════════════════
   CARDS
   ═════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.card.card-sm { padding: 12px 14px; }
.card.card-lg { padding: 22px 26px; }
.card.card-flat { border-radius: 0; }
.card + .card { margin-top: 12px; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head-title { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.card-head-sub { font-size: 12px; color: var(--ink-500); }
.card-body { font-size: 13px; color: var(--ink-900); }
.card-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.card-danger {
  border-color: #f3d5d5;
  background: #fefafa;
}

/* ═════════════════════════════════════════════════════════
   GRIDS
   ═════════════════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════════════
   TODAY CARDS (Start / Dashboard)
   ═════════════════════════════════════════════════════════ */
.today-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--rato-navy);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.1s ease, transform 0.1s ease;
}
.today-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.today-card-priority-high { border-left-color: var(--rato-red); }
.today-card-priority-med  { border-left-color: var(--rato-navy); }
.today-card-priority-low  { border-left-color: var(--ink-300); }

.today-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--ink-500);
}
.today-card-head-right { font-size: 12px; font-weight: 600; color: var(--ink-700); }
.today-card-head-right.red { color: var(--rato-red); }
.today-card-head-right.navy { color: var(--rato-navy); }

.today-list { font-size: 13px; line-height: 1.55; color: var(--ink-900); }
.today-list > div { padding: 4px 0; }
.today-list .muted { color: var(--ink-500); }
.today-list a { color: var(--ink-900); }
.today-list a:hover { color: var(--rato-navy); }

/* ═════════════════════════════════════════════════════════
   KPI
   ═════════════════════════════════════════════════════════ */
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.kpi-label {
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.kpi-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink-900);
  margin-top: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.kpi-delta { font-size: 12px; margin-top: 4px; }
.kpi-delta.good { color: var(--ok-ink); }
.kpi-delta.bad  { color: var(--danger-ink); }
.kpi-delta.muted { color: var(--ink-500); }

/* ═════════════════════════════════════════════════════════
   PROGRESS
   ═════════════════════════════════════════════════════════ */
.progress-bar {
  height: 5px;
  background: rgba(30, 24, 82, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--rato-navy);
  transition: width 0.3s ease;
}
.progress-fill.red { background: var(--rato-red); }
.progress-fill.ok  { background: var(--ok); }

/* ═════════════════════════════════════════════════════════
   TABLE
   ═════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  border-spacing: 0;
  font-size: 13px;
  overflow: hidden;
}
.data-table thead th {
  text-align: left;
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink-500);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.data-table thead th.num { text-align: right; }
.data-table thead th.center { text-align: center; }
.data-table tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .center { text-align: center; }
.data-table .code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-700);
  white-space: nowrap;
}
.data-table .cell-strong { color: var(--ink-900); font-weight: 500; }
.data-table .cell-muted { color: var(--ink-500); font-size: 12px; }
.data-table .cell-ellipsis {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

/* ═════════════════════════════════════════════════════════
   TOOLBAR, SEARCH, FILTER CHIPS
   ═════════════════════════════════════════════════════════ */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.search {
  flex: 1;
  max-width: 360px;
  position: relative;
}
.search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  color: var(--ink-900);
  outline: none;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}
.search input:focus { border-color: var(--rato-navy); box-shadow: 0 0 0 3px rgba(30, 24, 82, 0.08); }
.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
}

.filter-chip {
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  color: var(--ink-700);
}
.filter-chip:hover { border-color: var(--rato-navy); color: var(--rato-navy); }
.filter-chip.active {
  background: var(--rato-navy);
  border-color: var(--rato-navy);
  color: #fff;
}

/* ═════════════════════════════════════════════════════════
   PILLS / BADGES
   ═════════════════════════════════════════════════════════ */
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.pill-success { background: var(--ok-soft); color: var(--ok-ink); }
.pill-pending { background: var(--warn-soft); color: var(--warn-ink); }
.pill-error   { background: var(--danger-soft); color: var(--danger-ink); }
.pill-info    { background: var(--info-soft); color: var(--info-ink); }
.pill-neutral { background: var(--surface-3); color: var(--ink-700); }
.pill-navy    { background: rgba(30, 24, 82, 0.08); color: var(--rato-navy); }

/* Kompatybilność z istniejącymi miejscami używającymi .badge-* */
.badge, .pill-legacy { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.badge-confirmed, .badge-ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge-pending  { background: var(--warn-soft); color: var(--warn-ink); }
.badge-rejected { background: var(--danger-soft); color: var(--danger-ink); }
.badge-unsure   { background: var(--info-soft); color: var(--info-ink); }
.badge-other    { background: var(--surface-3); color: var(--ink-700); }
.badge-konwersja_ofert { background: var(--info-soft); color: var(--info-ink); }
.badge-zaniedbania { background: var(--danger-soft); color: var(--danger-ink); }
.badge-crm { background: rgba(30,24,82,0.08); color: var(--rato-navy); }

/* ═════════════════════════════════════════════════════════
   BUTTONS
   ═════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-800);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease, opacity 0.1s ease;
  white-space: nowrap;
  line-height: 1;
  user-select: none;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--rato-navy);
  color: #fff;
  border-color: var(--rato-navy);
}
.btn-primary:hover { background: var(--rato-navy-hover); border-color: var(--rato-navy-hover); }

.btn-danger {
  background: var(--rato-red);
  color: #fff;
  border-color: var(--rato-red);
}
.btn-danger:hover { background: var(--rato-red-hover); border-color: var(--rato-red-hover); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-700);
}
.btn-ghost:hover { background: rgba(15, 19, 36, 0.04); color: var(--ink-900); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 18px; font-size: 14px; }
.btn-icon { padding: 7px; }
.btn-block { width: 100%; }

/* ═════════════════════════════════════════════════════════
   FORMS
   ═════════════════════════════════════════════════════════ */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-row label,
.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-700);
}

.form-row input,
.form-row select,
.form-row textarea,
.form-input,
input[type=text], input[type=password], input[type=email], input[type=search],
input[type=number], input[type=date], input[type=tel], input[type=url],
select, textarea {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  color: var(--ink-900);
  outline: none;
  transition: border-color 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  width: 100%;
  line-height: 1.4;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--rato-navy);
  box-shadow: 0 0 0 3px rgba(30, 24, 82, 0.08);
}
.form-row input[readonly],
input[readonly] { background: var(--surface-2); color: var(--ink-600); cursor: default; }
.form-row input[disabled],
input[disabled] { background: var(--surface-2); color: var(--ink-400); cursor: not-allowed; }

.form-row textarea, textarea { min-height: 80px; resize: vertical; font-family: inherit; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.field-note { font-size: 11px; color: var(--ink-500); margin-top: 2px; }
.field-error { font-size: 12px; color: var(--danger-ink); margin-top: 4px; }

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  align-items: center;
  flex-wrap: wrap;
}

/* ═════════════════════════════════════════════════════════
   STEP INDICATOR (np. kreator oferty)
   ═════════════════════════════════════════════════════════ */
.steps {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.step {
  font-size: 12px;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-num {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
}
.step.done .step-num { background: var(--rato-navy); color: #fff; border-color: var(--rato-navy); }
.step.active { color: var(--rato-navy); font-weight: 600; }
.step.active .step-num {
  background: #fff;
  color: var(--rato-navy);
  border-color: var(--rato-navy);
  box-shadow: 0 0 0 3px rgba(30, 24, 82, 0.1);
}

/* ═════════════════════════════════════════════════════════
   ACTIVITY / LIST ROWS
   ═════════════════════════════════════════════════════════ */
.activity {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.activity-row {
  padding: 11px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.activity-row:last-child { border-bottom: none; }
.activity-row .muted { color: var(--ink-500); font-size: 12px; }

.activity-row-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 8px;
}
.tag-offer { background: var(--info-soft); color: var(--info-ink); }
.tag-plan { background: var(--ok-soft); color: var(--ok-ink); }
.tag-comment { background: var(--danger-soft); color: var(--danger-ink); }
.tag-import { background: var(--surface-3); color: var(--ink-700); }

/* ═════════════════════════════════════════════════════════
   PICKER (autocomplete dropdown)
   ═════════════════════════════════════════════════════════ */
.picker-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  box-shadow: var(--shadow-md);
  margin-top: 2px;
}
.picker-results .pick {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.picker-results .pick:hover,
.picker-results .pick.active { background: var(--surface-2); }
.picker-results .pick:last-child { border-bottom: none; }
.picker-results .pick strong { display: block; font-weight: 500; color: var(--ink-900); }
.picker-results .pick .sub { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; display: block; }
.picker-results .empty { padding: 12px; color: var(--ink-500); font-size: 12px; }
.picker-results .picker-hint {
  position: sticky;
  bottom: 0;
  padding: 9px 12px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  color: var(--ink-500);
  font-size: 12px;
}

.selected-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* ═════════════════════════════════════════════════════════
   EMPTY STATES, FLASH, ERROR
   ═════════════════════════════════════════════════════════ */
.empty-state {
  padding: 36px 24px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}
.empty-state strong { color: var(--ink-700); font-size: 14px; display: block; margin-bottom: 4px; }

.flash {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.flash-success { background: var(--ok-soft); color: var(--ok-ink); border-color: rgba(5, 150, 105, 0.2); }
.flash-error   { background: var(--danger-soft); color: var(--danger-ink); border-color: rgba(220, 38, 38, 0.2); }
.flash-info    { background: var(--info-soft); color: var(--info-ink); border-color: rgba(59, 96, 229, 0.2); }

.error-card {
  background: var(--danger-soft) !important;
  border-color: rgba(220, 38, 38, 0.2) !important;
  color: var(--danger-ink);
}

/* ═════════════════════════════════════════════════════════
   LOGIN (ekran logowania — bez sidebara)
   ═════════════════════════════════════════════════════════ */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  justify-content: center;
}
.login-brand-logo {
  background: #fff;
  border: 1px solid var(--line);
  padding: 7px 11px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
}
.login-brand-logo .r { color: var(--rato-navy); }
.login-brand-logo .t { color: var(--rato-red); }
.login-brand-title { font-size: 15px; color: var(--ink-700); }

.login-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  text-align: center;
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--ink-500);
  text-align: center;
  margin-bottom: 24px;
}

/* ═════════════════════════════════════════════════════════
   UTILITIES
   ═════════════════════════════════════════════════════════ */
.muted { color: var(--ink-500); }
.strong { color: var(--ink-900); font-weight: 500; }
.danger-text { color: var(--danger-ink); }
.ok-text { color: var(--ok-ink); }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-8 { gap: 8px; }
.flex-gap-12 { gap: 12px; }
.flex-gap-16 { gap: 16px; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; color: var(--ink-900); line-height: 1.2; }
h1 { font-size: 24px; margin-bottom: 4px; }
h2 { font-size: 20px; margin-bottom: 8px; }
h3 { font-size: 16px; margin-bottom: 8px; }
h4 { font-size: 14px; margin-bottom: 6px; }

.section-title { font-size: 14px; font-weight: 600; color: var(--ink-900); margin: 28px 0 12px; }

/* ═════════════════════════════════════════════════════════
   DASHBOARD TILES (nadpisanie starych .stat-card z style.css)
   Cel: czytelne karty z liczbami, bez ścisku i krzykliwych kolorów.
   ═════════════════════════════════════════════════════════ */
.dashboard > h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin-bottom: 4px;
}
.dashboard > .subtitle {
  color: var(--ink-500);
  font-size: 13px;
  margin-bottom: 20px;
}
.dashboard > .section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  margin: 32px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dashboard > .section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--rato-navy);
}

.dashboard .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1200px) { .dashboard .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .dashboard .stats-grid { grid-template-columns: 1fr; } }

.dashboard .stat-card,
.stats-grid .stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: none;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.dashboard .stat-card:hover { border-color: var(--line-strong); transform: none; }
.dashboard .stat-card::before { display: none; }

/* Kasujemy kolorowe akcenty bordera-lewego — robi się chaos */
.dashboard .stat-card-urlopy,
.dashboard .stat-card-gps,
.dashboard .stat-card-sales,
.dashboard .stat-card-weekly-plan,
.dashboard .stat-card-sales-map {
  border-left-width: 1px;
  border-left-color: var(--line);
}

/* Header karty: tytuł + delikatny tag */
.dashboard .stat-header,
.dashboard .stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  margin: 0;
}
.dashboard .stat-header h3,
.dashboard .stat-card-header .stat-title {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--ink-900) !important;
  letter-spacing: -0.005em;
  margin: 0;
  line-height: 1.3;
}
.dashboard .stat-header h3 a,
.dashboard .stat-header h3 a:hover {
  color: var(--ink-900) !important;
  text-decoration: none;
  background: none !important;
}
.dashboard .stat-header h3 a:hover { color: var(--rato-navy) !important; }
.dashboard .stat-icon { display: none; }

/* Tag w prawym górnym — stonowany, nie krzyczy */
.dashboard .tag,
.dashboard [class*="tag-"] {
  padding: 2px 9px !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  border-radius: 999px !important;
  text-transform: none !important;
  background: var(--surface-3) !important;
  color: var(--ink-600) !important;
  border: 0 !important;
  box-shadow: none !important;
  line-height: 1.6 !important;
}
.dashboard .tag-sales { background: rgba(30, 24, 82, 0.08) !important; color: var(--rato-navy) !important; }
.dashboard .tag-gps { background: rgba(229, 32, 58, 0.08) !important; color: var(--rato-red) !important; }
.dashboard .tag-sales-map { background: var(--surface-3) !important; color: var(--ink-700) !important; }

/* Siatka liczb w karcie — flex z wrap, każda liczba bierze tyle miejsca ile potrzebuje */
.dashboard .stat-numbers {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 14px 28px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  margin: 0 !important;
}

.dashboard .stat {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  align-items: flex-start !important;
  min-width: 0 !important;
  flex: 0 1 auto !important;
}
.dashboard .stat-value {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--ink-900) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 1.15 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.dashboard .stat-value.pending { color: var(--warn-ink) !important; }
.dashboard .stat-value.confirmed { color: var(--ok-ink) !important; }
.dashboard .stat-value.rejected { color: var(--danger-ink) !important; }
.dashboard .stat-value.unsure { color: var(--info-ink) !important; }
.dashboard .stat-label {
  font-size: 10.5px !important;
  font-weight: 500 !important;
  color: var(--ink-500) !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  line-height: 1.3;
}

/* Fix Urlopy: bare <strong> + <span> zamiast .stat-value/.stat-label */
.dashboard .stat-card-urlopy .stat {
  flex-direction: column !important;
  gap: 3px !important;
}
.dashboard .stat-card-urlopy .stat strong {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.dashboard .stat-card-urlopy .stat span {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Pasek postępu — jednakowy w całym dashboardzie */
.dashboard .progress-bar {
  height: 4px !important;
  background: rgba(30, 24, 82, 0.08) !important;
  border-radius: 3px !important;
  overflow: hidden;
  margin: 0 !important;
}
.dashboard .progress-fill {
  height: 100% !important;
  background: var(--rato-navy) !important;
  transition: width 0.3s ease;
}
.dashboard .progress-fill-gps { background: var(--rato-red) !important; }

.dashboard .progress-text,
.dashboard .stat-footer {
  font-size: 11.5px !important;
  color: var(--ink-500) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  line-height: 1.4 !important;
}

/* Lista urlopów / plany tygodniowe — małe pigułki */
.dashboard .urlopy-list,
.dashboard .weekly-plan-mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}
.dashboard .urlopy-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
  font-size: 12.5px;
}
.dashboard .urlopy-item:first-child { border-top: 0 !important; }
.dashboard .urlopy-item strong { font-weight: 500; color: var(--ink-900); font-size: 12.5px; }
.dashboard .urlopy-dates { color: var(--ink-500); font-size: 11px; }

.dashboard .empty-state-mini {
  color: var(--ink-500) !important;
  font-size: 12px !important;
  font-style: normal !important;
  text-align: left !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

/* Stara tabela „Ostatnie odpowiedzi" dostaje design-system look */
.dashboard .table-wrapper {
  margin-top: 8px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.dashboard .table-wrapper .data-table { border: 0; border-radius: 0; }

/* ═════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: var(--sidebar-w-collapsed); }
  .brand-title,
  .nav-group-label,
  .nav-item-label > *:not(svg),
  .nav-count,
  .sidebar-user { display: none; }
  .brand { justify-content: center; padding: 20px 0; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-footer { justify-content: center; padding: 14px 8px; }
  .sidebar-footer .avatar { margin: 0; }
  .main { padding: 20px; }
}
@media (max-width: 560px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
  .main { padding: 16px; }
}
