/* ==========================================================================
   Panel EW$ — arkusz stylów
   ========================================================================== */

:root {
  --bg:          #08080E;
  --bg-glow:     #150F2E;
  --surface:     #101019;
  --surface-2:   #16161F;
  --surface-3:   #1D1D29;
  --line:        rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);

  --text:        #EAEAF2;
  --text-dim:    #9C9CB4;
  --text-faint:  #6B6B85;

  --accent:      #7C5CFC;
  --accent-2:    #A78BFA;
  --accent-soft: rgba(124, 92, 252, .14);

  --green:  #34D399;
  --red:    #F87171;
  --amber:  #FBBF24;
  --cyan:   #22D3EE;
  --pink:   #F472B6;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;

  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .9);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(900px 520px at 12% -12%, var(--bg-glow), transparent 65%),
    radial-gradient(700px 420px at 92% 0%, rgba(34, 211, 238, .07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 400 14px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p  { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .9em;
}

svg { width: 18px; height: 18px; flex: none; fill: currentColor; }

svg.ico-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 3px solid transparent; background-clip: content-box; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #2C2C3E; background-clip: content-box; }

/* ── Layout ───────────────────────────────────────────────────────────── */

.layout { display: flex; min-height: 100%; }

.main {
  flex: 1;
  min-width: 0;
  padding: 26px 30px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: var(--sidebar-w);
  flex: none;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  border-right: 1px solid var(--line);
  background: rgba(12, 12, 20, .6);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), #4C2FD6);
  box-shadow: 0 6px 18px -6px var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand__name { font-weight: 600; font-size: 15px; }

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav__label {
  margin: 14px 0 6px 10px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav__label:first-child { margin-top: 0; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item.is-active { background: var(--accent-soft); color: #C9B8FF; }
.nav__item.is-active svg { color: var(--accent-2); }

.sidebar__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 12px;
}
.sidebar__foot strong { display: block; font-weight: 600; font-size: 12.5px; }
.sidebar__foot span   { color: var(--text-faint); }

.sync-dot {
  width: 8px; height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .15);
  transition: background .2s, box-shadow .2s;
}
.sync-dot.is-busy { background: var(--amber); box-shadow: 0 0 0 4px rgba(251, 191, 36, .15); }
.sync-dot.is-error { background: var(--red); box-shadow: 0 0 0 4px rgba(248, 113, 113, .15); }

/* ── Topbar ───────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.topbar__title { font-size: 25px; }
.topbar__sub { margin-top: 4px; color: var(--text-dim); font-size: 13px; }

.topbar__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.monthnav {
  display: flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.monthnav__btn {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.monthnav__btn:hover { background: var(--surface-3); color: var(--text); }

.monthnav__current {
  min-width: 132px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 600 13.5px/30px inherit;
  cursor: pointer;
}
.monthnav__current:hover { color: var(--accent-2); }

/* ── Przyciski ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 600 13.5px inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

.btn--primary {
  background: linear-gradient(140deg, var(--accent), #5B3BE8);
  color: #fff;
  box-shadow: 0 10px 24px -14px var(--accent);
}
.btn--primary:hover { background: linear-gradient(140deg, #8A6DFF, #6647F0); }

.btn--ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text-dim);
}
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }

.btn--danger { background: rgba(248, 113, 113, .15); border-color: rgba(248, 113, 113, .35); color: #FCA5A5; }
.btn--danger:hover { background: rgba(248, 113, 113, .25); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn--danger:hover { background: rgba(248, 113, 113, .15); color: #FCA5A5; }

/* ── Banner ───────────────────────────────────────────────────────────── */

.banner {
  padding: 12px 16px;
  border: 1px solid rgba(251, 191, 36, .28);
  border-radius: var(--r);
  background: rgba(251, 191, 36, .08);
  color: #FCD34D;
  font-size: 13px;
}
.banner a { color: inherit; font-weight: 600; }
.banner--error { border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .08); color: #FCA5A5; }

/* ── Kafelki ──────────────────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 16px 18px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}
.stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.stat header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-dim);
  font-size: 12.5px;
}

.stat__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
}

.stat strong {
  display: block;
  margin: 9px 0 6px;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.stat footer { color: var(--text-faint); font-size: 12px; }
.stat footer b { font-weight: 600; }
.stat footer .up   { color: var(--green); }
.stat footer .down { color: var(--red); }

/* ── Karty ────────────────────────────────────────────────────────────── */

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.card__head--wrap { flex-wrap: wrap; }
.card__head h2 { font-size: 16px; }
.card__sub { margin-top: 3px; color: var(--text-faint); font-size: 12.5px; }

.pill {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
}
.pill--muted { background: var(--surface-3); color: var(--text-dim); }

/* ── Segmented control ────────────────────────────────────────────────── */

.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.seg__btn {
  padding: 6px 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font: 600 12.5px inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg__btn:hover { color: var(--text); }
.seg__btn.is-active { background: var(--surface-3); color: var(--text); }

/* ── Wykres ───────────────────────────────────────────────────────────── */

.chart { position: relative; width: 100%; min-height: 268px; }
.chart svg { width: 100%; height: auto; display: block; }

.chart__grid       { stroke: rgba(255, 255, 255, .05); stroke-width: 1; }
.chart__axis-label { fill: var(--text-faint); font-size: 10.5px; }
.chart__guide      { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.chart__line       { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.chart__dot        { stroke: var(--surface); stroke-width: 2.5; }

.chart__empty {
  display: grid;
  place-items: center;
  min-height: 268px;
  color: var(--text-faint);
  font-size: 13px;
}

.chart__tooltip {
  position: absolute;
  z-index: 5;
  min-width: 148px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(22, 22, 31, .97);
  box-shadow: 0 16px 34px -18px #000;
  font-size: 12px;
  pointer-events: none;
  transform: translate(-50%, -100%);
  transition: opacity .1s;
}
.chart__tooltip h4 { margin: 0 0 7px; color: var(--text-dim); font-size: 11.5px; font-weight: 600; }
.chart__tooltip ul { display: flex; flex-direction: column; gap: 5px; }
.chart__tooltip li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.chart__tooltip li i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.chart__tooltip li b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart__tooltip .tt-total { margin-top: 3px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--text-dim); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-dim);
  font: 500 12px inherit;
  cursor: pointer;
  transition: opacity .15s, border-color .15s, color .15s;
}
.legend__item:hover { border-color: var(--line-strong); color: var(--text); }
.legend__item i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.legend__item b { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend__item.is-off { opacity: .38; }
.legend__item.is-off i { background: var(--text-faint); }

/* ── Placeholder (ogłoszenia) ─────────────────────────────────────────── */

.placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 230px;
  padding: 24px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  text-align: center;
}

.placeholder__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-2);
}
.placeholder__icon svg { width: 22px; height: 22px; }
.placeholder__title { font-weight: 600; font-size: 13.5px; }
.placeholder__text  { max-width: 280px; color: var(--text-faint); font-size: 12.5px; }

/* ── Filtry ───────────────────────────────────────────────────────────── */

.filters { display: flex; gap: 9px; flex-wrap: wrap; }

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-faint);
  transition: border-color .15s;
}
.field:focus-within { border-color: var(--accent); }
.field input, .field select {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}
.field--search input { width: 210px; }
.field--select { padding-right: 8px; cursor: pointer; }
.field--select option { background: var(--surface-2); color: var(--text); }

