/* ==========================================================
   Open Ticket Dashboard - Styles
   ========================================================== */

:root {
    /* ==========================================================
       Farbpalette - "Kristallpalast"
       Tiefes Mitternachtsblau mit elektrischem Cyan,
       violette Kristall-Akzente und eisige Highlights.
       ========================================================== */

    /* --- Hintergründe (tiefes Nachtblau) --- */
    --bg: #050a16;
    --bg-elev: #0a1224;
    --bg-elev-2: #101a30;
    --bg-elev-3: #16233d;

    /* --- Rahmen (kristallines Blau) --- */
    --border: #16294d;
    --border-light: #1f3a68;
    --border-glow: rgba(88, 214, 255, 0.28);

    /* --- Text (eisige Highlights) --- */
    --text: #dff2ff;
    --text-dim: #8fb3d9;
    --text-faint: #5a7ba8;

    /* --- Akzent: elektrisches Cyan (Hauptfarbe) --- */
    --accent: #4fd8ff;
    --accent-dim: rgba(79, 216, 255, 0.13);
    --accent-glow: rgba(79, 216, 255, 0.45);

    /* --- Sekundär: Violett (Kristall) --- */
    --purple: #9d7bff;
    --purple-dim: rgba(157, 123, 255, 0.13);

    /* --- Statusfarben --- */
    --blue: #3b8dff;
    --green: #2ee6a8;
    --red: #ff4d6d;
    --orange: #ff9d4d;

    /* --- Chartfarben (Reihenfolge) --- */
    --chart-1: #4fd8ff;
    --chart-2: #9d7bff;
    --chart-3: #2ee6a8;
    --chart-4: #ff9d4d;
    --chart-5: #3b8dff;
    --chart-6: #ff4d6d;
    --chart-7: #6ee7f9;
    --chart-8: #c4a3ff;

    /* --- Maße --- */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(79, 216, 255, 0.12);
    --sidebar-w: 240px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79, 216, 255, 0.09), transparent 60%),
        radial-gradient(ellipse 60% 45% at 15% 105%, rgba(157, 123, 255, 0.07), transparent 60%),
        radial-gradient(ellipse 50% 40% at 90% 80%, rgba(59, 141, 255, 0.05), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ==========================================================
   Scrollbars & Auswahl (Kristall-Look)
   ========================================================== */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
    background-clip: content-box;
    box-shadow: 0 0 8px var(--accent-glow);
}

::selection {
    background: rgba(79, 216, 255, 0.3);
    color: #ffffff;
}

/* ==========================================================
   Login
   ========================================================== */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 70% 55% at 50% 0%, rgba(79, 216, 255, 0.14), transparent 65%),
        radial-gradient(ellipse 55% 45% at 20% 100%, rgba(157, 123, 255, 0.11), transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 90%, rgba(59, 141, 255, 0.08), transparent 60%),
        linear-gradient(180deg, #03060e 0%, var(--bg) 45%, #060c1c 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* the light beam of the crystal in the middle of the image */
.login-screen::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 55%;
    background: linear-gradient(180deg, rgba(79, 216, 255, .55), transparent);
    box-shadow: 0 0 24px 4px rgba(79, 216, 255, .28);
    pointer-events: none;
}

/* the glowing crystal shards on both sides */
.login-screen::after {
    content: "";
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    height: 340px;
    background:
        conic-gradient(from 0deg at 50% 38%,
            transparent 0deg, rgba(79, 216, 255, .16) 18deg, transparent 40deg,
            transparent 180deg, rgba(157, 123, 255, .13) 200deg, transparent 220deg);
    filter: blur(22px);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: linear-gradient(160deg, rgba(16, 26, 48, 0.92), rgba(8, 14, 30, 0.94));
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(79, 216, 255, 0.06),
        0 0 40px rgba(79, 216, 255, 0.09);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

/* the shimmering crystal line at the top of the card */
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.login-logo {
    font-size: 44px;
    text-align: center;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 16px rgba(79, 216, 255, .65)) drop-shadow(0 0 34px rgba(157, 123, 255, .4));
    animation: crystal-pulse 4s ease-in-out infinite;
}

