/* Panel Kawcia: jasny i ciemny motyw, menu boczne, karty. */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --surface-3: #f0f0f3;
  --text: #1d1d1f;
  --text-2: #5f5f66;
  --text-3: #8e8e95;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .14);
  --accent: #b4632a;
  --accent-hover: #9a531f;
  --accent-soft: rgba(180, 99, 42, .10);
  --accent-text: #ffffff;
  --ok: #1e8e4e;
  --ok-soft: rgba(30, 142, 78, .12);
  --bad: #d4332b;
  --bad-soft: rgba(212, 51, 43, .10);
  --warn: #b7791f;
  --warn-soft: rgba(183, 121, 31, .13);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .12);
  --radius: 18px;
  --radius-sm: 11px;
  --sidebar: 268px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0e10;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --surface-3: #27272c;
  --text: #f4f4f6;
  --text-2: #a9a9b2;
  --text-3: #7b7b85;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .15);
  --accent: #e39a5e;
  --accent-hover: #f0ad75;
  --accent-soft: rgba(227, 154, 94, .14);
  --accent-text: #1b1208;
  --ok: #4cc27f;
  --ok-soft: rgba(76, 194, 127, .14);
  --bad: #ff6b60;
  --bad-soft: rgba(255, 107, 96, .13);
  --warn: #e6b24f;
  --warn-soft: rgba(230, 178, 79, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10; --surface: #18181b; --surface-2: #1f1f23; --surface-3: #27272c;
    --text: #f4f4f6; --text-2: #a9a9b2; --text-3: #7b7b85;
    --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .15);
    --accent: #e39a5e; --accent-hover: #f0ad75; --accent-soft: rgba(227, 154, 94, .14); --accent-text: #1b1208;
    --ok: #4cc27f; --ok-soft: rgba(76, 194, 127, .14); --bad: #ff6b60; --bad-soft: rgba(255, 107, 96, .13);
    --warn: #e6b24f; --warn-soft: rgba(230, 178, 79, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { letter-spacing: -.02em; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-3); padding: .1em .4em; border-radius: 6px; }
