/* ==========================================================================
   PokeBot panel – design system
   Wygląd wzorowany na panelu StartIT (ciemne szarości, limonkowy akcent,
   Nunito), napisany od zera; branding i logo PokeBota.
   ========================================================================== */
:root {
    --bg: #1a1b1e;
    --bg-2: #141517;
    --topbar: #0e0e10;
    --sidebar: #161719;
    --surface: #111214;
    --surface-2: #1c1d20;
    --surface-3: #26272b;
    --border: #232428;
    --border-strong: #303136;
    --text: #e8e8ea;
    --text-2: #a7a9ae;
    --text-3: #6e7076;
    --accent: #8ed04a;
    --accent-2: #6fae2f;
    --accent-dark: #2e4a14;
    --accent-dark-hover: #3a5c19;
    --accent-soft: rgba(142, 208, 74, 0.1);
    --accent-glow: rgba(142, 208, 74, 0.45);
    --gradient: linear-gradient(135deg, #a6e05f 0%, #6fae2f 100%);
    --danger: #e5484d;
    --danger-soft: rgba(229, 72, 77, 0.12);
    --counter-full: #6e1f22;
    --orange: #c4541c;
    --warning: #f0b232;
    --info: #5aa9e6;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 10px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --sidebar-w: 272px;
    --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Nunito', system-ui, sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; margin: 0; }
::selection { background: var(--accent-glow); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- Boot / loader ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--text-2); font-weight: 700; }
.boot__logo {
    width: 64px; height: 64px; background: url('/logo.png') center / contain no-repeat; image-rendering: pixelated;
    animation: hop 1s ease-in-out infinite;
}

/* ---------- Landing (logowanie) ---------- */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: radial-gradient(800px 500px at 50% 0%, rgba(142, 208, 74, .08), transparent 70%), var(--bg); }
.landing__card {
    width: 100%; max-width: 460px; text-align: center; padding: 40px 36px 32px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow); animation: fadeUp .5s var(--ease);
}
.landing__logo-wrap { width: 120px; height: 120px; margin: 0 auto 16px; }
.landing__logo { width: 120px; height: 120px; image-rendering: pixelated; display: block; }
.landing__spark { display: none; }
.landing__kicker { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.landing h1 { font-size: 32px; margin-bottom: 8px; }
.landing h1 span { color: var(--accent); }
.landing p { color: var(--text-2); margin: 0 0 24px; }
.landing__actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.landing__features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 26px; text-align: left; }
.landing__feature { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 600; }
.landing__footer { margin-top: 20px; font-size: 12px; color: var(--text-3); }

