/* ==========================================================================
   BC Social — system wizualny
   Webowa estetyka Apple: dużo światła, czytelna typografia, miękkie
   powierzchnie, szkło w nawigacji, sprężyste animacje.
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #FBFBFD;
  --surface-raised: #FFFFFF;
  --fill: rgba(0, 0, 0, 0.035);
  --fill-2: rgba(0, 0, 0, 0.06);
  --fill-3: rgba(0, 0, 0, 0.09);
  --separator: rgba(0, 0, 0, 0.08);
  --separator-strong: rgba(0, 0, 0, 0.14);
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --text-3: #86868B;
  --text-inverse: #FFFFFF;

  --accent: #0071E3;
  --accent-hover: #0077ED;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --accent-text: #0066CC;
  --focus-ring: 0 0 0 4px rgba(0, 113, 227, 0.22);

  --blue: #0071E3;   --blue-text: #0066CC;   --blue-soft: rgba(0, 113, 227, 0.1);
  --orange: #FF9500; --orange-text: #C45500; --orange-soft: rgba(255, 149, 0, 0.13);
  --purple: #AF52DE; --purple-text: #8944AB; --purple-soft: rgba(175, 82, 222, 0.12);
  --green: #34C759;  --green-text: #1E8E3E;  --green-soft: rgba(52, 199, 89, 0.13);
  --red: #FF3B30;    --red-text: #D70015;    --red-soft: rgba(255, 59, 48, 0.1);

  --nav-bg: rgba(250, 250, 252, 0.78);
  --nav-border: rgba(0, 0, 0, 0.07);
  --backdrop: rgba(0, 0, 0, 0.32);
  --toast-bg: rgba(29, 29, 31, 0.92);
  --toast-text: #F5F5F7;

  --sheet-bg: rgba(255, 255, 255, 0.82);
  --sheet-border: rgba(255, 255, 255, 0.65);
  --sheet-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.18), 0 8px 24px -4px rgba(0, 0, 0, 0.08), inset 0 1px 1px 0 rgba(255, 255, 255, 0.95);
  --sheet-card-bg: rgba(255, 255, 255, 0.52);
  --sheet-card-border: rgba(255, 255, 255, 0.65);
  --sheet-input-bg: rgba(255, 255, 255, 0.55);
  --sheet-input-border: rgba(0, 0, 0, 0.1);

  --hairline: rgba(0, 0, 0, 0.08);
  --bg-card: #FFFFFF;
  --bg-card-secondary: #FBFBFD;
  --border-card: rgba(0, 0, 0, 0.08);
  --bg-subtle-fill: rgba(0, 0, 0, 0.035);
  --bg-subtle-hover: rgba(0, 0, 0, 0.06);
  --border-input: rgba(0, 0, 0, 0.12);
  --accent-focus: rgba(0, 113, 227, 0.22);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.02), 0 4px 18px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.03), 0 18px 44px rgba(0, 0, 0, 0.09);
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-sheet: 0 30px 80px rgba(0, 0, 0, 0.22), 0 4px 16px rgba(0, 0, 0, 0.08);

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --r-xs: 8px;
  --pill: 980px;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --page-w: 1220px;
  --page-w-wide: 1480px;
  --gutter: 28px;
  --nav-h: 56px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1C1C1E;
  --surface-2: #161617;
  --surface-raised: #2C2C2E;
  --fill: rgba(255, 255, 255, 0.05);
  --fill-2: rgba(255, 255, 255, 0.08);
  --fill-3: rgba(255, 255, 255, 0.12);
  --separator: rgba(255, 255, 255, 0.09);
  --separator-strong: rgba(255, 255, 255, 0.16);
  --text: #F5F5F7;
  --text-2: #A1A1A6;
  --text-3: #7C7C80;
  --accent: #2997FF;
  --accent-hover: #47A6FF;
  --accent-soft: rgba(41, 151, 255, 0.16);
  --accent-text: #2997FF;
  --focus-ring: 0 0 0 4px rgba(41, 151, 255, 0.3);
  --blue: #2997FF;   --blue-text: #5AB0FF;   --blue-soft: rgba(41, 151, 255, 0.16);
  --orange: #FF9F0A; --orange-text: #FFB340; --orange-soft: rgba(255, 159, 10, 0.16);
  --purple: #BF5AF2; --purple-text: #DA8FFF; --purple-soft: rgba(191, 90, 242, 0.18);
  --green: #30D158;  --green-text: #4ADE80;  --green-soft: rgba(48, 209, 88, 0.16);
  --red: #FF453A;    --red-text: #FF6961;    --red-soft: rgba(255, 69, 58, 0.16);
  --nav-bg: rgba(22, 22, 23, 0.74);
  --nav-border: rgba(255, 255, 255, 0.08);
  --backdrop: rgba(0, 0, 0, 0.55);
  --toast-bg: rgba(58, 58, 60, 0.94);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 44px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-sheet: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 90px rgba(0, 0, 0, 0.7);

  --sheet-bg: rgba(24, 24, 28, 0.88);
  --sheet-border: rgba(255, 255, 255, 0.12);
  --sheet-shadow: 0 32px 72px -8px rgba(0, 0, 0, 0.75), 0 12px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.14);
  --sheet-card-bg: rgba(255, 255, 255, 0.05);
  --sheet-card-border: rgba(255, 255, 255, 0.09);
  --sheet-input-bg: rgba(255, 255, 255, 0.07);
  --sheet-input-border: rgba(255, 255, 255, 0.13);

  --hairline: rgba(255, 255, 255, 0.09);
  --bg-card: #1C1C1E;
  --bg-card-secondary: #2C2C2E;
  --border-card: rgba(255, 255, 255, 0.08);
  --bg-subtle-fill: rgba(255, 255, 255, 0.05);
  --bg-subtle-hover: rgba(255, 255, 255, 0.09);
  --border-input: rgba(255, 255, 255, 0.14);
  --accent-focus: rgba(41, 151, 255, 0.3);

  color-scheme: dark;
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --nav-bg: #FFFFFF;
    --sheet-bg: #FFFFFF;
    --backdrop: rgba(0, 0, 0, 0.6);
  }
  :root[data-theme="dark"] {
    --nav-bg: #1C1C1E;
    --sheet-bg: #1C1C1E;
    --backdrop: rgba(0, 0, 0, 0.75);
  }
  .sheet, .nav-blur, .popover, .mini-tile-dropdown {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* ───────────────────────── baza ───────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s var(--ease-out), color 0.35s var(--ease-out);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img, video { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
::selection { background: var(--accent-soft); }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }
.icon.xs { width: 13px; height: 13px; stroke-width: 2; }
.icon.lg { width: 22px; height: 22px; }
.icon.xl { width: 30px; height: 30px; stroke-width: 1.5; }
.icon.filled { fill: currentColor; stroke: none; }

/* ───────────────────────── nawigacja ───────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--nav-border);
}

.nav-inner {
  max-width: var(--page-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  transition: max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  justify-self: start;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #1D1D1F;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
}
.brand-mark img { width: 72%; height: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--pill);
  background: var(--fill-2);
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--pill);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s var(--ease-out), background-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link .lbl-short { display: none; }
.nav-link.active {
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.nav-link .dot-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center;
}

.nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-btn {
  border: 0;
  padding: 0;
  background: none;
  border-radius: 50%;
  transition: transform 0.2s var(--spring);
}
.avatar-btn:hover { transform: scale(1.06); }
.avatar-btn:active { transform: scale(0.96); }

/* ───────────────────────── przyciski ───────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background-color 0.2s var(--ease-out), color 0.2s, transform 0.18s var(--ease-out), box-shadow 0.2s, opacity 0.2s;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary { background: var(--fill-2); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--fill-3); }

.btn-tinted { background: var(--accent-soft); color: var(--accent-text); }
.btn-tinted:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 18%, transparent); }

.btn-plain { background: transparent; color: var(--accent-text); padding: 0 10px; }
.btn-plain:hover:not(:disabled) { background: var(--accent-soft); }

.btn-danger { background: var(--red-soft); color: var(--red-text); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 20%, transparent); }
.btn-danger-solid { background: var(--red); color: #fff; }

.btn-lg { height: 46px; padding: 0 26px; font-size: 16px; }
.btn-sm { height: 30px; padding: 0 13px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--text-2);
  transition: background-color 0.2s var(--ease-out), color 0.2s, transform 0.18s var(--ease-out);
}
.icon-btn:hover { background: var(--fill-2); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(0.92); }
.icon-btn:disabled { opacity: 0.28; cursor: default; background: transparent; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red-text); }

kbd {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  opacity: 0.85;
}
.btn-secondary kbd { background: var(--fill-2); }

/* ───────────────────────── układ strony ───────────────────────── */

.page {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 44px var(--gutter) 120px;
  animation: page-in 0.5s var(--ease-out) both;
}
.page.narrow { max-width: 820px; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0;
  margin-bottom: 6px;
}

.large-title {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.028em;
  margin: 0;
}

.subtitle {
  margin: 8px 0 0;
  font-size: 17px;
  color: var(--text-2);
  letter-spacing: -0.015em;
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 40px 0 16px;
}
.section-head:first-child { margin-top: 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 18px -4px;
  font-size: 15px;
  color: var(--accent-text);
}

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ───────────────────────── karty / powierzchnie ───────────────────────── */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 24px; }
.card + .card { margin-top: 16px; }

.card-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.card-desc { font-size: 14px; color: var(--text-2); margin: 0 0 18px; }

.grouped {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.grouped-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 20px;
  position: relative;
}
.grouped-row + .grouped-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 0;
  height: 1px;
  background: var(--separator);
}
.grouped-row .grow { flex: 1; min-width: 0; }
.grouped-row .label { font-weight: 500; }
.grouped-row .hint { font-size: 13px; color: var(--text-2); margin-top: 1px; }

/* ───────────────────────── formularze ───────────────────────── */

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field + .field { margin-top: 18px; }
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.005em;
}
.field-label .opt { font-weight: 400; color: var(--text-3); }
.field-hint { font-size: 12.5px; color: var(--text-3); }

.fields-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.fields-row .field + .field { margin-top: 0; }

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--separator-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.input.lg { min-height: 54px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; padding: 12px 16px; }
.input.invalid, .textarea.invalid { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.date-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.date-field-wrap .date-field-input {
  width: 100%;
  padding-right: 68px;
  cursor: pointer;
}
.date-field-icon-btn,
.date-field-clear-btn {
  position: absolute;
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s, transform 0.15s;
}
.date-field-icon-btn {
  right: 14px;
  width: 24px;
  height: 24px;
}
.date-field-icon-btn:hover {
  color: var(--text);
}
.date-field-clear-btn {
  right: 40px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.date-field-clear-btn:hover {
  color: var(--text);
  background: var(--fill-2);
}

.calendar-popover {
  position: fixed;
  z-index: 350;
  width: 292px;
  padding: 12px 14px 10px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.22s var(--spring) both;
  user-select: none;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cal-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cal-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-nav-btn:hover {
  background: var(--fill);
  color: var(--text);
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 6px;
}
.cal-weekday {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 10px;
}
.cal-day {
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
}
.cal-day:hover {
  background: var(--fill-2);
}
.cal-day.is-other {
  color: var(--text-3);
  opacity: 0.45;
}
.cal-day.is-today {
  position: relative;
  font-weight: 600;
  color: var(--accent);
}
.cal-day.is-today::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-day.is-selected {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  font-weight: 600;
}
.cal-day.is-selected::after {
  background: #FFFFFF;
}
.cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--separator);
}
.cal-btn-today {
  flex: 1;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-btn-today:hover {
  background: var(--accent);
  color: #FFFFFF;
}
.cal-btn-clear {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-btn-clear:hover {
  background: var(--fill);
  color: var(--text);
}

.search {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
}
.search .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search .input {
  min-height: 40px;
  padding: 8px 14px 8px 38px;
  border: 0;
  background: var(--fill-2);
  border-radius: var(--r-sm);
  font-size: 15px;
}
.search .input:hover { background: var(--fill-3); }
.search .input:focus { background: var(--surface); box-shadow: var(--focus-ring); }

/* przełącznik */
.switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track {
  position: absolute; inset: 0; border-radius: 16px;
  background: var(--fill-3);
  transition: background-color 0.25s var(--ease-out);
}
.switch .thumb {
  position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.3s var(--spring);
}
.switch input:checked ~ .track { background: var(--green); }
.switch input:checked ~ .thumb { transform: translateX(20px); }
.switch input:focus-visible ~ .track { box-shadow: var(--focus-ring); }
.switch input:disabled ~ .track { opacity: 0.5; }

/* kontrolka segmentowa */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 11px;
  background: var(--fill-2);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease-out), color 0.2s, box-shadow 0.25s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.segmented .count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.segmented button.active .count { color: var(--text-2); }
.segmented-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 5px var(--accent);
}
.segmented.block { display: flex; width: 100%; }
.segmented.block button { flex: 1; }

/* chipy filtrów */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--pill);
  border: 1px solid var(--separator-strong);
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s var(--ease-out);
}
.chip:hover { background: var(--fill); }
.chip.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.chip .swatch-dot { width: 9px; height: 9px; }

