* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #11131a;
    color: #f4f6fb;
    font-family: Arial, sans-serif;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    padding: 24px;
    background: #171a23;
    border-right: 1px solid #272b38;
}

.brand {
    margin-bottom: 28px;
    color: #a98cff;
    font-weight: 800;
    letter-spacing: 1px;
}

nav {
    display: grid;
    gap: 10px;
}

nav a,
.button {
    display: inline-block;
    padding: 11px 14px;
    border-radius: 10px;
    background: #6f55ff;
    color: white;
    text-decoration: none;
    font-weight: 700;
}

nav a {
    background: transparent;
    color: #d7daf0;
}

nav a:hover,
.button:hover {
    filter: brightness(1.1);
}

.button.secondary {
    background: #2a2f3d;
}

.content {
    margin-left: 240px;
    padding: 36px;
}

.card,
.guild-card,
.stat-card {
    background: #1b1f2b;
    border: 1px solid #2b3040;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.hero-card {
    max-width: 720px;
}

.muted-card {
    max-width: 720px;
    margin-top: 18px;
}

.page-header {
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #a98cff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h1,
h2,
p {
    margin-top: 0;
}

p {
    color: #c4c8d8;
    line-height: 1.6;
}

.alert {
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 12px;
}

.alert.error {
    background: rgba(255, 82, 82, 0.14);
    border: 1px solid rgba(255, 82, 82, 0.35);
}

.alert.success {
    background: rgba(60, 200, 120, 0.14);
    border: 1px solid rgba(60, 200, 120, 0.35);
}

.alert.warning {
    background: rgba(255, 197, 66, 0.14);
    border: 1px solid rgba(255, 197, 66, 0.35);
}

.user-box {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    display: grid;
    gap: 4px;
    padding-top: 16px;
    border-top: 1px solid #2b3040;
}

.user-box span,
.user-box small {
    color: #8f95aa;
}

.guild-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.guild-card {
    display: grid;
    gap: 18px;
    color: white;
    text-decoration: none;
}

.stats-row,
.config-flags,
.color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-row span,
.color-row span,
.flag {
    padding: 8px 10px;
    border-radius: 999px;
    background: #272c3a;
    color: #d7daf0;
    font-size: 14px;
}

.flag.ok {
    background: rgba(60, 200, 120, 0.18);
    color: #8ff0b8;
}

.flag.missing {
    background: rgba(255, 197, 66, 0.16);
    color: #ffd77a;
}

.stat-card span {
    display: block;
    color: #aeb4c8;
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 34px;
}

.table-like {
    display: grid;
    gap: 10px;
}

.table-like div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid #2b3040;
}

.table-like span,
.clean-list li {
    color: #c4c8d8;
}

.clean-list {
    padding-left: 18px;
    line-height: 1.8;
}

.table-like div {
    align-items: center;
}

.table-like div strong {
    text-align: right;
}

.table-like div small {
    display: block;
    color: #7f879c;
    font-size: 12px;
    margin-left: 8px;
}

.muted {
    color: #8f95aa;
}

.missing-value {
    color: #ffd77a;
}

.notice {
    margin: 12px 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
}

.notice p {
    margin: 0;
}

.notice.warning {
    background: rgba(255, 197, 66, 0.14);
    border: 1px solid rgba(255, 197, 66, 0.35);
}

.page-header.with-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.two-column-layout,
.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.form-grid,
.stack-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: #d7daf0;
    font-weight: 700;
}

select,
textarea,
input[type="text"] {
    width: 100%;
    border: 1px solid #343a4d;
    border-radius: 12px;
    background: #121520;
    color: #f4f6fb;
    padding: 12px 14px;
    font: inherit;
}

textarea {
    resize: vertical;
    min-height: 86px;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="color"] {
    width: 70px;
    height: 44px;
    padding: 0;
    border: 1px solid #343a4d;
    border-radius: 12px;
    background: transparent;
}

.preset-grid,
.placeholder-grid,
.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-color,
.copy-pill,
.emoji-copy,
.danger-button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.preset-color {
    padding: 9px 12px;
    border-radius: 999px;
    background: #272c3a;
    color: #f4f6fb;
}

.preset-color::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--preset-color);
    vertical-align: -1px;
}

.discord-preview {
    display: grid;
    gap: 12px;
}

.embed-preview {
    border-left: 5px solid var(--embed-color);
    border-radius: 12px;
    background: #232836;
    padding: 16px;
}

.embed-preview h3 {
    margin: 0 0 10px;
}

.embed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.embed-fields span,
.text-preview {
    padding: 8px 10px;
    border-radius: 10px;
    background: #2b3040;
    color: #d7daf0;
}

.placeholder-grid {
    margin-top: 12px;
}

.copy-pill {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #272c3a;
    color: #f4f6fb;
    text-align: left;
}

.copy-pill small {
    color: #9ca3ba;
}

.message-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.message-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #2b3040;
    border-radius: 14px;
    background: #171b27;
}

.message-row p {
    margin: 6px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-row small {
    color: #8f95aa;
}

.danger-button {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(231, 76, 60, 0.16);
    color: #ff9c91;
}

.emoji-grid {
    margin-top: 14px;
}

.emoji-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #272c3a;
    color: #f4f6fb;
}

.emoji-copy img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.emoji-copy.copied,
.copy-pill.copied {
    outline: 2px solid rgba(60, 200, 120, 0.65);
}

@media (max-width: 760px) {
    .page-header.with-actions {
        display: grid;
    }

    .content {
        margin-left: 0;
        padding: 20px;
    }

    .sidebar {
        position: static;
        width: auto;
    }

    .user-box {
        position: static;
        margin-top: 22px;
    }
}

/* Lewy sidebar działa jak drzewko: Serwery -> wybrany serwer -> moduły. */
.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-scroll {
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 150px;
}

.main-nav {
    margin-bottom: 18px;
}

.nav-link.active,
.side-guild.active,
.module-tile.active {
    outline: 2px solid rgba(60, 200, 120, 0.8);
    box-shadow: 0 0 0 4px rgba(60, 200, 120, 0.10);
}

.side-tree-title {
    margin: 18px 0 10px;
    color: #8f95aa;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.side-guild-block {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.side-guild,
.module-tile,
.logout-link {
    color: #f4f6fb;
    text-decoration: none;
}

.side-guild {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid #2b3040;
    border-radius: 14px;
    background: #1b1f2b;
}

.side-guild small,
.module-tile small {
    color: #8f95aa;
    font-size: 12px;
}

.side-modules {
    display: grid;
    gap: 8px;
    padding-left: 14px;
    border-left: 1px solid #2b3040;
}

.module-tile {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid #2b3040;
    border-radius: 12px;
    background: #151923;
}

.module-tile:hover,
.side-guild:hover {
    border-color: #6f55ff;
}

.module-tile.disabled {
    opacity: 0.55;
    cursor: default;
}

.logout-link {
    color: #a98cff;
    font-weight: 700;
}

.dashboard-list {
    display: grid;
    gap: 14px;
}

.list-card {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(260px, 420px);
    gap: 18px;
    align-items: start;
    padding: 16px;
    border: 1px solid #2b3040;
    border-radius: 16px;
    background: #171b27;
}

.compact-list .list-card {
    grid-template-columns: minmax(240px, 1fr) auto;
}

.list-card h3 {
    margin: 0 0 8px;
}

.list-card p {
    margin-bottom: 10px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.list-card-actions {
    display: grid;
    gap: 10px;
}

.inline-edit-form {
    display: grid;
    gap: 10px;
}

.inline-edit-form textarea {
    min-height: 72px;
}

@media (max-width: 980px) {
    .list-card,
    .compact-list .list-card {
        grid-template-columns: 1fr;
    }
}

/* Kafelki modułów w Overview, podobny kierunek UX jak panel botów: ciemny card + aktywny akcent. */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.module-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid #2b3040;
    border-radius: 16px;
    background: #151923;
    color: #f4f6fb;
    text-decoration: none;
}

.module-card:hover {
    border-color: rgba(60, 200, 120, 0.8);
    box-shadow: 0 0 0 4px rgba(60, 200, 120, 0.10);
}

.module-card span {
    color: #8f95aa;
    font-size: 14px;
}

.log-card {
    min-width: 0;
}

.log-output {
    max-height: 420px;
    overflow: auto;
    margin: 0;
    padding: 14px;
    border: 1px solid #2b3040;
    border-radius: 12px;
    background: #0e1118;
    color: #cbd2e6;
    font: 13px/1.5 Consolas, "Courier New", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* v15: układ bardziej jak panel Discord/StartIT.
   Lewa kolumna z ikonkami serwerów jest oddzielona od panelu modułów wybranego serwera. */
.app-shell {
    min-height: 100vh;
}

.server-rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 72px;
    padding: 12px 10px;
    background: #0c0f16;
    border-right: 1px solid #202431;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 30;
}

.rail-brand,
.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #f4f6fb;
    background: #1b1f2b;
    border: 1px solid #2b3040;
    text-decoration: none;
    font-weight: 900;
    overflow: hidden;
    transition: border-color 0.15s ease, border-radius 0.15s ease, box-shadow 0.15s ease;
}

