/* SherlockBot Dashboard UX refresh — public multi-server edition */
:root {
    --dash-card: rgba(7, 18, 37, .84);
    --dash-card-strong: rgba(8, 22, 46, .94);
    --dash-line: rgba(95, 157, 255, .18);
    --dash-line-strong: rgba(58, 183, 255, .34);
    --dash-glass: rgba(3, 10, 24, .86);
    --dash-radius: 16px;
    --dash-radius-sm: 11px;
    --dash-shadow: 0 18px 55px rgba(0, 22, 70, .22);
}

body {
    background:
        radial-gradient(circle at 78% -12%, rgba(0, 119, 255, .18), transparent 34%),
        radial-gradient(circle at 24% 105%, rgba(0, 211, 255, .07), transparent 31%),
        #020611;
}

/* Sidebar: fewer visual blocks, grouped navigation and clearer hierarchy */
.app-shell { grid-template-columns: 278px minmax(0, 1fr); }
.sidebar { width: 278px; padding: 22px 16px 16px; }
.brand { padding: 2px 10px 18px; }
.brand-logo { width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; }
.brand strong { font-size: 16px; }
.brand span { font-size: 11px; color: #70809a; }


/* Sidebar quick search: always visible between brand and navigation */
.sidebar-search { position: relative; z-index: 45; margin: 0 2px 13px; }
.sidebar-search-box {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 42px;
    padding: 0 9px 0 10px;
    gap: 7px;
    border: 1px solid rgba(88, 154, 255, .18);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(8, 22, 45, .88), rgba(4, 13, 30, .9));
    box-shadow: inset 0 1px rgba(255,255,255,.015);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.sidebar-search-box:focus-within {
    border-color: rgba(49, 187, 255, .54);
    background: linear-gradient(145deg, rgba(9, 29, 59, .96), rgba(5, 17, 38, .96));
    box-shadow: 0 0 0 3px rgba(0, 139, 255, .08), 0 12px 32px rgba(0, 45, 105, .18);
}
.sidebar-search-icon { display: grid; place-items: center; color: #55d2ff; font-size: 17px; }
.sidebar-search-box input { min-width: 0; width: 100%; border: 0; outline: 0; color: #e8f3ff; background: transparent; font: inherit; font-size: 11px; }
.sidebar-search-box input::placeholder { color: #64758d; }
.sidebar-search-box kbd { min-width: 21px; padding: 3px 5px; border: 1px solid rgba(123, 156, 198, .16); border-radius: 6px; color: #60718a; background: rgba(255,255,255,.025); font: 800 10px/1.2 inherit; text-align: center; }
.sidebar-search-example { padding: 5px 7px 0; color: #8293aa; font-size: 9px; letter-spacing: .01em; }
.sidebar-search-results {
    position: absolute;
    top: 51px;
    left: -4px;
    right: -4px;
    z-index: 60;
    max-height: min(500px, calc(100vh - 150px));
    overflow: auto;
    padding: 7px;
    border: 1px solid rgba(64, 170, 255, .28);
    border-radius: 13px;
    background: rgba(3, 12, 28, .985);
    box-shadow: 0 24px 65px rgba(0, 0, 0, .52), 0 0 0 1px rgba(0, 98, 255, .04);
    backdrop-filter: blur(22px);
    scrollbar-width: thin;
    scrollbar-color: #183b64 transparent;
}
.sidebar-search-result {
    width: 100%;
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 58px;
    padding: 8px 9px;
    border: 0;
    border-radius: 9px;
    color: #dbe9fb;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.sidebar-search-result + .sidebar-search-result { margin-top: 2px; }
.sidebar-search-result:hover,
.sidebar-search-result:focus-visible { outline: 0; background: rgba(0, 126, 255, .11); }
.sidebar-search-result-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: #70dfff; background: rgba(0, 128, 255, .11); font-size: 11px; font-weight: 900; }
.sidebar-search-result.is-action .sidebar-search-result-icon { color: #8ae9c3; background: rgba(45, 211, 149, .1); }
.sidebar-search-result-copy { min-width: 0; }
.sidebar-search-result-copy strong,
.sidebar-search-result-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-search-result-copy strong { color: #e4effd; font-size: 11px; line-height: 1.3; }
.sidebar-search-result-copy small { margin-top: 3px; color: #8293aa; font-size: 9px; }
.sidebar-search-result-action {
    grid-column: 2;
    justify-self: start;
    margin-top: -2px;
    padding: 3px 6px;
    border: 1px solid rgba(72, 167, 255, .14);
    border-radius: 6px;
    color: #8293aa;
    background: rgba(0, 125, 255, .055);
    font-size: 9px;
    font-weight: 850;
}
.sidebar-search-result.is-action .sidebar-search-result-action { color: #6fd8ad; border-color: rgba(63, 205, 148, .15); background: rgba(36, 181, 125, .055); }
.sidebar-search-empty { display: grid; gap: 5px; padding: 15px 11px; text-align: center; }
.sidebar-search-empty strong { color: #8395af; font-size: 11px; }
.sidebar-search-empty span { color: #8293aa; font-size: 9px; line-height: 1.5; }

/* Search result navigation visibly marks the exact setting/action found. */
.search-target-pulse { position: relative; animation: dashboard-search-target 1.65s ease both; }
@keyframes dashboard-search-target {
    0%, 100% { box-shadow: none; }
    18% { box-shadow: 0 0 0 2px rgba(57, 196, 255, .72), 0 0 0 7px rgba(0, 135, 255, .10), 0 12px 35px rgba(0, 91, 207, .12); }
    55% { box-shadow: 0 0 0 1px rgba(57, 196, 255, .34), 0 0 0 4px rgba(0, 135, 255, .05); }
}
.sidebar nav { padding: 0 2px 8px 0; }
.nav-home { margin-bottom: 8px; }
.nav-group { margin: 3px 0; border-radius: 12px; }
.nav-group summary {
    display: flex;
    align-items: center;
    min-height: 35px;
    padding: 0 11px;
    color: #8293aa;
    cursor: pointer;
    list-style: none;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    user-select: none;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: "›"; margin-left: auto; color: #45546d; font-size: 15px; transform: rotate(0deg); transition: transform .18s ease; }
.nav-group[open] summary::after { transform: rotate(90deg); }
.nav-group summary:hover { color: #9eb4d1; background: rgba(255,255,255,.025); }
.nav-group-body { display: grid; gap: 2px; padding: 1px 0 7px; }
.nav-item { min-height: 40px; padding: 0 11px; gap: 10px; border-radius: 9px; font-size: 12px; }
.nav-item > span { width: 22px; font-size: 15px; }
.nav-item.active { background: linear-gradient(90deg, rgba(0, 122, 255, .24), rgba(0, 193, 255, .045)); box-shadow: inset 2px 0 #0b93ff, 0 8px 24px rgba(0, 83, 185, .08); }
.nav-group:has(.nav-item.active) > summary { color: #85a6cf; }
.sidebar-footer { padding-top: 13px; }

/* Top bar and universal settings search */
.main-area { grid-column: 2; }
.topbar { height: 76px; justify-content: flex-start; gap: 14px; padding: 0 34px; background: rgba(2, 7, 18, .9); }
.server-overview-button { margin-right: 0; }
.page-context { display: grid; min-width: 118px; gap: 2px; }
.page-context small { color: #8293aa; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.page-context strong { overflow: hidden; max-width: 180px; color: #dce9fb; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-search { position: relative; width: min(390px, 34vw); margin-right: auto; }
.dashboard-search-box { display: flex; align-items: center; min-height: 40px; padding: 0 10px 0 12px; gap: 8px; border: 1px solid var(--dash-line); border-radius: 11px; background: rgba(7, 20, 42, .72); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.dashboard-search-box:focus-within { border-color: rgba(44, 181, 255, .56); background: rgba(8, 25, 52, .92); box-shadow: 0 0 0 3px rgba(0, 137, 255, .09), 0 10px 28px rgba(0, 72, 170, .14); }
.dashboard-search-box > span { color: #58cfff; font-size: 16px; }
.dashboard-search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: #eaf4ff; background: transparent; font: inherit; font-size: 11px; }
.dashboard-search-box input::placeholder { color: #60708a; }
.dashboard-search-box kbd { padding: 4px 6px; border: 1px solid rgba(120, 153, 194, .18); border-radius: 6px; color: #8293aa; background: rgba(255,255,255,.025); font-size: 10px; font-family: inherit; }
.dashboard-search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; max-height: min(480px, 62vh); overflow: auto; padding: 7px; border: 1px solid rgba(72, 159, 255, .24); border-radius: 13px; background: rgba(4, 13, 29, .985); box-shadow: 0 24px 70px rgba(0, 0, 0, .46); backdrop-filter: blur(20px); }
.search-result { width: 100%; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 52px; padding: 8px 9px; border: 0; border-radius: 9px; color: #dce9fb; background: transparent; text-align: left; }
.search-result:hover, .search-result:focus-visible { outline: 0; background: rgba(0, 125, 255, .11); }
.search-result-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #64d7ff; background: rgba(0, 125, 255, .11); font-size: 11px; font-weight: 900; }
.search-result strong, .search-result small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result strong { font-size: 11px; }
.search-result small { margin-top: 3px; color: #8293aa; font-size: 10px; }
.search-result em { color: #8293aa; font-size: 10px; font-style: normal; }
.search-empty { padding: 16px 12px; color: #6f809a; font-size: 11px; text-align: center; }

.server-picker-wrap { margin-left: auto; }
.server-picker-wrap label { display: none; }
.server-picker-wrap select { min-width: 175px; min-height: 40px; border-radius: 10px; background-color: rgba(7, 20, 42, .82); }
.invite-bot-button { min-height: 40px; border-radius: 10px; }
.top-status { padding: 0 2px; white-space: nowrap; }

/* Main content */
.content { max-width: 1460px; padding: 40px 44px 86px; }
.welcome-row, .page-heading { align-items: center; margin-bottom: 24px; }
.welcome-row h1, .page-heading h1 { font-size: clamp(31px, 3.7vw, 45px); }
.welcome-row > div > p:last-child, .page-heading > div > p:last-child { max-width: 760px; font-size: 12px; line-height: 1.65; }

/* Explain pages in plain language */
.view-guide { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .7fr); gap: 12px; margin: -8px 0 17px; }
.view-guide-card { display: flex; gap: 12px; min-height: 78px; padding: 15px 16px; border: 1px solid var(--dash-line); border-radius: 13px; background: linear-gradient(145deg, rgba(8, 22, 44, .78), rgba(4, 12, 27, .75)); }
.view-guide-card.primary { border-color: rgba(29, 161, 255, .26); background: linear-gradient(135deg, rgba(0, 106, 226, .14), rgba(5, 15, 32, .84)); }
.view-guide-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; color: #71dcff; background: rgba(0, 127, 255, .12); font-size: 15px; font-weight: 900; }
.view-guide-card strong, .view-guide-card span { display: block; }
.view-guide-card strong { margin: 1px 0 5px; font-size: 11px; }
.view-guide-card span { color: #7e8ea6; font-size: 11px; line-height: 1.55; }
.section-jumpbar { display: flex; align-items: center; gap: 7px; margin: 0 0 21px; padding: 8px; overflow-x: auto; border: 1px solid rgba(96, 139, 199, .12); border-radius: 12px; background: rgba(4, 12, 27, .48); scrollbar-width: thin; }
.section-jumpbar::before { content: "Springen zu"; flex: 0 0 auto; padding: 0 5px; color: #8293aa; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.section-jumpbar button { flex: 0 0 auto; min-height: 30px; padding: 0 9px; border: 1px solid rgba(94, 145, 214, .12); border-radius: 8px; color: #8fa2bd; background: rgba(255,255,255,.018); font-size: 10px; font-weight: 800; white-space: nowrap; }
.section-jumpbar button:hover { color: #8fe3ff; border-color: rgba(0, 170, 255, .28); background: rgba(0, 128, 255, .07); }

/* Overview: quick access and current module state */
.overview-workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 15px; margin-bottom: 15px; }
.quick-access-panel, .setup-status-panel { min-width: 0; }
.quick-access-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.quick-access-card { display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 70px; padding: 11px 12px; border: 1px solid rgba(81, 137, 210, .14); border-radius: 11px; color: #dce8f8; background: rgba(255,255,255,.015); text-align: left; }
.quick-access-card:hover { border-color: rgba(34, 178, 255, .32); background: rgba(0, 119, 255, .06); transform: translateY(-1px); }
.quick-access-card > span:first-child { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: #71dcff; background: rgba(0, 127, 255, .11); font-size: 15px; font-weight: 900; }
.quick-access-card strong, .quick-access-card small { display: block; min-width: 0; }
.quick-access-card strong { font-size: 11px; }
.quick-access-card small { margin-top: 4px; color: #8293aa; font-size: 10px; line-height: 1.35; }
.quick-access-card > b { color: #3d536f; font-size: 17px; }
.setup-module-list { display: grid; gap: 7px; }
.setup-module-row { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.015); }
.setup-module-row span:first-child { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #46546b; }
.setup-module-row.is-on span:first-child { background: #34d399; box-shadow: 0 0 10px rgba(52,211,153,.45); }
.setup-module-row strong { flex: 1; font-size: 11px; }
.setup-module-row em { color: #8293aa; font-size: 10px; font-style: normal; font-weight: 800; }
.setup-module-row.is-on em { color: #6bd9b3; }
.setup-status-note { margin: 10px 0 0; color: #8293aa; font-size: 10px; line-height: 1.55; }

/* Modern cards / forms: larger readable labels, stronger grouping */
.panel, .settings-card, .security-hero, .bot-profile-preview { border-color: var(--dash-line); border-radius: var(--dash-radius); background: linear-gradient(145deg, rgba(7, 19, 39, .9), rgba(4, 12, 27, .91)); box-shadow: 0 14px 42px rgba(0, 22, 70, .08); }
.settings-card { position: relative; padding: 22px 23px; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; scroll-margin-top: 108px; }
.settings-card:hover { border-color: rgba(86, 157, 255, .24); }
.settings-card::before { content: ""; position: absolute; left: 0; top: 19px; bottom: 19px; width: 2px; border-radius: 0 2px 2px 0; background: linear-gradient(#0b91ff, rgba(0, 203, 255, .15)); opacity: .36; }
.settings-intro { gap: 12px; }
.settings-intro h2 { font-size: 15px; letter-spacing: -.015em; }
.settings-intro p { max-width: 720px; margin-top: 5px; color: #76879f; font-size: 12px; line-height: 1.55; }
.settings-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 11px; }
.form-grid { gap: 14px; }
.field { gap: 7px; }
.field > span, .inline-fields label { color: #91a1b8; font-size: 11px; font-weight: 800; }
.field select, .field textarea, .field input, .inline-fields input { min-height: 42px; padding: 10px 11px; border-radius: 9px; border-color: rgba(86, 143, 219, .16); background: rgba(4, 15, 33, .92); font-size: 11px; }
.field textarea { min-height: 92px; }
.field small { color: #8293aa; font-size: 10px; line-height: 1.45; }
.switch { font-size: 11px; }
.switch span { width: 41px; height: 23px; }
.switch span::after { width: 17px; height: 17px; }
.switch input:checked + span::after { transform: translateX(18px); }

/* Sticky save bar makes long pages much easier to use */
#general-form > .form-actions,
#security-form > .form-actions,
#operations-form > .form-actions,
#tickets-form > .form-actions,
#ticket-ai-form > .form-actions,
#community-form > .form-actions,
#automations-form > .form-actions {
    position: sticky;
    bottom: 14px;
    z-index: 7;
    margin-top: 16px;
    padding: 10px;
    border: 1px solid rgba(73, 149, 255, .18);
    border-radius: 12px;
    background: rgba(4, 13, 29, .94);
    box-shadow: 0 16px 42px rgba(0,0,0,.28);
    backdrop-filter: blur(18px);
}

/* Server selection: search + filters and more spacious cards */
.server-select-content { width: min(1460px, calc(100% - 48px)); }
.server-select-tools { width: min(720px, 100%); display: flex; align-items: center; gap: 8px; margin: 21px auto 0; }
.server-select-search { flex: 1; min-width: 0; min-height: 42px; padding: 0 13px; border: 1px solid var(--dash-line); border-radius: 10px; outline: none; color: #edf6ff; background: rgba(6, 18, 38, .85); font: inherit; font-size: 11px; }
.server-select-search:focus { border-color: rgba(38, 183, 255, .52); box-shadow: 0 0 0 3px rgba(0, 139, 255, .08); }
.server-filter { min-height: 42px; padding: 0 12px; border: 1px solid rgba(89, 141, 207, .15); border-radius: 10px; color: #7e91ab; background: rgba(255,255,255,.02); font-size: 11px; font-weight: 800; }
.server-filter.active { color: #89dfff; border-color: rgba(0, 168, 255, .32); background: rgba(0, 123, 255, .09); }
.server-card-grid { gap: 16px; }
.server-card { min-height: 246px; padding: 18px; border-radius: 17px; }
.server-card-copy h2 { font-size: 14px; }
.server-card-action { min-height: 39px; border-radius: 9px; font-size: 11px; }
.server-card.is-filtered-out { display: none; }

/* Tables and lists readable at a glance */
.case-table-head, .ticket-table-head { color: #687b97; }
.case-row, .ticket-row, .operation-list-row, .command-permission-row { border-color: rgba(85, 135, 199, .11); }
.case-row:hover, .ticket-row:hover, .operation-list-row:hover, .command-permission-row:hover { background: rgba(0, 123, 255, .025); }
.empty-state { border-radius: 11px; }

/* Better focus indication */
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid rgba(46, 194, 255, .72); outline-offset: 2px; }

@media (max-width: 1220px) {
    .app-shell { grid-template-columns: 250px minmax(0, 1fr); }
    .sidebar { width: 250px; }
    .content { padding-left: 30px; padding-right: 30px; }
    .quick-access-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-search { width: min(330px, 30vw); }
}

@media (max-width: 980px) {
    .view-guide, .overview-workspace { grid-template-columns: 1fr; }
    .quick-access-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-search { width: min(300px, 38vw); }
    .page-context { display: none; }
}

@media (max-width: 860px) {
    .app-shell { display: block; }
    .main-area { grid-column: auto; }
    .sidebar { width: min(310px, 88vw); }
    .topbar { gap: 9px; padding: 0 15px; }
    .dashboard-search { order: 5; position: absolute; left: 14px; right: 14px; top: 68px; width: auto; display: none; }
    body.dashboard-search-open .dashboard-search { display: block; }
    .topbar::after { content: "⌕"; display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; border: 1px solid var(--dash-line); border-radius: 9px; color: #76d9ff; background: rgba(0, 119, 255, .08); cursor: pointer; }
    .server-picker-wrap { margin-left: 0; }
    .content { padding: 34px 17px 74px; }
    .view-guide { margin-top: -2px; }
    .settings-card { padding: 18px 17px; }
    .server-select-tools { flex-wrap: wrap; }
    .server-select-search { flex-basis: 100%; }
}

@media (max-width: 620px) {
    .quick-access-grid { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr; }
    .view-guide { gap: 8px; }
    .view-guide-card { min-height: 0; }
    .section-jumpbar { margin-left: -2px; margin-right: -2px; }
    .server-picker-wrap select { min-width: 145px; max-width: 44vw; }
    .top-status { display: none; }
    #general-form > .form-actions,
    #security-form > .form-actions,
    #operations-form > .form-actions,
    #tickets-form > .form-actions,
    #ticket-ai-form > .form-actions,
    #community-form > .form-actions,
    #automations-form > .form-actions { bottom: 7px; flex-wrap: wrap; }
}


/* Context navigation: only the active dashboard category shows its boxes. */
.nav-context-sections {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto;
    min-height: 0;
    max-height: min(350px, 42vh);
    margin: 5px 4px 9px 28px;
    padding: 7px;
    overflow: hidden;
    border: 1px solid rgba(45, 139, 242, .16);
    border-left: 2px solid rgba(37, 165, 255, .45);
    border-radius: 9px;
    background: linear-gradient(160deg, rgba(8, 25, 50, .78), rgba(3, 12, 27, .78));
    box-shadow: inset 0 1px rgba(255,255,255,.012);
}
.nav-context-head {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 22px;
    padding: 0 5px 5px;
    color: #6f86a5 !important;
}
.nav-context-head-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #8293aa !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    line-height: 1.2;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.nav-context-head b {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 1px solid rgba(65, 152, 255, .18);
    border-radius: 999px;
    color: #8293aa !important;
    background: rgba(36, 113, 207, .09);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}
.nav-context-list {
    position: relative;
    z-index: 2;
    display: grid !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    gap: 2px;
    max-height: calc(min(350px, 42vh) - 36px);
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: #173d67 transparent;
}
.nav-context-link {
    position: relative;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-height: 31px;
    margin: 0;
    padding: 5px 8px;
    gap: 0;
    border: 0;
    border-radius: 7px;
    color: #9fb2ca !important;
    background: transparent;
    text-align: left;
    cursor: pointer;
    pointer-events: auto !important;
    touch-action: manipulation;
    text-decoration: none;
    font: inherit;
    transform: none;
    transition: color .16s ease, background .16s ease;
}
.nav-context-link::before {
    content: "";
    position: absolute;
    left: -7px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #2b4564;
    box-shadow: 0 0 0 2px #07152b;
}
.nav-context-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: hidden;
    min-width: 0;
    color: inherit !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-context-link:hover,
.nav-context-link:focus-visible {
    outline: 0;
    color: #d8ebff !important;
    background: rgba(14, 118, 232, .14);
    box-shadow: inset 2px 0 rgba(37, 183, 255, .55);
}
.nav-context-link:active {
    background: rgba(14, 118, 232, .22);
    transform: translateY(1px);
}
.nav-context-link.is-current {
    color: #e9f6ff !important;
    background: linear-gradient(90deg, rgba(0, 128, 255, .18), rgba(0, 168, 255, .035));
}
.nav-context-link.is-current::before {
    background: #25b7ff;
    box-shadow: 0 0 0 2px #07152b, 0 0 8px rgba(37, 183, 255, .42);
}
.settings-card,
.panel { scroll-margin-top: 105px; }
.context-target-pulse { animation: context-target-pulse 1.55s ease; }
@keyframes context-target-pulse {
    0%, 100% { box-shadow: inherit; }
    20% { box-shadow: 0 0 0 1px rgba(48, 174, 255, .72), 0 0 0 5px rgba(0, 119, 255, .08), 0 18px 50px rgba(0, 88, 190, .12); }
}
@media (max-width: 860px) {
    .nav-context-sections { max-height: min(320px, 45vh); margin-right: 3px; }
    .nav-context-list { max-height: calc(min(320px, 45vh) - 36px); }
    .nav-context-link { min-height: 34px; }
}

.discord-preview-dock[hidden] { display: none !important; }

/* Discord Live Preview — beginner-friendly, shared across message-producing modules */
.main-area.discord-preview-open .content {
    max-width: 1660px;
    padding-right: 440px;
}

.discord-preview-dock {
    position: fixed;
    z-index: 7;
    top: 92px;
    right: 22px;
    width: 386px;
    max-height: calc(100vh - 116px);
    overflow: auto;
    border: 1px solid rgba(88, 101, 242, .28);
    border-radius: 16px;
    background: #111214;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .38);
    scrollbar-width: thin;
    scrollbar-color: #2b3e58 transparent;
}

.discord-preview-toolbar {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #26272d;
    background: #1e1f22;
}
.discord-preview-toolbar .eyebrow { margin: 0 0 3px; color: #949ba4; font-size: 9px; letter-spacing: .13em; }
.discord-preview-toolbar strong { display: block; color: #f2f3f5; font-size: 14px; }
.discord-preview-toolbar small { display: block; margin-top: 4px; color: #949ba4; line-height: 1.45; font-size: 10px; }
.discord-preview-picker-wrap { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: #b5bac1; font-size: 10px; font-weight: 700; }
.discord-preview-picker-wrap select { min-width: 0; height: 34px; padding: 0 30px 0 10px; border: 1px solid #3f4147; border-radius: 7px; background: #2b2d31; color: #f2f3f5; font: inherit; }

.discord-preview-channel { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border-bottom: 1px solid #26272d; background: #313338; color: #dbdee1; }
.discord-preview-channel > span { color: #949ba4; font-size: 20px; font-weight: 500; }
.discord-preview-channel strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.discord-preview-channel small { margin-left: auto; color: #80848e; font-size: 9px; white-space: nowrap; }
.discord-preview-surface { min-height: 260px; padding: 18px 12px 28px; background: #313338; }
.discord-message-preview { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 10px; padding: 2px 4px; }
.discord-preview-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #1e1f22; }
.discord-preview-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.discord-preview-message-body { min-width: 0; }
.discord-preview-author { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-height: 20px; }
.discord-preview-author strong { color: #f2f3f5; font-size: 13px; }
.discord-preview-author > span { padding: 1px 4px; border-radius: 3px; background: #5865f2; color: white; font-size: 7px; font-weight: 800; }
.discord-preview-author time { color: #949ba4; font-size: 9px; }
.discord-preview-content, .discord-preview-description, .discord-preview-field span { color: #dbdee1; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.discord-preview-content strong, .discord-preview-description strong { color: #f2f3f5; }
.discord-preview-placeholder { color: #80848e; font-style: italic; }
.discord-preview-link { color: #00a8fc; }
.discord-preview-mention { padding: 0 2px; border-radius: 3px; background: rgba(88,101,242,.3); color: #c9cdfb; }
.discord-preview-content code, .discord-preview-description code { padding: 1px 3px; border-radius: 3px; background: #1e1f22; color: #dbdee1; font-size: 11px; }

.discord-preview-embed { position: relative; display: grid; grid-template-columns: 4px minmax(0,1fr); max-width: 100%; margin-top: 7px; border-radius: 4px; overflow: hidden; background: #2b2d31; }
.discord-preview-embed-accent { min-height: 100%; background: #5865f2; }
.discord-preview-embed-body { position: relative; min-width: 0; padding: 11px 12px 10px; }
.discord-preview-embed-copy { min-width: 0; padding-right: 0; }
.discord-preview-title { display: block; margin-bottom: 5px; color: #f2f3f5; font-size: 13px; line-height: 1.3; }
.discord-preview-description { white-space: normal; }
.discord-preview-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px; margin-top: 10px; }
.discord-preview-field { min-width: 0; }
.discord-preview-field strong { display: block; margin-bottom: 2px; color: #f2f3f5; font-size: 10px; }
.discord-preview-field span { font-size: 10px; }
.discord-preview-thumbnail { float: right; width: 62px; height: 62px; margin: 0 0 8px 10px; border-radius: 4px; object-fit: cover; }
.discord-preview-image { display: block; width: 100%; max-height: 250px; margin-top: 10px; border-radius: 4px; object-fit: cover; background: #1e1f22; }

.discord-preview-member-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 460;
    min-height: 176px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 6px;
    background: linear-gradient(135deg,#08162c,#0b0d13 55%,#111827);
    color: #fff;
    isolation: isolate;
}
.discord-preview-member-card-bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.92; z-index:-3; }
.discord-preview-member-card-shade { position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,.34),rgba(0,0,0,.43) 55%,rgba(0,0,0,.84)); z-index:-2; }
.discord-preview-member-card::after { content:""; position:absolute; inset:-20%; background:radial-gradient(circle at 50% 42%,rgba(0,17,255,.22),transparent 42%); z-index:-1; pointer-events:none; }
.discord-preview-member-card[data-type="leave"]::after { background:radial-gradient(circle at 50% 42%,rgba(237,66,69,.18),transparent 42%); }
.discord-preview-member-card-kicker { position:absolute; top:8%; left:4%; right:4%; display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:7px; font-weight:800; letter-spacing:.12em; text-shadow:0 1px 5px #000; }
.discord-preview-member-card-kicker span { padding-bottom:4px; border-bottom:2px solid #0011ff; }
.discord-preview-member-card[data-type="leave"] .discord-preview-member-card-kicker span { border-color:#ed4245; }
.discord-preview-member-card-kicker b { max-width:55%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; letter-spacing:0; font-size:8px; }
.discord-preview-member-card-avatar { position:absolute; left:50%; top:41%; width:28%; max-width:94px; aspect-ratio:1; transform:translate(-50%,-50%); border:4px solid #f2f3f5; border-radius:50%; object-fit:cover; box-shadow:0 8px 22px rgba(0,0,0,.62); background:#1e1f22; }
.discord-preview-member-card > strong { position:absolute; left:5%; right:5%; bottom:19%; text-align:center; font-size:clamp(11px,2.2vw,18px); line-height:1.1; text-shadow:0 2px 7px #000; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.discord-preview-member-card > span:not(.discord-preview-member-card-kicker) { position:absolute; left:5%; right:5%; bottom:9%; text-align:center; color:rgba(255,255,255,.82); font-size:clamp(8px,1.45vw,12px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.discord-preview-member-card > i { position:absolute; left:50%; bottom:4%; width:11%; height:2px; transform:translateX(-50%); background:#0011ff; }
.discord-preview-member-card[data-type="leave"] > i { background:#ed4245; }
.discord-preview-footer { margin-top: 9px; color: #b5bac1; font-size: 9px; line-height: 1.35; }
.discord-preview-components { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.discord-preview-button { min-height: 30px; padding: 5px 11px; border: 0; border-radius: 3px; background: #4e5058; color: #fff; font-size: 10px; font-weight: 600; opacity: 1; }
.discord-preview-button:first-child { background: #5865f2; }
.discord-preview-note { padding: 10px 14px 12px; border-top: 1px solid #26272d; background: #1e1f22; color: #949ba4; font-size: 9px; line-height: 1.45; }

.command-permission-help { display: flex; gap: 8px; margin-bottom: 16px; padding: 10px 12px; border: 1px solid rgba(0,132,255,.18); border-radius: 9px; background: rgba(0,132,255,.055); color: #8291aa; font-size: 11px; line-height: 1.45; }
.command-permission-help strong { color: #cdd8e9; white-space: nowrap; }
.command-permission-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.command-permission-toolbar .field { width: min(360px,100%); margin: 0; }
.command-permission-count { padding-bottom: 10px; color: #8293aa; font-size: 11px; font-weight: 700; white-space: nowrap; }
.command-permission-list {
    display: grid;
    gap: 8px;
    max-height: 560px;
    overflow: auto;
    padding: 1px 4px 1px 0;
    scrollbar-width: thin;
    scrollbar-color: #2b3e58 transparent;
}
.command-permission-row {
    display: grid;
    grid-template-columns: minmax(150px,1fr) minmax(145px,.75fr) minmax(190px,1fr) auto;
    align-items: end;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(85, 135, 199, .11);
    border-radius: 10px;
    background: rgba(255,255,255,.012);
}
.command-permission-row .command-name { min-width: 0; align-self: center; }
.command-permission-row .command-name strong,
.command-permission-row .command-name small { display: block; min-width: 0; }
.command-permission-row .command-name strong { color: #dce8f8; font-size: 11px; overflow-wrap: anywhere; }
.command-permission-row .command-name small { margin-top: 4px; color: #8293aa; font-size: 10px; }
.command-permission-field { display: grid; gap: 4px; min-width: 0; }
.command-permission-field > span { color: #8293aa; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.command-permission-field select { width: 100%; }

@media (max-width: 1380px) {
    .main-area.discord-preview-open .content { max-width: 1280px; padding-right: 58px; }
    .discord-preview-dock { position: relative; top: auto; right: auto; width: 100%; max-height: none; margin: 0 0 26px; }
    .discord-preview-surface { min-height: 220px; }
}

@media (max-width: 900px) {
    .command-permission-row { grid-template-columns: 1fr 1fr; }
    .command-permission-row .command-name { grid-column: 1 / -1; }
    .command-permission-row > .secondary-button { justify-self: start; }
}

@media (max-width: 720px) {
    .main-area.discord-preview-open .content { padding-right: 18px; }
    .discord-preview-toolbar { padding: 13px; }
    .discord-preview-fields { grid-template-columns: 1fr; }
    .command-permission-toolbar { align-items: stretch; flex-direction: column; }
    .command-permission-count { padding: 0; }
    .command-permission-list { max-height: 480px; }
    .command-permission-row { grid-template-columns: 1fr; }
    .command-permission-row .command-name { grid-column: auto; }
}

/* Command-Rechte: sichere Grundstufen + optionale konkrete Discord-Rollen */
.command-role-editor {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: minmax(220px, .85fr) minmax(260px, 1.15fr);
    gap: 7px 10px;
    align-items: center;
    min-width: 0;
    padding-top: 2px;
}
.command-role-editor-label {
    grid-column: 1 / -1;
    color: #8293aa;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.command-role-controls { display: flex; gap: 7px; min-width: 0; }
.command-role-controls select { flex: 1 1 auto; width: 100%; min-width: 0; }
.command-role-add { flex: 0 0 auto; }
.command-role-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; align-items: center; }
.command-role-empty { color: #8293aa; font-size: 10px; }
.command-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 4px 6px 4px 8px;
    border: 1px solid rgba(0,132,255,.23);
    border-radius: 999px;
    background: rgba(0,132,255,.07);
    color: #b9d5f6;
    font-size: 10px;
    font-weight: 700;
}
.command-role-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-role-remove {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    color: #aebbd0;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}
.command-role-remove:hover { background: rgba(255,255,255,.13); color: #fff; }
.command-permission-save { align-self: end; }

@media (max-width: 900px) {
    .command-role-editor { grid-column: 1 / -1; grid-template-columns: 1fr; }
    .command-role-editor-label { grid-column: auto; }
}

@media (max-width: 560px) {
    .command-role-controls { flex-direction: column; align-items: stretch; }
    .command-role-add { width: 100%; }
}

/* Ticket-KI: Zeitwerte lesbar in Minuten, Stunden oder Tagen statt nur Roh-Minuten */
.ticket-timing-hint {
    margin: 13px 0 15px;
    padding: 10px 12px;
    border: 1px solid rgba(34, 178, 255, .17);
    border-radius: 9px;
    background: rgba(0, 119, 255, .045);
    color: #7186a2;
    font-size: 11px;
    line-height: 1.55;
}
.ticket-timing-hint b { color: #a9c7eb; }
.duration-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(105px, .46fr);
    gap: 7px;
    min-width: 0;
}
.duration-control input,
.duration-control select { width: 100%; min-width: 0; }
.duration-field small { min-height: 23px; }
@media (max-width: 700px) {
    .duration-control { grid-template-columns: 1fr; }
}
