/* ============================================================
   AUREN — panel administracyjny
   ============================================================ */

:root {
  --ink: #0b0b0c;
  --ink-2: #131418;
  --ink-3: #1c1e23;
  --gold: #c8a24a;
  --gold-light: #e3c77c;
  --gold-dark: #96762f;
  --gold-soft: rgba(200, 162, 74, 0.12);
  --bg: #f4f3f0;
  --card: #ffffff;
  --line: #e6e4df;
  --text: #1a1a1c;
  --muted: #6d6c69;
  --ok: #2f7d52;
  --ok-soft: rgba(47, 125, 82, 0.12);
  --warn: #b8860b;
  --warn-soft: rgba(184, 134, 11, 0.14);
  --err: #b3282f;
  --err-soft: rgba(179, 40, 47, 0.1);
  --info: #2c5f9e;
  --info-soft: rgba(44, 95, 158, 0.12);
  --radius: 12px;
  --sans: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }

/* ---------- logowanie ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ink);
  padding: 24px;
}
.login-card {
  width: min(100%, 400px);
  background: var(--card);
  border-radius: 18px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.login-card .logo {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: 0.22em;
  color: var(--gold-dark);
  text-align: center;
  margin-bottom: 4px;
}
.login-card .sub {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 30px;
}

/* ---------- layout ---------- */
.app { display: none; min-height: 100vh; grid-template-columns: 252px 1fr; }
.app.ready { display: grid; }

.sidebar {
  background: var(--ink);
  color: #b9b7b2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  padding: 24px 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.sidebar-brand .logo {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.sidebar-brand span {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6f6d69;
}
.sidebar-nav { padding: 14px 12px; display: grid; gap: 3px; flex: 1; overflow-y: auto; }
.sidebar-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  color: #b9b7b2;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 14.5px;
  text-align: left;
  transition: all 0.18s;
}
.sidebar-nav button svg { width: 19px; height: 19px; flex: none; }
.sidebar-nav button:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.sidebar-nav button.active { background: var(--gold); color: #14120c; font-weight: 600; }
.sidebar-nav .count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
}
.sidebar-nav button.active .count { background: rgba(0, 0, 0, 0.18); }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); font-size: 12.5px; }
.sidebar-foot a { color: var(--gold); }
.sidebar-foot button {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #b9b7b2;
  border-radius: 8px;
  padding: 8px 14px;
  width: 100%;
  margin-top: 10px;
  font-size: 13px;
}
.sidebar-foot button:hover { border-color: var(--gold); color: var(--gold); }