/* ---------- Przyciski ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent;
    padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap;
    background: #3a3c42; color: #fff; transition: background .15s, border-color .15s, opacity .15s, filter .15s;
}
.btn:hover { background: #45474e; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent-dark); color: #fff; }
.btn--primary:hover { background: var(--accent-dark-hover); }
.btn--discord { background: #5865f2; padding: 12px 22px; font-size: 15px; border-radius: var(--radius); }
.btn--discord:hover { background: #4752c4; }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--danger-soft); color: #ff8589; border-color: rgba(229, 72, 77, .3); }
.btn--danger:hover { background: rgba(229, 72, 77, .22); }
.btn--sm { padding: 6px 11px; font-size: 12px; }
.btn--block { width: 100%; }
.icon-btn {
    width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; border: none; cursor: pointer;
    background: var(--orange); color: #fff; font-size: 11px; font-weight: 800; transition: filter .15s;
}
.icon-btn:hover { filter: brightness(1.15); }

/* ---------- Układ panelu ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.topbar {
    position: sticky; top: 0; z-index: 20; grid-column: 1 / -1; height: 48px; display: flex; align-items: center; gap: 12px;
    padding: 0 16px; background: var(--topbar); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; color: var(--text); }
.brand img { width: 30px; height: 30px; image-rendering: pixelated; }
.brand__tag { font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 4px; background: var(--accent-dark); color: var(--accent); border: 1px solid rgba(142, 208, 74, .35); }
.topbar__spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--surface-2); }
.user-chip img { width: 28px; height: 28px; border-radius: 50%; }
.user-chip span { font-weight: 700; font-size: 13px; }
.menu-toggle { display: none; }

.sidebar {
    position: sticky; top: 48px; height: calc(100vh - 48px); overflow-y: auto; background: var(--sidebar);
    border-right: 1px solid var(--border); padding: 14px 12px 100px;
}
.guild-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; margin-bottom: 12px; text-align: center; border-radius: var(--radius); background: var(--surface-2); }
.guild-head__icon {
    width: 52px; height: 52px; border-radius: 14px; background: var(--surface-3) center / cover; display: grid; place-items: center;
    font-weight: 800; font-size: 18px; color: var(--text-2);
}
.guild-head__name { font-weight: 800; font-size: 14px; }
.guild-head__switch { font-size: 11.5px; color: var(--text-3); cursor: pointer; font-weight: 700; }
.guild-head__switch:hover { color: var(--accent); }
.search { position: relative; margin-bottom: 8px; }
.search input {
    width: 100%; padding: 7px 12px 7px 32px; border-radius: 999px; background: transparent; border: 1.5px solid var(--accent-2);
    outline: none; font-weight: 600; transition: box-shadow .2s;
}
.search input:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-2); }

.nav-group { margin-top: 10px; }
.nav-group__title {
    display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-2); padding: 7px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.nav-item {
    display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--text-2);
    font-weight: 700; font-size: 13px; cursor: pointer; transition: background .12s, color .12s; position: relative; user-select: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--surface-3); color: #fff; }
.nav-item.is-active::before { content: ''; position: absolute; left: -12px; top: 5px; bottom: 5px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item.is-soon { opacity: .45; cursor: default; }
.nav-item.is-soon:hover { background: transparent; color: var(--text-2); }
.nav-item__icon { width: 18px; text-align: center; font-size: 14px; }
.nav-item__label { flex: 1; }
.nav-item__badge { font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-3); }
.nav-item__dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; opacity: .8; }
.nav-item__dot.is-on { width: 22px; height: 12px; border-radius: 999px; background: var(--accent); opacity: 1; box-shadow: 0 0 6px var(--accent-glow); position: relative; }
.nav-item__dot.is-on::after { content: ''; position: absolute; right: 2px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.nav-item--sub { padding-left: 34px; font-size: 12.5px; }

.content { padding: 28px 40px 140px; min-width: 0; }
.page { max-width: 820px; animation: fadeUp .3s var(--ease); }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 28px; flex: 1; }
.page-head p { color: var(--text-2); margin: 4px 0 0; }

/* ---------- Karty ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 16px; margin-bottom: 26px; }
.card--accent { border-color: rgba(142, 208, 74, .5); }
.card__head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border-strong); }
.card__head--flush { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.card__title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.card__desc { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.card__titles { flex: 1; min-width: 0; }
.counter { font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: #fff; }
.counter.is-full { background: var(--counter-full); color: #fff; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.subcard { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.subcard__title { font-weight: 800; font-size: 13px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-strong); }

/* ---------- Statystyki ---------- */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; position: relative; }
.stat__label { color: var(--text-3); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.stat__value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat__icon { position: absolute; right: 14px; top: 12px; font-size: 20px; opacity: .8; }

/* ---------- Formularze ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.hint { font-size: 11.5px; color: var(--text-3); }
.input, .select {
    width: 100%; max-width: 250px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
    outline: none; font-weight: 700; transition: border-color .2s;
}
.input:focus, .select:focus { border-color: var(--accent-2); }
.input--sm { max-width: 80px; padding: 6px 10px; }
.input--md { max-width: 150px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e8e8ea' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
.select option { background: var(--surface-2); }

/* Przełącznik – limonkowy z poświatą */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 34px; height: 18px; border-radius: 999px; background: #3a3c42; position: relative; flex-shrink: 0; transition: background .2s, box-shadow .2s; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked + .switch__track { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch__text { font-size: 13px; color: var(--text-2); font-weight: 700; }
.switch--lg .switch__track { width: 40px; height: 22px; }
.switch--lg .switch__track::after { width: 16px; height: 16px; }
.switch--lg input:checked + .switch__track::after { transform: translateX(18px); }

/* Picker (wybór kanału / ról) */
.picker { position: relative; max-width: 360px; }
.picker--wide { max-width: none; }
.picker__control {
    min-height: 36px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 5px 32px 5px 8px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; position: relative; font-weight: 700;
}
.picker__control::after {
    content: ''; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 2px solid var(--text); border-bottom: 2px solid var(--text);
    transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.picker.is-open .picker__control { border-color: var(--accent-2); }
.picker.is-open .picker__control::after { transform: translateY(-30%) rotate(-135deg); }
.picker__placeholder { color: var(--text-2); padding-left: 4px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px 2px 8px; border-radius: 4px; background: var(--surface-3); font-size: 12px; font-weight: 700; max-width: 100%; }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.chip__x { border: none; background: none; cursor: pointer; color: var(--text-3); padding: 0 2px; font-size: 14px; line-height: 1; }
.chip__x:hover { color: var(--danger); }
.chip__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__menu {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface-2); border: 1px solid var(--border-strong);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; max-height: 280px; display: flex; flex-direction: column;
}
.picker__search { padding: 7px 10px; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--border); outline: none; margin-bottom: 6px; }
.picker__options { overflow-y: auto; }
.picker__group { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 8px 8px 4px; }
.picker__option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; }
.picker__option:hover, .picker__option.is-focus { background: var(--surface-3); }
.picker__option.is-selected { color: var(--accent); }
.picker__option.is-selected::after { content: '✓'; margin-left: auto; font-weight: 800; }
.picker__option.is-disabled { opacity: .45; cursor: not-allowed; }
.picker__empty { padding: 12px; color: var(--text-3); text-align: center; font-size: 13px; }
.channel-hash { color: var(--text-3); font-weight: 800; width: 14px; text-align: center; }