.rail-brand {
    color: #9be34b;
    background: radial-gradient(circle at 30% 20%, #2f3d20, #121720 70%);
}

.rail-guilds {
    display: grid;
    gap: 10px;
    width: 100%;
    justify-items: center;
    overflow-y: auto;
    padding: 4px 0;
}

.server-icon img,
.server-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-icon.active,
.server-icon:hover {
    border-radius: 13px;
    border-color: rgba(60, 200, 120, 0.95);
    box-shadow: 0 0 0 4px rgba(60, 200, 120, 0.12);
}

.server-list-shortcut {
    margin-top: auto;
    color: #9be34b;
}

.server-panel {
    position: fixed;
    inset: 0 auto 0 72px;
    width: 286px;
    padding: 22px 18px;
    background: linear-gradient(180deg, #171b23, #121620 58%, #10131a);
    border-right: 1px solid #272b38;
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 20;
}

.brand-block {
    display: grid;
    gap: 4px;
    margin-bottom: 2px;
}

.brand-block .brand {
    margin: 0;
}

.brand-block span {
    color: #8f95aa;
    font-size: 13px;
}

.active-server-card,
.empty-panel-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #2b3040;
    border-radius: 18px;
    background: rgba(27, 31, 43, 0.9);
}

.empty-panel-card {
    display: grid;
}

.empty-panel-card small,
.active-server-card small {
    display: block;
    margin-top: 3px;
    color: #8f95aa;
}

.server-avatar.large {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #272c3a;
    color: #f4f6fb;
    font-weight: 900;
    border: 1px solid #343a4d;
    flex: 0 0 auto;
}

.server-panel .side-tree {
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 120px;
}

.side-modules.flat {
    padding-left: 0;
    border-left: 0;
}

.server-panel .module-tile {
    min-height: 58px;
}

.server-panel .module-tile span {
    font-weight: 800;
}

.content {
    margin-left: 358px;
    padding: 42px;
    max-width: 1280px;
}

.guild-card-header {
    display: flex;
    gap: 14px;
    align-items: center;
}

.guild-card-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #272c3a;
    border: 1px solid #343a4d;
    font-weight: 900;
}

.guild-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Panel komend, podobny do list przełączników z inspiracji: ciemne rzędy i proste etykiety dostępu. */
.command-group {
    margin-bottom: 18px;
}

.command-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.command-row {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 100px 1fr;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #252a38;
    border-radius: 14px;
    background: #151923;
}

.command-name {
    font: 700 15px/1.4 Consolas, "Courier New", monospace;
    color: #f4f6fb;
}

.access-pill {
    justify-self: start;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(155, 227, 75, 0.13);
    color: #a9f66a;
    font-size: 12px;
    font-weight: 800;
}

.access-pill.admin {
    background: rgba(111, 85, 255, 0.16);
    color: #b9a8ff;
}

.access-pill.user {
    background: rgba(52, 152, 219, 0.16);
    color: #9ed6ff;
}

.prefix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.prefix-card {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #2b3040;
    background: #151923;
}

@media (max-width: 980px) {
    .server-rail,
    .server-panel {
        position: static;
        width: auto;
    }

    .server-rail {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid #202431;
    }

    .rail-guilds {
        display: flex;
        overflow-x: auto;
    }

    .server-panel {
        border-right: 0;
        border-bottom: 1px solid #272b38;
    }

    .content {
        margin-left: 0;
        padding: 22px;
    }

    .command-row {
        grid-template-columns: 1fr;
    }
}

/* v17: karty serwerów mają więcej miejsca, aby nazwy i moduły nie wyglądały na ściśnięte. */
.guild-grid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 22px;
    align-items: stretch;
}

.guild-card {
    min-height: 230px;
}

.guild-card h2 {
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.guild-card .stats-row,
.guild-card .config-flags {
    gap: 12px;
}

.content {
    max-width: 1540px;
}

/* v17: przełączniki ON/OFF modułów w stylu ciemnego panelu. */
.module-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 18px;
    padding: 16px 18px;
    border: 1px solid #2b3040;
    border-radius: 18px;
    background: linear-gradient(180deg, #171b27, #121620);
}

.module-status-card.enabled {
    border-color: rgba(155, 227, 75, 0.45);
    box-shadow: 0 0 0 4px rgba(155, 227, 75, 0.06);
}

.module-status-card.disabled {
    opacity: 0.86;
}

.module-status-card strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.module-status-card p {
    margin: 6px 0 0;
    color: #9ca3ba;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 8px;
}

.status-dot.on {
    background: #9be34b;
    box-shadow: 0 0 14px rgba(155, 227, 75, 0.55);
}

.status-dot.off {
    background: #5c6274;
}

.toggle-form {
    margin: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 58px;
    height: 32px;
    cursor: pointer;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #343a4d;
    border: 1px solid #444b60;
    transition: 0.18s ease;
}

.toggle-switch span::before {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #f4f6fb;
    transition: 0.18s ease;
}

.toggle-switch input:checked + span {
    background: linear-gradient(90deg, #6ca822, #9be34b);
    border-color: rgba(155, 227, 75, 0.9);
    box-shadow: 0 0 18px rgba(155, 227, 75, 0.2);
}

.toggle-switch input:checked + span::before {
    transform: translateX(26px);
}

.switch-module-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.switch-card {
    padding: 0;
    overflow: hidden;
}

.switch-card > a {
    display: grid;
    gap: 6px;
    padding: 18px 18px 0;
    color: #f4f6fb;
    text-decoration: none;
}

.switch-card .module-status-card {
    margin: 14px 12px 12px;
    padding: 12px 14px;
    border-radius: 14px;
}

.switch-card .module-status-card p {
    display: none;
}

.mini-state {
    float: right;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
}

.mini-state.on {
    color: #9be34b;
    background: rgba(155, 227, 75, 0.12);
}

.mini-state.off {
    color: #aeb4c8;
    background: rgba(174, 180, 200, 0.12);
}

/* v18: responsywny panel na pełną szerokość przeglądarki.
   Wcześniej główna treść miała max-width, więc na szerokich monitorach zostawała duża pusta przestrzeń po prawej.
   Teraz szerokość liczymy od realnej szerokości okna minus lewy pasek serwerów i panel modułów. */
:root {
    --rail-width: 72px;
    --panel-width: 286px;
    --shell-left: calc(var(--rail-width) + var(--panel-width));
    --page-padding: clamp(22px, 2.2vw, 56px);
}

html,
body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.app-shell {
    width: 100%;
    min-width: 0;
}

.server-rail {
    width: var(--rail-width);
}

.server-panel {
    left: var(--rail-width);
    width: var(--panel-width);
    max-height: 100vh;
}

.content {
    margin-left: var(--shell-left);
    width: calc(100vw - var(--shell-left));
    max-width: none;
    min-width: 0;
    padding: var(--page-padding);
}

/* Karty i sekcje mają używać całej dostępnej szerokości, ale bez rozsadzania układu długimi tekstami. */
.card,
.guild-card,
.stat-card,
.module-card,
.list-card,
.log-card,
.prefix-card,
.module-status-card {
    min-width: 0;
}

.hero-card,
.muted-card {
    max-width: none;
}

/* Gridy lepiej skalują się na monitorach 1440p, 2K i ultrawide. */
.guild-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
    width: 100%;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    width: 100%;
}

.module-grid,
.switch-module-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    width: 100%;
}

.two-column-layout,
.management-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
    width: 100%;
}

.prefix-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    width: 100%;
}

.page-header.with-actions {
    align-items: flex-start;
}

.header-actions {
    justify-content: flex-end;
    max-width: 100%;
}