/* ── Tabela ───────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table th {
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table th:first-child { padding-left: 4px; }

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  vertical-align: middle;
}
.table td:first-child { padding-left: 4px; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }

.th-amount, .td-amount { text-align: right; white-space: nowrap; }
.th-actions { width: 1%; }
.td-actions { width: 1%; white-space: nowrap; }
.td-actions .icon-btn { opacity: .45; }
.table tbody tr:hover .td-actions .icon-btn { opacity: 1; }
.td-actions svg { width: 16px; height: 16px; }

.td-date  { color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-date b { display: block; color: var(--text); font-weight: 600; }
.td-date span { font-size: 11.5px; color: var(--text-faint); }

.td-amount b { font-weight: 650; font-variant-numeric: tabular-nums; }

.td-muted { color: var(--text-faint); }

.worker-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.worker-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.table-empty { padding: 34px 0 12px; color: var(--text-faint); text-align: center; font-size: 13px; }

.foot { padding-top: 6px; color: var(--text-faint); font-size: 12px; text-align: center; }

/* ── Modale ───────────────────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, .68);
  backdrop-filter: blur(4px);
  animation: fade .16s ease-out;
}

.modal__box {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  box-shadow: 0 40px 90px -30px #000;
  animation: pop .18s cubic-bezier(.2, .9, .3, 1.1);
}
.modal__box--wide   { width: min(640px, 100%); }
.modal__box--narrow { width: min(400px, 100%); }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.modal__head h3 { font-size: 16.5px; }

.modal__body { padding: 18px 20px 20px; overflow-y: auto; }

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@keyframes fade { from { opacity: 0; } }
@keyframes pop  { from { opacity: 0; transform: translateY(10px) scale(.985); } }

/* ── Formularze ───────────────────────────────────────────────────────── */

