/* Wygląd „C” (dashboard) dla całego panelu: ładowany jako ostatni arkusz na każdej stronie, nadpisuje tylko wygląd, nie układ ani logikę.
   Liczby na górze w kartach, zaokrąglone karty 14–16 px, Jost półgruby w liczbach i tytułach kart, Cormorant w nagłówkach bez wersalików, przyciski min. 44 px. */
:root {
  --bg: #f3f1ea;
  --surface: #fbfaf6;
  --sunken: #ece9df;
  --line: #d9d5c6;
  --fg: #423a33;
  --muted: #7a7166;
  --muted-ciemny: #6f665b;
  --accent: #6b4f3a;
  --accent-dark: #4a3628;
  --accent-fg: #ffffff;
  --accent-soft: #e9e6da;
  --mila-bg: #cacab8;
  --mila-ink: #4a3628;
  --ok: #4c7556; --ok-bg: #e2ecdf;
  --warn: #8c6223; --warn-bg: #f5e8cf;
  --bad: #a1443e; --bad-bg: #f6dfdb;
  --r: 16px;
}
/* Mila: zielone akcenty zamiast brązowych (lokal wybiera lokal.js) */
:root[data-lokal="mila"] {
  --accent: #4c7556;
  --accent-dark: #3a5c43;
  --accent-soft: #e2ecdf;
}
body { font-variant-numeric: tabular-nums; }
.lokal-wybor { display: inline-flex; gap: 4px; background: var(--sunken); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.lokal-wybor button { font: inherit; font-size: 0.95rem; font-weight: 500; border: 0; border-radius: 9px; min-height: 40px; min-width: 64px; padding: 0 14px; background: transparent; color: var(--muted-ciemny); cursor: pointer; }
.lokal-wybor button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); font-weight: 600; }