/* ---------- Podgląd wiadomości Discord ---------- */
.discord-preview { background: #313338; border-radius: var(--radius); padding: 12px 16px; max-width: 500px; font-family: 'gg sans', var(--font); }
.dmsg { display: flex; gap: 12px; }
.dmsg + .dmsg { margin-top: 12px; }
.dmsg__avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; background: var(--surface-3) center / cover; image-rendering: pixelated; }
.dmsg__name { font-weight: 600; color: #f2f3f5; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.dmsg__name.is-user { color: #4ade80; }
.dmsg__name.is-bot { color: #a78bfa; }
.dmsg__app { font-size: 10px; font-weight: 700; background: #5865f2; color: #fff; border-radius: 4px; padding: 0 5px; }
.dmsg__time { font-size: 11px; color: #949ba4; font-weight: 400; }
.dmsg__text { color: #dbdee1; font-size: 14px; }
.dmsg__reply { font-size: 12.5px; color: #b5bac1; margin-bottom: 2px; display: flex; gap: 6px; align-items: center; }
.mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 3px; font-weight: 500; }

/* ---------- Komendy ---------- */
.cmd-category { margin-bottom: 18px; }
.cmd-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cmd { display: flex; align-items: center; gap: 10px; padding: 16px 16px; border-radius: var(--radius-sm); background: var(--surface-2); transition: opacity .2s; }
.cmd.is-off { opacity: .55; }
.cmd__badges { display: flex; gap: 3px; }
.cmd__badge { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; background: #3a3c42; color: #fff; }
.cmd__badge--slash { background: #3c45a5; }
.cmd__body { flex: 1; min-width: 0; }
.cmd__name { font-weight: 800; font-size: 15px; }
.cmd__desc { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd__perm { font-size: 10.5px; color: var(--warning); margin-top: 2px; }

/* ---------- Akcje automatyczne / sloty ---------- */
.rule { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 10px; }
.rule__text { color: var(--text); font-size: 13px; font-weight: 700; }
.rule .icon-btn { position: absolute; top: -8px; right: -8px; }
.limit-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px; margin-top: 6px; }
.limit-bar strong { font-size: 12.5px; }
.add-slot {
    width: 100%; padding: 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: transparent; color: var(--text);
    font-weight: 800; font-size: 12px; cursor: pointer; transition: background .15s, border-color .15s;
}
.add-slot:hover { background: var(--surface-2); border-color: var(--accent-2); }

/* ---------- Tabela kar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar .input { max-width: 320px; }
.toolbar .select { max-width: 200px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 800; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-removed td { opacity: .5; }
.table tr.is-removed .case-reason { text-decoration: line-through; }
.case-type { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; padding: 2px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.case-reason { max-width: 340px; color: var(--text-2); word-break: break-word; }
.muted { color: var(--text-3); }
.mono { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; color: var(--text-2); }
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty__icon { font-size: 36px; margin-bottom: 8px; }

/* ---------- Wybór serwera ---------- */
.servers { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }
.servers h1 { font-size: 28px; margin-bottom: 6px; }
.servers > p { color: var(--text-2); margin: 0 0 24px; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.server-card {
    display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 16px; border-radius: var(--radius-lg); background: var(--surface);
    border: 1px solid var(--border); cursor: pointer; text-align: center; transition: border-color .2s, transform .2s var(--ease);
}
.server-card:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.server-card__icon { width: 68px; height: 68px; border-radius: 18px; background: var(--surface-3) center / cover; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--text-2); }
.server-card__name { font-weight: 800; font-size: 15px; }
.server-card__meta { font-size: 12px; color: var(--text-3); }

/* ---------- Pasek zapisu ---------- */
.savebar {
    position: fixed; left: calc(var(--sidebar-w) + 40px); right: 40px; bottom: 20px; z-index: 40; max-width: 820px;
    display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-radius: var(--radius-lg);
    background: #0e0e10; border: 1px solid var(--border-strong); box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
    transform: translateY(150%); opacity: 0; transition: transform .3s var(--ease), opacity .3s;
}
.savebar.is-visible { transform: none; opacity: 1; }
.savebar__text { flex: 1; font-weight: 800; }
.savebar.is-shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Powiadomienia ---------- */
.toasts { position: fixed; top: 60px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
    pointer-events: auto; min-width: 260px; max-width: 380px; padding: 11px 14px; border-radius: var(--radius); background: var(--surface-2);
    border: 1px solid var(--border-strong); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; font-weight: 700; animation: fadeUp .25s var(--ease);
}
.toast--success { border-color: rgba(142, 208, 74, .5); }
.toast--error { border-color: rgba(229, 72, 77, .5); }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: all .3s; }

/* ---------- Banery / info ---------- */
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: linear-gradient(90deg, rgba(142, 208, 74, .18), rgba(142, 208, 74, .06)); border: 1px solid rgba(142, 208, 74, .35); color: var(--text); margin-bottom: 18px; font-size: 12.5px; font-weight: 700; }
.notice--warn { background: rgba(240, 178, 50, .1); border-color: rgba(240, 178, 50, .35); }
.soon { text-align: center; padding: 56px 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.soon__icon { font-size: 44px; margin-bottom: 10px; }
.soon h2 { font-size: 20px; margin-bottom: 8px; }
.soon p { color: var(--text-2); margin: 0 auto; max-width: 480px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; background: var(--surface-3); color: var(--text-2); }
.tag--accent { background: var(--accent-dark); color: var(--accent); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 36px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.chips-input input { flex: 1; min-width: 140px; background: transparent; border: none; outline: none; font-weight: 600; }
.chips-input:focus-within { border-color: var(--accent-2); }
.textarea { max-width: none; width: 100%; min-height: 90px; resize: vertical; font-family: inherit; line-height: 1.5; padding: 8px 10px; }
.section-title { font-size: 18px; font-weight: 800; margin: 28px 0 12px; color: var(--text); }
:not(.row) > .field + .field, .row + .field, .field + .row { margin-top: 12px; }

/* ---------- Selfrole ---------- */
.guide { border-radius: var(--radius); overflow: hidden; margin-bottom: 26px; border: 1px solid rgba(142, 208, 74, .35); box-shadow: 0 0 24px rgba(142, 208, 74, .06); }
.guide__title { padding: 10px 14px; font-weight: 800; font-size: 13.5px; color: #fff; background: linear-gradient(90deg, #4f7f22, #2e4a14); }
.guide__text { padding: 11px 14px; font-size: 12.5px; line-height: 1.55; color: var(--text-2); background: linear-gradient(90deg, rgba(142, 208, 74, .14), rgba(142, 208, 74, .04)); }
.guide__text strong { color: var(--text); }
.sr-item {
    position: relative; padding: 13px 15px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent;
    margin-bottom: 14px; cursor: pointer; transition: border-color .15s, background .15s, transform .15s var(--ease);
}
.sr-item:hover, .sr-item:focus-visible { border-color: rgba(142, 208, 74, .55); background: #202125; outline: none; transform: translateY(-1px); }
.sr-item .icon-btn { position: absolute; top: -8px; right: -8px; }
.sr-item__title { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; font-size: 14px; font-weight: 800; padding-right: 8px; }
.sr-item__title em { color: var(--text-3); font-style: normal; }
.sr-item__colon { color: var(--text-3); margin-right: 4px; }
.sr-item__roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.sr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px; background: var(--surface-3); font-size: 11.5px; font-weight: 700; color: var(--text); }
.sr-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--border-strong); }
.sr-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--text-3); margin-right: auto; }
.sr-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.sr-status.is-live { color: var(--accent); }
.sr-status.is-live::before { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.sr-status.is-new { color: var(--warning); }
.sr-status.is-new::before { background: var(--warning); animation: pulse 1.6s infinite; }
.emoji { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: -0.3em; }

/* Okno (modal) */
body.modal-open { overflow: hidden; }
.content.has-modal .page { animation: none; }
.modal {
    position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
    background: rgba(5, 5, 7, .65); backdrop-filter: blur(4px); animation: modalFade .2s ease;
}
.modal__dialog {
    width: min(1060px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--bg);
    border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); animation: modalPop .28s var(--ease);
}
.modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal__head > div { flex: 1; }
.modal__head h2 { font-size: 18px; margin: 0; }
.modal__head p { margin: 3px 0 0; color: var(--text-3); font-size: 12px; }
.modal__x { width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer; background: var(--surface-3); color: var(--text-2); font-weight: 800; transition: background .15s, color .15s; }
.modal__x:hover { background: var(--orange); color: #fff; }
.modal__body { padding: 18px 20px; overflow-y: auto; }
.modal__foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 12px 12px; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* Edytor panelu */
.sr-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 430px); gap: 24px; align-items: start; }
.sr-editor__preview { position: sticky; top: 0; }
.sr-editor .input { max-width: none; }
.sr-editor .picker { max-width: none; }
.sr-editor__roles-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 12px; padding-top: 14px; border-top: 1px solid var(--border-strong); }
.input--full { max-width: none; }
.sr-role { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 12px; }
.sr-role > .icon-btn { position: absolute; top: -8px; right: -8px; }
.sr-role__emoji {
    width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--radius-sm); cursor: pointer;
    border: 1px dashed var(--border-strong); background: var(--surface-3); font-size: 21px; transition: border-color .15s, transform .15s var(--ease);
}
.sr-role__emoji:hover { border-color: var(--accent); transform: scale(1.05); }
.sr-role__emoji.is-missing { border-color: var(--warning); }
.sr-role__emoji .emoji { width: 26px; height: 26px; }
.sr-role__plus { color: var(--text-3); font-size: 16px; font-weight: 800; }
.sr-role__fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sr-role__row { display: flex; gap: 8px; }
.sr-role__row .input { flex: 1; }
.sr-role__row:empty { display: none; }
.sr-emoji-pop {
    position: absolute; z-index: 40; top: 60px; left: 8px; width: 310px; padding: 10px; border-radius: var(--radius);
    background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); animation: fadeUp .18s var(--ease);
}
.sr-emoji-pop__title { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 10px 0 4px; }
.sr-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 150px; overflow-y: auto; }
.sr-emoji-opt { border: none; background: none; border-radius: 5px; padding: 4px; font-size: 19px; line-height: 1; cursor: pointer; transition: background .12s, transform .12s; }
.sr-emoji-opt:hover { background: var(--surface-3); transform: scale(1.15); }
.sr-emoji-opt img { width: 22px; height: 22px; object-fit: contain; }
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type='color'] { width: 42px; height: 36px; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }

/* Podgląd embedów / komponentów Discorda */
.dembed { margin-top: 6px; padding: 10px 14px 12px; border-radius: 4px; border-left: 4px solid var(--accent); background: #2b2d31; }
.dembed__title { color: #f2f3f5; font-weight: 700; font-size: 15px; margin-bottom: 6px; word-wrap: break-word; }
.dembed__desc { color: #dbdee1; font-size: 13.5px; line-height: 1.45; word-wrap: break-word; }
.dembed__desc + .dembed__desc { margin-top: 10px; }
.dreactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dreaction { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 8px; background: rgba(88, 101, 242, .15); border: 1px solid #5865f2; color: #dee0fc; font-size: 13px; font-weight: 600; }
.dbuttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: 8px; background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; }
.dbtn--primary { background: #5865f2; }
.dbtn--success { background: #248046; }
.dbtn--danger { background: #da373c; }
.dselect { display: flex; align-items: center; justify-content: space-between; max-width: 400px; height: 40px; margin-top: 8px; padding: 0 12px; border-radius: 8px; background: #1e1f22; color: #949ba4; font-size: 14px; }
.dselect__caret { width: 8px; height: 8px; border-right: 2px solid #b5bac1; border-bottom: 2px solid #b5bac1; transform: translateY(-2px) rotate(45deg); }

/* ---------- Responsywność ---------- */
@media (max-width: 1100px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .menu-toggle { display: inline-flex; }
    .sidebar { position: fixed; left: 0; top: 48px; bottom: 0; height: auto; width: var(--sidebar-w); z-index: 30; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow); }
    .layout.is-menu-open .sidebar { transform: none; }
    .content { padding: 22px 16px 140px; }
    .savebar { left: 16px; right: 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
    .user-chip span { display: none; }
    .landing__features { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .sr-editor { grid-template-columns: 1fr; }
    .sr-editor__preview { position: static; }
    .modal { padding: 10px; }
}

/* ---------- Wspólne elementy modułów ---------- */
.item-box { position: relative; padding: 14px 16px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent; margin-bottom: 14px; transition: border-color .15s; }
.item-box:hover { border-color: var(--border-strong); }
.item-box > .icon-btn { position: absolute; top: -8px; right: -8px; }
.item-box .picker, .item-box .input { max-width: none; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 8px; transition: opacity .2s; }
.log-row.is-off .log-row__label, .log-row.is-off .log-row__emoji { opacity: .5; }
.log-row__emoji { font-size: 18px; width: 24px; text-align: center; }
.log-row__label { flex: 1; font-weight: 700; font-size: 13px; }
.log-row .picker { width: 260px; flex-shrink: 0; }

/* Edytor wiadomości */
.msg-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 22px; align-items: start; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border-strong); }
.msg-editor .input, .msg-editor .picker { max-width: none; }
.msg-editor__embed { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border-left: 3px solid var(--accent); }
.msg-editor__preview { position: sticky; top: 64px; }
.var-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.var-chip { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--accent); font: 700 11.5px/1 ui-monospace, Consolas, monospace; padding: 5px 8px; border-radius: 999px; cursor: pointer; transition: background .15s, border-color .15s, transform .15s var(--ease); }
.var-chip:hover { background: var(--accent-dark); border-color: var(--accent-2); transform: translateY(-1px); }

/* Podgląd Discorda – dodatki */
.dmsg__text { word-wrap: break-word; line-height: 1.4; }
.dmsg__text code, .dembed code { background: #1e1f22; border-radius: 4px; padding: 0 4px; font-size: 85%; font-family: ui-monospace, Consolas, monospace; }
.dh1 { display: block; font-size: 22px; font-weight: 700; margin: 4px 0; color: #f2f3f5; }
.dh2 { display: block; font-size: 18px; font-weight: 700; margin: 4px 0; color: #f2f3f5; }
.dh3 { display: block; font-size: 15px; font-weight: 700; margin: 2px 0; color: #f2f3f5; }
.dembed.has-thumb { position: relative; padding-right: 96px; min-height: 96px; }
.dembed__thumb { position: absolute; top: 12px; right: 14px; width: 72px; height: 72px; border-radius: 6px; object-fit: cover; }
.dembed__image { display: block; max-width: 100%; max-height: 260px; margin-top: 12px; border-radius: 6px; object-fit: cover; }
.dembed__footer { margin-top: 8px; font-size: 11.5px; color: #b5bac1; }
.dembed__fields { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.dembed__field { flex: 1 1 100%; min-width: 0; }
.dembed__field.is-inline { flex: 1 1 28%; }
.dembed__fname { font-size: 13px; font-weight: 700; color: #f2f3f5; margin-bottom: 2px; }
.dembed__fvalue { font-size: 13.5px; color: #dbdee1; }
.dprogress { height: 8px; border-radius: 99px; background: #1e1f22; overflow: hidden; margin-top: 8px; }
.dprogress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* Mini tabela (np. ranking, statystyki) */
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table td, .mini-table th { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.mini-table th { font-size: 11px; text-transform: uppercase; color: var(--text-3); letter-spacing: .05em; }
.mini-table tr:last-child td { border-bottom: none; }
.rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-weight: 800; font-size: 11px; }
.rank--1 { background: linear-gradient(135deg, #f5c542, #b8860b); color: #1a1405; }
.rank--2 { background: linear-gradient(135deg, #d9dde3, #8f969f); color: #15171a; }
.rank--3 { background: linear-gradient(135deg, #e09a5b, #8d5426); color: #1a0f05; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 10px; }
.bars__bar { flex: 1; min-width: 4px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--accent), var(--accent-2)); opacity: .85; transition: opacity .15s, transform .15s var(--ease); transform-origin: bottom; animation: barGrow .6s var(--ease) both; }
.bars__bar:hover { opacity: 1; }
.bars__labels { display: flex; gap: 4px; margin-top: 6px; font-size: 10px; color: var(--text-3); }
.bars__labels span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Dni tygodnia (zaplanowane wiadomości) */
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.day-chip { min-width: 40px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); font-weight: 700; font-size: 12.5px; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s var(--ease); }
.day-chip:hover { transform: translateY(-1px); border-color: var(--accent-2); }
.day-chip.is-on { background: var(--accent-dark); border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
    .msg-editor { grid-template-columns: 1fr; }
    .msg-editor__preview { position: static; }
    .log-row { flex-wrap: wrap; }
    .log-row .picker { width: 100%; }
}