.swatch-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ───────────────────────── znaczniki ───────────────────────── */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 9px;
  border-radius: var(--pill);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-new { background: var(--blue-soft); color: var(--blue-text); }
.status-in_progress { background: var(--orange-soft); color: var(--orange-text); }
.status-review { background: var(--purple-soft); color: var(--purple-text); }
.status-done { background: var(--green-soft); color: var(--green-text); }
.status-suspended { background: var(--red-soft); color: var(--red-text); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--fill-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.tag.danger { background: var(--red-soft); color: var(--red-text); }
.tag.warn { background: var(--orange-soft); color: var(--orange-text); }
.tag.accent { background: var(--accent-soft); color: var(--accent-text); }
.tag.success { background: var(--green-soft); color: var(--green-text); }

.dept {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 0;
}
.dept .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* awatary */
.avatar {
  --size: 32px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  font-size: calc(var(--size) * 0.38);
  font-weight: 600;
  letter-spacing: 0;
  user-select: none;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}
.avatar.xs { --size: 20px; }
.avatar.sm { --size: 26px; }
.avatar.lg { --size: 44px; }
.avatar.xl { --size: 72px; }
.avatar.avatar-none { background: var(--fill-2); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--separator); }

.avatar.avatar-more {
  background: var(--fill-2);
  color: var(--text-2);
  font-weight: 700;
  font-size: calc(var(--size) * 0.32);
  box-shadow: inset 0 0 0 1px var(--separator);
}

.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -6px; }

/* selektor wielu wykonawców */
.assignee-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 10px;
  background: var(--fill-2);
  border: 1px solid var(--separator);
  border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.assignee-picker:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
  background: var(--surface);
}
.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 20px;
  padding: 3px 8px 3px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.assignee-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  margin-left: 2px;
  padding: 0;
  transition: all 0.12s;
}
.assignee-chip-remove:hover {
  background: var(--fill-2);
  color: var(--red);
}
.assignee-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--separator-strong);
  border-radius: 20px;
  background: transparent;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.assignee-add-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.assignee-add-btn.empty-state {
  border-style: solid;
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
  font-weight: 500;
  padding: 4px 6px;
}
.assignee-add-btn.empty-state:hover {
  background: var(--fill);
  color: var(--text);
}
.assignee-menu-item.is-selected {
  background: var(--accent-soft);
}

/* ───────────────────────── pasek narzędzi listy ───────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin-bottom: 14px;
}
.toolbar + .chips { margin-bottom: 26px; }
.toolbar > * { min-width: 0; max-width: 100%; }

/* ───────────────────────── podział zleceń na miesiące (historia) ───────────────────────── */

.orders-grouped-view {
  display: flex;
  flex-direction: column;
}

.orders-month-section {
  margin-bottom: 32px;
  transition: margin-bottom 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.orders-month-section.is-collapsed {
  margin-bottom: 12px;
}

.orders-month-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin: 28px 0 16px;
}

.orders-month-section:first-child .orders-month-header {
  margin-top: 4px;
}

.orders-month-divider {
  flex: 1 1 auto;
  height: 1px;
  background: var(--separator);
  opacity: 0.6;
}

.orders-month-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 14px;
  background: var(--fill-2, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border-soft, rgba(0, 0, 0, 0.08));
  border-radius: 999px;
  color: var(--text-2);
  font-family: var(--font-display, inherit);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
}

[data-theme="dark"] .orders-month-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
}

.orders-month-toggle-btn:hover {
  background: var(--fill-3, rgba(0, 0, 0, 0.08));
  color: var(--text);
  border-color: var(--separator-strong, rgba(0, 0, 0, 0.16));
  transform: translateY(-1px);
}

[data-theme="dark"] .orders-month-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.orders-month-toggle-btn.is-collapsed {
  background: rgba(233, 113, 164, 0.08);
  border-color: rgba(233, 113, 164, 0.25);
  color: var(--text);
}

[data-theme="dark"] .orders-month-toggle-btn.is-collapsed {
  background: rgba(233, 113, 164, 0.14);
  border-color: rgba(233, 113, 164, 0.35);
}

.orders-month-label {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.orders-month-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-2);
}

[data-theme="dark"] .orders-month-badge {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-2);
}

.orders-month-toggle-btn.is-collapsed .orders-month-badge {
  background: rgba(233, 113, 164, 0.2);
  color: #e971a4;
}

.orders-month-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
}

.orders-month-toggle-btn:hover .orders-month-chevron {
  color: var(--text);
}

.orders-month-toggle-btn.is-collapsed .orders-month-chevron {
  transform: rotate(180deg);
  color: #e971a4;
}

@media (max-width: 600px) {
  .orders-month-header {
    gap: 10px;
    margin: 20px 0 12px;
  }
  .orders-month-toggle-btn {
    padding: 4px 10px 4px 12px;
    font-size: 12.5px;
  }
}

/* ───────────────────────── karty zleceń ───────────────────────── */

.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 18px;
}

.order-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  color: var(--text);
  overflow: hidden;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.order-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); text-decoration: none; }
.order-card:active { transform: translateY(-1px) scale(0.995); }

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.cover {
  position: relative;
  height: 136px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--tint) 34%, transparent) 0%, transparent 60%),
    radial-gradient(100% 120% at 100% 100%, color-mix(in srgb, var(--tint) 22%, transparent) 0%, transparent 55%),
    color-mix(in srgb, var(--tint) 9%, var(--surface));
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .glyph {
  width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center;
  color: color-mix(in srgb, var(--tint) 85%, var(--text));
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--tint) 22%, transparent);
}
.cover .glyph .icon { width: 26px; height: 26px; stroke-width: 1.6; }
.cover-swatches {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: flex;
}
.cover-swatches span {
  width: 22px; height: 22px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface), 0 2px 6px rgba(0, 0, 0, 0.15);
}
.cover-swatches span + span { margin-left: -5px; }
.cover .cover-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.38);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
}
.cover .unread-dot { position: absolute; top: 14px; right: 14px; box-shadow: 0 0 0 3px var(--surface); }

.order-card .body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.order-card .title {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.022em;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-card .activity-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-2);
  min-width: 0;
}
.order-card .activity-line .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  flex-wrap: wrap;
}
.order-card .foot-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.order-card .foot-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.order-card .foot .metrics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.order-card .foot .metrics span { display: inline-flex; align-items: center; gap: 3px; }
.order-card .foot .avatar-stack { flex-shrink: 0; }

/* widok listy */
.orders-list { padding: 6px 0; }
.list-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 140px 120px 150px 110px;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  color: var(--text);
  position: relative;
  transition: background-color 0.15s;
}
.list-row:hover { background: var(--fill); text-decoration: none; }
.list-row + .list-row::before {
  content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 1px; background: var(--separator);
}
.list-row .t { font-weight: 600; font-size: 15px; letter-spacing: -0.018em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 2px; min-width: 0; }
.list-row .sub .dept { font-weight: 500; }
.list-row .cell { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 7px; min-width: 0; }
.list-row .cell .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-head {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 140px 120px 150px 110px;
  gap: 16px;
  padding: 0 22px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}

/* stan pusty */
.empty {
  text-align: center;
  padding: 72px 24px;
  color: var(--text-2);
}
.empty .empty-icon {
  width: 72px; height: 72px; margin: 0 auto 18px;
  border-radius: 22px;
  display: grid; place-items: center;
  background: var(--fill-2);
  color: var(--text-3);
}
.empty h3 { margin: 0 0 6px; font-size: 21px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.empty p { margin: 0 auto 22px; max-width: 380px; font-size: 15px; }

.skeleton {
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 50%, var(--fill) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ───────────────────────── szczegóły zlecenia ───────────────────────── */

.order-hero { margin-bottom: 28px; }
.order-hero .meta-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.order-hero .large-title { font-size: 40px; }
.order-hero .actions { display: flex; gap: 8px; align-items: center; }

.dept-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px 0 10px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--tint) 13%, transparent);
  color: color-mix(in srgb, var(--tint) 75%, var(--text));
}
.dept-pill .swatch-dot { background: var(--tint); }

/* postęp statusu (jak śledzenie zamówienia) */
/* postęp statusu (informacyjny wskaźnik etapu zamówienia) */
.progress-wrap {
  margin: 20px 0 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
}
.progress-step {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: default;
  user-select: none;
}
.progress-step .bar {
  height: 6px;
  border-radius: 3px;
  background: var(--fill-3);
  position: relative;
  overflow: hidden;
}
.progress-step .bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--step-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.progress-step.reached .bar::after { transform: scaleX(1); }
.progress-step .lbl {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.progress-step .lbl .check {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--separator-strong);
  transition: all 0.3s var(--ease-out);
}
.progress-step.reached .lbl { color: var(--text); }
.progress-step.reached .lbl .check { background: var(--step-color); border-color: var(--step-color); color: #fff; }
.progress-step.current .lbl { font-weight: 600; color: var(--text); }

/* Wskazówka pod paskami postępu */
.progress-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 9px 14px;
  background: var(--fill-2);
  border: 1px solid var(--separator);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-2);
}
.progress-hint-icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}
.progress-hint-text {
  flex: 1 1 280px;
  line-height: 1.4;
}
.progress-hint-text strong {
  color: var(--text);
}
.progress-hint-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--fill-3);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--separator-strong);
  cursor: pointer;
  transition: all 0.15s ease;
}
.progress-hint-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}
.detail-side { position: sticky; top: calc(var(--nav-h) + 20px); display: flex; flex-direction: column; gap: 16px; }