/* Nagłówki: Cormorant półgruby, bez wersalików */
h1 { font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 1.75rem; }
h1 small { letter-spacing: 0.02em; }
h2 { font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 1.85rem; line-height: 1.1; }
h3 { font-family: var(--f-body); font-size: 0.8rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.panel > h3, .grupa > h3 { font-size: 0.95rem; font-weight: 600; color: var(--fg); }

/* Karty z liczbami (kafelki na górze modułów) */
.tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.tile { border-radius: 14px; padding: 12px 14px; gap: 2px; align-content: start; }
.tile .big { font-family: var(--f-body); font-weight: 600; font-size: clamp(1.35rem, 5vw, 1.8rem); line-height: 1.15; letter-spacing: 0; overflow-wrap: anywhere; }
.tile .sub { font-size: 0.8rem; }
:root:not([data-modul="foodcost"]) .tiles > .tile:first-child:not(.nowe):not(:has(.neg)) { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
:root:not([data-modul="foodcost"]) .tiles > .tile:first-child:not(.nowe):not(:has(.neg)) h3,
:root:not([data-modul="foodcost"]) .tiles > .tile:first-child:not(.nowe):not(:has(.neg)) .sub,
:root:not([data-modul="foodcost"]) .tiles > .tile:first-child:not(.nowe):not(:has(.neg)) .big { color: var(--accent-fg); }
:root:not([data-modul="foodcost"]) .tiles > .tile:first-child:not(.nowe):not(:has(.neg)) a { color: var(--accent-fg); }
:root:not([data-modul="foodcost"]) .tiles > .tile:first-child:not(.nowe):not(:has(.neg)) .pill { background: var(--accent-fg); }

/* Panele i karty */
.panel, .banner { border-radius: var(--r); }
.panel { padding: 16px; }

/* Nawigacja modułu: zakładki jak w kartach C */
nav button { border-radius: 12px; letter-spacing: 0; min-height: 44px; font-weight: 500; }

/* Przełączniki */
.seg, .lokbar .seg { border-radius: 12px; padding: 4px; }
.seg button, .lokbar .seg button { border-radius: 9px; min-height: 40px; }
.dzialy { border-radius: 14px; }
.dzialy button { min-height: 44px; letter-spacing: 0; font-weight: 600; }
.chips button { border-radius: 12px; min-height: 40px; }
.chips button[aria-pressed="true"], .seg button[aria-pressed="true"] { font-weight: 600; }

/* Przyciski: min. 44 px pod palec */
.btn { border-radius: 12px; letter-spacing: 0; min-height: 44px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.sm { min-height: 36px; border-radius: 10px; }
.btn.pri { font-weight: 600; }
.x { min-width: 36px; min-height: 36px; }

/* Znaczki statusu jak w C: małe, prostokątne, półgrube */
.pill { border-radius: 6px; font-weight: 600; font-size: 0.78rem; padding: 2px 8px; }

/* Pola */
input, select, textarea { border-radius: 12px; background: var(--surface); }
input[type="search"] { border-radius: 14px; }

/* Tabele: nagłówki zwykłymi literami */
th { text-transform: none; letter-spacing: 0; font-size: 0.8rem; font-weight: 500; color: var(--muted-ciemny); }
td.num, .num { font-weight: 500; }

/* Lista składników (Zamówienia) */
.sk-row { border-radius: 12px; }
.sk-nazwa b { font-weight: 600; }

/* Dolny pasek zamówienia i powiadomienia */
.koszyk { font-weight: 600; }
.koszyk .btn { min-height: 52px; border-radius: 14px; font-size: 1.05rem; }
.toast { border-radius: 14px; }

/* Ikony i drobne opisy na beżowym tle muszą mieć kontrast 4,5:1 */
.hint, .note, .muted, h1 small { color: var(--muted-ciemny); }

@media (max-width: 700px) {
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.5rem; }
  nav button { border-radius: 12px; min-height: 48px; font-size: 0.78rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 12px; }
}

/* ===== Ciemne tło (przełącznik na ekranie startowym, lokal.js ustawia data-tryb) ===== */
:root[data-tryb="ciemny"] {
  --bg: #1c1916; --surface: #262220; --sunken: #201d1a; --line: #3b3530;
  --fg: #ece6dc; --muted: #a89e92; --muted-ciemny: #b8aea1;
  --accent: #c9a07e; --accent-dark: #dcb796; --accent-fg: #1c1916; --accent-soft: #3a3028;
  --mila-bg: #4a4a3c; --mila-ink: #ebe7d4;
  --ok: #92c49e; --ok-bg: #22332a; --warn: #e2b86e; --warn-bg: #3b301d; --bad: #ea8d84; --bad-bg: #3f2421;
  --blue: #2c3a44; --mk: #93b6ea; --mk-bg: #1f2a3b; --bf: #a2cf83; --bf-bg: #24311d; --vp: #eba574; --vp-bg: #3b2719;
  --siatka: #3b3530; --naglowek: #2c2723; --weekend: #29241f;
  --kuchnia: #4b3727; --kuchnia-ink: #f1dac6; --bar: #3a402b; --bar-ink: #e0e6c1; --sala: #2a3745; --sala-ink: #cfdeee; --inne: #37322c; --inne-ink: #e2dacd;
  --naglowek-zielony: #33462a; --weekend-wiersz: #3e2828;
  color-scheme: dark;
}
:root[data-tryb="ciemny"][data-lokal="mila"] { --accent: #92c49e; --accent-dark: #addab7; --accent-soft: #24352b; }
[data-tryb="ciemny"] body { background: var(--bg); color: var(--fg); }
[data-tryb="ciemny"] input, [data-tryb="ciemny"] select, [data-tryb="ciemny"] textarea { background: var(--sunken); color: var(--fg); border-color: var(--line); }
[data-tryb="ciemny"] .arkusz-ramka, [data-tryb="ciemny"] .arkusz td.k input { background: var(--surface); }
[data-tryb="ciemny"] .arkusz .osoba, [data-tryb="ciemny"] .arkusz.dni .data { background: var(--surface); }
[data-tryb="ciemny"] .arkusz thead .we { background: #332d27; }
[data-tryb="ciemny"] .arkusz.dni thead th, [data-tryb="ciemny"] .arkusz.dni thead .dz { color: #d9e8cc; }
[data-tryb="ciemny"] .arkusz.dni thead th small { color: #b9c9ac; }
[data-tryb="ciemny"] .arkusz.dni thead .data { background: #42304a; color: #ecd8f2; }
[data-tryb="ciemny"] .kal .dzien.we { background: #29241f; }
[data-tryb="ciemny"] .toast { background: var(--fg); color: var(--bg); }
[data-tryb="ciemny"] .skaner .btn:not(.pri) { color: #1c1916; }
.tryb-btn { font: inherit; border: 1px solid var(--line); background: var(--sunken); color: var(--fg); border-radius: 12px; min-height: 48px; min-width: 48px; display: inline-grid; place-items: center; cursor: pointer; }
.tryb-btn svg { width: 20px; height: 20px; }
@media print { [data-tryb="ciemny"] body { background: #fff; color: #000; } }
/* iPhone (Safari): pole daty ma własną szerokość i wysokość, rozpycha kolumnę formularza, a puste jest wyższe od wypełnionego */
.fields > *, label { min-width: 0; }
input[type="date"], input[type="month"], input[type="time"] { -webkit-appearance: none; appearance: none; max-width: 100%; box-sizing: border-box; }
input[type="date"]::-webkit-date-and-time-value, input[type="month"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; margin: 0; }
/* Telefon: etykieta kolumny w jednej linii, żeby wartości w wierszu (np. „brak”) stały na równym poziomie */
@media (max-width: 700px) { table.resp td[data-l]::before { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
/* Telefon: małe przyciski i krzyżyki też 44 px pod palec, z odstępem między przyciskami obok siebie */
@media (pointer: coarse) {
  .btn.sm, .x { min-height: 44px; }
  .x { min-width: 44px; }
  .chips button { min-height: 44px; }
  .actions { gap: 10px; }
}

/* BistroDesk: znak w nagłówku i nazwa firmy pod nim */
.logo.bd { font-family: "Inter", system-ui, sans-serif; font-weight: 500; letter-spacing: -0.02em; text-transform: none; }
.logo.bd b { font-weight: 800; color: var(--accent); }
.logo.bd small:empty { display: none; }
.logo.bd .bd-nazwa { white-space: nowrap; }