.content { padding: 30px 34px 70px; min-width: 0; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head h1 { font-family: var(--serif); font-size: 30px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14.5px; }

.view { display: none; }
.view.active { display: block; }

/* ---------- karty / siatki ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.card-head h2 { font-size: 18px; margin: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat span {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
.stat strong { font-family: var(--serif); font-size: 30px; line-height: 1; display: block; }
.stat.accent { background: var(--ink); border-color: var(--ink); }
.stat.accent span { color: #85837f; }
.stat.accent strong { color: var(--gold); }
.stat small { color: var(--muted); font-size: 12.5px; }

/* ---------- tabele ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
table.data th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:hover { background: #faf9f7; }
table.data tr.clickable { cursor: pointer; }
/* nieprzeczytana wiadomosc - zlota krecha przy krawedzi wiersza */
table.data tr.row-unread td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
table.data tr.row-unread strong { color: var(--text); }
table.data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ref { font-family: 'Consolas', monospace; font-size: 12.5px; letter-spacing: 0.04em; color: var(--gold-dark); }

/* ---------- odznaki ---------- */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-pending { background: var(--warn-soft); color: var(--warn); }
.pill-confirmed { background: var(--ok-soft); color: var(--ok); }
.pill-active { background: var(--info-soft); color: var(--info); }
.pill-completed { background: #ececea; color: #55534f; }
.pill-cancelled { background: var(--err-soft); color: var(--err); }
.pill-online { background: var(--gold-soft); color: var(--gold-dark); }
.pill-manual { background: #ececea; color: #55534f; }
.pill-off { background: #ececea; color: #8a8884; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-gold { background: var(--gold); color: #14120c; }
.btn-gold:hover { background: var(--gold-light); }
.btn-dark { background: var(--ink); color: #f2f0ec; }
.btn-dark:hover { background: var(--ink-3); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn-danger { background: var(--err-soft); color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- zakladki ---------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: #ebe9e4;
  border-radius: 11px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 8px;
  transition: background 0.16s, color 0.16s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- grafik godzin otwarcia ---------- */
.hours-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.hours-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.hours-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 8px 9px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 0.16s;
}
.hours-row:last-child { border-bottom: 0; }
.hours-row:nth-child(6), .hours-row:nth-child(7) { background: #fcfbf9; }
.hours-row.is-closed { background: #f7f6f3; }
.hours-row .switch { margin: 0; flex: 1; min-width: 0; }
.hours-row .switch span { font-weight: 600; }
.hours-row.is-closed .switch span { color: var(--muted); font-weight: 500; }

.hours-times { display: flex; align-items: center; gap: 8px; }
.hours-times input[type='time'] {
  width: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.hours-times input[type='time']:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.hours-times .dash { color: var(--muted); }
.hours-times .closed-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding-right: 6px;
}

.hours-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--gold-soft);
}
.hours-preview span {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold-dark);
}
.hours-preview strong { font-size: 14.5px; font-weight: 600; }

/* pole tekstowe z przyciskiem akcji, np. NIP + "Pobierz dane" */
.input-btn { display: flex; gap: 8px; align-items: stretch; }
.input-btn input { flex: 1; min-width: 0; }
.input-btn .btn { flex: none; white-space: nowrap; }
.hint code,
.alert code {
  background: #f2f1ee;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'Consolas', monospace;
  font-size: 11.5px;
}

/* ---------- formularze ---------- */
.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.field textarea { min-height: 92px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field.invalid input, .field.invalid select { border-color: var(--err); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }

.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 12px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--gold-dark); }

.fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.fieldset > legend {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold-dark);
  padding: 0 8px;
}

/* ---------- filtry ---------- */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.filters input,
.filters select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 13px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}
.filters input:focus, .filters select:focus { outline: none; border-color: var(--gold); }
.filters .grow { flex: 1; min-width: 180px; }

/* ---------- flota ---------- */
.car-rows { display: grid; gap: 12px; }
.car-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 18px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.car-row.inactive { opacity: 0.6; }
.car-row .thumb {
  width: 120px;
  aspect-ratio: 16/10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ink-2);
}
.car-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.car-row h3 { font-size: 17px; margin: 0 0 3px; }
.car-row .meta { font-size: 13px; color: var(--muted); }
.car-row .tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.car-row .price { font-family: var(--serif); font-size: 20px; color: var(--gold-dark); }

/* ---------- zdjęcia ---------- */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.image-tile {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-2);
  aspect-ratio: 16/10;
}
.image-tile img { width: 100%; height: 100%; object-fit: cover; }
.image-tile .tools {
  position: absolute;
  inset: auto 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 20px 8px 7px;
  display: flex;
  gap: 5px;
  justify-content: center;
}
.image-tile .tools button {
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 6px;
  width: 28px;
  height: 26px;
  font-size: 13px;
  line-height: 1;
}
.image-tile .tools button:hover { background: var(--gold); }
.image-tile.is-cover::after {
  content: 'okładka';
  position: absolute;
  top: 7px; left: 7px;
  background: var(--gold);
  color: #14120c;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  transition: all 0.2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-dark); }

/* ---------- kalendarz ---------- */
.cal-scroll { overflow-x: auto; padding-bottom: 8px; }
table.calendar { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.calendar th, table.calendar td { padding: 0; }
table.calendar th.car-col,
table.calendar td.car-col {
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 2;
  min-width: 200px;
  max-width: 200px;
  padding: 8px 12px;
  border-right: 2px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}
table.calendar td.car-col strong { display: block; font-weight: 600; }
table.calendar td.car-col small { color: var(--muted); font-size: 11.5px; }
table.calendar th.day {
  width: 30px;
  min-width: 30px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 0;
  text-align: center;
  border-bottom: 1px solid var(--line);
  line-height: 1.25;
}
table.calendar th.day.weekend { color: var(--err); }
table.calendar th.day.today { background: var(--gold); color: #14120c; border-radius: 5px 5px 0 0; }
table.calendar td.slot {
  height: 34px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #f2f1ee;
  background: #fcfcfb;
}
table.calendar td.slot.weekend { background: #f7f6f3; }
table.calendar td.slot.busy { cursor: pointer; }
table.calendar td.slot.b-pending { background: var(--warn); }
table.calendar td.slot.b-confirmed { background: var(--ok); }
table.calendar td.slot.b-active { background: var(--info); }
table.calendar td.slot.b-block {
  background: repeating-linear-gradient(45deg, #b9b7b2, #b9b7b2 5px, #cdcbc6 5px, #cdcbc6 10px);
  cursor: pointer;
}
table.calendar td.slot.busy:hover { filter: brightness(1.08); }
table.calendar td.slot.start { border-radius: 6px 0 0 6px; }
table.calendar td.slot.end { border-radius: 0 6px 6px 0; }
.cal-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.cal-legend i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; margin-right: 6px; vertical-align: -2px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 12, 0.62);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 34px 18px;
  overflow-y: auto;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg);
  border-radius: 16px;
  width: min(100%, 820px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.modal.wide { width: min(100%, 1020px); }
@keyframes pop {
  from { opacity: 0; transform: translateY(-12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  background: var(--ink);
  color: #f2f0ec;
  padding: 20px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.modal-head h2 { font-family: var(--serif); font-size: 22px; margin: 0; }
.modal-head p { margin: 2px 0 0; font-size: 12.5px; color: #8d8b87; }
.modal-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 0;
  border-radius: 50%;
  color: #8d8b87;
  padding: 0;
  transition: background 0.16s, color 0.16s;
}
.modal-head button svg { width: 18px; height: 18px; }
.modal-head button:hover { background: var(--bg); }
.modal-head button:hover { color: var(--gold); }
.modal-body { padding: 24px 26px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot {
  padding: 16px 26px;
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.modal-foot .left { margin-right: auto; }

/* ---------- komunikaty ---------- */
.alert {
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert.error { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--info-soft); color: var(--info); }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: #f2f0ec;
  padding: 13px 22px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all 0.25s;
  border-left: 3px solid var(--gold);
}
.toast.show { opacity: 1; transform: none; }
.toast.err { border-left-color: var(--err); }

.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--muted);
}
.empty h3 { font-size: 17px; color: var(--text); }

.detail-list { display: grid; gap: 0; }
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.detail-list span { color: var(--muted); }
.detail-list b { font-weight: 600; text-align: right; }

/* ---------- responsywność ---------- */
/* ---------- podpowiedź z kontem testowym ---------- */
.demo-hint {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.demo-hint strong {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.demo-hint button {
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
  border-radius: 9px;
  padding: 9px 12px;
  text-align: left;
  font-size: 12.5px;
  transition: all 0.2s ease;
}
.demo-hint button b { color: var(--text); font-family: Consolas, monospace; }
.demo-hint button:hover { border-color: var(--gold); background: rgba(200, 162, 74, 0.08); }

/* dopisek przy nagłówku sekcji formularza */
.legend-note {
  margin-left: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.meta.mono {
  font-family: Consolas, 'SF Mono', Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ikony w menu bocznym mają być spokojne i równe */
.sidebar-nav button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: 0.85;
}
.sidebar-nav button.active svg { opacity: 1; }

/* ---------- wybór marki z logotypów ---------- */
.brand-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-field input { flex: 1; }
.brand-chip {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.brand-chip img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.brand-chip b { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }

/* popup z kafelkami marek */
.brand-sheet {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.brand-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 12, 0.6);
}
.brand-sheet-card {
  position: relative;
  width: min(880px, 100%);
  max-height: min(84vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.brand-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand-sheet-head h3 { margin: 0; font-size: 17px; font-family: var(--sans); font-weight: 700; }
.brand-sheet-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.fm-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  flex: 0 0 auto;
}
.fm-close-btn svg { width: 16px; height: 16px; }
.fm-close-btn:hover { background: var(--ink); color: #fff; }

.brand-sheet-search { padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand-sheet-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  background: var(--bg);
}

.brand-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  padding: 16px 20px 20px;
  overflow-y: auto;
}
.brand-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: all 0.18s ease;
}
.brand-option img { width: 52px; height: 52px; object-fit: contain; }
.brand-option span {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
  word-break: break-word;
}
.brand-option:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); }
.brand-option.is-active { border-color: var(--gold); background: var(--gold-soft); }
.picker-empty { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; text-align: center; padding: 18px 0; }
.mono { font-family: Consolas, 'SF Mono', Menlo, monospace; font-size: 12px; }

@media (max-width: 640px) {
  .brand-sheet { padding: 0; align-items: flex-end; }
  .brand-sheet-card { max-height: 88vh; border-radius: 16px 16px 0 0; }
  .brand-sheet-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); padding: 12px 14px 20px; }
  .brand-option img { width: 44px; height: 44px; }
}

/* logo marki w wierszu floty */
.row-brand {
  display: inline-flex;
  width: 26px;
  height: 26px;
  margin-right: 8px;
  vertical-align: -6px;
  align-items: center;
  justify-content: center;
}
.row-brand img { width: 100%; height: 100%; object-fit: contain; }
.row-brand b { font-size: 11px; color: var(--muted); }

/* ---------- tablica rejestracyjna ---------- */
.plate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    linear-gradient(90deg, #1c3f94 0 10px, transparent 10px),
    #fff;
  color: #14161a;
  font-family: Consolas, 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  vertical-align: middle;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.color-row input[type='color'] {
  width: 56px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

@media (max-width: 980px) {
  .app.ready { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .sidebar-nav button { white-space: nowrap; }
  .sidebar-foot { display: flex; gap: 12px; align-items: center; }
  .sidebar-foot button { width: auto; margin: 0; }
  .content { padding: 22px 18px 60px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tabs button { flex: none; padding: 9px 13px; font-size: 13px; }
  .hours-row { flex-wrap: wrap; padding: 10px 12px; }
  .hours-row .switch { flex: 1 0 100%; }
  .hours-times { width: 100%; }
  .hours-times input[type='time'] { flex: 1; width: auto; }
  .hours-tools .btn { flex: 1; }
  .input-btn { flex-wrap: wrap; }
  .input-btn .btn { width: 100%; }
  .car-row { grid-template-columns: 84px 1fr; }
  .car-row .thumb { width: 84px; }
  .car-row > div:last-child { grid-column: 1 / -1; }
  .page-head h1 { font-size: 24px; }
}

/* ============================================================
   ZAGĘSZCZENIE — panel ma być narzędziem pracy, nie wizytówką.
   Mniej powietrza, więcej danych na ekranie.
   ============================================================ */
body { font-size: 14px; }

.content { padding: 20px 22px 48px; }
.page-head { margin-bottom: 16px; align-items: center; }
.page-head h1 { font-family: var(--sans); font-weight: 700; font-size: 21px; letter-spacing: -0.01em; }
.page-head p { font-size: 13px; }

.card { padding: 14px 16px; border-radius: 8px; box-shadow: none; }
.card + .card { margin-top: 14px; }
.card-head { margin-bottom: 10px; }
.card-head h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* statystyki jako wąski pasek */
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { padding: 12px 14px; border-radius: 8px; box-shadow: none; }
.stat span { font-size: 10px; margin-bottom: 4px; }
.stat strong { font-family: var(--sans); font-weight: 700; font-size: 22px; }
.stat small { font-size: 11.5px; }

/* tabele — sedno panelu */
table.data { font-size: 13px; }
table.data th { padding: 0 8px 7px; font-size: 10px; }
table.data td { padding: 7px 8px; }
table.data tbody tr:hover { background: #f2f6fb; }
table.data.compact td, table.data.compact th { padding: 5px 8px; }
table.data td small { font-size: 11.5px; }

/* wiersze floty jako gęsta lista */
.car-rows { gap: 6px; }
.car-row { padding: 8px 10px; border-radius: 8px; box-shadow: none; grid-template-columns: 74px 1fr auto; gap: 12px; }
.car-row .thumb { width: 74px; border-radius: 5px; }
.car-row h3 { font-family: var(--sans); font-size: 14.5px; font-weight: 700; }
.car-row .meta { font-size: 12px; }
.car-row .tags { margin-top: 4px; gap: 4px; }
.car-row .price { font-family: var(--sans); font-size: 16px; font-weight: 700; }

.pill { font-size: 10px; padding: 2px 8px; }
.btn { padding: 7px 13px; font-size: 13px; border-radius: 6px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.filters { gap: 8px; margin-bottom: 12px; }
.filters input, .filters select { padding: 7px 11px; font-size: 13px; border-radius: 6px; }

.field { margin-bottom: 11px; }
.field label { font-size: 10px; margin-bottom: 3px; }
.field input, .field select, .field textarea { padding: 7px 10px; font-size: 13.5px; border-radius: 6px; }
.field textarea { min-height: 70px; }
.fieldset { padding: 12px 14px; margin-bottom: 12px; border-radius: 8px; }
.fieldset > legend { font-size: 10px; }
.grid-2, .grid-3, .grid-4 { gap: 0 12px; }
.alert { padding: 9px 12px; font-size: 13px; border-radius: 6px; margin-bottom: 12px; }

.sidebar { position: sticky; }
.sidebar-brand { padding: 16px 18px 14px; }
.sidebar-brand .logo { font-size: 30px; }
.sidebar-nav { padding: 8px; }
.sidebar-nav button { padding: 9px 12px; font-size: 13.5px; border-radius: 6px; }
.sidebar-foot { padding: 12px 14px; font-size: 12px; }

.modal-body { padding: 16px 18px; }
.modal-head { padding: 14px 20px; }
.modal-head h2 { font-family: var(--sans); font-weight: 700; font-size: 17px; }
.modal-foot { padding: 12px 18px; }
.detail-list div { padding: 6px 0; font-size: 13px; }
.image-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.dropzone { padding: 16px; font-size: 13px; }

/* kalendarz gęściej */
table.calendar th.car-col, table.calendar td.car-col { min-width: 165px; max-width: 165px; padding: 5px 9px; font-size: 12px; }
table.calendar td.slot { height: 26px; }
table.calendar th.day { width: 26px; min-width: 26px; font-size: 9px; }

/* konta pracowników */
.staff-row-inactive td { opacity: 0.5; }
.role-admin { background: var(--gold-soft); color: var(--gold-dark); }
.role-staff { background: var(--info-soft); color: var(--info); }
.you-badge { background: var(--ok-soft); color: var(--ok); }

/* ============================================================
   PANEL NA TELEFONIE I TABLECIE
   Blok na końcu pliku — wygrywa z wcześniejszymi regułami
   o tej samej specyficzności.
   ============================================================ */
@media (max-width: 980px) {
  .app.ready { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .content, .view, .card { min-width: 0; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 50;
  }
  .sidebar-brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 12px 16px 10px;
  }
  .sidebar-brand .logo { font-size: 24px; }
  .sidebar-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 12px;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-nav button { min-height: 44px; white-space: nowrap; }
  .sidebar-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    padding: 10px 16px;
  }
  .sidebar-foot button { width: auto; margin: 0; min-height: 40px; }
}

@media (max-width: 640px) {
  /* 16 px zapobiega przybliżaniu pola po dotknięciu w iOS */
  input, select, textarea { font-size: 16px !important; min-height: 46px; }
  .field textarea { min-height: 96px; }
  .btn { min-height: 46px; padding: 11px 18px; }
  .btn-sm { min-height: 40px; }

  .content { padding: 16px 14px 72px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head .btn-row { width: 100%; }
  .page-head .btn-row .btn { flex: 1; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select { width: 100%; }

  /* tabele zamieniają się w karty — poziome przewijanie na telefonie męczy */
  .table-wrap { overflow-x: visible; }
  table.data { display: block; min-width: 0; }
  table.data thead { display: none; }
  table.data tbody, table.data tr { display: block; width: 100%; }
  table.data tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  table.data tbody tr:hover { background: var(--card); }
  table.data td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 5px 0;
    border: 0;
    text-align: right;
  }
  table.data td::before {
    content: attr(data-label);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    flex: 0 0 auto;
    text-align: left;
  }
  table.data td:empty { display: none; }
  table.data td .btn-row { justify-content: flex-end; flex-wrap: wrap; }
  table.data td.num { text-align: right; }

  /* modal jako arkusz wysuwany z dołu */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.wide {
    width: 100%;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    border-radius: 16px 16px 0 0;
  }
  .modal-body { flex: 1; overflow-y: auto; }
  .modal-foot {
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .modal-foot .btn { flex: 1 1 100%; }
  .modal-foot .btn.left { order: 3; }

  .car-row { grid-template-columns: 1fr; }
  .car-row .thumb { width: 100%; height: 160px; }
  .car-row > div:last-child { text-align: left; }
  .car-row .btn-row { justify-content: flex-start !important; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .cal-scroll { margin-inline: -14px; padding-inline: 14px; }
  .image-grid { grid-template-columns: 1fr 1fr; }
}

@media (hover: none) {
  table.data tr.clickable:hover { background: var(--card); }
}