/* Tabele, logi i długie nazwy kanałów nie powinny rozpychać strony. */
.table-like div,
.message-row,
.guild-card-header,
.active-server-card {
    min-width: 0;
}

.table-like div strong,
.table-like div span,
.message-row p,
.guild-card h2,
.guild-card p,
.active-server-card strong,
.active-server-card small {
    overflow-wrap: anywhere;
}

.log-output {
    width: 100%;
    max-width: 100%;
}

/* Na bardzo szerokich ekranach formularze nie robią się za ciasne, bo kolumny same się rozkładają. */
@media (min-width: 1800px) {
    .two-column-layout,
    .management-grid {
        grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
    }

    .guild-grid {
        grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
    }
}

/* Tablet: zostawiamy rail i panel, ale zmniejszamy panel oraz padding treści. */
@media (max-width: 1200px) {
    :root {
        --panel-width: 260px;
        --page-padding: 24px;
    }

    .server-panel {
        padding: 18px 14px;
    }
}

/* Telefon i małe okna: układ przechodzi w pion, bez stałego lewego marginesu. */
@media (max-width: 980px) {
    :root {
        --rail-width: 0px;
        --panel-width: 0px;
        --shell-left: 0px;
    }

    .server-rail,
    .server-panel {
        position: static;
        width: 100%;
        max-height: none;
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 22px;
    }
}

/* ============================================================
   v19 Dashboard Pro
   Więcej układu aplikacyjnego, pełna szerokość i wygodne karty.
   ============================================================ */
.top-status {
    position: sticky;
    top: 0;
    z-index: 10;
    float: right;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 12px;
    border: 1px solid rgba(87, 242, 135, 0.35);
    border-radius: 999px;
    background: rgba(17, 19, 26, 0.85);
    color: #b7ffc9;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.status-dot,
.health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #57f287;
    box-shadow: 0 0 16px rgba(87, 242, 135, 0.65);
}

.overview-hero {
    min-height: 160px;
    padding: 28px;
    border: 1px solid #2b3040;
    border-radius: 22px;
    background: radial-gradient(circle at top left, rgba(111, 85, 255, 0.22), transparent 35%), #171b26;
}

.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.pro-stats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 18px;
}

.pro-module-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: stretch;
    margin-bottom: 18px;
}

.pro-card {
    display: grid;
    gap: 16px;
    min-height: 180px;
}

.pro-card strong {
    font-size: 20px;
}

.pro-card span {
    color: #aeb4c8;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-self: end;
}

.button.ghost {
    background: transparent;
    border: 1px solid #343a4d;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.health-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-items: center;
    padding: 16px;
    border: 1px solid #2b3040;
    border-radius: 16px;
    background: #121520;
}

.health-card small {
    grid-column: 2;
    color: #9aa2b8;
}

.health-card.bad .health-dot {
    background: #ed4245;
    box-shadow: 0 0 16px rgba(237, 66, 69, 0.55);
}

.audit-table {
    display: grid;
    gap: 8px;
}

.audit-head,
.audit-row {
    display: grid;
    grid-template-columns: 190px minmax(120px, 180px) minmax(200px, 1fr) minmax(220px, 1.4fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
}

.audit-head {
    background: #111520;
    color: #8f95aa;
    font-weight: 800;
}

.audit-row {
    background: #151925;
    border: 1px solid #252a39;
}

.audit-row small {
    color: #aeb4c8;
    overflow-wrap: anywhere;
}

.action-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 18px;
}

.action-card {
    border: 1px solid #2b3040;
    text-align: left;
}

.wide-left {
    grid-template-columns: minmax(420px, 1.35fr) minmax(320px, 0.65fr);
}

.sticky-preview {
    position: sticky;
    top: 24px;
    align-self: start;
}

.discord-embed-preview {
    display: grid;
    grid-template-columns: 6px 1fr;
    overflow: hidden;
    border: 1px solid #2f3548;
    border-radius: 16px;
    background: #121520;
}

.embed-accent {
    min-height: 180px;
}

.embed-body {
    padding: 18px;
}

.embed-body small,
.embed-body footer {
    color: #9aa2b8;
}

.embed-body h3 {
    margin: 8px 0 10px;
}

.field-builder {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #2b3040;
    border-radius: 16px;
    background: #151925;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.5fr) minmax(160px, 1fr);
    gap: 10px;
}

.card-lite {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #2b3040;
    border-radius: 16px;
    background: #151925;
}

.component-head {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

.component-head span {
    color: #8f95aa;
    font-size: 13px;
}

.emoji-search {
    margin-bottom: 10px;
}

.emoji-grid.compact {
    max-height: 230px;
    overflow: auto;
}

.saved-embed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 16px;
}

.saved-embed-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #2b3040;
    border-radius: 18px;
    background: #151925;
}

.saved-embed-preview {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-left: 6px solid #9146ff;
    border-radius: 12px;
    background: #111520;
}

.saved-embed-preview small {
    color: #aeb4c8;
}

.compact-form {
    gap: 10px;
}

.custom-command-row {
    grid-template-columns: minmax(120px, 180px) 70px 1fr auto;
}

.compact-table div {
    padding: 10px 0;
}

.compact-list li {
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr auto;
    gap: 10px;
    align-items: center;
}

@media (max-width: 980px) {
    .wide-left {
        grid-template-columns: 1fr;
    }

    .sticky-preview {
        position: static;
    }

    .audit-head,
    .audit-row {
        grid-template-columns: 1fr;
    }

    .field-row {
        grid-template-columns: 1fr;
    }
}

/* v21, tabela użytkowników dashboardu */
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #252b3a;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #aeb4c8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.button.small {
    padding: 8px 12px;
    min-height: auto;
    font-size: 12px;
}

.button.danger {
    background: #3a1720;
    border-color: #ef4444;
    color: #fecdd3;
}

.button.danger:hover {
    background: #5b1d2b;
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid #2b3040;
    border-radius: 999px;
    background: #151925;
    color: #d8dcef;
}

.mini-info {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid #2b3040;
    border-radius: 14px;
    background: #111520;
}

.mini-info span {
    color: #8f95aa;
    font-size: 12px;
    text-transform: uppercase;
}

/* v22, dostęp wielu użytkowników i wyszarzone serwery bez uprawnień */
.guild-grid.relaxed {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.disabled-guild,
.server-icon.disabled-server {
    filter: grayscale(1);
    opacity: 0.45;
    cursor: not-allowed;
}

.disabled-guild {
    position: relative;
    background: linear-gradient(135deg, rgba(31, 35, 48, 0.9), rgba(20, 23, 32, 0.92));
}

.flag.locked {
    background: rgba(146, 153, 171, 0.14);
    color: #aeb4c8;
}

.locked-note {
    margin: 10px 0 0;
    color: #9aa2b8;
    font-size: 13px;
}

/* v22, Tożsamość bota */
.identity-grid {
    grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
}

.bot-identity-preview {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid #2b3040;
    border-radius: 18px;
    background: #121520;
}

.bot-avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6f55ff, #57f287);
    color: #fff;
    font-weight: 900;
    font-size: 28px;
}

.bot-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hint-box {
    margin-top: 16px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #2b3040;
    background: #151925;
}