/* the crystal breathes gently */
@keyframes crystal-pulse {
    0%, 100% { filter: drop-shadow(0 0 14px rgba(79, 216, 255, .55)) drop-shadow(0 0 30px rgba(157, 123, 255, .35)); }
    50% { filter: drop-shadow(0 0 20px rgba(79, 216, 255, .8)) drop-shadow(0 0 44px rgba(157, 123, 255, .55)); }
}

.login-card h1 {
    margin: 0;
    font-size: 20px;
    text-align: center;
    font-weight: 600;
}

.login-sub {
    margin: 2px 0 26px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.field {
    display: block;
    margin-bottom: 16px;
}

.field span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(5, 10, 22, 0.7);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim), 0 0 16px rgba(79, 216, 255, .18);
}

.login-error {
    margin-top: 16px;
    padding: 10px 12px;
    background: rgba(255, 77, 109, 0.12);
    border: 1px solid rgba(255, 77, 109, 0.35);
    border-radius: var(--radius-sm);
    color: #ff8fa3;
    font-size: 13px;
    text-align: center;
}

/* technische Details zum Fehler (z. B. Discord-Fehlermeldung) */
.login-error-detail {
    margin-top: 8px;
    padding: 9px 12px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.login-info {
    margin-top: 16px;
    padding: 10px 12px;
    background: rgba(46, 230, 168, 0.1);
    border: 1px solid rgba(46, 230, 168, 0.3);
    border-radius: var(--radius-sm);
    color: #6ef0c4;
    font-size: 13px;
    text-align: center;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-faint);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-discord {
    background: #5865f2;
    border-color: #5865f2;
    color: #fff;
    font-weight: 600;
}

.btn-discord:hover:not(:disabled) {
    background: #4752c4;
    border-color: #4752c4;
}

/* ==========================================================
   Layout
   ========================================================== */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background:
        linear-gradient(180deg, rgba(10, 18, 36, 0.96) 0%, rgba(6, 11, 24, 0.98) 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 1px 0 0 rgba(79, 216, 255, 0.05), 8px 0 30px rgba(0, 0, 0, 0.35);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

/* the glowing crystal seam under the brand */
.sidebar-brand::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: .5;
}

.brand-icon { font-size: 26px; filter: drop-shadow(0 0 8px var(--accent-glow)); }
.brand-name { font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--text-faint); letter-spacing: .08em; text-transform: uppercase; }

.nav {
    flex: 1;
    padding: 14px 10px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s, color .12s, box-shadow .12s;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-elev-2);
    color: var(--text);
}

.nav-item.active {
    background: linear-gradient(90deg, var(--accent-dim), rgba(157, 123, 255, 0.05));
    color: var(--accent);
    box-shadow: inset 2px 0 0 var(--accent), 0 0 14px rgba(79, 216, 255, 0.08);
}