.kv { display: flex; flex-direction: column; }
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  font-size: 14px;
}
.kv-row + .kv-row { border-top: 1px solid var(--separator); }
.kv-row .k { color: var(--text-2); }
.kv-row .v { font-weight: 500; text-align: right; display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.kv-row .v .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* brief */
.brief-card { padding: 28px; }
.brief-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

.storyboard { display: flex; flex-direction: column; gap: 4px; counter-reset: scene; }
.scene-view {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 16px 0;
}
.scene-view + .scene-view { border-top: 1px solid var(--separator); }
.scene-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.scene-view .content { font-size: 16px; line-height: 1.5; white-space: pre-wrap; }
.scene-view .content.empty-txt { color: var(--text-3); font-style: italic; }
.caption-chip {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 13px;
  border-radius: 12px;
  background: var(--fill);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.caption-chip .icon { margin-top: 1px; color: var(--text-3); }

.prose-block + .prose-block { margin-top: 22px; }
.prose-block .k { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.prose-block .v { font-size: 16px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

.color-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 5px;
  border-radius: var(--pill);
  background: var(--fill);
  font-size: 13.5px;
  font-weight: 500;
}
.color-chip .sw { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.color-chip .hex { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.color-chip button { border: 0; background: none; color: var(--text-3); padding: 0 0 0 2px; display: grid; place-items: center; }
.color-chip button:hover { color: var(--red-text); }

/* oś aktualizacji */
.composer {
  padding: 18px 20px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s;
  position: relative;
}
.composer.focused { box-shadow: var(--shadow-card), 0 0 0 1.5px var(--accent); }
.composer.dragging { box-shadow: 0 0 0 2px var(--accent), 0 12px 40px var(--accent-soft); }
.composer .top { display: flex; gap: 12px; }
.composer textarea {
  flex: 1;
  border: 0;
  background: transparent;
  resize: none;
  min-height: 48px;
  max-height: 360px;
  padding: 6px 0;
  font-size: 16px;
  line-height: 1.5;
}
.composer textarea::placeholder { color: var(--text-3); }
.composer textarea:focus { box-shadow: none; }
.composer .bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--separator);
}
.composer .attachments { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0 44px; }
.composer .link-form { display: flex; gap: 8px; margin: 10px 0 0 44px; flex-wrap: wrap; }
.composer .link-form .input { min-height: 38px; padding: 8px 12px; font-size: 14px; flex: 1 1 200px; }
.drop-hint {
  position: absolute; inset: 0; border-radius: inherit;
  display: none; place-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--accent-text); font-weight: 600; font-size: 15px;
  z-index: 2;
}
.composer.dragging .drop-hint { display: grid; }

.status-select {
  height: 32px;
  min-height: 32px;
  width: auto;
  padding: 0 32px 0 12px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 500;
  border: 0;
  background-color: var(--fill-2);
  background-position: right 10px center;
  background-size: 14px;
}

/* Dedykowany pasek wyboru statusu w kompozytorze */
.composer-status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--fill-2);
  border: 1px solid var(--separator);
  border-radius: 12px;
  transition: all 0.3s var(--ease);
}
.composer-status-bar-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.composer-status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}
.composer-status-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--pill);
  border: 1px solid var(--separator-strong);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.composer-status-trigger:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.composer-status-trigger:active:not(:disabled) {
  transform: scale(0.98);
}
.composer-status-trigger:disabled {
  opacity: 0.65;
  cursor: default;
}
.composer-status-trigger-lbl {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}
.composer-status-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.status-action-chip {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: var(--pill);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.status-action-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.status-action-chip:active {
  transform: scale(0.97);
}
.status-interactive-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 2px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.status-interactive-btn:hover {
  background: var(--fill-2);
  border-color: var(--separator);
}
.status-interactive-btn .icon {
  color: var(--text-3);
  transition: transform 0.15s;
}
.status-interactive-btn:hover .icon {
  color: var(--text);
  transform: translateY(1px);
}
.status-menu-head {
  padding: 8px 12px 6px;
}
.status-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.status-menu-item:hover {
  background: var(--fill-2);
}
.status-menu-item .status {
  pointer-events: none;
}
.status-menu-item .icon {
  color: var(--text-3);
}
.status-menu-item:hover .icon {
  color: var(--text);
}
.composer-status-hint {
  color: var(--text-3);
  font-size: 12px;
  flex: 1 1 200px;
}
.pulse-highlight {
  animation: composer-pulse 2s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes composer-pulse {
  0% { box-shadow: 0 0 0 0 var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
  35% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--surface)); }
  100% { box-shadow: 0 0 0 0 transparent; border-color: var(--separator); background: var(--fill-2); }
}

.timeline { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

.entry {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  animation: card-in 0.45s var(--ease-out) both;
}
.entry-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 14px 18px 16px;
  min-width: 0;
}
.entry-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.entry-head .who { font-weight: 600; }
.entry-head .when { color: var(--text-3); font-size: 13px; }
.entry-head .spacer { flex: 1; }
.entry-body { margin-top: 6px; font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.entry .status-change { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--text-2); }

.system-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 2px 6px;
  font-size: 13.5px;
  color: var(--text-2);
  animation: card-in 0.45s var(--ease-out) both;
}
.system-entry .sys-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fill-2); color: var(--text-2);
  flex-shrink: 0;
}
.system-entry b { color: var(--text); font-weight: 600; }
.system-entry .when { color: var(--text-3); }

/* media */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.media-grid.single { grid-template-columns: minmax(0, 420px); }
.media-tile {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--fill-2);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.media-grid.single .media-tile { aspect-ratio: auto; max-height: 420px; }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; }
.media-grid.single .media-tile img { height: auto; max-height: 420px; object-fit: contain; background: var(--fill); }
.media-tile:hover { transform: scale(1.015); box-shadow: var(--shadow-hover); }
.media-tile .play {
  position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.media-tile .play .icon { margin-left: 3px; }

.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--fill);
  color: var(--text);
  min-width: 0;
  transition: background-color 0.15s;
}
a.file-row:hover { background: var(--fill-2); text-decoration: none; }
.file-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface); color: var(--accent-text);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.file-icon img { width: 100%; height: 100%; object-fit: cover; }
.file-row .meta { flex: 1; min-width: 0; }
.file-row .nm { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .sz { font-size: 12.5px; color: var(--text-3); }
.file-row .progress-line { height: 3px; border-radius: 2px; background: var(--fill-3); margin-top: 6px; overflow: hidden; }
.file-row .progress-line > div { height: 100%; background: var(--accent); width: 0; transition: width 0.2s linear; }
.file-row.error .sz { color: var(--red-text); }

.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  background: var(--fill);
  color: var(--text);
  min-width: 0;
  transition: background-color 0.15s;
}
.link-card:hover { background: var(--fill-2); text-decoration: none; }
.link-card .file-icon { color: var(--text-2); }
.link-card .meta { flex: 1; min-width: 0; }
.link-card .nm { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-card .host { font-size: 12.5px; color: var(--accent-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.materials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.materials-grid .media-tile { aspect-ratio: 1; border-radius: 10px; }
.materials-grid .more-tile {
  aspect-ratio: 1; border-radius: 10px; background: var(--fill-2); color: var(--text-2);
  display: grid; place-items: center; font-weight: 600; font-size: 14px; border: 0;
}

/* ───────────────────────── kreator ───────────────────────── */

.editor-head { margin-bottom: 26px; }
.stepper {
  display: flex;
  gap: 6px;
  margin-top: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.step {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 16px 0 8px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.25s var(--ease-out);
}
.step .n {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600;
  background: var(--fill-2); color: var(--text-2);
  transition: all 0.25s var(--ease-out);
}
.step:hover:not(:disabled) { color: var(--text); background: var(--fill); }
.step.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-card); }
.step.active .n { background: var(--accent); color: #fff; }
.step.done { color: var(--text-2); }
.step.done .n { background: var(--green); color: #fff; }
.step:disabled { cursor: default; }

.editor-section { margin-bottom: 34px; }
.editor-section > .q {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 0 0 4px;
}
.editor-section > .q-hint { font-size: 15px; color: var(--text-2); margin: 0 0 16px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 92px;
  padding: 16px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-card), inset 0 0 0 1px var(--separator);
  color: var(--text);
  text-align: left;
  transition: box-shadow 0.25s var(--ease-out), transform 0.2s var(--ease-out), background-color 0.2s;
}
.tile:hover { box-shadow: var(--shadow-hover), inset 0 0 0 1px var(--separator-strong); }
.tile:active { transform: scale(0.98); }
.tile.selected { box-shadow: var(--shadow-card), inset 0 0 0 2px var(--accent); }
.tile .tile-check {
  position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  transform: scale(0); transition: transform 0.3s var(--spring);
}
.tile.selected .tile-check { transform: scale(1); }
.tile .tile-name { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.tile .tile-sub { font-size: 13px; color: var(--text-2); margin-top: -6px; }
.tile .tile-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint) 16%, transparent); background: var(--tint); margin: 2px 0 2px 2px; }

.tiles.format { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile.big { min-height: 150px; padding: 20px; gap: 14px; }
.tile.big .tile-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--fill-2); color: var(--text-2);
  transition: all 0.25s var(--ease-out);
}
.tile.big.selected .tile-icon { background: var(--accent); color: #fff; }
.tile.big .tile-name { font-size: 18px; }

.reveal { animation: reveal 0.4s var(--ease-out) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* sceny w edytorze */
.scene-edit {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 6px 14px;
  padding: 20px 20px 18px 16px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  animation: card-in 0.4s var(--ease-out) both;
}
.scene-edit + .scene-edit { margin-top: 12px; }
.scene-edit .scene-num { text-align: center; padding-top: 10px; }
.scene-edit .textarea { min-height: 76px; border-color: transparent; background: var(--fill); }
.scene-edit .textarea:focus { background: var(--surface); border-color: var(--accent); }
.scene-edit .caption-input { position: relative; margin-top: 8px; }
.scene-edit .caption-input .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.scene-edit .caption-input .input { padding-left: 36px; min-height: 40px; font-size: 14px; border-color: transparent; background: var(--fill); }
.scene-edit .caption-input .input:focus { background: var(--surface); border-color: var(--accent); }
.scene-edit .scene-tools { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 8px; }

.add-scene {
  width: 100%;
  margin-top: 12px;
  height: 52px;
  border: 1.5px dashed var(--separator-strong);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s var(--ease-out);
}
.add-scene:hover { background: var(--accent-soft); border-color: var(--accent); }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 38px 20px;
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--separator-strong);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.dragging { transform: scale(1.01); }
.dropzone .dz-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--accent-text);
  box-shadow: var(--shadow-card);
}
.dropzone .dz-title { font-size: 16px; font-weight: 600; }
.dropzone .dz-title span { color: var(--accent-text); }
.dropzone .dz-hint { font-size: 13px; color: var(--text-2); }

/* Edytor wielu linków i istniejących materiałów */
.links-edit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.link-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.link-edit-row .link-url-input {
  flex: 1 1 280px;
  min-height: 40px;
}
.link-edit-row .link-label-input {
  flex: 0 1 220px;
  min-height: 40px;
}
.existing-materials-wrap {
  padding: 14px;
  background: var(--fill-2);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm, 10px);
  margin-bottom: 16px;
}

.editor-footer {
  position: sticky;
  bottom: 18px;
  z-index: 20;
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 20px;
  border-radius: var(--pill);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow-pop);
}
.editor-footer .summary {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.editor-footer .summary b { color: var(--text); font-weight: 600; }

.review-card { padding: 28px; }
.review-card .review-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.025em; margin: 10px 0 6px; }

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--fill);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.45;
}
.callout .icon { color: var(--accent-text); margin-top: 1px; }
.callout b { color: var(--text); font-weight: 600; }
.callout.warn .icon { color: var(--orange-text); }

/* ───────────────────────── Guardi ───────────────────────── */

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.metric { padding: 20px 22px; }
.metric .m-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.metric .m-value { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin-top: 2px; font-variant-numeric: tabular-nums; }

.add-panel { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 22px; margin-bottom: 20px; flex-wrap: wrap; }
.add-panel .lbl { font-size: 14px; font-weight: 600; white-space: nowrap; }
.add-panel .input { min-height: 40px; padding: 8px 12px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; }
.table th {
  height: 42px;
  padding: 0 18px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 1px solid var(--separator);
  white-space: nowrap;
  user-select: none;
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th .sort { margin-left: 4px; opacity: 0.35; }
.table th.sorted .sort { opacity: 1; color: var(--accent-text); }
.table td { height: 56px; padding: 0 18px; border-bottom: 1px solid var(--separator); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 0.12s; }
.table tbody tr:hover td { background: var(--fill); }
.table .center { text-align: center; }

.swatch-box { display: flex; align-items: center; gap: 10px; }
.swatch-view {
  width: 28px; height: 28px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
}
.swatch-view:hover { transform: scale(1.1); }
.hex-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--fill);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.hex-badge:hover {
  background: var(--fill-2);
  border-color: var(--separator-strong);
  transform: scale(1.03);
}
.hex-badge:active {
  transform: scale(0.96);
  background: var(--fill-3);
}
.color-name-btn {
  display: inline-block;
  background: transparent;
  border: 0;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.color-name-btn:hover {
  background: var(--fill-2);
  color: var(--accent-text);
}
.color-name-btn:active {
  transform: scale(0.98);
}
.swatch-picker { position: relative; width: 28px; height: 28px; }
.swatch-picker .sw {
  width: 28px; height: 28px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s var(--spring);
}
.swatch-picker:hover .sw { transform: scale(1.1); }
.swatch-picker input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.hex-input {
  width: 84px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--fill);
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: center;
  text-transform: uppercase;
  transition: all 0.2s;
}
.hex-input:hover { border-color: var(--separator-strong); }
.hex-input:focus { border-color: var(--accent); background: var(--surface); box-shadow: var(--focus-ring); }