/* v22, Generator Embed: kolory i przyciski */
.preset-color::before {
    background: var(--preset, var(--preset-color, #9146ff));
    box-shadow: 0 0 12px var(--preset, var(--preset-color, #9146ff));
}

.preset-color {
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--preset, #9146ff) 45%, transparent);
}

.color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--preset, #9146ff);
    box-shadow: 0 0 14px var(--preset, #9146ff);
    display: inline-block;
    flex: 0 0 auto;
}

.saved-embed-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.embed-edit-details {
    border: 1px solid #2b3040;
    border-radius: 14px;
    background: #111520;
    overflow: hidden;
}

.embed-edit-details summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 800;
    color: #d7daf0;
}

.embed-edit-details[open] summary {
    border-bottom: 1px solid #252b3a;
}

.embed-edit-details form {
    padding: 14px;
}

.button.danger-action {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, rgba(237, 66, 69, 0.22), rgba(237, 66, 69, 0.12));
    border: 1px solid rgba(237, 66, 69, 0.45);
    color: #ffd2d2;
}

.button.danger-action:hover {
    border-color: #ed4245;
    box-shadow: 0 0 0 3px rgba(237, 66, 69, 0.16);
}

@media (max-width: 980px) {
    .identity-grid {
        grid-template-columns: 1fr;
    }
}

/* v23, lepsze kopiowanie emotek i podgląd obrazów w embedach */
.copy-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    padding: 10px 14px;
    border: 1px solid rgba(87, 242, 135, 0.45);
    border-radius: 14px;
    background: rgba(17, 22, 32, 0.96);
    color: #e7f9ee;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.copy-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.embed-media-preview {
    margin-top: 12px;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid #2b3040;
    object-fit: cover;
}

.embed-thumb-preview {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid #2b3040;
    float: right;
    margin-left: 12px;
}

.upload-help {
    color: #8f95aa;
    font-size: 12px;
    margin-top: -6px;
}

.file-log-god-only {
    border: 1px solid rgba(255, 184, 108, 0.25);
}

.event-log-row {
    display: grid;
    grid-template-columns: 150px 120px 1fr;
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid #252b3a;
}
.event-log-row span {
    color: #9098ad;
    font-size: 13px;
}
.event-log-row strong {
    color: #f4f6ff;
}
.event-log-row p {
    margin: 0;
    color: #c7ccdd;
}

@media (max-width: 900px) {
    .event-log-row {
        grid-template-columns: 1fr;
    }
}

/* v24, większe panele diagnostyki i managera plików */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.permission-check {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.03);
}
.permission-check.ok { border-color: rgba(67, 255, 137, 0.35); }
.permission-check.bad { border-color: rgba(255, 86, 86, 0.45); background: rgba(255, 86, 86, 0.06); }
.permission-check span {
    display: inline-flex;
    margin: 8px 0;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    font-size: 12px;
}
.permission-check.ok span { color: #8dffad; }
.permission-check.bad span { color: #ff9b9b; }
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.upload-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
}
.upload-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0d111b;
}
.warning-card {
    border-color: rgba(255, 196, 87, 0.35);
    background: rgba(255, 196, 87, 0.06);
}

/* v25, Upload Manager bez nachodzenia kart i długich URL-i */
.upload-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-items: stretch;
}
.upload-card {
    min-width: 0;
    overflow: hidden;
}
.upload-card strong,
.upload-card input[type="text"] {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upload-card input[type="text"] {
    font-size: 12px;
}
.upload-card .button,
.upload-card form {
    width: 100%;
}

/* v25, Generator Embed 2.0 */
.two-fields {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.field-builder-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.dynamic-field-row {
    grid-template-columns: minmax(120px, .8fr) minmax(160px, 1.2fr) 150px auto;
    align-items: end;
}
.dynamic-field-row select {
    height: 44px;
}
.embed-preview-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 12px 0;
}
.preview-field-pill {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #2b3040;
    border-radius: 12px;
    background: #171b27;
}
.preview-field-pill span {
    color: #cbd2e6;
    overflow-wrap: anywhere;
}
.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #d7daf0;
}
.checkbox-line input {
    width: 18px;
    height: 18px;
}
.safe-send-form {
    border: 1px solid rgba(155, 227, 75, .16);
    border-radius: 14px;
    padding: 12px;
    background: rgba(155, 227, 75, .04);
}
code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #111520;
    color: #d7daf0;
}
@media (max-width: 980px) {
    .dynamic-field-row {
        grid-template-columns: 1fr;
    }
}
:root { --border: #2b3040; }

/* v26: YouTube 2.0 */
.youtube-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}
.youtube-type-card {
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.025);
    border-radius: 18px;
    padding: 18px;
    display: grid;
    gap: 14px;
}
.youtube-type-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.youtube-type-head h3 { margin: 0 0 4px 0; }
.youtube-type-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.compact-switch { white-space: nowrap; }
.mini-preview { margin-top: 6px; }

/* v26: modal podglądu wysyłki embeda */
body.modal-open { overflow: hidden; }
.send-preview-modal[hidden] { display: none; }
.send-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 24px;
}
.send-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .78);
    backdrop-filter: blur(10px);
}
.send-preview-dialog {
    position: relative;
    width: min(840px, 96vw);
    max-height: 92vh;
    overflow: auto;
    border-radius: 22px;
    background: #111522;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 24px 80px rgba(0,0,0,.55);
    padding: 22px;
}
.send-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.send-preview-head h2 { margin: 0; }
.send-preview-meta {
    color: var(--muted);
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}
.send-preview-content {
    color: var(--text);
    background: rgba(88, 101, 242, .12);
    border: 1px solid rgba(88, 101, 242, .25);
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    white-space: pre-wrap;
}
.send-modal-preview { margin-top: 12px; }
.send-preview-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* v37: przełączniki logów administracyjnych */
.toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    width: 100%;
}
.toggle-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}
.toggle-card input {
    width: auto;
}
.small-toggle-card span {
    font-size: 0.9rem;
}

/* v38 Auto role */
.stack-list { display: grid; gap: 18px; }
.nested-card { border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 18px; background: rgba(255,255,255,.035); }
.card-headline-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.slim-gap { gap: 14px; }
.compact-form { gap: 10px; }
.compact-table > div { grid-template-columns: 1fr 1fr auto; align-items: center; }
.button.tiny { padding: 6px 10px; font-size: 12px; }
.send-panel-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
@media (max-width: 720px) {
    .card-headline-row { flex-direction: column; }
    .inline-actions { justify-content: flex-start; }
    .compact-table > div { grid-template-columns: 1fr; }
}

/* v39: Pierwsza konfiguracja */
.setup-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.setup-status-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.setup-status-card .setup-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    font-size: 24px;
    flex: 0 0 auto;
}

.setup-wizard-layout {
    align-items: start;
}

.setup-form .setup-checkbox {
    grid-column: 1 / -1;
}

.setup-preview {
    display: grid;
    gap: 16px;
}

.setup-category {
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.035);
    border-radius: 18px;
    padding: 16px;
}

.setup-category strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.setup-category span {
    color: var(--muted);
    font-size: .92rem;
}

.setup-category ul {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: grid;
    gap: 8px;
}