.nav-icon { width: 16px; text-align: center; opacity: .85; }
.nav-item.active .nav-icon { opacity: 1; filter: drop-shadow(0 0 6px var(--accent-glow)); }

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--border);
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-dim);
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-faint);
    flex-shrink: 0;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(46, 230, 168, .16), 0 0 8px rgba(46, 230, 168, .5); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 77, 109, .16); }

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 62px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.page-title { margin: 0; font-size: 17px; font-weight: 600; flex: 1; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.menu-toggle { display: none; }

.content {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
}

.view { display: none; }
.view.active { display: block; animation: fade .18s ease; }

@keyframes fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* ==========================================================
   Cards & Grid
   ========================================================== */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.card {
    background: linear-gradient(165deg, rgba(16, 26, 48, 0.72), rgba(8, 14, 30, 0.86));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(79, 216, 255, 0.05);
    backdrop-filter: blur(6px);
}

.grid-2 > .card { margin-bottom: 0; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.card-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.chart-wrap { padding: 16px 18px; min-height: 220px; }

.legend { display: flex; gap: 14px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.dot-created { background: var(--blue); }
.dot-closed { background: var(--green); }

/* ==========================================================
   KPI
   ========================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.kpi {
    background: linear-gradient(160deg, rgba(16, 26, 48, 0.7), rgba(8, 14, 30, 0.85));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(79, 216, 255, 0.06);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.kpi:hover {
    border-color: var(--border-light);
    box-shadow: 0 6px 26px rgba(0, 0, 0, 0.4), 0 0 22px rgba(79, 216, 255, 0.09);
    transform: translateY(-1px);
}

/* the glowing crystal seam on the left edge */
.kpi::after {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.kpi.k-blue::after { background: var(--blue); box-shadow: 0 0 12px rgba(59, 141, 255, .5); }
.kpi.k-green::after { background: var(--green); box-shadow: 0 0 12px rgba(46, 230, 168, .5); }
.kpi.k-red::after { background: var(--red); box-shadow: 0 0 12px rgba(255, 77, 109, .5); }
.kpi.k-orange::after { background: var(--orange); box-shadow: 0 0 12px rgba(255, 157, 77, .5); }
.kpi.k-purple::after { background: var(--purple); box-shadow: 0 0 12px rgba(157, 123, 255, .5); }

.kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint);
    font-weight: 600;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 27px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.kpi-sub {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-dim);
}

.skeleton {
    min-height: 92px;
    background: linear-gradient(90deg, var(--bg-elev) 25%, var(--bg-elev-2) 50%, var(--bg-elev) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* ==========================================================
   Buttons & Inputs
   ========================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-elev-2);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s, border-color .12s, opacity .12s;
    white-space: nowrap;
}

.btn:hover:not(:disabled) { background: var(--border); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1400;
    font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #ffcb1a; border-color: #ffcb1a; }

.btn-ghost { background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-elev-2); }

.btn-danger { background: rgba(255, 77, 109, .14); border-color: rgba(255, 77, 109, .4); color: #ff8fa3; }
.btn-danger:hover:not(:disabled) { background: rgba(255, 77, 109, .24); }

.btn-success { background: rgba(46, 230, 168, .14); border-color: rgba(46, 230, 168, .4); color: #6ef0c4; }
.btn-success:hover:not(:disabled) { background: rgba(46, 230, 168, .24); }

.btn-icon {
    padding: 8px 10px;
    min-width: 36px;
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.input, .select {
    padding: 8px 11px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.input:focus, .select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.select { cursor: pointer; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.toolbar .input { flex: 1; min-width: 220px; }

/* ==========================================================
   Tables
   ========================================================== */

.table-wrap { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-faint);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--text); }
.table th.sorted { color: var(--accent); }

.table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(22, 41, 77, .55);
    vertical-align: middle;
}

.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(79, 216, 255, .045); }
.table tbody tr:last-child td { border-bottom: none; }

.col-actions { text-align: right; }
.mono { font-family: var(--mono); font-size: 12px; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.nowrap { white-space: nowrap; }

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
}

/* ==========================================================
   Badges
   ========================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-open { background: rgba(46,230,168,.14); color: #6ef0c4; border-color: rgba(46,230,168,.3); }
.badge-closed { background: rgba(152,160,179,.14); color: var(--text-dim); border-color: rgba(152,160,179,.3); }
.badge-claimed { background: rgba(59,141,255,.14); color: #7bb8ff; border-color: rgba(59,141,255,.3); }
.badge-unclaimed { background: rgba(255,159,69,.14); color: #ffb877; border-color: rgba(255,159,69,.3); }
.badge-pinned { background: rgba(167,139,250,.14); color: #c4aeff; border-color: rgba(167,139,250,.3); }
.badge-reopened { background: rgba(79, 216, 255, .14); color: #4fd8ff; border-color: rgba(79, 216, 255, .3); }

.prio { font-weight: 600; white-space: nowrap; }
.prio-5 { color: #ff7b7f; }
.prio-4 { color: #ff9d4d; }
.prio-3 { color: #ffd23f; }
.prio-2 { color: #6ef0c4; }
.prio-1 { color: #7bb8ff; }
.prio-0 { color: var(--text-dim); }
.prio--1 { color: var(--text-faint); }

/* ==========================================================
   Pagination
   ========================================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-dim);
}

.pagination-buttons { display: flex; gap: 6px; }

/* ==========================================================
   Modal
   ========================================================== */

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.66); backdrop-filter: blur(2px); }

.modal-box {
    position: relative;
    width: 100%;
    max-width: 620px;
    max-height: 86vh;
    background: var(--bg-elev);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    animation: pop .16s ease;
}

@keyframes pop {
    from { opacity: 0; transform: scale(.97); }
    to { opacity: 1; transform: none; }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.modal-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(110px, auto) 1fr;
    gap: 9px 16px;
    font-size: 13px;
}

.detail-grid dt { color: var(--text-faint); font-size: 12px; }
.detail-grid dd { margin: 0; word-break: break-word; }

.section-title {
    margin: 20px 0 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint);
    font-weight: 600;
}
.section-title:first-child { margin-top: 0; }