.fb-btn {
  width: 32px; height: 32px; border: 0; border-radius: 9px;
  display: inline-grid; place-items: center;
  background: rgba(24, 119, 242, 0.1); color: #1877F2;
  transition: all 0.2s var(--ease-out);
}
.fb-btn:hover { background: rgba(24, 119, 242, 0.2); transform: scale(1.06); }
.fb-btn.disabled { background: var(--fill); color: var(--text-3); opacity: 0.55; }
.fb-btn.disabled:hover { transform: none; opacity: 0.85; }

/* ───────────────────────── profil / admin ───────────────────────── */

.profile-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; }
.profile-hero .large-title { font-size: 36px; }

.settings-section { margin-bottom: 36px; }
.settings-section > h2 { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 10px 20px; text-transform: none; }
.settings-section > .foot-note { font-size: 13px; color: var(--text-3); margin: 10px 20px 0; line-height: 1.45; }

.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 20px; }
.theme-option {
  border: 0; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
}
.theme-option .preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--separator-strong);
  transition: box-shadow 0.2s, transform 0.2s var(--ease-out);
  position: relative;
}
.theme-option:hover .preview { transform: translateY(-2px); }
.theme-option.active { color: var(--text); font-weight: 600; }
.theme-option.active .preview { box-shadow: 0 0 0 3px var(--accent); }
.theme-option .preview .p-nav { position: absolute; top: 0; left: 0; right: 0; height: 18%; }
.theme-option .preview .p-card { position: absolute; border-radius: 6px; }
.theme-option .preview .p-line { position: absolute; height: 5px; border-radius: 3px; }

.admin-tabs { margin-bottom: 28px; }

.user-row .role { margin-left: 6px; }