.setup-category li {
    padding: 9px 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.inline-form.danger-zone {
    margin-top: 12px;
}

@media (max-width: 980px) {
    .setup-status-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   v50 Dashboard UX refresh
   Chowany sidebar, topbar użytkownika, moduł Komendy w zakładkach.
   ============================================================ */
:root {
    --topbar-height: 72px;
    --panel-collapsed-width: 0px;
    --muted: #9aa2b8;
    --text: #f4f6fb;
}

body.sidebar-collapsed {
    --panel-width: 0px;
    --shell-left: var(--rail-width);
}

body.sidebar-collapsed .server-panel {
    transform: translateX(calc(-1 * var(--panel-width, 286px) - 12px));
    pointer-events: none;
    opacity: 0;
}

.server-panel {
    transition: transform .18s ease, opacity .18s ease;
}

.compact-brand {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #2b3040;
    border-radius: 12px;
    background: #151923;
    color: #f4f6fb;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.icon-button:hover {
    border-color: #6f55ff;
}

.desktop-sidebar-button {
    display: inline-grid;
}

.mobile-menu-button {
    display: none;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: var(--topbar-height);
    margin: calc(-1 * var(--page-padding)) calc(-1 * var(--page-padding)) 28px;
    padding: 14px var(--page-padding);
    background: rgba(17, 19, 26, 0.82);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-context {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-context span {
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-context small,
.topbar-user small {
    color: #8f95aa;
}

.topbar-user {
    padding: 8px 10px;
    border: 1px solid #2b3040;
    border-radius: 16px;
    background: rgba(21, 25, 35, .88);
}

.topbar-user img,
.topbar-user-initial {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #272c3a;
    object-fit: cover;
    font-weight: 900;
}

.topbar-user strong {
    display: block;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user .logout-link {
    padding-left: 10px;
    border-left: 1px solid #2b3040;
}

.server-panel .user-box,
.top-status {
    display: none !important;
}

.server-panel .side-tree {
    padding-bottom: 18px;
}

.server-panel .module-tile {
    min-height: 52px;
    padding: 9px 12px;
}

.server-panel .module-tile small {
    line-height: 1.25;
}

.active-server-card {
    flex: 0 0 auto;
}

.server-card-text {
    min-width: 0;
}

/* Komendy, zakładki i kreator */
.module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
    padding: 8px;
    border: 1px solid #2b3040;
    border-radius: 18px;
    background: #121620;
}

.tab-button {
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #aeb4c8;
    padding: 10px 14px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.tab-button.active,
.tab-button:hover {
    color: #f4f6fb;
    background: #272c3a;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.command-workspace {
    display: grid;
    grid-template-columns: minmax(420px, 1.1fr) minmax(320px, .75fr);
    gap: 18px;
    align-items: start;
}

.builder-side-stack {
    display: grid;
    gap: 18px;
    position: sticky;
    top: calc(var(--topbar-height) + 18px);
}

.section-head.split,
.form-footer-row,
.command-manage-head,
.list-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.field-help,
.small {
    color: #8f95aa;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

input[type="number"],
input[type="file"],
input[type="url"] {
    width: 100%;
    border: 1px solid #343a4d;
    border-radius: 12px;
    background: #121520;
    color: #f4f6fb;
    padding: 12px 14px;
    font: inherit;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.soft-details {
    border: 1px solid #2b3040;
    border-radius: 14px;
    background: #111520;
    overflow: hidden;
}

.soft-details summary {
    cursor: pointer;
    padding: 13px 14px;
    font-weight: 900;
}

.soft-details[open] summary {
    border-bottom: 1px solid #252b3a;
}

.details-body {
    padding: 14px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.compact-templates {
    grid-template-columns: 1fr;
}

.template-card,
.placeholder-chip {
    border: 1px solid #2b3040;
    border-radius: 14px;
    background: #151923;
    color: #f4f6fb;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    display: grid;
    gap: 6px;
    font: inherit;
}

.template-card:hover,
.placeholder-chip:hover {
    border-color: #6f55ff;
    box-shadow: 0 0 0 4px rgba(111, 85, 255, .12);
}

.template-card span,
.placeholder-chip small {
    color: #9aa2b8;
    font-size: 12px;
    line-height: 1.35;
}

.placeholder-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.placeholder-chip strong {
    font: 700 12px/1.4 Consolas, "Courier New", monospace;
    overflow-wrap: anywhere;
}

.discord-command-preview {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #2b3040;
    border-radius: 14px;
    background: #111520;
}

.discord-command-preview p {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(88, 101, 242, .12);
    color: #dfe5ff;
    white-space: pre-wrap;
}

.manageable-command-list {
    gap: 14px;
}

.command-manage-card {
    display: grid;
    gap: 10px;
    border: 1px solid #2b3040;
    border-radius: 16px;
    background: #151923;
    padding: 16px;
}

.command-manage-head > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.danger-link {
    border: 0;
    background: transparent;
    color: #ff9c91;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: #151923;
    border: 1px solid #2b3040;
    color: #d8dcef;
    font-weight: 800;
}

.command-lists-layout {
    margin-bottom: 18px;
}

.list-create-form {
    margin-top: 12px;
}

.list-help-card .emoji-component.card-lite {
    margin-top: 16px;
}

.weight-examples {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.weight-examples span {
    padding: 9px 10px;
    border-radius: 12px;
    background: #111520;
    color: #d7daf0;
}

.better-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(520px, 100%), 1fr));
    gap: 18px;
}

.list-card-v50 {
    grid-template-columns: 1fr;
}

.list-items {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.list-item-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #252b3a;
    border-radius: 12px;
    background: #111520;
}

.list-item-row span {
    overflow-wrap: anywhere;
    color: #d7daf0;
}

.upload-preview {
    padding: 10px;
    border: 1px solid #2b3040;
    border-radius: 12px;
    background: #111520;
    color: #aeb4c8;
}

.upload-preview img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 10px;
    background: #0d111b;
}

.relaxed-header {
    margin-bottom: 18px;
}

@media (max-width: 1200px) {
    .command-workspace {
        grid-template-columns: 1fr;
    }
    .builder-side-stack {
        position: static;
    }
}

@media (max-width: 980px) {
    .desktop-sidebar-button,
    .sidebar-collapse-button {
        display: none;
    }
    .mobile-menu-button {
        display: inline-grid;
    }
    .server-rail {
        display: none;
    }
    .server-panel {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(330px, 88vw);
        max-height: 100vh;
        transform: translateX(-105%);
        opacity: 1;
        pointer-events: auto;
        z-index: 4000;
    }
    body.mobile-sidebar-open .server-panel {
        transform: translateX(0);
    }
    body.mobile-sidebar-open .mobile-sidebar-backdrop {
        display: block;
    }
    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 3990;
        background: rgba(0,0,0,.58);
        backdrop-filter: blur(4px);
    }
    .content {
        padding: 18px;
    }
    .app-topbar {
        margin: -18px -18px 20px;
        padding: 12px 18px;
    }
    .topbar-user small,
    .topbar-user .logout-link {
        display: none;
    }
    .topbar-user strong {
        max-width: 120px;
    }
    .form-grid.two,
    .field-row,
    .list-item-row {
        grid-template-columns: 1fr;
    }
    .section-head.split,
    .form-footer-row,
    .command-manage-head,
    .list-card-head {
        flex-direction: column;
    }
}
@media (max-width: 980px) {
    body.sidebar-collapsed .server-panel {
        transform: translateX(-105%);
        opacity: 1;
        pointer-events: auto;
    }
    body.mobile-sidebar-open.sidebar-collapsed .server-panel,
    body.mobile-sidebar-open .server-panel {
        transform: translateX(0);
    }
}

/* ============================================================
   v51 Dashboard polish
   Server picker, Overview refresh, calmer sidebar, Custom Commands UX.
   ============================================================ */

/* mniej rzucający się w oczy scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(154, 162, 184, .28) transparent;
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: rgba(154, 162, 184, .18);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(154, 162, 184, .34);
    background-clip: padding-box;
}
.server-panel .side-tree,
.rail-guilds {
    scrollbar-color: rgba(154, 162, 184, .18) transparent;
}

/* sidebar po v51, trochę lżej i mniej kartonowo */
.server-panel {
    background: linear-gradient(180deg, rgba(23, 27, 35, .97), rgba(16, 19, 26, .97));
}
.server-panel .module-tile {
    border-color: rgba(255,255,255,.055);
    background: rgba(255,255,255,.025);
    box-shadow: none;
}
.server-panel .module-tile.active {
    outline: 0;
    border-color: rgba(111, 85, 255, .85);
    background: linear-gradient(135deg, rgba(111,85,255,.18), rgba(60,200,120,.05));
    box-shadow: inset 3px 0 0 rgba(111, 85, 255, .85);
}
.server-panel .module-tile:hover {
    border-color: rgba(111, 85, 255, .55);
    background: rgba(111, 85, 255, .075);
}
.active-server-card {
    border-color: rgba(111, 85, 255, .22);
    background: rgba(111, 85, 255, .07);
}
.side-tree-title {
    color: #b2b8ce;
    opacity: .8;
}

/* Server picker */
.guild-picker-hero {
    min-height: calc(100vh - var(--topbar-height) - 80px);
    display: grid;
    align-content: start;
    gap: 18px;
    padding: clamp(18px, 2vw, 28px);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 28px;
    background:
        radial-gradient(circle at 75% 0%, rgba(111,85,255,.28), transparent 30%),
        radial-gradient(circle at 10% 100%, rgba(60,200,120,.09), transparent 24%),
        #121620;
}
.guild-picker-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}
.guild-picker-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
}
.guild-search-label {
    min-width: min(420px, 100%);
}
.guild-filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-chip {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    padding: 9px 12px;
    color: #cfd4e8;
    background: rgba(255,255,255,.035);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.filter-chip.active,
.filter-chip:hover {
    background: rgba(111,85,255,.22);
    border-color: rgba(111,85,255,.55);
    color: #fff;
}
.server-picker-panel {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;
    background: rgba(21, 25, 35, .78);
    box-shadow: 0 18px 60px rgba(0,0,0,.25);
    overflow: hidden;
}
.picker-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    color: #dbe0f4;
    font-weight: 900;
}
.picker-panel-head small {
    color: #8f95aa;
}
.server-bubble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px 18px;
    padding: clamp(18px, 2.6vw, 34px);
}
.server-bubble-card {
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 14px 10px;
    border: 1px solid transparent;
    border-radius: 22px;
    color: #f4f6fb;
    text-align: center;
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.server-bubble-card:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,.035);
    border-color: rgba(111,85,255,.35);
}
.server-bubble-card.locked {
    opacity: .58;
    filter: grayscale(.5);
}
.server-bubble-avatar {
    width: 112px;
    height: 112px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #0d111b;
    border: 3px solid rgba(255,255,255,.38);
    box-shadow: 0 14px 32px rgba(0,0,0,.28);
    font-size: 28px;
    font-weight: 900;
}
.server-bubble-card.configured .server-bubble-avatar {
    border-color: rgba(87,242,135,.95);
}
.server-bubble-card.attention .server-bubble-avatar {
    border-color: rgba(255,197,66,.85);
}
.server-bubble-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.server-bubble-card strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.server-status-chip,
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    color: #d7daf0;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}
.server-status-chip.configured,
.status-chip.ok {
    background: rgba(87,242,135,.13);
    color: #9dffbf;
}
.server-status-chip.attention,
.status-chip.warning {
    background: rgba(255,197,66,.14);
    color: #ffe19a;
}
.server-status-chip.locked,
.status-chip.missing {
    background: rgba(255,255,255,.06);
    color: #a8afc6;
}
.server-mini-stats {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.server-mini-stats span {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(0,0,0,.2);
    color: #b8bfd4;
    font-size: 12px;
}
.guild-empty-filter {
    padding: 0 24px 24px;
}

/* Overview v51 */
.overview-hero-v51 {
    background:
        linear-gradient(135deg, rgba(111,85,255,.24), rgba(155,227,75,.06)),
        #171b26;
}
.overview-section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 12px;
}
.overview-section-head h2,
.overview-section-head p {
    margin-bottom: 4px;
}
.overview-module-grid-v51 {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.overview-module-card {
    min-height: 158px;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 12px;
    border-color: rgba(255,255,255,.07);
    background: rgba(255,255,255,.026);
}
.overview-module-card.enabled {
    border-color: rgba(155, 227, 75, .32);
    background: linear-gradient(180deg, rgba(155,227,75,.055), rgba(255,255,255,.022));
}
.overview-module-card.disabled {
    opacity: .72;
}
.module-card-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.module-card-main strong {
    display: block;
    font-size: 17px;
}
.module-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.module-config-link {
    align-self: end;
    justify-self: start;
    color: #b9a9ff;
    text-decoration: none;
    font-weight: 900;
}
.module-config-link:hover {
    color: #fff;
}
.overview-action-panel {
    margin: 18px 0;
}
.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.quick-action {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 13px 14px;
    color: #f4f6fb;
    background: #121620;
    text-decoration: none;
    font-weight: 900;
}
.quick-action:hover {
    border-color: rgba(111,85,255,.6);
    background: rgba(111,85,255,.13);
}
.config-status-list {
    display: grid;
    gap: 8px;
}
.config-status-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.config-status-row span,
.config-status-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
}
.activity-feed {
    display: grid;
    gap: 10px;
}
.activity-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}
.activity-item p {
    margin: 2px 0 0;
    color: #c4c8d8;
}
.activity-item small {
    color: #8f95aa;
    white-space: nowrap;
}
.activity-dot {
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 999px;
    background: #9be34b;
    box-shadow: 0 0 12px rgba(155,227,75,.45);
}