/* ==========================================================
   Toasts
   ========================================================== */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-width: 360px;
}

.toast {
    padding: 11px 15px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--blue);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 13px;
    animation: slidein .18s ease;
}

.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--orange); }

@keyframes slidein {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: none; }
}

/* ==========================================================
   Chart elements (pure SVG / CSS)
   ========================================================== */

.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-dim);
}

.chart-legend .legend-item { display: flex; align-items: center; gap: 7px; }

.bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 150px) 1fr auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 9px;
    font-size: 13px;
}

.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.bar-track { height: 9px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transition: width .35s ease; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 34px; text-align: right; }

.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }
.donut-center { text-align: center; }

.tooltip {
    position: fixed;
    z-index: 300;
    padding: 7px 11px;
    background: #0b0d13;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
    pointer-events: none;
    box-shadow: var(--shadow);
    white-space: nowrap;
    opacity: 0;
    transition: opacity .1s;
}
.tooltip.visible { opacity: 1; }

/* ==========================================================
   Config Editor
   ========================================================== */

.config-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.config-tab {
    padding: 5px 12px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dim);
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all .12s;
}

.config-tab:hover { color: var(--text); border-color: var(--text-faint); }
.config-tab.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.config-tab .tab-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 5px; }
.config-tab .tab-dot.ok { background: var(--green); }
.config-tab .tab-dot.err { background: var(--red); }

.config-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.config-info { font-size: 12px; color: var(--text-dim); }
.config-info strong { color: var(--text); font-weight: 600; }

.config-actions { display: flex; gap: 7px; }

.editor-wrap { padding: 0; }

.editor {
    width: 100%;
    min-height: 480px;
    padding: 16px 18px;
    background: #0b0d13;
    border: none;
    border-bottom: 1px solid var(--border);
    color: #d6deeb;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.65;
    resize: vertical;
    tab-size: 4;
}

.editor:focus { outline: none; }
.editor:disabled { opacity: .5; cursor: not-allowed; }

.config-status {
    padding: 10px 18px;
    font-size: 12.5px;
    display: none;
}

