:root {
    color-scheme: dark;
    --bg: #090b0e;
    --surface: #11141b;
    --surface-soft: #171b24;
    --surface-hover: #1e2430;
    --border: #252b36;
    --border-soft: #1b2029;
    --text: #f4f6f8;
    --muted: #8892a0;
    --muted-strong: #b2b9c5;
    --accent: #e34451;
    --accent-hover: #ff4d5e;
    --accent-soft: rgba(227, 68, 81, 0.14);
    --accent-glow: rgba(227, 68, 81, 0.25);
    --green: #39b878;
    --orange: #e6a23c;
    --blue: #6578e8;
    --sidebar-width: 268px;
    --radius: 12px;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 70% -20%, rgba(227, 68, 81, 0.12), transparent 40rem),
        radial-gradient(circle at 0% 100%, rgba(227, 68, 81, 0.05), transparent 30rem),
        var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 1.2rem; height: 1.2rem; fill: currentColor; flex: 0 0 auto; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 22px 18px 18px;
    background: rgba(13, 16, 22, 0.95);
    border-right: 1px solid var(--border-soft);
    backdrop-filter: blur(20px);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 7px 8px 20px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}
.sidebar-brand img { 
    width: 44px; 
    height: 44px; 
    border-radius: 10px; 
    box-shadow: 0 0 15px var(--accent-glow);
    border: 1px solid rgba(227, 68, 81, 0.3);
}
.sidebar-brand div { display: grid; min-width: 0; }
.sidebar-brand strong { font-size: 15px; letter-spacing: .02em; font-weight: 800; text-transform: uppercase; }
.sidebar-brand span { color: var(--muted); font-size: 12px; }
.nav-section-label { padding: 0 12px 8px; color: #5c6470; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 4px; }
.nav-link, .logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--muted-strong);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all .18s ease;
}
.nav-link:hover { background: var(--surface-soft); color: var(--text); transform: translateX(2px); }
.nav-link.active { color: #fff; background: var(--accent-soft); border-left: 3px solid var(--accent); box-shadow: 0 4px 15px rgba(227, 68, 81, 0.15); }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; color: currentColor; }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 13px; min-width: 0; }
.sidebar-user img, .avatar-fallback { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.avatar-fallback { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; border: 1px solid rgba(227, 68, 81, 0.3); }
.sidebar-user-text { display: grid; min-width: 0; }
.sidebar-user-text strong, .sidebar-user-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-text strong { font-size: 13px; font-weight: 700; }
.sidebar-user-text span { color: var(--muted); font-size: 11px; }
.logout-link { color: #e0969c; }
.logout-link:hover { color: #fff; background: rgba(227, 68, 81, 0.15); }
.sidebar-backdrop { display: none; }

.main { min-height: 100vh; margin-left: var(--sidebar-width); }
.page-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 36px 42px 24px;
    border-bottom: 1px solid var(--border-soft);
}
.page-header h1 { margin: 0; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.15; letter-spacing: -.03em; font-weight: 800; }
.eyebrow, .section-kicker { margin: 0 0 5px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.page-description { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.mobile-menu { display: none; }
.page-content { padding: 32px 42px 48px; }

.card {
    background: linear-gradient(145deg, rgba(21, 25, 33, 0.9), rgba(15, 18, 24, 0.95));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.card-header h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; font-weight: 750; }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-strong); font-size: 13px; font-weight: 700; text-decoration: none; transition: color .15s; }
.text-link:hover { color: var(--accent); }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.content-grid-form { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); }
.info-card { position: sticky; top: 22px; }
.info-card > p:not(.section-kicker) { color: var(--muted); font-size: 14px; }
.soft-note { display: grid; gap: 4px; margin-top: 18px; padding: 14px; border-radius: 9px; background: rgba(101, 120, 232, 0.08); border: 1px solid rgba(101, 120, 232, 0.2); }
.soft-note strong { font-size: 13px; color: #a4b0f5; }
.soft-note span { color: var(--muted); font-size: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { min-height: 140px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: rgba(227, 68, 81, 0.4); }
.stat-card-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stat-card strong { display: block; margin-top: 14px; font-size: 34px; line-height: 1; letter-spacing: -.03em; font-weight: 800; }
.stat-card small { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }
.stat-open .stat-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(230, 162, 60, 0.15); }
.stat-closed .stat-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(57, 184, 120, 0.15); }
.stat-types .stat-dot { background: var(--blue); box-shadow: 0 0 0 4px rgba(101, 120, 232, 0.15); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group-wide { grid-column: 1 / -1; }
label { color: var(--muted-strong); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
input, textarea, select {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    color: var(--text);
    background: #0b0e13;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: all .18s ease;
}
textarea { resize: vertical; min-height: 104px; }
input::placeholder, textarea::placeholder { color: #525a66; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #0f1218; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
button, .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #fff;
    background: var(--accent);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(227, 68, 81, 0.25);
    transition: all .18s ease;
}
button:hover, .btn-link:hover { transform: translateY(-1px); background: var(--accent-hover); box-shadow: 0 6px 20px rgba(227, 68, 81, 0.35); }
button:active, .btn-link:active { transform: translateY(0); }
button.secondary { background: var(--surface-soft); border-color: var(--border); color: var(--muted-strong); box-shadow: none; }
button.secondary:hover { background: var(--surface-hover); border-color: #3b4352; color: #fff; }
button.danger { background: rgba(227, 68, 81, 0.12); border-color: rgba(227, 68, 81, 0.3); color: #ff858e; box-shadow: none; }
button.danger:hover { background: rgba(227, 68, 81, 0.22); border-color: var(--accent); color: #fff; }
.full-width { width: 100%; }

.table-wrapper { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; min-width: 700px; }
.table th { padding: 14px 16px; color: var(--muted); background: rgba(9, 11, 14, 0.6); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border-soft); }
.table td { padding: 14px 16px; border-top: 1px solid var(--border-soft); color: var(--text); font-size: 13px; vertical-align: middle; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.align-right { text-align: right !important; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.type-cell { display: flex; align-items: center; gap: 12px; }
.type-emoji { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--surface-hover); border: 1px solid var(--border); font-size: 18px; }
.type-cell strong { display: block; color: var(--text); font-weight: 700; }
.type-cell small { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--surface-hover); color: var(--muted-strong); border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.enabled { color: #4ade80; background: rgba(57, 184, 120, 0.12); border-color: rgba(57, 184, 120, 0.25); }
.badge.status-closed { color: #a1a1aa; background: rgba(161, 161, 170, 0.1); border-color: rgba(161, 161, 170, 0.2); }
.badge.disabled { color: #ff7b86; background: rgba(227, 68, 81, 0.12); border-color: rgba(227, 68, 81, 0.25); }
.badge.status-new { color: #ff7b86; background: rgba(227, 68, 81, 0.12); border-color: rgba(227, 68, 81, 0.25); }
.badge.status-claimed { color: #4ade80; background: rgba(57, 184, 120, 0.12); border-color: rgba(57, 184, 120, 0.25); }
.badge.status-waiting { color: #fbbf24; background: rgba(230, 162, 60, 0.12); border-color: rgba(230, 162, 60, 0.25); }
.empty-state { padding: 32px; color: var(--muted); text-align: center; font-size: 14px; }
.mono { color: var(--muted-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; }

.filters { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.filters select { width: 180px; min-height: 40px; }
.search-field { position: relative; display: block; width: min(340px, 34vw); }
.search-field > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; }
.search-field input { min-height: 40px; padding-left: 38px; }

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 36px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.login-card img { width: 74px; height: 74px; border-radius: 16px; box-shadow: 0 0 20px var(--accent-glow); }
.login-card h1 { margin: 20px 0 8px; font-size: 26px; font-weight: 800; }
.login-card p { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.discord-login { width: 100%; background: #5865f2; box-shadow: 0 4px 14px rgba(88, 101, 242, 0.3); }
.discord-login:hover { background: #4752c4; box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4); }

@media (max-width: 1180px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .content-grid-form { grid-template-columns: 1fr; }
    .info-card { position: static; }
}
@media (max-width: 960px) {
    .sidebar { transform: translateX(-102%); box-shadow: 20px 0 50px rgba(0,0,0,0.6); transition: transform .25s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.visible { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
    .main { margin-left: 0; }
    .mobile-menu { display: inline-flex; width: 42px; padding: 0; background: var(--surface); border-color: var(--border); box-shadow: none; }
    .page-header, .page-content { padding-left: 24px; padding-right: 24px; }
    .content-grid, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .page-header { padding: 24px 16px 20px; }
    .page-content { padding: 20px 16px 34px; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 120px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group-wide { grid-column: auto; }
    .card { padding: 18px; border-radius: 10px; }
    .card-header-responsive { align-items: stretch; flex-direction: column; }
    .filters { width: 100%; margin-left: 0; align-items: stretch; flex-direction: column; }
    .filters select, .search-field { width: 100%; }
    .actions { justify-content: flex-start; }
}

.settings-switches {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.switch-row:hover {
    background: var(--surface-soft);
    border-color: #353d4d;
}

.switch-row > span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.switch-row strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.switch-row small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.input-suffix {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-suffix input {
    flex: 1;
}

.input-suffix span {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

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

    .switch-row {
        align-items: flex-start;
    }
}

.status-settings-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.status-setting {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.status-setting-title {
    display: block;
    margin-bottom: 12px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.status-setting-fields {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
}

.status-setting-fields > input,
.emoji-input-wrapper input {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    color: var(--text);
    background: #0b0e13;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: all 0.18s ease;
}

.status-setting-fields > input:focus,
.emoji-input-wrapper input:focus {
    background: #0f1218;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.emoji-input-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
}

.emoji-input-wrapper input {
    font-size: 20px;
    text-align: center;
}

.emoji-picker-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    color: #ffffff;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 19px;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.18s ease;
}

.emoji-picker-button:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.emoji-picker {
    position: fixed;
    z-index: 1000;
    width: 340px;
    max-width: calc(100vw - 32px);
    padding: 14px;
    background: #141821;
    border: 1px solid #2d3545;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.emoji-picker[hidden] {
    display: none;
}

.emoji-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.emoji-picker-header strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.emoji-picker-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: none;
}

.emoji-picker-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.emoji-picker-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.15s ease;
}

.emoji-picker-item:hover {
    background: var(--surface-hover);
    transform: scale(1.15);
}

@media (max-width: 700px) {
    .status-setting-fields {
        grid-template-columns: 1fr;
    }

    .emoji-picker {
        left: 16px !important;
        right: 16px !important;
        width: auto;
    }
}

.switch-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ios-switch {
    position: relative;
    display: inline-block;
    flex: 0 0 50px;
    width: 50px;
    height: 28px;
}

/* La vraie checkbox reste fonctionnelle, mais devient invisible. */
.ios-switch > input[type="checkbox"] {
    position: absolute !important;
    inset: 0 !important;
    z-index: 2;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    cursor: pointer;
}

/* Track OFF */
.ios-switch-track {
    position: absolute;
    inset: 0;
    display: block;
    width: 50px;
    height: 28px;
    background: #222733;
    border: 1px solid #333b4d;
    border-radius: 999px;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transition: all 0.25s ease;
}

/* Bouton blanc */
.ios-switch-track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #e6e6e6 100%);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Track ON */
.ios-switch > input[type="checkbox"]:checked + .ios-switch-track {
    background: linear-gradient(180deg, #ff4d5e 0%, #e34451 100%);
    border-color: #ff4d5e;
    box-shadow: 0 0 12px rgba(227, 68, 81, 0.35);
}

/* Déplacement du bouton */
.ios-switch > input[type="checkbox"]:checked + .ios-switch-track::before {
    transform: translateX(22px);
}

/* Hover */
.ios-switch:hover .ios-switch-track {
    border-color: #4a556b;
}

.ios-switch:hover > input[type="checkbox"]:checked + .ios-switch-track {
    border-color: #ff6876;
}

/* Navigation clavier */
.ios-switch > input[type="checkbox"]:focus-visible + .ios-switch-track {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Désactivé */
.ios-switch > input[type="checkbox"]:disabled + .ios-switch-track {
    opacity: 0.4;
    cursor: not-allowed;
}

.availability-group {
    grid-column: 1 / -1;
}

.availability-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 70px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.availability-row:hover {
    background: var(--surface-soft);
    border-color: #353d4d;
}

.availability-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.availability-content strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.availability-content small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.discord-logs-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.discord-log-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 0.85fr);
    align-items: center;
    gap: 24px;
    min-height: 80px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.discord-log-row:hover {
    background: var(--surface-soft);
    border-color: #353d4d;
}

.discord-log-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.discord-log-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    background: #0b0e13;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 20px;
}

.discord-log-info > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.discord-log-info strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.discord-log-info small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.discord-log-controls {
    display: grid;
    grid-template-columns: 50px minmax(200px, 1fr);
    align-items: center;
    gap: 16px;
}

.discord-log-controls select,
#globalLogChannel {
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    color: var(--text);
    background-color: #0b0e13;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: all 0.18s ease;
}

.discord-log-controls select:focus,
#globalLogChannel:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #0f1218;
}

.logs-global-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) auto;
    align-items: end;
    gap: 20px;
    margin-top: 20px;
}

.logs-global-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.secondary-button {
    min-height: 42px;
    padding: 0 16px;
    color: var(--muted-strong);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.18s ease;
}

.secondary-button:hover {
    background: var(--surface-hover);
    border-color: #3b4352;
    color: #ffffff;
}

.secondary-button.danger-soft {
    color: #ff858e;
    background: rgba(227, 68, 81, 0.08);
    border-color: rgba(227, 68, 81, 0.25);
}

.secondary-button.danger-soft:hover {
    background: rgba(227, 68, 81, 0.18);
    border-color: var(--accent);
    color: #ffffff;
}

.logs-save-actions {
    margin-top: 20px;
}

.logs-loading,
.logs-error {
    padding: 24px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
}

.logs-error {
    color: #ff7b86;
    border-color: rgba(227, 68, 81, 0.3);
    background: rgba(227, 68, 81, 0.05);
}

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

    .logs-global-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .discord-log-controls {
        grid-template-columns: 50px 1fr;
    }

    .logs-global-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .logs-global-actions button {
        width: 100%;
    }
}

/* Suggestions */
.suggestion-help { color: var(--muted); line-height: 1.6; margin: 0 0 18px; font-size: 14px; }
.suggestion-help code { color: #e9edf3; background: #0b0e13; border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; }
.suggestion-role-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.suggestion-role { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.18s ease; }
.suggestion-role:hover { border-color: #3b4352; background: var(--surface-soft); }
.suggestion-role input { width: 18px; height: 18px; accent-color: var(--accent); }
.suggestion-role span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.suggestion-role small { color: var(--muted); font-family: ui-monospace, SFMono-Regular, monospace; }
.suggestion-count { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--accent-soft); color: #ff858e; font-weight: 800; border: 1px solid rgba(227, 68, 81, 0.25); }

/* Automatisation */
.automation-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.automation-tab { border: 0; background: transparent; color: var(--muted); padding: 10px 16px; border-radius: 7px; font-weight: 700; cursor: pointer; box-shadow: none; transition: all 0.18s ease; }
.automation-tab.active { background: var(--surface-hover); color: #fff; border: 1px solid var(--border); }
.automation-panel { display: none; }
.automation-panel.active { display: block; }
.automation-help { color: var(--muted); line-height: 1.6; font-size: 13px; }
.automation-help code { color: #e9edf3; background: #0b0e13; border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; font-family: ui-monospace, SFMono-Regular, monospace; }
.automation-list { display: grid; gap: 12px; }
.automation-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.automation-item > div:first-child { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.automation-item small { color: var(--muted); }
.automation-item-actions { display: flex; gap: 8px; }
.automation-badge { font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.automation-badge.on { color: #4ade80; background: rgba(57, 184, 120, 0.12); border: 1px solid rgba(57, 184, 120, 0.25); }
.automation-badge.off { color: #ff7b86; background: rgba(227, 68, 81, 0.12); border: 1px solid rgba(227, 68, 81, 0.25); }
.automation-two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.automation-check-list { max-height: 260px; overflow-y: auto; display: grid; gap: 8px; padding: 10px; background: #0b0e13; border: 1px solid var(--border); border-radius: 9px; }
.automation-check-list.wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-height: 320px; }
.automation-check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border-radius: 7px; color: var(--text); cursor: pointer; border: 1px solid var(--border-soft); transition: border-color .15s; }
.automation-check:hover { border-color: #3b4352; }
.automation-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.compact-switch { margin: 0; }
.form-group textarea { width: 100%; resize: vertical; min-height: 96px; }
.form-group input[type=color] { height: 44px; padding: 4px; cursor: pointer; }
.automation-panel h3 { margin: 20px 0 10px; color: var(--text); font-size: 15px; font-weight: 750; }
@media (max-width: 800px) {
    .automation-two-columns { grid-template-columns: 1fr; }
    .automation-item { align-items: flex-start; flex-direction: column; }
    .automation-item-actions { width: 100%; }
    .automation-item-actions button { flex: 1; }
}

/* Moderation */
.danger-banner { display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px; padding: 18px 20px; border: 1px solid rgba(227, 68, 81, 0.5); border-radius: 10px; background: rgba(227, 68, 81, 0.08); color: #ffe3e5; }
.danger-banner strong { font-size: 1.05rem; color: #ff7b86; font-weight: 800; }
.danger-banner span { line-height: 1.55; font-size: 14px; }
.honeypot-preview { margin: 20px 0; padding: 24px; border: 2px dashed var(--accent); border-radius: 12px; background: rgba(13, 10, 13, 0.9); text-align: center; }
.honeypot-preview h2 { color: #ff6671; font-size: 1.35rem; margin: 0; }
.honeypot-preview h3 { color: #fff; margin: 14px 0; font-size: 1.1rem; }
.honeypot-preview p { color: var(--muted); margin: 0; font-size: 14px; }
.danger-confirm { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 8px; background: #140d11; border: 1px solid rgba(227, 68, 81, 0.3); color: #ffe3e5; cursor: pointer; font-size: 13px; }
.danger-confirm input { margin-top: 2px; accent-color: var(--accent); }
.moderation-tabs { position: sticky; top: 10px; z-index: 5; }

/* AutoMod rule editor */
.automod-detector-box { margin: 20px 0; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.automod-detector-box h3 { margin-top: 0; font-size: 16px; }
.rule-field[hidden] { display: none !important; }
.reset-inline { display: grid; grid-template-columns: minmax(180px, 1fr) 110px 150px; gap: 12px; align-items: end; }
.reset-inline label { grid-column: 1 / -1; }
.escalation-builder { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.escalation-card { display: grid; grid-template-columns: 32px 92px minmax(220px, 1fr) 42px; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: all 0.18s ease; }
.escalation-card.dragging { opacity: 0.5; border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); }
.escalation-drag { font-size: 20px; cursor: grab; user-select: none; text-align: center; color: var(--muted); }
.escalation-drag:active { cursor: grabbing; }
.escalation-number { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; }
.escalation-main { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr); gap: 12px; align-items: end; }
.escalation-main > label, .esc-duration > label { display: block; margin-bottom: 6px; }
.esc-duration[hidden] { display: none !important; }
.duration-row { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.esc-remove { min-width: 38px; padding: 8px; font-size: 18px; box-shadow: none; }
@media (max-width: 760px) {
    .reset-inline, .escalation-card, .escalation-main { grid-template-columns: 1fr; }
    .escalation-drag { display: none; }
    .duration-row { grid-template-columns: 1fr 1fr; }
}