.template-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.placeholder-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.placeholder-chip {
  height: 28px; padding: 0 10px; border: 0; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-text);
  font-family: var(--mono); font-size: 12px;
  transition: all 0.15s;
}
.placeholder-chip:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.template-body { font-family: var(--mono); font-size: 13.5px; min-height: 320px; line-height: 1.6; }
.mail-preview { overflow: hidden; }
.mail-preview .mp-head { padding: 16px 20px; border-bottom: 1px solid var(--separator); }
.mail-preview .mp-subject { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.mail-preview iframe { display: block; width: 100%; height: 560px; border: 0; background: #F5F5F7; }

.log-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.log-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.log-status.sent { color: var(--green-text); }
.log-status.failed { color: var(--red-text); }
.log-status.queued { color: var(--blue-text); }
.log-status.skipped { color: var(--text-3); }

.event-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.event-badge.event-new { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.event-badge.event-status { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green-text); }
.event-badge.event-message { background: color-mix(in srgb, #af52de 14%, transparent); color: #af52de; }
.event-badge.event-update { background: color-mix(in srgb, var(--text-3) 14%, transparent); color: var(--text-2); }
.event-badge.event-system { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange-text); }

/* ───────────────────────── logowanie ───────────────────────── */

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(60% 50% at 20% 10%, color-mix(in srgb, #4A9DFF 18%, transparent) 0%, transparent 70%),
    radial-gradient(50% 50% at 85% 90%, color-mix(in srgb, #A259FF 16%, transparent) 0%, transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 36px 34px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  text-align: center;
  animation: sheet-in 0.6s var(--ease) both;
}
.auth-card .brand-mark { width: 60px; height: 60px; border-radius: 17px; margin: 0 auto 20px; }
.auth-card .brand-mark { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14); }
.auth-card h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 6px; }
.auth-card p.lead { margin: 0 0 28px; color: var(--text-2); font-size: 15px; }
.auth-card form { text-align: left; }
.auth-card .error-msg { color: var(--red-text); font-size: 13.5px; margin-top: 14px; text-align: center; min-height: 20px; }

/* ───────────────────────── nakładki ───────────────────────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  animation: fade-in 0.25s var(--ease-out) both;
}
.backdrop.closing { animation: fade-out 0.2s var(--ease-out) both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Liquid Glass macOS 27 Sheet (wszystkie modale w aplikacji) ── */
.sheet {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: var(--sheet-bg);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  backdrop-filter: blur(36px) saturate(190%);
  border: 1px solid var(--sheet-border);
  box-shadow: var(--sheet-shadow);
  color: var(--text);
  overflow: hidden;
  animation: sheet-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .sheet {
  background: var(--sheet-bg);
  border: 1px solid var(--sheet-border);
  box-shadow: var(--sheet-shadow);
}

.sheet.wide { max-width: 720px; }
.backdrop.closing .sheet { animation: sheet-out 0.2s var(--ease-out) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }

/* Kontrolki formularza wewnątrz modali Liquid Glass */
.sheet .input,
.sheet .select,
.sheet .textarea {
  background: var(--sheet-input-bg);
  border-color: var(--sheet-input-border);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sheet .input,
[data-theme="dark"] .sheet .select,
[data-theme="dark"] .sheet .textarea {
  background: var(--sheet-input-bg);
  border-color: var(--sheet-input-border);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sheet .input:focus,
.sheet .select:focus,
.sheet .textarea:focus {
  background: var(--surface-raised);
  border-color: var(--accent);
}

[data-theme="dark"] .sheet .input:focus,
[data-theme="dark"] .sheet .select:focus,
[data-theme="dark"] .sheet .textarea:focus {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--accent);
}

.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 6px; }
.sheet-title { font-size: 21px; font-weight: 700; letter-spacing: -0.022em; margin: 0; }
.sheet-body { padding: 14px 24px 22px; overflow-y: auto; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 22px; }

.alert { max-width: 340px; text-align: center; }
.alert .sheet-body { padding: 28px 24px 8px; }
.alert h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.alert p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.alert .sheet-foot { justify-content: stretch; padding: 18px 20px 20px; }
.alert .sheet-foot .btn { flex: 1; }

.popover {
  position: fixed;
  z-index: 300;
  min-width: 220px;
  padding: 6px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.28s var(--spring) both;
  transform-origin: top right;
}
@keyframes pop-in { from { opacity: 0; transform: scale(0.94) translateY(-4px); } to { opacity: 1; transform: none; } }
.popover .pop-head { padding: 10px 12px 10px; border-bottom: 1px solid var(--separator); margin-bottom: 6px; }
.popover .pop-head .nm { font-weight: 600; font-size: 14px; }
.popover .pop-head .em { font-size: 12.5px; color: var(--text-2); }
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  text-decoration: none !important;
}
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item:hover .icon { color: #fff; }
.menu-item .icon { color: var(--text-2); }
.menu-item.danger { color: var(--red-text); }
.menu-item.danger .icon { color: var(--red-text); }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-sep { height: 1px; margin: 6px 8px; background: var(--separator); }
.popover .segmented { margin: 4px 6px 6px; display: flex; }
.popover .segmented button { flex: 1; height: 28px; padding: 0 8px; font-size: 12.5px; }

.lightbox {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: fade-in 0.25s var(--ease-out) both;
  padding: 60px 70px;
}
.lightbox img, .lightbox video { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 12px; animation: sheet-in 0.45s var(--ease) both; }
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next, .lightbox .lb-dl {
  position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, 0.12);
  transition: background-color 0.2s;
}
.lightbox button:hover, .lightbox a:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-dl { top: 18px; right: 72px; }
.lightbox .lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-caption { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.75); font-size: 13px; }

#toasts {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px 12px 14px;
  border-radius: var(--pill);
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: toast-in 0.45s var(--spring) both;
  pointer-events: auto;
}
.toast.leaving { animation: toast-out 0.25s var(--ease-out) both; }
.toast .icon { color: #8FD0FF; }
.toast.success .icon { color: #4ADE80; }
.toast.error .icon { color: #FF7A70; }
.toast button { border: 0; background: none; color: #8FD0FF; font-weight: 600; padding: 0 0 0 6px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.95); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  opacity: 0.7;
}
@keyframes spin { to { transform: rotate(360deg); } }

.boot { min-height: 100vh; display: grid; place-items: center; color: var(--text-3); }

/* ───────────────────────── responsywność ───────────────────────── */

/* Tablety i węższe ekrany (do 1180px): kompaktowy górny pasek bez przelewania poza ekran, idealnie wyśrodkowany */
@media (max-width: 1180px) and (min-width: 761px) {
  :root { --gutter: 18px; }

  .nav-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .brand {
    justify-self: start;
    flex-shrink: 0;
  }

  .nav-links {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px;
    min-width: 0;
  }

  .nav-link {
    padding: 0 11px;
    font-size: 13px;
    height: 32px;
  }

  .nav-link .lbl-long { display: none; }
  .nav-link .lbl-short { display: inline; }

  .nav-actions {
    justify-self: end;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nav-new .lbl,
  .nav-new-list .lbl {
    display: none;
  }

  .nav-new {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-new-list {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .avatar-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .avatar-btn .avatar {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 900px) and (min-width: 761px) {
  .nav-inner {
    gap: 8px;
    padding: 0 12px;
  }
  .nav-link {
    padding: 0 9px;
    font-size: 12.5px;
  }
  .nav-actions {
    gap: 6px;
  }
}

@media (max-width: 1020px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .detail-side { position: static; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .template-layout { grid-template-columns: 1fr; }
  .list-row, .list-head { grid-template-columns: 14px minmax(0, 1fr) 130px 110px; }
  .list-row .hide-md, .list-head .hide-md { display: none; }
}

@media (max-width: 760px) {
  :root { --gutter: 12px; --nav-h: 52px; }
  .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .brand { flex-shrink: 0; }
  .brand .brand-name { display: none; }
  .brand .brand-mark { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
  .brand .brand-mark img { width: 22px; height: 22px; }
  .nav-links {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 2px;
    overflow-x: visible;
    max-width: none;
    min-width: 0;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-link {
    padding: 0 7px;
    font-size: 11.5px;
    height: 30px;
    border-radius: 8px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
  }
  .nav-link .lbl-long { display: none; }
  .nav-link .lbl-short { display: inline; }
  .nav-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .nav-theme-btn { display: none !important; }
  .nav-new { width: 32px; height: 32px; min-width: 32px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
  .nav-new .lbl { display: none; }
  .nav-new-list { width: 32px; height: 32px; min-width: 32px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
  .nav-new-list .lbl { display: none; }
  .avatar-btn { width: 30px; height: 30px; min-width: 30px; }
  .avatar-btn .avatar { width: 30px; height: 30px; font-size: 11px; }

  /* Zapobieganie powiększaniu widoku / auto-zoom na telefonach */
  input, textarea, select, .input, .select, .textarea,
  .list-smart-input, .list-smart-note-input {
    font-size: 16px !important;
  }

  .page {
    padding-top: 20px;
    padding-left: 12px;
    padding-right: 12px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .card-pad { padding: 16px 14px; }
  .card { max-width: 100%; box-sizing: border-box; }
  .large-title { font-size: 30px; }
  .order-hero .large-title { font-size: 26px; }
  .subtitle { font-size: 15px; }
  .list-row, .list-head { grid-template-columns: 10px minmax(0, 1fr) auto; padding-left: 12px; padding-right: 12px; }
  .list-row .hide-sm, .list-head .hide-sm { display: none; }
  .list-row + .list-row::before { left: 38px; }
  .metrics { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .metric { padding: 12px 10px; }
  .metric .m-value { font-size: 22px; }
  .progress-step .lbl { font-size: 11px; }
  .progress-step .lbl .check { display: none; }
  .sheet {
    border-radius: 24px 24px 0 0;
    max-height: 94vh;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    align-self: flex-end;
  }
  .backdrop { padding: 0; }
  .backdrop .alert { border-radius: 22px; align-self: center; margin: 20px; }
  .theme-options { gap: 10px; padding: 14px; }
  .editor-footer { border-radius: 22px; bottom: 10px; padding: 8px 8px 8px 14px; }
  .editor-footer .summary { display: none; }
  .editor-footer .btn { flex: 1; }
  .lightbox { padding: 60px 10px; }
  .kbd-hint { display: none; }
  .scene-edit { grid-template-columns: 34px minmax(0, 1fr); padding: 16px 14px 14px 8px; gap: 6px 8px; }
  .scene-num { font-size: 22px; }
  .scene-view { grid-template-columns: 36px minmax(0, 1fr); }
  .brief-card, .review-card { padding: 16px 14px; width: 100% !important; max-width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
  .brief-head { flex-wrap: wrap; gap: 8px 12px; }
  .table td, .table th { padding: 0 10px; }

  /* Układ szczegółów zlecenia na telefonie */
  .detail-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .detail-layout > *,
  .order-detail-main {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .chat-card,
  .detail-side,
  .detail-side .card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .section-head {
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 24px 0 12px;
  }
  .role-legend {
    font-size: 11.5px;
    gap: 4px 10px;
    max-width: 100%;
  }

  /* Rozmowa / wiadomości na telefonie */
  .chat {
    padding: 16px 12px 14px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .msg {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .msg-col {
    max-width: calc(100% - 34px);
    min-width: 0;
  }
  .msg.mine .msg-col {
    max-width: calc(100% - 20px);
  }
  .msg-row {
    max-width: 100%;
    min-width: 0;
  }
  .bubble {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .bubble-text {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .bubble .media-grid {
    margin-top: 8px;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .bubble .media-grid.single {
    grid-template-columns: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .bubble .media-grid.single .media-tile {
    max-width: 100%;
    width: 100%;
  }
  .bubble .media-grid.single .media-tile img,
  .bubble .media-grid.single .media-tile video {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  .media-grid.single {
    grid-template-columns: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .bubble .file-list,
  .bubble .file-row,
  .bubble .link-card {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .chat-card .composer.composer-v2,
  .composer.composer-v2 {
    padding: 12px 10px 10px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .composer-field {
    max-width: 100%;
    box-sizing: border-box;
  }
  .status-row {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Elementy kreatora list na telefonie */
  .list-smart-main {
    padding: 10px 10px;
    gap: 8px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .list-smart-fields {
    min-width: 0;
    max-width: calc(100% - 60px);
  }
  .perm-switch.segmented.sm button {
    padding: 0 6px;
    font-size: 11px;
    height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ───────────────────────── rozmowa (styl iMessage) ───────────────────────── */

.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px 0 8px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: color-mix(in srgb, var(--role) 78%, var(--text));
  background: color-mix(in srgb, var(--role) 14%, transparent);
}
.role-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--role); }

.role-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.role-legend span { display: inline-flex; align-items: center; gap: 6px; }
.role-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--role); }

.chat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.chat-card .composer {
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid var(--separator);
  background: var(--surface-2);
}
.chat-card .composer.focused { box-shadow: inset 0 0 0 1.5px var(--accent); }
.chat-card .composer .attachments,
.chat-card .composer .link-form { margin-left: 0; }

.chat { display: flex; flex-direction: column; padding: 22px 20px 18px; }
.chat-empty { text-align: center; color: var(--text-3); font-size: 14px; padding: 30px 10px; }

.chat-system { display: flex; justify-content: center; margin: 14px 0; }
.chat-system .pill {
  display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 6px;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: var(--pill);
  background: var(--fill);
  font-size: 12.5px;
  color: var(--text-2);
}
.chat-system b { color: var(--text); font-weight: 600; }
.chat-system .status { height: 20px; font-size: 11.5px; }
.chat-system .when { color: var(--text-3); }

.msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 14px;
  max-width: 100%;
  animation: msg-in 0.4s var(--ease-out) both;
}
.msg.cont { margin-top: 3px; }
.msg.mine { justify-content: flex-end; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

.avatar-spacer { width: 26px; flex-shrink: 0; }
.msg-col { display: flex; flex-direction: column; min-width: 0; max-width: min(78%, 560px); }
.msg.mine .msg-col { align-items: flex-end; }

.msg-meta { display: flex; align-items: baseline; gap: 7px; margin: 0 12px 4px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.msg.mine .msg-meta { justify-content: flex-end; }
.msg-meta .who { font-weight: 600; color: var(--text-2); }
.msg-meta .role { font-weight: 600; color: color-mix(in srgb, var(--role) 80%, var(--text)); }

.msg-row { display: flex; align-items: center; gap: 4px; max-width: 100%; }
.msg-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}
.msg:hover .msg-actions,
.msg-actions:focus-within {
  opacity: 1;
}
@media (hover: none) {
  .msg-actions {
    opacity: 0.7;
  }
}
.msg-react-btn { color: var(--text-2); }
.msg-react-btn:hover { color: var(--text); background: var(--fill); }
.msg-more { opacity: 1; }

.bubble {
  min-width: 0;
  padding: 9px 14px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--role) 13%, var(--surface));
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--role) 22%, transparent);
  font-size: 15.5px;
  line-height: 1.45;
}
.msg.mine .bubble { background: color-mix(in srgb, var(--role) 24%, var(--surface)); }
.bubble.tail { border-bottom-left-radius: 6px; }
.msg.mine .bubble.tail { border-bottom-left-radius: 20px; border-bottom-right-radius: 6px; }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.bubble-text a { color: color-mix(in srgb, var(--role) 55%, var(--accent-text)); text-decoration: underline; text-underline-offset: 2px; }
.bubble.has-media { padding-bottom: 8px; }
.bubble.has-media .bubble-text { margin-bottom: 2px; }
.bubble .media-grid { margin-top: 8px; min-width: min(300px, 60vw); }
.bubble .media-grid.single { grid-template-columns: minmax(0, 380px); }
.bubble .media-tile { border-radius: 14px; }
.bubble .file-list { margin-top: 8px; min-width: min(260px, 55vw); }
.bubble .file-row, .bubble .link-card { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.bubble .file-row:hover, .bubble .link-card:hover { background: var(--surface); }
.bubble-status { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }

.bubble.is-editing {
  width: 100%;
  max-width: 580px;
  background: var(--surface) !important;
  box-shadow: 0 0 0 1.5px var(--accent), 0 4px 16px rgba(0, 0, 0, 0.08);
}
.msg-edit-box { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.msg-edit-textarea {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  resize: vertical;
  min-height: 50px;
  max-height: 320px;
  padding: 0;
}
.msg-edit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.msg-edit-actions { display: flex; align-items: center; gap: 6px; }
.edited-tag { font-size: 11px; color: var(--text-3); font-style: italic; }

/* ───────────────────────── reakcje do wiadomości (discord style) ───────────────────────── */

.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  width: 100%;
  justify-content: flex-end; /* pod wiadomością po prawej stronie */
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--separator);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  line-height: 1;
}
.reaction-pill:hover {
  background: var(--fill);
  border-color: var(--separator-strong);
  transform: translateY(-1px);
}
.reaction-pill:active {
  transform: scale(0.96);
}
.reaction-pill .emoji {
  font-size: 14.5px;
  line-height: 1;
}
.reaction-pill .count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.reaction-pill.me {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.reaction-pill.me .count {
  color: var(--accent);
  font-weight: 700;
}
.reaction-pill.add-btn {
  padding: 0 7px;
  color: var(--text-3);
  background: transparent;
  border: 1px dashed var(--separator-strong);
}
.reaction-pill.add-btn:hover {
  background: var(--fill);
  color: var(--text);
  border-style: solid;
}

/* Emoji picker popover */
.emoji-picker-wrap {
  width: 280px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.emoji-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
}
.emoji-picker-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.emoji-picker-btn {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}
.emoji-picker-btn:hover {
  background: var(--fill);
  transform: scale(1.25);
}
.emoji-picker-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--separator);
  background: var(--fill);
  font-size: 13px;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}
.emoji-picker-input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

@media (max-width: 760px) {
  .chat { padding: 16px 12px 14px; }
  .msg-col { max-width: 86%; }
  .msg-actions { opacity: 0.85; }
}

/* ───────────────────────── powitanie po zalogowaniu ───────────────────────── */

.welcome {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  cursor: pointer;
  transition: opacity 0.7s var(--ease), backdrop-filter 0.7s var(--ease);
}
.welcome.leaving { opacity: 0; pointer-events: none; }
.welcome.leaving .welcome-inner { transform: scale(1.06); filter: blur(10px); }
.welcome-inner {
  text-align: center;
  transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
}
.welcome-line {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.welcome-line.hello { font-size: clamp(44px, 8vw, 96px); color: var(--text); }
.welcome-line.name { font-size: clamp(44px, 8vw, 96px); padding-bottom: 0.08em; }
/* gradient na samym słowie – animowany span ma własną warstwę, więc clip z rodzica by nie zadziałał */
.welcome-line.name .welcome-word {
  background: linear-gradient(100deg, #FF9500 0%, #FF4F9A 50%, #1BAE9F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.08em;
}
.welcome-word {
  display: inline-block;
  margin: 0 0.12em;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(0.35em);
  animation: welcome-word 0.9s var(--ease-out) forwards;
}
@keyframes welcome-word {
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* ───────────────────────── reguły hasła i hasło tymczasowe ───────────────────────── */

.auth-card.force-card {
  max-width: 440px;
}
.password-rules {
  margin: 14px 0 18px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}
.password-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  transition: color 0.18s ease;
}
.password-rule.met {
  color: var(--green-text);
  font-weight: 500;
}
.password-rule-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease;
}
.password-rule.met .password-rule-dot {
  background: var(--green);
  transform: scale(1.3);
}

.temp-password-box {
  background: var(--surface-2);
  border: 1px dashed var(--line-focus);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.temp-password-code {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  user-select: all;
}

/* ───────────────────────── wybór typu konta (admin modal) ───────────────────────── */

.role-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.role-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--separator);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-align: left;
  width: 100%;
  color: var(--text);
  font-family: inherit;
}
.role-card:hover {
  border-color: var(--line-focus);
  background: var(--fill);
}
.role-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
  box-shadow: 0 0 0 1px var(--accent);
}
.role-card-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.role-card-badge svg {
  width: 17px;
  height: 17px;
}
.role-card-content {
  flex: 1;
  min-width: 0;
}
.role-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.role-card-desc {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.35;
}
.role-card-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--separator-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  color: transparent;
}
.role-card.selected .role-card-radio {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.role-card-radio svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.5;
}
.role-card-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--separator-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  color: transparent;
}
.role-card.selected .role-card-checkbox {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.role-card-checkbox svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}
.role-card.locked {
  cursor: not-allowed;
  opacity: 0.8;
}
.dept-tag {
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.rank-tag {
  font-size: 11px;
  white-space: nowrap;
}

/* ───────────────────────── selektor koloru z obsługą HEX ───────────────────────── */

.color-picker-container {
  padding: 6px 0;
}
.color-picker-swatch {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 2px solid var(--separator-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  outline: none;
}
.color-picker-swatch:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.color-picker-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.color-picker-hex-wrap {
  position: relative;
}
.color-picker-hex {
  letter-spacing: 0.5px;
}
.color-picker-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  padding: 0;
  outline: none;
}
.color-picker-dot:hover {
  transform: scale(1.15);
}
.color-picker-dot.selected {
  border-color: #fff;
  transform: scale(1.18);
  box-shadow: 0 0 0 2px var(--accent);
}



/* ───────────────────────── dzwonek powiadomień ───────────────────────── */

.bell-btn { position: relative; }
.bell-btn.has-items { color: var(--accent-text); }
.bell-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--nav-solid, var(--bg));
  pointer-events: none;
  animation: badge-pop 0.35s var(--spring, cubic-bezier(.34,1.56,.64,1)) both;
}
.bell-badge[hidden] { display: none; }
.bell-btn.ring .icon { animation: bell-ring 0.9s ease-in-out; transform-origin: 50% 8%; }
@keyframes bell-ring {
  0% { transform: rotate(0); }
  15% { transform: rotate(16deg); }
  30% { transform: rotate(-14deg); }
  45% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  75% { transform: rotate(3deg); }
  100% { transform: rotate(0); }
}
@keyframes badge-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.notif-sheet { max-width: 560px; }
.notif-sheet .sheet-body { padding: 4px 12px 8px; }
.notif-sheet .sheet-foot { align-items: center; }
.notif-list { display: flex; flex-direction: column; gap: 2px; }
.notif-list .empty { padding: 36px 16px; }
.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color 0.15s;
}
.notif-row:hover, .notif-row:focus-visible { background: var(--fill); }
.notif-row > .icon { margin-top: 8px; color: var(--text-3); flex-shrink: 0; }
.notif-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notif-text { font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.notif-text b { font-weight: 600; }
.notif-extra { font-size: 12.5px; color: var(--text-2); }
.notif-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.notif-order { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .bell-btn.ring .icon, .bell-badge { animation: none; }
}

/* ───────────────────────── kompozytor v2 (styl iMessage) ───────────────────────── */

.chat-card .composer.composer-v2,
.composer.composer-v2 {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
}
.composer-v2 .attachments,
.composer-v2 .link-form { margin: 0; }
.composer-v2 .attachments:empty { display: none; }

/* wiersz statusu */
.status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--separator);
}
.status-row-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.status-row .status-more { color: var(--text-2); gap: 3px; }
.status-row .status-more:hover { color: var(--text); background: var(--fill); }
.status-row .status-next { gap: 4px; font-weight: 600; }

/* kapsuła pola wiadomości */
.composer-field {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px;
  border-radius: 22px;
  background: var(--bg);
  border: 1px solid var(--separator-strong);
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.composer-field:hover { border-color: color-mix(in srgb, var(--text) 28%, transparent); }
.composer-field.focused {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  background: var(--surface);
}
.composer-v2.dragging .composer-field { border-color: var(--accent); border-style: dashed; }
.composer-field textarea {
  flex: 1;
  min-height: 34px;
  max-height: 240px;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  resize: none;
  font-size: 15.5px;
  line-height: 1.4;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
.composer-field textarea::placeholder { color: var(--text-2); }
.composer-field textarea:focus { box-shadow: none; outline: none; }

.field-btn, .send-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  transition: background-color 0.2s, color 0.2s, transform 0.18s var(--spring), opacity 0.2s;
}
.field-btn { background: var(--fill-2); color: var(--text-2); }
.field-btn:hover { background: var(--fill-3); color: var(--text); }
.field-btn .icon { stroke-width: 2.2; }
.send-btn { background: var(--accent); color: #fff; }
.send-btn .icon { stroke-width: 2.4; }
.send-btn:hover:not(:disabled) { background: var(--accent-hover); transform: scale(1.06); }
.send-btn:active:not(:disabled) { transform: scale(0.94); }
.send-btn:disabled { background: var(--fill-3); color: var(--text-3); cursor: default; }
.send-btn.uploading { opacity: 0.6; }
.send-btn .spinner { width: 14px; height: 14px; }

.composer-hint { font-size: 12px; color: var(--text-3); padding: 0 6px; }
@media (max-width: 760px) {
  .composer-hint { display: none; }
  .status-row .status-next { flex: 1 1 100%; justify-content: center; }
}
.composer-v2 > div:empty, .composer-v2 > [hidden] { display: none; }
.status-row .status-alt { gap: 5px; }
@media (max-width: 760px) { .status-row .status-alt { flex: 1 1 100%; justify-content: center; } }
.status-row .status-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }

/* ══════════════════════════════════════════════════════════════════════════════
   MODUŁ LIST I CHECKLIST (#e971a4)
   ══════════════════════════════════════════════════════════════════════════════ */

.btn-pink, .nav-new-list {
  background: #e971a4 !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(233, 113, 164, 0.35);
  transition: background 0.16s ease, transform 0.12s var(--spring), box-shadow 0.16s ease;
}
.btn-pink:hover, .nav-new-list:hover {
  background: #db5991 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(233, 113, 164, 0.45);
  transform: translateY(-1px);
}
.btn-pink:active, .nav-new-list:active {
  transform: scale(0.96);
}

/* Obszar listy na stronie głównej */
.lists-area {
  margin: 0 0 24px 0;
}
.lists-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lists-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.list-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e971a4;
  box-shadow: 0 0 8px #e971a4;
  display: inline-block;
}
.counter-badge-pink {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(233, 113, 164, 0.15);
  color: #e971a4;
}
.lists-empty-box {
  background: var(--surface-raised);
  border: 1px dashed var(--border-card);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.list-empty-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(233, 113, 164, 0.12);
  color: #e971a4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Siatka i karty list */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
@media (max-width: 600px) {
  .lists-grid { grid-template-columns: 1fr; }
}
.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s var(--spring), box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}
.list-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  border-color: rgba(233, 113, 164, 0.3);
  transform: translateY(-2px);
}
.list-card.is-all-done {
  border-color: rgba(52, 199, 89, 0.3);
}
.list-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.list-icon-pill {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 8px;
  background: rgba(233, 113, 164, 0.15);
  color: #e971a4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.list-card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-progress-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--bg-subtle-fill);
  color: var(--text-2);
  white-space: nowrap;
}
.list-progress-pill.done {
  background: rgba(52, 199, 89, 0.15);
  color: #34C759;
}
.list-card-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  min-height: 24px;
}

/* Pozycje na liście */
.list-card-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
}
.list-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  background: var(--bg-card-secondary);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.2s ease, transform 0.15s ease;
  user-select: none;
}
.list-item-row:hover {
  background: var(--bg-subtle-hover);
}
.list-item-row:active {
  transform: scale(0.99);
}

/* Pozycja wykonana – szara pozycja */
.list-item-row.is-done {
  background: rgba(118, 118, 128, 0.08) !important;
  opacity: 0.72;
}
.list-item-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item-title.is-done-text {
  color: var(--text-3);
  text-decoration: line-through;
}

/* Checkbox pozycji – zielona ikonka z białym checkmarkiem */
.list-item-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 1.8px solid var(--border-input);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.15s var(--spring);
}
.list-item-check:hover {
  border-color: #34C759;
  transform: scale(1.1);
}
.list-item-check.checked {
  background: #34C759 !important;
  border-color: #34C759 !important;
  color: #ffffff !important;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.4);
}
.list-item-check.checked .icon {
  stroke: #ffffff;
  stroke-width: 2.8;
}

.list-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.chip-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-subtle-fill);
  padding: 2px 5px;
  border-radius: 6px;
}

/* Modal pozycji z listy */
.list-item-sheet .sheet-card {
  max-width: 640px !important;
}
.list-modal-head {
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
}
.list-modal-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.list-badge-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(233, 113, 164, 0.14);
  color: #e971a4;
}
.list-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.list-status-badge.done {
  background: rgba(52, 199, 89, 0.14);
  color: #34C759;
}
.list-status-badge.pending {
  background: var(--bg-subtle-fill);
  color: var(--text-2);
}
.list-modal-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.list-check-circle {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-input);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.list-check-circle:hover {
  border-color: #34C759;
}
.list-check-circle.checked {
  background: #34C759 !important;
  border-color: #34C759 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.4);
}
.list-check-circle.checked .icon {
  stroke: #ffffff;
  stroke-width: 2.8;
}
.list-modal-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: var(--text);
}
.list-modal-title.is-done-text {
  color: var(--text-3);
  text-decoration: line-through;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.section-k {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-2);
}
.list-item-content-body {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: rgba(255, 255, 255, 0.45);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  white-space: pre-wrap;
  word-break: break-word;
}

[data-theme="dark"] .list-item-content-body {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Galeria zdjęć w modalu */
.list-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}
.list-photo-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  background: var(--bg-card-secondary);
  cursor: pointer;
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.list-photo-thumb:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.list-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-icon-box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  text-align: center;
  color: var(--text-2);
}
.file-name-xs {
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  margin-top: 4px;
}

/* Dyskusja w modalu */
.list-messages-stream {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
  margin-bottom: 12px;
}
.list-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.list-msg-bubble {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 8px 12px;
  max-width: 85%;
}

[data-theme="dark"] .list-msg-bubble {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}
.list-msg-row.is-me {
  flex-direction: row-reverse;
}
.list-msg-row.is-me .list-msg-bubble {
  background: rgba(0, 113, 227, 0.08);
  border-color: rgba(0, 113, 227, 0.2);
}
.list-msg-author {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.faint-ts {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-3);
}
.list-msg-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}
.list-msg-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.list-msg-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  color: var(--text);
  text-decoration: none;
}
.list-msg-file-chip:hover {
  background: var(--bg-subtle-hover);
}

.list-modal-composer {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 10px;
}
.list-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.list-composer-textarea {
  flex: 1 1 auto;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 4px;
  font-size: 14px;
  resize: none;
}
.list-composer-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.composer-uploads-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
}
.composer-upload-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  font-size: 12px;
}
.composer-upload-chip img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
}
.remove-upload-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
}
.remove-upload-btn:hover {
  color: var(--apple-red);
}