.config-status.show { display: block; }
.config-status.ok { background: rgba(46, 230, 168, .1); color: #6ef0c4; }
.config-status.err { background: rgba(255, 77, 109, .1); color: #ff8fa3; }
.config-status.info { background: rgba(79, 216, 255, .1); color: #7bdcff; }
.config-status.warn { background: rgba(255, 157, 77, .12); color: #ffb56b; }

/* ==========================================================
   Config Form Editor
   ========================================================== */

.config-list-head {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 420px;
    /* both columns have the same height -> each one scrolls on its own */
    align-items: stretch;
}

/* the editor panel must fill its grid column */
.config-list-head > .config-editor-panel {
    grid-column: 2;
    width: 100%;
    max-width: 100%;
}

/* no item list -> the editor uses the full width */
.config-list-head-single {
    grid-template-columns: minmax(0, 1fr);
}

.config-list-head-single > .config-editor-panel {
    grid-column: 1;
}

.config-list {
    padding: 14px;
    border-right: 1px solid var(--border);
    background: var(--bg);
    overflow-y: auto;
    max-height: 70vh;
    min-width: 0;
    /* the list scrolls on its own - even when it is shorter than the panel */
    align-self: stretch;
    height: 100%;
}

.config-list-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 13px;
    margin-bottom: 7px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: border-color .12s, background .12s;
    position: relative;
}

.config-list-item:hover {
    border-color: var(--accent);
    background: var(--bg-elev-2);
}

.config-list-item-title {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 3px;
    padding-right: 18px;
}

.config-list-item-sub {
    font-size: 11.5px;
    color: var(--text-faint);
    font-family: var(--mono);
}

.config-list-item-arrow {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 17px;
}

.config-editor-panel {
    padding: 16px 18px;
    overflow-y: auto;
    max-height: 70vh;
    min-width: 0;
    width: 100%;
    /* fill the grid row so that the list next to it has the same height */
    align-self: stretch;
}

/* the form on the left, the preview on the right */
.config-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 18px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

/* if the preview is hidden there must be no empty column for it */
.config-body:has(> .config-preview.hidden) {
    grid-template-columns: minmax(0, 1fr);
}

/* the plugin editor has no preview column -> use the full width */
.config-body-single {
    grid-template-columns: minmax(0, 1fr);
}

.config-groups { min-width: 0; width: 100%; }

.config-preview {
    position: sticky;
    top: 0;
    padding: 13px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.config-editor-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.config-editor-title {
    font-size: 15px;
    font-weight: 600;
}

.config-editor-sub {
    font-size: 11.5px;
    color: var(--text-faint);
    font-family: var(--mono);
}

.config-editor-actions { margin-left: auto; }

/* --- collapsible sections --- */
.form-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    background: var(--bg-elev);
    overflow: hidden;
}

.form-section > summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background .12s;
}

.form-section > summary::-webkit-details-marker { display: none; }
.form-section > summary:hover { background: var(--bg-elev-2); }

.form-section[open] > summary { border-bottom: 1px solid var(--border); }

.form-section-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.form-section-desc {
    font-size: 11.5px;
    color: var(--text-faint);
    margin-top: 2px;
}

.form-section-arrow {
    margin-left: auto;
    color: var(--text-faint);
    transition: transform .15s;
}

.form-section[open] .form-section-arrow { transform: rotate(180deg); }

.form-section-body { padding: 15px; }

/* --- grid & fields --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px 16px;
}

.form-field-wide { grid-column: 1 / -1; }

.form-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 5px;
    letter-spacing: .02em;
}

.form-field .req { color: var(--red); }

.form-field input[type="text"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-field textarea { resize: vertical; min-height: 60px; }

.char-count {
    font-size: 10.5px;
    color: var(--text-faint);
    text-align: right;
    margin-top: 3px;
}

/* --- toggle --- */
/* the specificity has to beat ".form-field label" (0,1,1), otherwise the
   toggles inside a repeater are rendered as plain block labels */
label.form-toggle,
.form-field label.form-toggle,
.form-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.form-toggle input { display: none; }

.toggle-track {
    width: 38px;
    height: 21px;
    border-radius: 11px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border-light);
    position: relative;
    transition: background .15s, border-color .15s, box-shadow .15s;
    flex-shrink: 0;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--text-faint);
    transition: transform .15s, background .15s, box-shadow .15s;
}

.form-toggle input:checked + .toggle-track {
    background: linear-gradient(135deg, rgba(79, 216, 255, .35), rgba(157, 123, 255, .25));
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(79, 216, 255, .25);
}

.form-toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(17px);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.form-label { font-size: 13px; color: var(--text); }