.form { display: flex; flex-direction: column; gap: 14px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form__group { display: flex; flex-direction: column; gap: 6px; }
.form__group > span { color: var(--text-dim); font-size: 12.5px; font-weight: 500; }

.form input[type="text"],
.form input[type="date"],
.form select,
.worker-add input {
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form select:focus, .worker-add input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form input::placeholder, .worker-add input::placeholder { color: var(--text-faint); }
.form select { cursor: pointer; }
.form select option { background: var(--surface-2); }
.form input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }

.input-affix { position: relative; display: flex; }
.input-affix input { width: 100%; padding-right: 38px; font-size: 17px; font-weight: 600; }
.input-affix em {
  position: absolute;
  top: 50%; right: 13px;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-style: normal;
  font-size: 13px;
}

.form__error {
  padding: 9px 12px;
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: 10px;
  background: rgba(248, 113, 113, .1);
  color: #FCA5A5;
  font-size: 12.5px;
}
.form__error[hidden] { display: none; }

.confirm-text { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; }
.confirm-text b { color: var(--text); }

/* ── Lista modelek ────────────────────────────────────────────────────── */

.worker-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 9px;
  margin-bottom: 14px;
}
.worker-add input { min-width: 0; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}
.switch input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.worker-list { display: flex; flex-direction: column; gap: 8px; }

.worker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  transition: border-color .15s;
}
.worker-row:hover { border-color: var(--line-strong); }
.worker-row.is-hidden { opacity: .5; }

.worker-row__avatar {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--surface-3);
  background: color-mix(in srgb, var(--c) 20%, transparent);
  color: var(--c);
  font-weight: 700;
  font-size: 13px;
}

.worker-row__info { min-width: 0; flex: 1; }
.worker-row__info strong { display: block; font-weight: 600; font-size: 13.5px; }
.worker-row__info span   { color: var(--text-faint); font-size: 12px; }

.worker-row__stats { text-align: right; font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.worker-row__stats b { display: block; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }

.worker-row__actions { display: flex; gap: 2px; }

.empty-note { padding: 18px 0; color: var(--text-faint); text-align: center; font-size: 13px; }

/* ── Toasty ───────────────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(24, 24, 34, .97);
  box-shadow: 0 20px 40px -20px #000;
  font-size: 13px;
  animation: slide .2s ease-out;
}
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.toast--error::before { background: var(--red); }
.toast.is-out { opacity: 0; transform: translateX(12px); transition: opacity .2s, transform .2s; }

@keyframes slide { from { opacity: 0; transform: translateX(16px); } }

/* ── Skeleton ─────────────────────────────────────────────────────────── */

.is-loading { position: relative; }
.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .04), transparent);
  animation: shimmer 1.1s infinite;
  pointer-events: none;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ── Responsywność ────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .grid-2  { grid-template-columns: 1fr; }
  .stats   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { position: fixed; bottom: 0; top: auto; left: 0; right: 0; z-index: 40; height: auto; width: auto; flex-direction: row; align-items: center; gap: 6px; padding: 8px 10px; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  .brand__name, .nav__label, .sidebar__foot { display: none; }
  .nav { flex-direction: row; gap: 4px; }
  .nav__item { width: auto; white-space: nowrap; font-size: 12.5px; }
  .main { padding: 20px 16px 92px; }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .topbar { align-items: stretch; }
  .topbar__actions { justify-content: space-between; }
  .monthnav { flex: 1; }
  .monthnav__current { flex: 1; min-width: 0; }
  .form__row { grid-template-columns: 1fr; }
  .worker-add { grid-template-columns: 1fr; }
  .field--search input { width: 100%; }
  .filters { width: 100%; }
  .field--search { flex: 1; }
}