/* Custom Commands v51 */
.command-creator-v51 {
    display: grid;
    gap: 18px;
}
.command-preview-top {
    border-color: rgba(111,85,255,.24);
    background: linear-gradient(135deg, rgba(111,85,255,.12), rgba(255,255,255,.025));
}
.command-workspace-v51 {
    grid-template-columns: minmax(460px, 1fr) minmax(340px, 420px);
}
.large-preview {
    font-size: 15px;
}
.builder-tools-v51 {
    gap: 14px;
}
.command-tools-card {
    display: grid;
    gap: 12px;
}
.tool-section {
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(0,0,0,.12);
    overflow: hidden;
}
.tool-section summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 900;
}
.tool-section[open] summary {
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.tool-section > :not(summary) {
    margin: 12px 14px;
}
.compact-placeholder-grid {
    grid-template-columns: 1fr;
}
.insert-list-grid {
    display: grid;
    gap: 8px;
}
.insert-list-chip {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    background: #151923;
    color: #f4f6fb;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.insert-list-chip:hover {
    border-color: rgba(111,85,255,.6);
}
.insert-list-chip small {
    color: #9aa2b8;
}
.sticky-form-actions {
    position: sticky;
    bottom: 0;
    margin: 0 -24px -24px;
    padding: 14px 24px;
    background: rgba(27, 31, 43, .94);
    border-top: 1px solid rgba(255,255,255,.07);
    backdrop-filter: blur(12px);
}
.list-create-form label,
.command-builder-card label {
    line-height: 1.35;
}

@media (max-width: 1200px) {
    .command-workspace-v51 {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 980px) {
    .guild-picker-topline,
    .guild-picker-toolbar,
    .overview-section-head {
        display: grid;
    }
    .server-bubble-grid {
        grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    }
    .server-bubble-avatar {
        width: 88px;
        height: 88px;
    }
    .config-status-row,
    .activity-item {
        grid-template-columns: 1fr;
    }
    .sticky-form-actions {
        position: static;
        margin: 0;
        padding: 0;
        background: transparent;
        border-top: 0;
    }
}
.access-pill.owner {
    background: rgba(111,85,255,.18);
    color: #cfc4ff;
}

/* ============================================================
   v52 Overview cleanup
   Moduły bez karty w karcie, mniej tekstu, osobne akcje ręczne.
   ============================================================ */
.overview-hero-v52 {
    margin-bottom: 22px;
    border: 1px solid rgba(255,255,255,.07);
    background:
        radial-gradient(circle at 12% 0%, rgba(111,85,255,.20), transparent 26%),
        linear-gradient(135deg, rgba(111,85,255,.12), rgba(255,255,255,.018)),
        #151925;
    box-shadow: none;
}

.overview-hero-v52 h1 {
    margin-bottom: 8px;
}

.compact-pills {
    gap: 8px;
    margin-top: 14px;
}

.clean-block-head {
    margin: 8px 0 12px;
}

.clean-block-head h2,
.compact-section-head-v52 h2 {
    margin-bottom: 3px;
}

.clean-block-head p,
.compact-section-head-v52 p {
    margin: 0;
    color: #9da4bb;
}

.module-grid-v52 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.module-tile-v52 {
    min-width: 0;
    min-height: 142px;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.018));
    box-shadow: none;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.module-tile-v52:hover {
    transform: translateY(-1px);
    border-color: rgba(111,85,255,.42);
    background: linear-gradient(180deg, rgba(111,85,255,.07), rgba(255,255,255,.02));
}

.module-tile-v52.is-off {
    opacity: .76;
}

.module-tile-v52.needs-config {
    border-color: rgba(255,197,66,.22);
}

.module-tile-head-v52 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.module-title-row-v52 {
    min-width: 0;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.module-icon-v52 {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(111,85,255,.12);
    border: 1px solid rgba(111,85,255,.18);
    font-size: 16px;
}

.module-title-row-v52 strong {
    display: block;
    font-size: 16px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.module-title-row-v52 small {
    display: block;
    margin-top: 4px;
    color: #9da4bb;
    line-height: 1.35;
}

.module-toggle-compact-v52 {
    flex: 0 0 auto;
}

.mini-toggle-v52.toggle-switch {
    width: 44px;
    height: 24px;
}

.mini-toggle-v52.toggle-switch span {
    background: #2b3040;
    border-color: rgba(255,255,255,.12);
    box-shadow: none;
}

.mini-toggle-v52.toggle-switch span::before {
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
}

.mini-toggle-v52.toggle-switch input:checked + span {
    background: rgba(155,227,75,.75);
    border-color: rgba(155,227,75,.55);
    box-shadow: none;
}

.mini-toggle-v52.toggle-switch input:checked + span::before {
    transform: translateX(20px);
}

.module-tile-meta-v52 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.status-chip.neutral {
    background: rgba(255,255,255,.055);
    color: #aeb4c8;
}

.module-count-v52 {
    color: #aeb4c8;
    font-size: 13px;
}

.module-config-button-v52 {
    align-self: end;
    justify-self: start;
    padding: 8px 10px;
    border-radius: 10px;
}

.soft-card-v52 {
    border-color: rgba(255,255,255,.075);
    background: rgba(255,255,255,.026);
    box-shadow: none;
}

.manual-actions-v52 {
    margin: 18px 0;
}

.manual-action-grid-v52 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.manual-action-form-v52 {
    margin: 0;
}

.manual-action-form-v52 button,
.manual-action-link-v52 {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: #121620;
    color: #eef1ff;
    font: inherit;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.manual-action-form-v52 button:hover,
.manual-action-link-v52:hover {
    border-color: rgba(111,85,255,.48);
    background: rgba(111,85,255,.12);
}

.overview-bottom-grid-v52 {
    align-items: start;
}

.config-status-list-v52 {
    display: grid;
    gap: 4px;
}

.config-status-row-v52 {
    display: grid;
    grid-template-columns: minmax(120px, .9fr) minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 42px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,.055);
}

.config-status-row-v52 span,
.config-status-row-v52 strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.config-status-row-v52 span {
    color: #d9def2;
    font-weight: 700;
}

.config-status-row-v52 strong {
    color: #b5bdd5;
    font-weight: 800;
    text-align: right;
}

.activity-feed-v52 {
    display: grid;
    gap: 8px;
}

.activity-item-v52 {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,.055);
}

.activity-item-v52 p {
    margin: 2px 0 0;
    color: #c4c8d8;
}

.activity-item-v52 small {
    color: #8f95aa;
    white-space: nowrap;
}

.activity-dot-v52 {
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 999px;
    background: rgba(155,227,75,.85);
}

/* mniej jaskrawy scrollbar w sidebarze i panelach */
.server-panel,
.sidebar-scroll,
.side-tree,
.rail-guilds {
    scrollbar-width: thin;
    scrollbar-color: rgba(154,162,184,.14) transparent;
}

.server-panel::-webkit-scrollbar-thumb,
.sidebar-scroll::-webkit-scrollbar-thumb,
.side-tree::-webkit-scrollbar-thumb,
.rail-guilds::-webkit-scrollbar-thumb {
    background: rgba(154,162,184,.12);
}

.server-panel:hover::-webkit-scrollbar-thumb,
.sidebar-scroll:hover::-webkit-scrollbar-thumb,
.side-tree:hover::-webkit-scrollbar-thumb,
.rail-guilds:hover::-webkit-scrollbar-thumb {
    background: rgba(154,162,184,.24);
}

@media (max-width: 1100px) {
    .module-grid-v52 {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .config-status-row-v52 {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .config-status-row-v52 strong {
        text-align: left;
    }
}

@media (max-width: 720px) {
    .module-grid-v52,
    .manual-action-grid-v52 {
        grid-template-columns: 1fr;
    }

    .overview-hero-v52 .header-actions {
        width: 100%;
    }
}

/* ============================================================
   v53 Navigation cleanup
   Sidebar groups, cleaner Overview shortcuts, calmer module layout.
   ============================================================ */
.side-tree-v53 {
    display: grid;
    gap: 12px;
    padding-bottom: 22px;
}

.side-group-v53 {
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 16px;
    background: rgba(255,255,255,.018);
    overflow: hidden;
}

.side-group-v53 summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    color: #e8ecff;
    font-weight: 900;
}

.side-group-v53 summary::-webkit-details-marker {
    display: none;
}

.side-group-v53 summary::before {
    content: '›';
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-right: 2px;
    color: #9aa2b8;
    transition: transform .16s ease;
}

.side-group-v53[open] summary::before {
    transform: rotate(90deg);
}

.side-group-v53 summary span {
    flex: 1;
}

.side-group-v53 summary em {
    color: #7f879c;
    font-size: 11px;
    font-style: normal;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.side-group-body-v53 {
    display: grid;
    gap: 6px;
    padding: 0 8px 10px;
}

.server-panel .nav-item-v53.module-tile {
    min-height: 46px;
    padding: 8px 10px;
    border-radius: 12px;
    border-color: transparent;
    background: transparent;
}

.server-panel .nav-item-v53.module-tile.active {
    background: rgba(111,85,255,.14);
    border-color: rgba(111,85,255,.32);
    box-shadow: inset 3px 0 0 rgba(111,85,255,.85);
}

.server-panel .nav-item-v53.module-tile:hover {
    background: rgba(111,85,255,.075);
    border-color: rgba(111,85,255,.20);
}

.module-nav-v53 span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.module-state-dot-v53 {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 999px;
    flex: 0 0 auto;
    background: #566074;
    box-shadow: none;
}

.module-state-dot-v53.on {
    background: #9be34b;
    box-shadow: 0 0 0 4px rgba(155,227,75,.08);
}

.module-state-dot-v53.off {
    background: #626a7d;
}

.overview-hero-v53 {
    gap: 20px;
}

.overview-quick-actions-v53 {
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.quick-more-v53 {
    position: relative;
}

.quick-more-v53 summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #2a2f3d;
    color: white;
    cursor: pointer;
    font-weight: 900;
}

.quick-more-v53 summary::-webkit-details-marker {
    display: none;
}

.quick-more-v53 summary::after {
    content: '▾';
    margin-left: 8px;
    color: #aeb4c8;
    font-size: 11px;
}

.quick-more-menu-v53 {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;
    min-width: 220px;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: #151923;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

.quick-more-menu-v53 a {
    color: #eef1ff;
    text-decoration: none;
    font-weight: 800;
    padding: 10px 11px;
    border-radius: 10px;
}

.quick-more-menu-v53 a:hover {
    background: rgba(111,85,255,.12);
}

.module-grid-v53 {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.module-card-v53 {
    min-height: 132px;
    padding: 15px;
    border-color: rgba(255,255,255,.06);
    background: rgba(255,255,255,.022);
}

.module-card-v53:hover {
    transform: none;
    border-color: rgba(111,85,255,.30);
    background: rgba(255,255,255,.035);
}

.module-card-v53 .module-icon-v52 {
    background: rgba(111,85,255,.09);
    border-color: rgba(111,85,255,.12);
}

.module-card-v53.needs-config {
    border-color: rgba(255,197,66,.20);
}

.manual-actions-v53 {
    margin-top: 20px;
}

@media (max-width: 980px) {
    .side-group-v53 summary em {
        display: none;
    }
}

@media (max-width: 720px) {
    .overview-quick-actions-v53 {
        width: 100%;
        justify-content: stretch;
    }
    .overview-quick-actions-v53 > a,
    .overview-quick-actions-v53 .quick-more-v53,
    .overview-quick-actions-v53 .quick-more-v53 summary {
        width: 100%;
    }
    .quick-more-menu-v53 {
        position: static;
        margin-top: 8px;
    }
}

/* ============================================================
   v54 Sidebar group expansion fix
   Rozwinięte grupy pokazują pełną zawartość, a przewija się cały panel.
   ============================================================ */
.server-panel {
    overflow: hidden;
}

.server-panel .side-tree,
.server-panel .side-tree-v53 {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    padding-bottom: 36px;
}

.side-group-v53 {
    overflow: visible;
}

.side-group-v53[open] {
    height: auto;
    min-height: auto;
}

.side-group-v53[open] .side-group-body-v53 {
    display: grid;
    height: auto;
    max-height: none;
    overflow: visible;
}

.server-panel .side-group-body-v53 .nav-item-v53.module-tile {
    min-height: 44px;
    height: auto;
    overflow: visible;
}

.server-panel .side-group-body-v53 .nav-item-v53.module-tile span,
.server-panel .side-group-body-v53 .nav-item-v53.module-tile small {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

@media (max-width: 980px) {
    .server-panel {
        overflow: hidden;
    }

    .server-panel .side-tree,
    .server-panel .side-tree-v53 {
        flex: 1 1 auto;
        max-height: calc(100vh - 190px);
        overflow-y: auto;
    }
}

/* v55, Custom Commands UX cleanup */
.command-creator-clean {
    display: grid;
    gap: 18px;
}

.template-bar-card {
    padding: 16px 18px;
}

.template-bar {
    display: grid;
    grid-template-columns: minmax(220px, 340px) minmax(260px, 1fr);
    gap: 16px;
    align-items: center;
}

.template-bar div {
    display: grid;
    gap: 4px;
}

.template-bar small {
    color: #9aa2b8;
}

.clean-builder-card {
    max-width: 980px;
}

.clean-builder-card [hidden],
.edit-command-details [hidden] {
    display: none !important;
}

.advanced-command-options summary::after {
    content: "opcjonalne";
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(111, 85, 255, .16);
    color: #cfc4ff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.smart-input-wrap {
    position: relative;
}

.smart-input-wrap textarea,
.smart-input-wrap input[type="text"] {
    padding-right: 92px;
}

.smart-input-actions {
    position: absolute;
    top: 9px;
    right: 9px;
    display: flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    background: rgba(18, 21, 32, .92);
    backdrop-filter: blur(8px);
}

.smart-tool-btn {
    width: 32px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #dfe4ff;
    cursor: pointer;
    font: 900 13px/1 inherit;
}

.smart-tool-btn:hover,
.smart-tool-btn:focus-visible {
    background: rgba(111, 85, 255, .24);
    outline: none;
}

.smart-popover {
    position: fixed;
    z-index: 2000;
    max-height: min(560px, calc(100vh - 32px));
    overflow: auto;
    border: 1px solid #343a4d;
    border-radius: 16px;
    background: #151925;
    box-shadow: 0 18px 60px rgba(0,0,0,.46);
    padding: 12px;
}

.smart-popover-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.smart-popover-head button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 9px;
    background: #272c3a;
    color: #f4f6fb;
    cursor: pointer;
}

.smart-popover-section {
    display: grid;
    gap: 7px;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,.06);
}

.smart-popover-section:first-of-type {
    border-top: 0;
}

.smart-popover-section > small {
    color: #9aa2b8;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.smart-popover-section button {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    background: #111520;
    color: #f4f6fb;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.smart-popover-section button:hover {
    border-color: rgba(111,85,255,.65);
    background: rgba(111,85,255,.12);
}

.smart-popover-section code {
    color: #d7ccff;
    overflow-wrap: anywhere;
}

.smart-popover-section span {
    color: #9aa2b8;
    font-size: 12px;
}

.emoji-smart-popover .emoji-grid.compact {
    max-height: 320px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 8px;
}

.emoji-smart-popover .emoji-copy {
    justify-content: center;
    flex-direction: column;
    min-height: 76px;
    padding: 8px;
}

.emoji-smart-popover .emoji-copy small {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.color-picker-shell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.color-picker-shell input[type="color"] {
    width: 54px;
    height: 38px;
    border-radius: 12px;
}

.color-pipette-button {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #343a4d;
    border-radius: 12px;
    background: #121520;
    color: #dfe4ff;
    cursor: pointer;
}

.color-pipette-button:hover {
    border-color: rgba(111,85,255,.65);
    background: rgba(111,85,255,.14);
}

.color-pipette-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.empty-state-card {
    border-style: dashed;
}

@media (max-width: 760px) {
    .template-bar {
        grid-template-columns: 1fr;
    }
    .smart-input-wrap textarea,
    .smart-input-wrap input[type="text"] {
        padding-right: 14px;
        padding-bottom: 54px;
    }
    .smart-input-actions {
        top: auto;
        bottom: 9px;
    }
}

/* ===== v56: Smart fields fixed inline controls ===== */
.form-field {
    display: grid;
    gap: 8px;
}

.field-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #f4f6fb;
    font-weight: 800;
}

.smart-field-v56 {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.smart-field-v56 textarea,
.smart-field-v56 input[type="text"] {
    width: 100% !important;
    min-height: 84px;
    padding-right: 108px !important;
    box-sizing: border-box;
}

.smart-field-tools-v56 {
    position: absolute !important;
    right: 10px !important;
    top: 10px !important;
    z-index: 5;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: rgba(13, 17, 27, .92) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,.25);
    backdrop-filter: blur(8px);
}

.smart-tool-btn-v56 {
    width: 34px !important;
    height: 32px !important;
    min-width: 34px;
    border: 0 !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,.04) !important;
    color: #edf0ff !important;
    font: 900 13px/1 inherit !important;
    cursor: pointer;
}

.smart-tool-btn-v56:hover,
.smart-tool-btn-v56:focus-visible {
    background: rgba(139, 92, 246, .28) !important;
    color: #fff !important;
    outline: 2px solid rgba(139, 92, 246, .35);
    outline-offset: 1px;
}

.smart-popover.open {
    display: block;
}

.list-items-panel-v56 {
    margin: 14px 0 16px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 16px;
    background: rgba(9, 12, 20, .34);
}

.list-items-panel-head-v56 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.list-items-panel-head-v56 strong {
    color: #f4f6fb;
}

.list-items-panel-head-v56 small {
    color: #9aa2b8;
}

.list-items-v56 {
    display: grid;
    gap: 8px;
}

.list-item-row-v56 {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    background: rgba(15, 19, 31, .72);
}

.list-item-row-v56 span {
    overflow-wrap: anywhere;
}

.empty-list-note-v56 {
    margin: 0;
}

.list-add-details-v56 {
    margin-top: 10px;
}

.list-add-details-v56 summary {
    cursor: pointer;
}

@media (max-width: 760px) {
    .smart-field-v56 textarea,
    .smart-field-v56 input[type="text"] {
        padding-right: 16px !important;
        padding-bottom: 58px !important;
    }
    .smart-field-tools-v56 {
        top: auto !important;
        bottom: 10px !important;
    }
    .list-item-row-v56 {
        grid-template-columns: 1fr;
    }
}

/* ===== v57: smart pickers globally ===== */
.smart-field-v57 input[type="text"] {
    min-height: 44px !important;
    height: 44px;
    padding-right: 96px !important;
}

.smart-field-v57 textarea {
    padding-right: 96px !important;
}

.smart-field-v57 .smart-field-tools-v56 {
    right: 8px !important;
    top: 8px !important;
}

.smart-field-v57 input[type="text"] + .smart-field-tools-v56 {
    top: 6px !important;
}

.function-smart-popover [data-smart-functions-content] {
    display: grid;
    gap: 12px;
}

@media (max-width: 760px) {
    .smart-field-v57 input[type="text"] {
        padding-right: 14px !important;
        padding-bottom: 48px;
        height: auto;
        min-height: 88px !important;
    }
}

/* v59: floating, draggable emoji/function pickers */
.smart-popover.floating-smart-popover-v59 {
    position: fixed !important;
    z-index: 9999 !important;
    max-height: min(560px, calc(100vh - 24px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.smart-popover.floating-smart-popover-v59 .smart-popover-head {
    cursor: grab;
    user-select: none;
    flex: 0 0 auto;
}

.smart-popover.floating-smart-popover-v59.dragging .smart-popover-head {
    cursor: grabbing;
}

.smart-popover.floating-smart-popover-v59 [data-smart-functions-content],
.smart-popover.floating-smart-popover-v59 .emoji-grid.compact {
    overflow: auto;
    min-height: 0;
}

.smart-popover.floating-smart-popover-v59 [data-smart-functions-content] {
    padding-right: 2px;
}

.smart-popover.floating-smart-popover-v59 .emoji-search {
    flex: 0 0 auto;
}

.smart-popover.floating-smart-popover-v59 .emoji-grid.compact {
    max-height: min(360px, calc(100vh - 170px));
}

.smart-popover.floating-smart-popover-v59[data-placement="top"] {
    transform-origin: bottom right;
}

.smart-popover.floating-smart-popover-v59[data-placement="bottom"] {
    transform-origin: top right;
}


/* v61 maintenance banner */
.maintenance-banner {
    margin: 14px 0 18px;
    padding: 12px 14px;
    border: 1px solid rgba(245, 158, 11, .45);
    background: rgba(245, 158, 11, .10);
    color: #fde68a;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
.maintenance-banner strong {
    color: #fbbf24;
    margin-right: 6px;
}

/* v63: Owner Health controls */
.card-heading-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.compact-actions-v63 {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}
.inline-status-v63 {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(148, 163, 184, .10);
    border: 1px solid rgba(148, 163, 184, .18);
    color: #cbd5e1;
    font-size: .92rem;
}
.inline-status-v63.is-error {
    color: #fecaca;
    border-color: rgba(248, 113, 113, .35);
    background: rgba(248, 113, 113, .10);
}
.bot-control-grid-v63 strong {
    overflow-wrap: anywhere;
}
.owner-live-logs-v63 .log-box,
.live-log-box-v63 {
    max-height: 560px;
    overflow: auto;
    white-space: pre-wrap;
}
.log-filter-v63,
.log-tail-select-v63 select {
    min-height: 38px;
}
.log-filter-v63 {
    min-width: 190px;
}
.log-tail-select-v63 {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: #cbd5e1;
    font-size: .9rem;
}
.button.danger {
    background: rgba(239, 68, 68, .18);
    border-color: rgba(239, 68, 68, .38);
    color: #fecaca;
}
.button.danger:hover {
    background: rgba(239, 68, 68, .26);
}
@media (max-width: 900px) {
    .card-heading-row {
        flex-direction: column;
    }
    .compact-actions-v63 {
        justify-content: flex-start;
    }
}