/* --- number stepper --- */
.number-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.number-row input {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* --- color --- */
.color-row { display: flex; gap: 7px; align-items: center; }

.color-row input[type="color"] {
    width: 42px;
    height: 36px;
    padding: 2px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}

.color-row input[type="text"] { flex: 1; }

/* --- emoji --- */
.emoji-row { display: flex; gap: 7px; align-items: center; }
.emoji-row input { flex: 1; text-align: center; }

/* the input opens the picker -> make that visible */
.emoji-row input[data-emoji-picker] {
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.emoji-row input[data-emoji-picker]:hover,
.emoji-row input.emoji-input-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.emoji-hint {
    margin-top: 4px;
    font-size: 10.5px;
    color: var(--text-faint);
}

.emoji-preview {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 18px;
}

/* --- emoji picker --- */
.emoji-picker {
    position: absolute;
    z-index: 1000;
    width: 320px;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
    overflow: hidden;
}

.emoji-picker-search {
    padding: 9px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.emoji-picker-search-input {
    width: 100%;
    padding: 7px 10px;
    background: var(--bg-elev);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
}

.emoji-picker-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.emoji-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.emoji-picker-section { margin-bottom: 10px; }
.emoji-picker-section:last-child { margin-bottom: 0; }

.emoji-picker-section-title {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 5px;
}

.emoji-picker-section-icon {
    font-size: 12px;
    line-height: 1;
    filter: grayscale(1);
    opacity: .8;
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 3px;
}

.emoji-picker-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transition: background .1s, border-color .1s, transform .1s;
}

.emoji-picker-item:hover {
    background: var(--bg-elev-2);
    border-color: var(--accent);
    transform: scale(1.12);
}

.emoji-picker-item:active { transform: scale(.95); }

.emoji-picker-empty {
    padding: 22px 10px;
    text-align: center;
    color: var(--text-faint);
    font-size: 12.5px;
}

/* --- tags --- */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 7px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    min-height: 40px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px 3px 9px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 20px;
    font-size: 12px;
    font-family: var(--mono);
}

/* an ID that does not exist in the referenced config */
.tag-chip-invalid {
    background: rgba(255, 77, 109, .12);
    border-color: var(--red);
    color: #ff8fa3;
}

.tag-chip-invalid .tag-remove { color: #ff8fa3; }

.tag-warning {
    margin-top: 6px;
    padding: 7px 10px;
    background: rgba(255, 77, 109, .1);
    border: 1px solid rgba(255, 77, 109, .32);
    border-radius: var(--radius-sm);
    color: #ff8fa3;
    font-size: 11.5px;
    line-height: 1.5;
}

.tag-warning code {
    font-family: var(--mono);
    font-size: 11px;
    padding: 1px 4px;
    background: rgba(255, 77, 109, .16);
    border-radius: 3px;
}

.tag-remove {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0 2px;
}

.tag-input {
    flex: 1;
    min-width: 160px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    padding: 3px;
}

.tag-input:focus { outline: none; }

.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.tag-suggestion {
    padding: 3px 9px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 11.5px;
    font-family: inherit;
    cursor: pointer;
    transition: all .12s;
}

.tag-suggestion:hover { border-color: var(--accent); color: var(--accent); }

/* --- choice list ("a OR b OR c") --- */
.choice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.choice-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    cursor: pointer;
    transition: all .12s;
    user-select: none;
}

.choice-option:hover { border-color: var(--text-faint); }

.choice-option input { accent-color: var(--accent); margin: 0; }

.choice-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

/* --- group --- */
.form-group {
    grid-column: 1 / -1;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    padding: 13px;
    background: rgba(255, 255, 255, .012);
}

.form-group-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-faint);
    margin-bottom: 11px;
}

/* --- repeater --- */
.repeater { margin-bottom: 10px; }

.repeater-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 9px;
    background: var(--bg);
    overflow: hidden;
}

.repeater-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--bg-elev-2);
    border-bottom: 1px solid var(--border);
}

.repeater-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
}

.repeater-actions { margin-left: auto; display: flex; gap: 5px; }
.repeater-item > .form-grid { padding: 13px; }

/* --- permissions --- */
.perm-hint {
    font-size: 11.5px;
    color: var(--text-faint);
    margin-bottom: 11px;
    padding: 8px 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.perm-hint code {
    background: var(--bg-elev-2);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 11px;
}

.perm-row {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 7px;
}

.perm-name {
    font-size: 12.5px;
    font-family: var(--mono);
    color: var(--text-dim);
}

/* --- Discord preview --- */
.config-preview-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint);
    font-weight: 600;
    margin-bottom: 11px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.discord-preview { padding: 4px 0; }