.i { flex: none; display: block; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.wrap { overflow-wrap: anywhere; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.gap { gap: 10px; flex-wrap: wrap; }
.gap-sm { gap: 6px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 8px; }
.top-gap { margin-top: 16px; }
.inline { display: inline; margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Układ */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); z-index: 30;
}
.main { margin-left: var(--sidebar); min-width: 0; }
.content { max-width: 1240px; margin: 0 auto; padding: 36px 40px 80px; }

.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 14px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #fff;
  background: linear-gradient(145deg, #c9814a, #7a3f16); box-shadow: 0 4px 12px rgba(122, 63, 22, .3);
}
.brand-mark.big { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 18px; }
.brand-mark.warn { background: linear-gradient(145deg, #e6a23c, #b4632a); }
.brand-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; object-fit: cover; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.brand-avatar.small { width: 28px; height: 28px; }
.brand-avatar.big { width: 84px; height: 84px; margin: 0 auto 14px; }
.brand-text b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand-text small { display: block; font-size: 12px; color: var(--text-3); }
.brand.small { padding: 0; gap: 8px; }
.brand.small .brand-mark { width: 28px; height: 28px; border-radius: 8px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; }
.nav-group { margin: 18px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 9px;
  color: var(--text-2); font-size: 14px; font-weight: 500; transition: background .15s, color .15s;
}
.nav-item span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dot.on { background: var(--ok); }

.sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.me img, .me-fallback { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.me-fallback { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.me-text { min-width: 0; }
.me-text b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { display: block; font-size: 12px; color: var(--text-3); }
.foot-actions { display: flex; gap: 2px; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: none;
  color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }

.mobile-bar { display: none; }
.backdrop { display: none; }

/* Nagłówek strony */
.crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--text-3); }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.crumbs a:hover { color: var(--accent); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-head-main { display: flex; align-items: center; gap: 16px; }
.page-head-side { display: flex; align-items: center; gap: 12px; padding-top: 6px; }
.page-ico {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; flex: none;
  background: var(--accent-soft); color: var(--accent);
}
.lead { margin-top: 6px; color: var(--text-2); font-size: 16px; max-width: 68ch; }
.page-head .eyebrow { margin-bottom: 6px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.col-main, .col-side { display: grid; gap: 20px; min-width: 0; }
.col-side.sticky { position: sticky; top: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.section-title { font-size: 15px; color: var(--text-2); font-weight: 600; margin: 8px 2px -6px; }

/* Karty */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.layout > .col-main > .card + .card { margin-top: 0; }
.content > .card { margin-bottom: 20px; }
.card-title { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; margin-bottom: 16px; letter-spacing: -.01em; }
.card-title .i { color: var(--text-3); }
.card-title.spread .row .i { color: var(--text-3); }
.card-title .muted.small { font-weight: 400; margin-left: auto; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; margin-bottom: 20px; border-radius: 13px;
  background: var(--warn-soft); color: var(--text); font-size: 14px;
}
.notice .i { color: var(--warn); margin-top: 2px; }

/* Przyciski */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.full { width: 100%; justify-content: flex-start; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; height: 46px; width: 100%; font-size: 15px; border-radius: 13px; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; color: #fff; }
form.inline .btn.full { width: 100%; }
.col-side form.inline { display: block; }

/* Przełącznik funkcji */
.switch {
  position: relative; width: 46px; height: 28px; border-radius: 99px; border: 0; padding: 0; cursor: pointer;
  background: var(--line-strong); transition: background .2s;
}
.switch span {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch.on { background: var(--ok); }
.switch.on span { transform: translateX(18px); }
.switch-input { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.switch-input input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-input span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .2s; }
.switch-input span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch-input input:checked + span { background: var(--ok); }
.switch-input input:checked + span::after { transform: translateX(18px); }
.switch-input input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Odznaki */
.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* Formularze */
.form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field { display: grid; gap: 7px; align-content: start; min-width: 0; }
.field.end { align-self: end; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 4px 0; }
.label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.input, textarea, .select select {
  width: 100%; font: 14px/1.4 var(--font); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
.input { height: 40px; }
.input.narrow { max-width: 160px; }
textarea { resize: vertical; min-height: 64px; }
.input:focus, textarea:focus, .select select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input:disabled { opacity: .7; }
.select { position: relative; }
.select select { appearance: none; height: 40px; padding-right: 36px; cursor: pointer; }
.select::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -5px; pointer-events: none;
  border-right: 1.6px solid var(--text-3); border-bottom: 1.6px solid var(--text-3); transform: rotate(45deg);
}
/* Lista wyboru z wyszukiwarką */
.combo .combo-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.combo-btn {
  width: 100%; height: 40px; padding: 0 36px 0 12px; text-align: left; cursor: pointer;
  font: 14px/1.4 var(--font); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: border-color .15s, box-shadow .15s;
}
.combo-btn.placeholder { color: var(--text-3); }
.combo-btn:focus-visible, .combo.open .combo-btn { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.combo-btn.invalid { border-color: var(--bad); }
.combo-panel {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.combo-search { width: 100%; height: 40px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 14px var(--font); outline: none; }
.combo-list { max-height: 280px; overflow-y: auto; padding: 4px; }
.combo-opt { padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-opt.empty-opt { color: var(--text-3); }
.combo-opt.active { background: var(--surface-3); }
.combo-opt.selected { color: var(--accent); font-weight: 600; }
.combo-none { padding: 12px 10px; font-size: 13px; color: var(--text-3); }

.color-field { display: flex; gap: 8px; }
.color-field input[type=color] { width: 40px; height: 40px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; flex: none; }
.file { position: relative; display: flex; align-items: center; height: 40px; padding: 0 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; cursor: pointer; background: var(--surface-2); overflow: hidden; }
.file:hover { border-color: var(--accent); color: var(--accent); }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.mini-switch { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }

/* Wybór wielu ról i kanałów */
.picker { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.picker-head { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.picker-head input { flex: 1; min-width: 0; height: 38px; border: 0; background: none; color: var(--text); font: 14px var(--font); outline: none; }
.picker-count { font-size: 12px; white-space: nowrap; }
.picker-list { max-height: 228px; overflow-y: auto; padding: 4px; }
.picker-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.picker-opt:hover { background: var(--surface-3); }
.picker-opt input { position: absolute; opacity: 0; pointer-events: none; }
.picker-opt .check { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-strong); color: transparent; flex: none; }
.picker-opt input:checked + .check { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.picker-opt input:focus-visible + .check { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.pad { padding: 10px; }

/* Pulpit */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px;
  background: linear-gradient(120deg, var(--surface), var(--surface) 60%, var(--accent-soft)); }
.hero-bot { display: flex; align-items: center; gap: 16px; }
.hero-avatar { position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.hero-avatar img { width: 56px; height: 56px; border-radius: 50%; }
.status-dot { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--bad); border: 3px solid var(--surface); }
.status-dot.on { background: var(--ok); }
.hero h2 { font-size: 19px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.col-main > .stats { margin-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s; }
a.stat:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-ico { color: var(--accent); margin-bottom: 6px; }
.stat b { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat b small { font-size: 16px; color: var(--text-3); font-weight: 500; }
.stat > span:last-child { font-size: 13px; color: var(--text-2); }
.row-link { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 0 -12px; border-radius: 12px; color: var(--text); }
a.row-link:hover { background: var(--surface-3); color: var(--text); }
.row-link small { display: block; color: var(--text-3); font-size: 13px; }
.row-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; color: var(--text-3); }
.empty b { color: var(--text); font-size: 15px; }
.empty p { font-size: 13.5px; max-width: 40ch; }

/* Funkcje */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.feature { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.feature-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.feature-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-3); color: var(--text-2); transition: background .2s, color .2s; }
.feature.is-on .feature-ico { background: var(--accent-soft); color: var(--accent); }
.feature p { color: var(--text-2); font-size: 13.5px; flex: 1; }
.feature-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; margin-top: 4px; }

/* Instrukcja */
.help { background: var(--surface-2); }
.help-lead { color: var(--text); font-weight: 500; margin-bottom: 14px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.steps li { position: relative; padding-left: 36px; font-size: 14px; color: var(--text-2); counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent);
}
.tips { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.tips p { display: flex; gap: 8px; font-size: 13px; color: var(--text-2); }
.tips .i { color: var(--text-3); margin-top: 2px; }
.commands { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.commands p { display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.commands code { justify-self: start; }

/* Listy i tabele */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.list.numbered { counter-reset: q; }
.list.numbered li::before { counter-increment: q; content: counter(q); width: 22px; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.date-pill { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; padding: 3px 9px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.leaderboard { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.leaderboard li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; font-size: 14px; }
.leaderboard li:nth-child(odd) { background: var(--surface-2); }
.leaderboard .place { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.leaderboard li:nth-child(1) .place { background: #f6d365; color: #6b4a00; }
.leaderboard li:nth-child(2) .place { background: #dfe3e8; color: #44505c; }
.leaderboard li:nth-child(3) .place { background: #f0c39b; color: #6b3c12; }
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 0 10px 10px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }

/* Biblioteka wiadomości i zestawy */
.embed-list { display: grid; gap: 8px; }
.embed-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 18px; border-radius: 13px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); position: relative; overflow: hidden;
}
.embed-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--bar); }
.embed-item:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-3); }
.embed-item-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.embed-item-body b { font-size: 14.5px; }
.embed-item-body small { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.embed-item-meta { display: grid; justify-items: end; gap: 4px; }
.embed-item > .i { color: var(--text-3); }
.note { padding: 14px 0; border-bottom: 1px solid var(--line); }
.note:last-of-type { border-bottom: 0; }
.note-text { font-size: 15px; margin-bottom: 10px; white-space: pre-wrap; }
.note-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.poll { display: grid; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.poll:first-of-type { padding-top: 0; }
.poll:last-of-type { border-bottom: 0; padding-bottom: 0; }
.role-rows { display: grid; gap: 8px; }
.role-row { display: grid; grid-template-columns: 1.4fr 1.4fr 90px; gap: 8px; }
.role-row.head span { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }

/* Edytor wiadomości */
.editor .col-main > .card { display: grid; gap: 16px; }
.editor .col-main > .card > .card-title { margin-bottom: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-3); }
.toolbar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.toolbar button { min-width: 32px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font: 14px var(--font); cursor: pointer; }
.toolbar button:hover { background: var(--surface); color: var(--text); }
.toolbar select { height: 30px; border: 0; border-radius: 7px; background: var(--surface); color: var(--text-2); font: 13px var(--font); padding: 0 8px; max-width: 150px; cursor: pointer; }
.toolbar-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; }
.fields-list { display: grid; gap: 10px; }
.embed-field-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; align-items: start; }
.embed-field-row .mini-switch { height: 40px; }
.savebar {
  position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 20px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}

/* Wykresy */
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 44px; gap: 12px; align-items: center; margin: 7px 0; font-size: 13.5px; }
.bar-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-row > b { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: var(--accent); }
.columns { display: flex; gap: 3px; align-items: end; height: 190px; padding-top: 8px; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 6px; }
.col i { display: block; width: 100%; height: var(--h); min-height: 2px; border-radius: 4px 4px 2px 2px; background: var(--accent); opacity: .85; transition: opacity .15s; }
.col:hover i { opacity: 1; }
.col small { font-size: 10.5px; color: var(--text-3); height: 14px; white-space: nowrap; }
.hours { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-bottom: 10px; }
.hour { aspect-ratio: 1; border-radius: 8px; background: color-mix(in srgb, var(--accent) calc(var(--o) * 100%), var(--surface-3)); display: grid; place-items: center; }
.hour small { font-size: 10.5px; color: var(--text); opacity: .7; }

/* Podgląd Discorda (zawsze ciemny motyw Discorda) */
.dc { background: #313338; border-radius: 13px; padding: 14px 14px 6px; color: #dbdee1; font: 15px/1.375 "gg sans", "Noto Sans", var(--font); overflow: hidden; }
.dc-msg { display: flex; gap: 14px; margin-bottom: 14px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center; background: #b4632a; color: #fff; }
.dc-avatar img { width: 40px; height: 40px; }
.dc-content { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.dc-head b { color: #f2f3f5; font-weight: 600; }
.dc-bot { display: inline-flex; align-items: center; gap: 2px; height: 15px; padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; }
.dc-time { font-size: 12px; color: #949ba4; }
.dc-text, .dc-desc { white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-embed { display: flex; gap: 12px; margin-top: 6px; max-width: 520px; padding: 10px 14px 14px 12px; border-radius: 4px; background: #2b2d31; border-left: 4px solid var(--bar); }
.dc-embed-body { min-width: 0; flex: 1; display: grid; gap: 7px; font-size: 14px; }
.dc-author { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: #f2f3f5; }
.dc-author img { width: 24px; height: 24px; border-radius: 50%; }
.dc-title { font-weight: 700; color: #f2f3f5; font-size: 15px; }
.dc-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.dc-field { flex: 1 1 100%; font-size: 14px; }
.dc-field.inline { flex: 1 1 28%; min-width: 120px; }
.dc-field b { display: block; color: #f2f3f5; margin-bottom: 2px; }
.dc-field div { white-space: pre-wrap; }
.dc-image { max-width: 100%; border-radius: 4px; margin-top: 4px; }
.dc-image.placeholder { display: grid; place-items: center; gap: 4px; height: 150px; background: #1e1f22; color: #6d6f78; font-size: 13px; }
.dc-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex: none; }
.dc-footer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #b5bac1; }
.dc-footer img { width: 20px; height: 20px; border-radius: 50%; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #fff; background: #4e5058; }
.dc-btn.success { background: #248046; }
.dc-btn.primary { background: #5865f2; }
.dc-btn.danger { background: #da373c; }
.dc-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dc-reaction { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 8px; background: #2b2d31; border: 1px solid transparent; font-size: 14px; }
.dc-reaction:first-child { background: rgba(88, 101, 242, .15); border-color: #5865f2; }
.dc-reaction b { font-size: 13px; color: #dbdee1; font-weight: 600; }
.dc-select { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; max-width: 400px; height: 40px; padding: 0 12px; border-radius: 8px; background: #1e1f22; color: #949ba4; font-size: 14px; }
.dc-select .i { transform: rotate(90deg); }
.dc-select-options { display: grid; max-width: 400px; margin-top: 4px; border-radius: 8px; background: #2b2d31; overflow: hidden; }
.dc-select-options span { padding: 9px 12px; font-size: 14px; border-top: 1px solid #1e1f22; }
.dc-select-options span:first-child { border-top: 0; }
.dc .mention { padding: 0 2px; border-radius: 3px; background: rgba(88, 101, 242, .3); color: #c9cdfb; font-weight: 500; }
.dc code { background: #1e1f22; color: #dbdee1; }
.dc strong { color: #f2f3f5; }
.md-h1, .md-h2, .md-h3 { display: block; font-weight: 700; color: #f2f3f5; line-height: 1.3; }
.md-h1 { font-size: 22px; }
.md-h2 { font-size: 19px; }
.md-h3 { font-size: 16px; }
.md-sub { display: block; font-size: 12px; color: #949ba4; }
.md-quote { display: block; padding-left: 10px; border-left: 4px solid #4e5058; }

/* Profil bota */
.profile-card { border-radius: 16px; overflow: hidden; background: #232428; color: #dbdee1; }
.profile-banner { height: 104px; background: linear-gradient(135deg, #c9814a, #7a3f16) center / cover no-repeat; }
.profile-avatar { position: relative; width: 88px; height: 88px; margin: -46px 0 0 16px; border-radius: 50%; border: 6px solid #232428; background: #b4632a; }
.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.presence { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; border: 5px solid #232428; background: #80848e; }
.presence.on { background: #23a55a; }
.presence.idle { background: #f0b232; }
.presence.dnd { background: #f23f43; }
.profile-body { display: grid; gap: 4px; padding: 10px 16px 16px; }
.profile-name { font-size: 20px; color: #f2f3f5; }
.profile-user { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: #b5bac1; }
.profile-status { font-size: 13.5px; color: #dbdee1; min-height: 1em; }
.profile-section { margin-top: 10px; padding: 12px; border-radius: 10px; background: #2b2d31; }
.profile-section .eyebrow { color: #b5bac1; }
.profile-section p { margin-top: 4px; font-size: 14px; white-space: pre-wrap; }

/* Statystyki */
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-3); justify-self: start; }
.segmented a { padding: 6px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.columns.short { height: 120px; }
.lb-sub { display: block; font-size: 12px; color: var(--text-3); }
.lb-bar { width: 26%; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.lb-bar i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 99px; }
.pair { display: flex; gap: 1px; align-items: end; width: 100%; height: 100%; }
.pair i { flex: 1; }
.columns.pairs .col i.out { background: var(--text-3); }
.legend { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; color: var(--text-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.legend i.lg-out { background: var(--text-3); margin-left: 6px; }

/* Przełącznik serwerów */
.switcher { margin: 0 12px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.switcher summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary small { display: block; font-size: 11px; color: var(--text-3); line-height: 1.1; }
.switcher summary b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher summary .i { color: var(--text-3); }
.switcher img, .srv-fallback, .srv-icon { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.srv-fallback { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.switcher-list { display: grid; gap: 2px; padding: 4px; border-top: 1px solid var(--line); }
.switcher-list a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text); font-size: 13.5px; }
.switcher-list a:hover { background: var(--surface-3); color: var(--text); }
.switcher-list a.active { background: var(--accent-soft); color: var(--accent); }

/* Migracja */
.option-list { display: grid; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.option:hover { border-color: var(--line-strong); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); color: transparent; flex: none; margin-top: 1px; }
.option input:checked + .check { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.option input:focus-visible + .check { outline: 2px solid var(--accent); outline-offset: 2px; }
.option b { display: block; font-size: 14px; }
.option small { display: block; color: var(--text-2); font-size: 13px; }
.progress { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.progress i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 99px; transition: width .4s; }
.log { margin: 10px 0 0; max-height: 260px; overflow: auto; padding: 12px 14px; border-radius: 12px; background: var(--surface-3); font: 12.5px/1.55 var(--mono); color: var(--text-2); white-space: pre-wrap; }
.log:empty { display: none; }
.plan-details summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0; }
.plan-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; font-size: 13px; }
.plan-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.plan-list li small { color: var(--text-3); white-space: nowrap; }
.plan-list li.create small { color: var(--ok); font-weight: 600; }
.plan-list li.bot_missing small { color: var(--warn); font-weight: 600; }
.plan-list li.cat { font-weight: 600; margin-top: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.dc-btn.link { background: #4e5058; }
.dc-btn.link::after { content: "↗"; margin-left: 6px; font-size: 12px; opacity: .8; }

/* Powiadomienia */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 50; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: 14px; font-size: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  animation: toast-in .3s ease-out; transition: opacity .3s, transform .3s;
}
.toast .i { color: var(--ok); margin-top: 2px; }
.toast.error { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.toast.error .i { color: var(--bad); }
.toast.warn .i { color: var(--warn); }
.toast > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast a { font-weight: 600; }
.toast-close { flex: none; border: 0; background: none; color: var(--text-3); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.toast-close:hover { color: var(--text); }
.toast.hide { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* Logowanie i komunikaty */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 50%), var(--bg); }
.auth-card { width: min(420px, 100%); padding: 40px 36px 32px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.auth-card h1 { font-size: 26px; }
.auth-card .btn { margin-top: 10px; }
.fine { font-size: 12.5px; color: var(--text-3); }

/* Telefon i tablet */
.page-head > div, .page-head-main > div { min-width: 0; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side.sticky { position: static; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .35); }
  .main { margin-left: 0; }
  .mobile-bar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; height: 56px; padding: 0 12px;
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-bar .brand { color: var(--text); }
  .content { padding: 22px 16px 64px; }
  h1 { font-size: 25px; }
  .page-head { flex-direction: column; gap: 12px; }
  .page-head-side { padding-top: 0; }
  .grid-2, .form-grid, .form-grid.three, .stats.three { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head-main { align-items: flex-start; }
  .page-ico { width: 44px; height: 44px; border-radius: 13px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .card { padding: 18px 16px; border-radius: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .embed-field-row { grid-template-columns: 1fr; }
  .role-row { grid-template-columns: 1fr 1fr 70px; }
  .savebar { flex-direction: column; align-items: stretch; }
  .savebar .row { justify-content: flex-end; flex-wrap: wrap; }
  .embed-item-meta { display: none; }
  .toasts { top: 68px; right: 16px; }
}