/* Kreator listy (list_editor.js) */
.list-editor-items-holder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.list-editor-item-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-card);
  background: var(--bg-card-secondary);
  transition: border-color 0.15s ease;
}
.list-editor-item-card:focus-within {
  border-color: rgba(233, 113, 164, 0.4);
}
.list-editor-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.list-editor-item-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #e971a4;
  background: rgba(233, 113, 164, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
}
.list-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}
.list-editor-members-holder {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--hairline);
  gap: 10px;
}

/* Pełny widok listy (list_view.js) */
.list-view-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.list-view-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.badge-readonly {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-subtle-fill);
  color: var(--text-2);
}
.list-view-progress-wrap {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 12px 16px;
}
.list-progress-bar-bg {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: var(--hairline);
  overflow: hidden;
}
.list-progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #e971a4, #34C759);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.member-perm-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-subtle-fill);
  color: var(--text-2);
}
.member-perm-chip.can-edit {
  background: rgba(233, 113, 164, 0.12);
  color: #e971a4;
  font-weight: 600;
}

.list-view-items-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list-full-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.18s ease;
  cursor: pointer;
}
.list-full-item-card:hover {
  border-color: rgba(233, 113, 164, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.list-full-item-card.is-done-card {
  background: rgba(118, 118, 128, 0.06) !important;
  border-color: var(--hairline);
  opacity: 0.72;
}
.list-item-big-check {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-input);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  margin-top: 1px;
  transition: all 0.16s ease;
}
.list-item-big-check:hover:not(:disabled) {
  border-color: #34C759;
  transform: scale(1.08);
}
.list-item-big-check.checked {
  background: #34C759 !important;
  border-color: #34C759 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.4);
}
.list-item-big-check.checked .icon {
  stroke: #ffffff;
  stroke-width: 2.8;
}
.list-full-item-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.35;
}
.list-full-item-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
  margin-top: 4px;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.list-full-item-desc.is-done-desc {
  color: var(--text-3);
}
.list-full-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.done-info-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: #34C759;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(52, 199, 89, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
}
.list-card.clickable {
  cursor: pointer;
}
.list-quick-add-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-card);
  border-radius: 16px;
  padding: 14px 18px;
}

/* ───────────────────────── Sidebar list i powiększony modal listy ───────────────────────── */

