:root {
  --bg: #f5f2ec;
  --surface: #ffffff;
  --text: #2b2620;
  --muted: #7a7064;
  --border: #e6dfd3;
  --side-bg: #2f3a2e;
  --side-text: #d9dfd2;
  --side-active: #4a5a47;
  --accent: #b5652b;
  --accent-soft: #f6e7da;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(40, 30, 20, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--side-bg);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-logo { font-size: 30px; }
.brand-name { font-weight: 700; font-size: 18px; color: #fff; }
.brand-sub { font-size: 12px; opacity: .7; }

.menu { display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; }
.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--side-text);
  text-decoration: none;
  font-size: 15px;
  transition: background .15s;
}
.menu a:hover { background: rgba(255, 255, 255, .06); }
.menu a.active {
  background: var(--side-active);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.menu .ico { width: 22px; text-align: center; }

.user-box {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.user-name { color: #fff; font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; opacity: .7; margin-bottom: 10px; }
.btn-logout {
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: none;
  color: var(--side-text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.btn-logout:hover { background: rgba(255, 255, 255, .06); }

/* ---------- Logowanie ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: linear-gradient(160deg, #2f3a2e, #5b6e57);
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-brand { font-size: 40px; text-align: center; }
.login-card h1 { margin: 0; text-align: center; font-size: 24px; }
.login-sub { margin: -8px 0 6px; text-align: center; color: var(--muted); font-size: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
}
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.login-error { color: #b3261e; font-size: 13px; min-height: 18px; }
.btn-primary {
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.page-title { margin: 0; font-size: 22px; }
.today { margin-left: auto; color: var(--muted); font-size: 14px; }
.burger {
  display: none;
  border: 0;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
}

.content { padding: 28px; }

/* ---------- Dashboard ---------- */
.welcome {
  background: linear-gradient(120deg, #3d4b3b, #5b6e57);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
}
.welcome h2 { margin: 0 0 6px; font-size: 22px; }
.welcome p { margin: 0; opacity: .85; }

.section-title { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 28px 0 12px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tile-ico {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--accent-soft);
  border-radius: 10px;
  margin-bottom: 12px;
}
.tile h3 { margin: 0 0 4px; font-size: 16px; }
.tile p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Placeholder modułu ---------- */
.placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.placeholder .big { font-size: 48px; }
.placeholder h2 { color: var(--text); margin: 12px 0 6px; }

/* ---------- Mobile ---------- */
.backdrop { display: none; }

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform .2s;
  }
  .sidebar.open { transform: translateX(0); }
  .backdrop.show {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 10;
  }
  .burger { display: block; }
  .topbar { padding: 14px 16px; }
  .content { padding: 16px; }
  .today { display: none; }
}

/* ---------- Moduł: Informacje o domkach ---------- */
.muted { color: var(--muted); }
.obj-stats { margin-bottom: 20px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar .seg-small { margin-left: auto; }

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.seg button {
  border: 0;
  background: none;
  padding: 7px 14px;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.seg button.on { background: var(--side-bg); color: #fff; }
.seg-small button { padding: 6px 12px; font-size: 13px; }

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 7px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: #7a3e12; font-weight: 600; }

.people-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.people-filter input {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.legend .bed { background: none; border: 0; padding: 0; }

.obj-section { margin-bottom: 32px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 19px; }
.section-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }

.grid { display: grid; gap: 14px; }
.grid-units { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-rooms { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid-buildings { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Willa */
.willa-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  background: linear-gradient(120deg, #3d4b3b, #5b6e57);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 14px;
}
.willa-main { flex: 1 1 320px; }
.willa-hero h2 { margin: 2px 0 6px; font-size: 22px; }
.willa-hero p { margin: 0 0 14px; opacity: .9; }
.willa-common { display: flex; flex-wrap: wrap; gap: 10px; }
.common {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 8px 12px;
}
.common span { font-size: 20px; }
.common b { display: block; font-size: 14px; }
.common small { opacity: .85; }
.willa-nums { display: flex; gap: 22px; align-items: center; }
.willa-nums div { text-align: center; }
.willa-nums b { display: block; font-size: 28px; }
.willa-nums span { font-size: 12px; opacity: .8; }

/* Karty obiektów */
.unit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.unit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.unit-head h3 { margin: 0; font-size: 16px; }
.unit-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; min-height: 4px; }
.unit-tags:empty { display: none; }

.tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag-blue { background: #e3eef8; color: #1f4f7a; }
.tag-orange { background: var(--accent-soft); color: #7a3e12; }
.tag-muted { background: #efebe4; color: var(--muted); }

.rooms { display: flex; flex-direction: column; gap: 8px; }
.room { border-top: 1px solid var(--border); padding-top: 8px; }
.room-name { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.room-beds { display: flex; flex-wrap: wrap; gap: 6px; }

.bed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  background: #f7f4ef;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px 3px 5px;
}
.bed b { font-weight: 700; }
.bed-extra { border-style: dashed; background: none; color: var(--muted); }
.bed-ico { display: inline-flex; width: 20px; height: 20px; color: #5b6e57; }
.bed-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; }

.people { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dots { display: inline-flex; gap: 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.dots i.extra { background: none; border: 1.5px solid var(--accent); width: 7px; height: 7px; box-sizing: border-box; }
.people-num { font-weight: 700; font-size: 14px; }

.unit-budynek { display: flex; gap: 14px; align-items: center; }
.unit-budynek h3 { margin: 0 0 2px; font-size: 16px; }
.unit-budynek p { margin: 0; font-size: 13px; }
.building-ico {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--accent-soft);
  border-radius: 10px;
}

.note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.empty { color: var(--muted); padding: 16px 0; }

/* Tabela */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.obj-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.obj-table th, .obj-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.obj-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #faf8f4; }
.obj-table tr:last-child td { border-bottom: 0; }
.t-room { font-size: 13px; }
.nowrap { white-space: nowrap; }

@media (max-width: 860px) {
  .toolbar .seg-small { margin-left: 0; }
  .seg { flex-wrap: wrap; }
  .willa-nums { gap: 16px; }
}

/* ---------- Moduł: Kody dostępowe ---------- */
.search {
  flex: 1 1 280px;
  max-width: 420px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
}
.search:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.code-tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 10px;
  box-shadow: var(--shadow);
}
.code-label { font-size: 13px; color: var(--muted); padding-right: 54px; }
.code-value {
  display: block;
  border: 0;
  background: none;
  padding: 2px 0 0;
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text);
  cursor: default;
}
.code-value.masked { color: var(--muted); cursor: pointer; letter-spacing: .2em; }
.code-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.code-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; }
.icon-btn {
  width: 28px; height: 28px;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
}
.icon-btn:hover { background: #f1ece4; color: var(--text); }

.link-btn {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Okno dialogowe */
.dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  width: min(420px, calc(100vw - 32px));
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
  color: var(--text);
}
.dialog::backdrop { background: rgba(30, 25, 20, .45); }
.dialog-form { display: flex; flex-direction: column; gap: 12px; padding: 22px 22px 18px; }
.dialog-form h2 { margin: 0 0 4px; font-size: 18px; }
.dialog-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.dialog-form input, .dialog-form select {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
}
.dialog-form .mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 18px; letter-spacing: .1em; }
.dialog-meta { font-size: 12px; }
.dialog-buttons { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.dialog-buttons .spacer { flex: 1; }
.btn-secondary, .btn-danger {
  padding: 10px 14px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  background: none;
}
.btn-secondary { border: 1px solid var(--border); color: var(--text); }
.btn-danger { border: 1px solid #e3b4ae; color: #b3261e; }
.btn-danger:hover { background: #fbecea; }
.dialog-buttons .btn-primary { padding: 10px 18px; }

/* ---------- Moduł: Stan domków ---------- */
.st-do_sprzatania  { --st: #c0392b; --st-bg: #fbe9e7; }
.st-w_trakcie      { --st: #b7791f; --st-bg: #fdf3dc; }
.st-do_sprawdzenia { --st: #2b6cb0; --st-bg: #e4eefa; }
.st-czysty         { --st: #2f855a; --st-bg: #e3f3ea; }

.status-counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.status-counter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--st);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.status-counter.on { background: var(--st-bg); border-color: var(--st); }
.sc-num { font-size: 28px; font-weight: 700; color: var(--st); line-height: 1.1; }
.sc-label { font-size: 13px; color: var(--muted); }

.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.status-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--st);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .1s;
}
.status-tile:hover { transform: translateY(-1px); }
.status-tile.st-do_sprzatania, .status-tile.st-w_trakcie, .status-tile.st-do_sprawdzenia { background: var(--st-bg); }
.status-tile.selected { outline: 3px solid var(--accent); outline-offset: 1px; }
.st-name { font-weight: 700; font-size: 15px; }
.st-status { font-size: 13px; color: var(--st); font-weight: 600; }
.st-meta { font-size: 11px; color: var(--muted); }
.tile-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.status-tile.selected .tile-check { border-color: var(--accent); }

.st-btn {
  padding: 12px 14px;
  border: 1px solid var(--st);
  border-radius: 10px;
  background: var(--st-bg);
  color: var(--st);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.st-btn:disabled { opacity: .45; cursor: default; }
.st-btn.current { background: var(--st); color: #fff; }
.st-btn small { font-weight: 400; opacity: .9; }
.st-choices { display: grid; gap: 8px; }
.st-choices .st-btn { font-size: 16px; padding: 14px 16px; }

.history { font-size: 13px; border-top: 1px solid var(--border); padding-top: 10px; }
.history-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.history ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-height: 180px; overflow-y: auto; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--st); margin-right: 7px; }

.bulk-bar {
  position: sticky;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(40, 30, 20, .18);
}
.bulk-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-buttons .st-btn { padding: 9px 12px; font-size: 14px; }

@media (max-width: 860px) {
  .status-counters { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .bulk-buttons { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
}

/* ---------- Moduł: Wyżywienie ---------- */
.week-bar { gap: 12px; }
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-label { margin: 0; font-size: 18px; min-width: 210px; text-align: center; }
.icon-btn.big { width: 36px; height: 36px; font-size: 22px; border: 1px solid var(--border); background: var(--surface); }
.add-btn { margin-left: auto; padding: 9px 16px; }

/* Na szerokim ekranie 7 kolumn, na węższym — dzień pod dniem. */
.week { display: flex; flex-direction: column; gap: 10px; }
.day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #faf8f4;
  border-bottom: 1px solid var(--border);
}
.day.is-today .day-head { background: var(--accent-soft); }
.day-name { font-weight: 700; }
.day-date { color: var(--muted); }
.today-pill { font-size: 11px; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.day-sum { margin-left: auto; font-size: 12px; color: var(--muted); }
.day-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 10px; }
.day.empty .day-body { padding: 6px 12px; }
.day-none { font-size: 13px; color: var(--muted); }

@media (min-width: 1400px) {
  .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
  .day-body { grid-template-columns: 1fr; padding: 8px; gap: 8px; }
  .day.empty .day-body { padding: 8px; }
  .day-head { flex-wrap: wrap; gap: 2px 8px; }
  .day-sum { margin-left: 0; width: 100%; order: 3; }
}

.meal-card {
  border: 1px solid var(--border);
  border-left: 4px solid #5b6e57;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.meal-card[role=button] { cursor: pointer; }
.meal-card[role=button]:hover { border-color: var(--accent); border-left-color: var(--accent); }
.meal-card.needs-ack { border-left-color: #c05621; background: #fffaf3; }
.meal-card.cancelled { border-left-color: #a0a0a0; background: #f6f5f3; }
.meal-card.cancelled .meal-top, .meal-card.cancelled .meal-place, .meal-card.cancelled .meal-menu { text-decoration: line-through; opacity: .6; }
.meal-card.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }

.meal-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.meal-time { font-size: 18px; font-weight: 700; }
.meal-type { font-weight: 600; }
.meal-persons { margin-left: auto; font-weight: 700; color: var(--accent); white-space: nowrap; }
.meal-place { font-size: 13px; color: var(--muted); }
.meal-menu { font-size: 13px; white-space: pre-wrap; border-top: 1px dashed var(--border); padding-top: 5px; }
.meal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }

.meal-state { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ms-new { background: #fdf3dc; color: #8a5a12; }
.ms-changed { background: #fde2d6; color: #a2361a; }
.ms-ok { background: #e3f3ea; color: #2f855a; }
.ms-cancel { background: #ece9e4; color: #6b645b; }

.btn-ack {
  margin-left: auto;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: #2f855a;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ack:disabled { opacity: .6; }

.pending {
  background: #fff4e5;
  border: 1px solid #f0c48a;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.pending-title { font-weight: 700; color: #8a4b0f; margin-bottom: 6px; }
.pending ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pending-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 6px 4px;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.pending-item:hover { background: rgba(255, 255, 255, .6); }
.pending-item .meal-state { margin-left: 6px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-form textarea {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  resize: vertical;
}
.form-hint { font-size: 13px; background: #fff4e5; border-radius: 8px; padding: 8px 10px; color: #8a4b0f; }
.dialog-buttons.wrap { flex-wrap: wrap; }
#mealDialog { width: min(520px, calc(100vw - 32px)); }

@media (max-width: 860px) {
  .add-btn { margin-left: 0; width: 100%; }
  .week-label { min-width: 0; font-size: 16px; }
  .day-body { grid-template-columns: 1fr; }
  .btn-ack { width: 100%; margin-left: 0; padding: 11px; }
}

/* ---------- Zmiana hasła / Moduł: Użytkownicy ---------- */
.user-buttons { display: flex; gap: 6px; }
.user-buttons .btn-logout { flex: 1; }

.users-table td { vertical-align: middle; }
.users-table tr.inactive td { opacity: .55; }
.mono-sm { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 12px; }
.row-actions { white-space: nowrap; text-align: right; }
.btn-secondary.small { padding: 6px 10px; font-size: 13px; }
.ok-dot { color: #2f855a; }

.role-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #efebe4; color: var(--muted); }
.role-admin { background: #3d4b3b; color: #fff; }
.role-obsluga { background: #e3eef8; color: #1f4f7a; }
.role-catering { background: var(--accent-soft); color: #7a3e12; }

.roles-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.role-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.role-card p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; min-width: 0; }
.dialog-form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.dialog-form small { font-size: 12px; }
.cred-box {
  margin: 0;
  padding: 12px 14px;
  background: #f7f4ef;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  user-select: all;
}

@media (max-width: 860px) {
  .users-table thead { display: none; }
  .users-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .users-table td { border: 0; padding: 0; }
  .users-table td:nth-child(4) { grid-column: 1 / -1; font-size: 12px; }
  .users-table .row-actions { grid-column: 1 / -1; text-align: left; display: flex; gap: 8px; }
}