.embed {
    display: flex;
    gap: 12px;
    background: #2b2d31;
    border-radius: 4px;
    padding: 14px 16px 14px 12px;
    max-width: 520px;
}

.embed-left {
    width: 4px;
    border-radius: 2px;
    background: var(--embed-color, #4fd8ff);
    flex-shrink: 0;
    box-shadow: 0 0 10px var(--embed-color, #4fd8ff);
}

.embed-content { flex: 1; min-width: 0; }

.embed-top { display: flex; gap: 12px; }
.embed-main { flex: 1; min-width: 0; }

.embed-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.embed-description {
    font-size: 13px;
    color: #dbdee1;
    line-height: 1.45;
    white-space: pre-wrap;
}

.embed-field { margin-top: 9px; }
.embed-field.inline { display: inline-block; width: 48%; vertical-align: top; }

.embed-field-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.embed-field-value {
    font-size: 12.5px;
    color: #dbdee1;
    white-space: pre-wrap;
}

.embed-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.embed-image {
    width: 100%;
    margin-top: 10px;
    border-radius: 4px;
    max-height: 200px;
    object-fit: cover;
}

.embed-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.embed-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: var(--btn-color, #4e5058);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: default;
}

.embed-button-emoji { font-size: 14px; }

.embed-footer {
    margin-top: 10px;
    font-size: 11px;
    color: #949ba4;
}

.preview-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-faint);
    font-size: 12.5px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

/* --- raw editor --- */
.raw-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    background: var(--bg-elev-2);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-dim);
}

.raw-hint button { margin-left: auto; }

/* ==========================================================
   Plugins
   ========================================================== */

.plugin-list { padding: 14px 18px; }

.plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.plugin-card {
    background: linear-gradient(160deg, rgba(16, 26, 48, 0.6), rgba(8, 14, 30, 0.8));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 15px;
    transition: border-color .12s, transform .12s, box-shadow .12s;
}

.plugin-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 0 20px rgba(79, 216, 255, .08);
}

.plugin-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 9px;
}

.plugin-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--bg-elev-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.plugin-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.plugin-meta {
    font-size: 11px;
    color: var(--text-faint);
    font-family: var(--mono);
}

.plugin-desc {
    font-size: 12.5px;
    color: var(--text-dim);
    line-height: 1.45;
    margin-bottom: 11px;
    min-height: 36px;
}

.plugin-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.plugin-config-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 11px;
}

.plugin-config-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text-dim);
    cursor: pointer;
    transition: all .12s;
}

.plugin-config-chip:hover { border-color: var(--accent); color: var(--accent); }

.plugin-config-chip.has-config { border-color: rgba(46, 230, 168, .4); color: #6ef0c4; }
.plugin-config-chip.no-config { opacity: .5; cursor: default; }

.plugin-detail-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plugin-detail-sub {
    font-size: 11.5px;
    color: var(--text-faint);
    font-family: var(--mono);
    margin-top: 2px;
}

.plugin-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.plugin-badge.enabled { background: rgba(46, 230, 168, .14); color: #6ef0c4; }
.plugin-badge.disabled { background: rgba(152, 160, 179, .14); color: var(--text-dim); }

/* --- install form --- */
.plugin-install {
    display: flex;
    gap: 7px;
    margin-bottom: 9px;
}

.plugin-install .input {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-family: var(--mono);
}

.plugin-install-hint {
    font-size: 11px;
    color: var(--text-faint);
    line-height: 1.5;
}

.plugin-install-hint code {
    display: block;
    margin-top: 4px;
    padding: 5px 7px;
    background: var(--bg);
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 10.5px;
    word-break: break-all;
    color: var(--text-dim);
}

#plugin-list { padding: 14px 18px; }
#view-plugins > .card { margin-bottom: 16px; }

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.open { transform: none; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 16px; }
    .grid-2 { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .config-list-head { grid-template-columns: 1fr; }
    .config-list { border-right: none; border-bottom: 1px solid var(--border); max-height: 240px; }
    .perm-row { grid-template-columns: 1fr; gap: 4px; }
}