.page.orders-page {
  max-width: var(--page-w);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 44px var(--gutter) 120px;
  transition: max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.orders-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

.orders-main-content {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────
   ROZSZERZANIE GÓRNEGO PASKA I STRONY PO ROZWINIĘCIU LIST:
   Na szerokim ekranie (>= 1400px):
   Górny pasek (.nav-inner) i strona zleceń (.orders-page) rozszerzają się razem
   na pełną szerokość z listą (1480px), zachowując 3 kafelki na szerokość!
   ───────────────────────────────────────────────────────────── */
@media (min-width: 1400px) {
  body.sidebar-lists-expanded .nav-inner,
  body.sidebar-lists-expanded .page.orders-page {
    max-width: var(--page-w-wide);
  }

  body.sidebar-lists-expanded .orders-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Gdy ekran jest węższy (< 1400px) i lista jest rozwinięta:
   Karty formatują się na 2 na szerokość */
@media (max-width: 1399px) and (min-width: 1025px) {
  body.sidebar-lists-expanded .orders-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* W trybie zwiniętym na desktopie (>= 1025px): dokładnie 3 kafelki na szerokość */
@media (min-width: 1025px) {
  body:not(.sidebar-lists-expanded) .orders-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.orders-sidebar-lists {
  width: 260px;
  min-width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 16px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03), inset 0 1px 1px 0 rgba(255, 255, 255, 0.9);
  scrollbar-width: thin;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.24s cubic-bezier(0.16, 1, 0.3, 1), padding 0.24s ease, border-radius 0.24s ease;
  z-index: 20;
}

[data-theme="dark"] .orders-sidebar-lists {
  background: rgba(28, 28, 34, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Nagłówek sidebara w trybie rozwiniętym */
.sidebar-lists-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  width: 100%;
  gap: 8px;
}

[data-theme="dark"] .sidebar-lists-head {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.sidebar-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-lists-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.sidebar-lists-title .icon {
  color: #e971a4;
}

/* Przycisk "+ Nowa" w nagłówku rozwiniętym (Liquid Glass Pill) */
.glass-add-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(233, 113, 164, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #e971a4;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(233, 113, 164, 0.28);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(233, 113, 164, 0.1);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-add-pill-btn:hover {
  background: #e971a4;
  color: #ffffff;
  border-color: #e971a4;
  transform: scale(1.04);
  box-shadow: 0 3px 10px rgba(233, 113, 164, 0.3);
}

/* Przycisk zwijania / rozwijania w stylu Apple SF Symbol Liquid Glass */
.glass-sidebar-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-sidebar-toggle-btn.sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: none;
}

[data-theme="dark"] .glass-sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: var(--text-2);
}

[data-theme="dark"] .glass-sidebar-toggle-btn.sm {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.glass-sidebar-toggle-btn:hover {
  background: rgba(233, 113, 164, 0.16);
  color: #e971a4;
  border-color: rgba(233, 113, 164, 0.4);
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(233, 113, 164, 0.22);
}

.glass-sidebar-toggle-btn:active {
  transform: scale(0.96);
}

/* ─────────────────────────────────────────────────────────────
   TRYB ZWINIĘTY (Apple macOS Liquid Glass Rail)
   ───────────────────────────────────────────────────────────── */

.orders-sidebar-lists.is-collapsed {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  padding: 8px 6px 12px;
  border-radius: 24px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.orders-sidebar-lists.is-collapsed .sidebar-lists-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  width: 100%;
}

.sidebar-glass-divider {
  width: 20px;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 5px 0 2px;
  border-radius: 1px;
}

[data-theme="dark"] .sidebar-glass-divider {
  background: rgba(255, 255, 255, 0.12);
}

.orders-sidebar-lists.is-collapsed .sidebar-lists-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 100%;
}

/* Kafelek listy w trybie zwiniętym: Apple macOS Glass Squircle */
.glass-sidebar-tile {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .glass-sidebar-tile {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-sidebar-tile:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(233, 113, 164, 0.5);
  box-shadow: 0 6px 18px rgba(233, 113, 164, 0.22), inset 0 1px 1px #fff;
}

[data-theme="dark"] .glass-sidebar-tile:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(233, 113, 164, 0.5);
  box-shadow: 0 6px 18px rgba(233, 113, 164, 0.25);
}

.glass-sidebar-tile.is-all-done {
  border-color: rgba(52, 199, 89, 0.4);
}

.glass-sidebar-tile .avatar {
  width: 26px;
  height: 26px;
  font-size: 10px;
  border-radius: 50%;
}

/* Subtelny szklany mikro-wskaźnik stanu punktów w rogu kafelka */
.glass-tile-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  height: 14px;
  min-width: 14px;
  padding: 0 3.5px;
  font-size: 8px;
  font-weight: 700;
  border-radius: 99px;
  background: rgba(20, 20, 24, 0.72);
  color: #ffffff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.glass-tile-status.is-done {
  background: #34C759;
  border-color: #ffffff;
  box-shadow: 0 2px 6px rgba(52, 199, 89, 0.45);
}

.glass-tile-status.is-done .icon {
  width: 8px;
  height: 8px;
  stroke-width: 3.2;
}

/* ─────────────────────────────────────────────────────────────
   TOOLTIPS (Apple macOS Liquid Glass Frosted Tooltips)
   ───────────────────────────────────────────────────────────── */

.has-tooltip {
  position: relative;
}

.sidebar-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: rgba(24, 24, 28, 0.82);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.15s ease;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.16);
  z-index: 1000;
  line-height: 1.3;
}

.sidebar-tooltip.right {
  left: auto;
  right: calc(100% + 10px);
  transform: translateY(-50%) translateX(4px);
}

.has-tooltip:hover .sidebar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.has-tooltip:hover .sidebar-tooltip.right {
  transform: translateY(-50%) translateX(0);
}

.sidebar-empty-state {
  padding: 16px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sidebar-lists-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Na telefonach i tabletach (szerokość poniżej 1024px) sidebar jest całkowicie ukryty.
   Listy są dostępne w dedykowanej zakładce "Listy" oraz przez przycisk "+ Nowa lista". */
@media (max-width: 1024px) {
  .orders-sidebar-lists {
    display: none !important;
  }
  .orders-layout {
    display: block !important;
    gap: 0 !important;
  }
  .orders-main-content {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Tablet (600px - 1024px): dokładnie 2 kolumny zleceń obok siebie */
@media (min-width: 600px) and (max-width: 1024px) {
  .orders-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
  .lists-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

/* Telefon (poniżej 600px): 1 kolumna na całą szerokość ekranu */
@media (max-width: 599px) {
  .orders-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .lists-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* Pasek zakładek statusów (Aktywne, Nowe, ..., Listy) */
.orders-status-bar {
  flex: 0 1 auto;
  max-width: 100%;
}

/* Na telefonach pasek zakładek układa się w 2 czyste rzędy zamiast uciążliwego przewijania */
@media (max-width: 680px) {
  .orders-status-bar {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  .orders-status-tabs.segmented {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible !important;
    gap: 4px !important;
    padding: 4px !important;
    border-radius: 12px !important;
  }
  .orders-status-tabs.segmented button {
    flex: 1 1 auto !important;
    height: 30px !important;
    padding: 0 7px !important;
    font-size: 11.5px !important;
    gap: 4px !important;
    white-space: nowrap !important;
    border-radius: 7px !important;
    justify-content: center !important;
  }
  .orders-status-tabs.segmented .count {
    font-size: 10.5px !important;
  }
}

/* ───────────────────────── Kafelki list w lewym sidebarze (z rozwijanym podglądem) ───────────────────────── */

.list-mini-tile-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s var(--spring);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.list-mini-tile-card:hover {
  border-color: rgba(233, 113, 164, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.list-mini-tile-card.is-all-done {
  border-color: rgba(52, 199, 89, 0.35);
}

.list-mini-tile-card.is-expanded {
  border-color: rgba(233, 113, 164, 0.55);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.mini-tile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.mini-tile-header:hover {
  background: var(--bg-subtle-hover);
}

.mini-tile-row-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.mini-tile-row-box:hover {
  background: var(--bg-subtle-hover);
}

.mini-tile-full-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.mini-tile-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-tile-actions-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mini-tile-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 9px;
  background: rgba(233, 113, 164, 0.14);
  color: #e971a4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.mini-tile-icon.done {
  background: rgba(52, 199, 89, 0.15);
  color: #34C759;
}

.mini-tile-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mini-tile-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.mini-tile-author {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.mini-tile-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.mini-tile-count {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--fill-2);
  color: var(--text-2);
  white-space: nowrap;
}

.mini-tile-count.done {
  background: rgba(52, 199, 89, 0.15);
  color: #34C759;
}

.mini-tile-expand-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.18s var(--spring);
}

.mini-tile-expand-btn:hover {
  background: rgba(233, 113, 164, 0.15);
  color: #e971a4;
}

.mini-tile-expand-btn.expanded {
  color: #e971a4;
  background: rgba(233, 113, 164, 0.12);
}

/* Rozwinięty uproszczony podgląd w dół */
.mini-tile-dropdown {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  animation: mini-dropdown-in 0.22s var(--ease-out) both;
}

@keyframes mini-dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.mini-tile-preview-items {
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.mini-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s ease;
  font-size: 12.5px;
}

.mini-preview-row:last-child {
  border-bottom: none;
}

.mini-preview-row:hover {
  background: var(--bg-subtle-hover);
}

.mini-preview-row.is-done {
  background: rgba(118, 118, 128, 0.04);
}

.mini-preview-check {
  width: 17px;
  height: 17px;
  min-width: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--border-input);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.mini-preview-check:hover:not(:disabled) {
  border-color: #34C759;
  transform: scale(1.12);
}

.mini-preview-check.checked {
  background: #34C759 !important;
  border-color: #34C759 !important;
  color: #ffffff !important;
}

.mini-preview-check.checked .icon {
  stroke: #ffffff;
  stroke-width: 3;
}

.mini-preview-title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-weight: 500;
}

.mini-preview-title.is-done-text {
  color: var(--text-3);
  text-decoration: line-through;
}

.mini-preview-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  flex-shrink: 0;
}

.mini-preview-empty {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

.mini-preview-open-full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  background: var(--fill-2);
  color: #e971a4;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mini-preview-open-full:hover {
  background: rgba(233, 113, 164, 0.12);
  color: #d85a92;
}

/* ───────────────────────── Smart List Builder (Kreator listy) ───────────────────────── */

.list-smart-builder {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.list-smart-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.15s ease;
}

.list-smart-row:last-child {
  border-bottom: none;
}

.list-smart-row:focus-within {
  background: var(--bg-subtle-hover);
}

.list-smart-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
}

.list-smart-badge {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 6px;
  background: rgba(233, 113, 164, 0.12);
  color: #e971a4;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.list-smart-fields {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-smart-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  padding: 0;
  font-family: inherit;
  line-height: 1.35;
}

.list-smart-input::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

.list-smart-note-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12.5px;
  color: var(--text-2);
  resize: none;
  overflow: hidden;
  padding: 0;
  font-family: inherit;
  line-height: 1.4;
  min-height: 20px;
}

.list-smart-note-input::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

.list-smart-note-input:focus {
  color: var(--text);
}

.btn-icon-subtle {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.btn-icon-subtle:hover {
  background: var(--fill-2);
  color: var(--text);
}

.btn-icon-subtle.danger:hover {
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.1);
}

.list-smart-add-wrap {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
}

.btn-smart-add-pink {
  background: #e971a4;
  color: #ffffff;
  border: none;
  border-radius: 99px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s var(--spring), box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(233, 113, 164, 0.28);
}

.btn-smart-add-pink .icon {
  stroke: #ffffff;
  stroke-width: 2.8;
}

.btn-smart-add-pink:hover {
  background: #df5e95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(233, 113, 164, 0.38);
}

.btn-smart-add-pink:active {
  transform: scale(0.97);
}

/* ───────────────────────── Modale zleceń / projektów (Liquid Glass macOS 27) ───────────────────────── */

/* 1. Modal szczegółów zlecenia */
.sheet.wide.order-modal-sheet {
  max-width: 1080px;
  width: 95vw;
  max-height: 90vh;
  border-radius: 24px;
}

.order-modal-sheet .sheet-body {
  padding: 24px 28px 32px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.order-modal-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.order-modal-sheet .order-hero {
  margin-bottom: 22px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Nagłówek szczegółów zlecenia: tagi i akcje w górnym wierszu, akcje w prawym górnym rogu */
.order-hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.order-hero-top-row .meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
  flex: 1 1 auto;
  margin-bottom: 0;
}

.order-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.order-hero-actions .order-more-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.order-hero .order-hero-title {
  margin-top: 4px;
  margin-bottom: 14px;
  word-break: break-word;
}

.order-modal-sheet .order-hero .order-hero-title {
  font-size: 26px;
  line-height: 1.15;
}

.order-modal-sheet .detail-side {
  position: static;
}

.order-modal-sheet .card.brief-card,
.order-modal-sheet .chat-card,
.order-modal-sheet .detail-side .card {
  background: var(--sheet-card-bg);
  border: 1px solid var(--sheet-card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .order-modal-sheet .card.brief-card,
[data-theme="dark"] .order-modal-sheet .chat-card,
[data-theme="dark"] .order-modal-sheet .detail-side .card {
  background: var(--sheet-card-bg);
  border-color: var(--sheet-card-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.order-modal-sheet .caption-chip {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .order-modal-sheet .caption-chip {
  background: rgba(255, 255, 255, 0.06);
}

/* 2. Modal kreatora / edycji zlecenia */
.sheet.wide.order-editor-sheet {
  max-width: 860px;
  width: 95vw;
  max-height: 90vh;
  border-radius: 24px;
}

.order-editor-sheet .sheet-body {
  padding: 24px 28px 24px;
  overflow-y: auto;
}

.order-editor-sheet .editor-head {
  margin-bottom: 22px;
}

.order-editor-sheet .editor-modal-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.order-editor-sheet .editor-modal-title-col {
  min-width: 0;
  flex: 1 1 auto;
}

.order-editor-sheet .order-modal-close-btn {
  flex-shrink: 0;
  margin-left: auto;
}

.order-editor-sheet .large-title {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 26px;
  line-height: 1.15;
  word-break: break-word;
}

.order-editor-sheet .subtitle {
  font-size: 14px;
  margin: 4px 0 0;
  line-height: 1.4;
  word-break: break-word;
}

.order-editor-sheet .tile {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .order-editor-sheet .tile {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.order-editor-sheet .tile:hover {
  background: rgba(255, 255, 255, 0.75);
}

[data-theme="dark"] .order-editor-sheet .tile:hover {
  background: rgba(255, 255, 255, 0.09);
}

.order-editor-sheet .tile.selected {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

[data-theme="dark"] .order-editor-sheet .tile.selected {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.order-editor-sheet .step.active {
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .order-editor-sheet .step.active {
  background: rgba(255, 255, 255, 0.12);
}

.order-editor-sheet .editor-footer {
  position: sticky;
  bottom: 0;
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 10px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .order-editor-sheet .editor-footer {
  background: rgba(30, 30, 36, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.order-editor-sheet .dropzone {
  background: rgba(255, 255, 255, 0.35);
  border: 1.5px dashed rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .order-editor-sheet .dropzone {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}

.order-editor-sheet .review-card {
  background: var(--sheet-card-bg);
  border: 1px solid var(--sheet-card-border);
  border-radius: 16px;
}

[data-theme="dark"] .order-editor-sheet .review-card {
  background: var(--sheet-card-bg);
  border-color: var(--sheet-card-border);
}

/* 3. Przycisk zamknięcia w stylu Liquid Glass */
.order-modal-close-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .order-modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.order-modal-close-btn:hover {
  background: rgba(233, 113, 164, 0.16);
  color: #e971a4;
  border-color: rgba(233, 113, 164, 0.4);
  transform: scale(1.08);
}

@media (max-width: 760px) {
  .sheet.wide.order-modal-sheet,
  .sheet.wide.order-editor-sheet,
  .sheet.wide.center-full-list-sheet {
    max-width: 100vw;
    width: 100%;
    margin: 0;
    border-radius: 24px 24px 0 0;
    max-height: 94vh;
  }
}

@media (max-width: 600px) {
  .order-modal-sheet .sheet-body,
  .order-editor-sheet .sheet-body {
    padding: 16px 14px 20px;
    overflow-x: hidden;
  }
  .chat {
    padding: 14px 10px 12px;
  }
  .bubble {
    font-size: 14.5px;
    padding: 8px 12px 9px;
  }
  .msg-col {
    max-width: calc(100% - 28px);
  }
  .msg.mine .msg-col {
    max-width: 100%;
  }

  .order-hero-top-row {
    gap: 8px;
    margin-bottom: 6px;
  }

  .order-hero-top-row .meta-line {
    gap: 6px 8px;
  }

  .order-hero-actions {
    gap: 6px;
  }

  .order-hero-edit-btn {
    height: 30px;
    padding: 0 10px;
    font-size: 13px;
  }

  .order-hero .order-hero-title,
  .order-modal-sheet .order-hero .order-hero-title {
    font-size: 23px;
    margin-bottom: 12px;
  }

  .order-editor-sheet .large-title {
    font-size: 22px;
  }

  .order-editor-sheet .subtitle {
    font-size: 13px;
  }

  .order-editor-sheet .editor-modal-top-row {
    gap: 8px;
    margin-bottom: 10px;
  }
}

/* ───────────────────────── Czysta forma listy (Split view: Lista + Czat) ───────────────────────── */

.sheet.wide.center-full-list-sheet {
  max-width: 960px;
  width: 95vw;
  max-height: 90vh;
  border-radius: 24px;
}

.center-full-list-sheet .sheet-body {
  padding: 20px 24px;
  overflow-y: auto;
}

/* Nagłówek modalu listy: przyciski Edytuj i X w lewym górnym rogu */
.center-list-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.list-modal-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-modal-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(0, 135, 147, 0.12);
  color: #008793;
  border: 1px solid rgba(0, 135, 147, 0.3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.list-modal-edit-btn:hover {
  background: #008793;
  color: #ffffff;
  border-color: #008793;
  box-shadow: 0 3px 10px rgba(0, 135, 147, 0.3);
  transform: translateY(-1px);
}

.list-modal-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 135, 147, 0.1);
  color: #008793;
  border: 1px solid rgba(0, 135, 147, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.list-modal-close-btn:hover {
  background: #008793;
  color: #ffffff;
  border-color: #008793;
  transform: scale(1.08);
  box-shadow: 0 3px 10px rgba(0, 135, 147, 0.3);
}

.list-modal-eyebrow {
  color: #e971a4 !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.list-modal-eyebrow .list-section-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e971a4;
  box-shadow: 0 0 6px rgba(233, 113, 164, 0.45);
}

.center-list-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--text);
}

.list-modal-split-layout {
  display: flex;
  gap: 22px;
  margin-top: 14px;
  align-items: flex-start;
}

.list-modal-left-col {
  flex: 1 1 54%;
  min-width: 320px;
  display: flex;
  flex-direction: column;
}

.list-modal-chat-col {
  flex: 1 1 46%;
  min-width: 300px;
  border-left: 1px solid var(--hairline);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 820px) {
  .center-full-list-sheet .sheet-body {
    padding: 16px 14px;
  }
  .list-modal-split-layout {
    flex-direction: column;
    gap: 16px;
  }
  .list-modal-left-col {
    min-width: 0;
    width: 100%;
  }
  .list-modal-chat-col {
    border-left: none;
    border-top: 1px solid var(--hairline);
    padding-left: 0;
    padding-top: 18px;
    min-width: 0;
    width: 100%;
  }
}

.checklist-filter-bar {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  margin-bottom: 12px;
}

.checklist-filter-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-2);
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.16s ease;
}

[data-theme="dark"] .checklist-filter-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.checklist-filter-pill:hover:not(.active) {
  background: rgba(0, 135, 147, 0.12);
  color: #008793;
  border-color: rgba(0, 135, 147, 0.25);
}

.checklist-filter-pill.active {
  background: #008793 !important;
  color: #ffffff !important;
  border-color: #008793 !important;
  box-shadow: 0 2px 8px rgba(0, 135, 147, 0.35);
}

.full-checklist-box {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02), inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .full-checklist-box {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.checklist-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.15s ease;
  cursor: pointer;
}

.checklist-row:hover {
  background: var(--bg-subtle-hover);
}

.checklist-row.is-done {
  background: rgba(118, 118, 128, 0.035);
}

/* Kółko checkmark po lewej: kliknięcie wypełnia zielone z białym checkmarkiem */
.checklist-check-circle {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 1.8px solid var(--border-input);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  margin-top: 1px;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.15s var(--spring);
}

.checklist-check-circle:hover:not(:disabled) {
  border-color: #34C759;
  transform: scale(1.12);
}

.checklist-check-circle.checked {
  background: #34C759 !important;
  border-color: #34C759 !important;
  color: #ffffff !important;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.35);
}

.checklist-check-circle.checked .icon {
  stroke: #ffffff;
  stroke-width: 3;
}

.checklist-body {
  flex: 1 1 auto;
  min-width: 0;
}

.checklist-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.checklist-text.is-done {
  color: var(--text-3);
  text-decoration: line-through;
}

.checklist-notes {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.35;
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.checklist-notes.is-done {
  color: var(--text-3);
}

/* Przycisk wygenerowania zlecenia z punktu listy */
.checklist-gen-order-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  margin-left: 8px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.22);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.85;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .checklist-gen-order-btn {
  background: rgba(41, 151, 255, 0.12);
  border-color: rgba(41, 151, 255, 0.28);
  color: #2997ff;
}

.checklist-gen-order-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

[data-theme="dark"] .checklist-gen-order-btn:hover {
  background: #2997ff;
  color: #000000;
  border-color: #2997ff;
  box-shadow: 0 2px 8px rgba(41, 151, 255, 0.35);
}

.checklist-gen-order-btn:disabled,
.checklist-gen-order-btn.busy {
  opacity: 0.5;
  cursor: wait;
  pointer-events: none;
}

.checklist-row.is-done .checklist-gen-order-btn {
  opacity: 0.5;
}

.checklist-row.is-done .checklist-gen-order-btn:hover {
  opacity: 1;
}

@media (max-width: 600px) {
  .checklist-gen-order-btn .btn-text {
    display: none;
  }
  .checklist-gen-order-btn {
    padding: 4px;
    width: 26px;
    height: 26px;
    justify-content: center;
    margin-left: 4px;
  }
}

.checklist-empty-row {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.checklist-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.02);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease;
}

[data-theme="dark"] .checklist-add-row {
  background: rgba(255, 255, 255, 0.02);
  border-top-color: rgba(255, 255, 255, 0.06);
}

.checklist-add-row:focus-within {
  background: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .checklist-add-row:focus-within {
  background: rgba(255, 255, 255, 0.05);
}

.checklist-add-icon {
  color: #e971a4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checklist-add-input {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
}

.checklist-add-input::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

/* ───────────────────────── Czat listy ───────────────────────── */

.list-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
}

.list-chat-stream {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  margin-bottom: 12px;
}

.list-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 12px;
  color: var(--text-3);
  text-align: center;
}

.list-chat-msg-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.list-chat-msg-row.is-me {
  justify-content: flex-end;
}

.list-chat-msg-bubble {
  max-width: 82%;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .list-chat-msg-bubble {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.09);
}

.list-chat-msg-row.is-me .list-chat-msg-bubble {
  background: rgba(233, 113, 164, 0.14);
  border-color: rgba(233, 113, 164, 0.28);
}

.list-chat-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.list-chat-msg-author {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
}

.list-chat-msg-time {
  font-size: 10.5px;
  color: var(--text-3);
}

.list-chat-msg-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}

.list-chat-files-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.list-chat-image-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.list-chat-image-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.list-chat-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.list-chat-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--fill-2);
  color: var(--text-2);
  text-decoration: none;
  max-width: 180px;
}

.list-chat-file-chip:hover {
  color: #e971a4;
  background: rgba(233, 113, 164, 0.12);
}

.file-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-chat-composer {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-x: hidden !important;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
}

[data-theme="dark"] .list-chat-composer {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.list-chat-composer:focus-within {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 135, 147, 0.4);
  box-shadow: 0 4px 14px rgba(0, 135, 147, 0.12);
}

[data-theme="dark"] .list-chat-composer:focus-within {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(0, 135, 147, 0.5);
  box-shadow: 0 4px 14px rgba(0, 135, 147, 0.2);
}

.list-chat-textarea {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  min-height: 36px;
  max-height: 120px;
  overflow-x: hidden !important;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 4px 2px;
}

.list-chat-textarea::-webkit-scrollbar:horizontal {
  display: none !important;
  height: 0 !important;
}

.list-chat-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid var(--hairline);
}

.list-chat-queue-preview {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
}

.list-chat-queue-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  background: var(--fill-2);
  padding: 2px 6px;
  border-radius: 6px;
  max-width: 180px;
}

.queue-thumb {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
}

.queue-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-del-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 0;
  display: inline-flex;
}

.queue-del-btn:hover {
  color: #ff3b30;
}

/* ───────────────────────── Miniaturka listy w zakładce Listy ───────────────────────── */

.list-card-miniaturka {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s var(--spring);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.list-card-miniaturka:hover {
  border-color: rgba(233, 113, 164, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.list-card-miniaturka.is-all-done {
  border-color: rgba(52, 199, 89, 0.35);
}

.list-miniaturka-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-miniaturka-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.list-miniaturka-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-miniaturka-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.list-miniaturka-author-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

/* ───────────────────────── Kontrolka uprawnień (Segmented Switch) ───────────────────────── */

.perm-switch.segmented.sm {
  padding: 2px;
  border-radius: 9px;
  background: var(--fill-2);
}

.perm-switch.segmented.sm button {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  gap: 5px;
  border-radius: 7px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.perm-switch button.active.perm-editable {
  background: rgba(40, 167, 69, 0.18) !important;
  color: #1e7e34 !important;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.perm-switch button.active.perm-readonly {
  background: var(--surface-raised) !important;
  color: var(--text-2) !important;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}



