:root {
    --bg: #08111f;
    --bg-soft: #0d1728;
    --panel: rgba(12, 20, 34, 0.88);
    --panel-2: rgba(18, 30, 50, 0.95);
    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.24);
    --text: #eef4ff;
    --muted: #90a1bc;
    --muted-2: #b8c6db;
    --primary: #2563eb;
    --primary-2: #3b82f6;
    --accent: #ef4444;
    --accent-2: #fb7185;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #38bdf8;
    --shadow: 0 20px 60px rgba(2, 8, 23, 0.38);
    --sidebar-width: 290px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.14), transparent 24%),
        radial-gradient(circle at 85% 5%, rgba(239, 68, 68, 0.12), transparent 20%),
        linear-gradient(180deg, #08111f 0%, #040914 100%);
}
a { color: #dbeafe; text-decoration: none; }
a:hover { color: #ffffff; }
.site-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255,255,255,.02) 0 1px, transparent 1px 180px),
        linear-gradient(180deg, rgba(255,255,255,.015) 0 1px, transparent 1px 180px);
    mask-image: linear-gradient(180deg, rgba(0,0,0,.42), rgba(0,0,0,0));
    opacity: .5;
}
.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(11,18,31,.96) 0%, rgba(8,13,24,.98) 100%);
    backdrop-filter: blur(16px);
    overflow-y: auto;
}
.sidebar-brand a,
.guest-brand a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}
.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 56px;
    box-shadow: 0 16px 30px rgba(37, 99, 235, .22);
}
.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-brand strong,
.guest-brand strong { display: block; font-size: 1.25rem; }
.sidebar-brand small,
.guest-brand small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: .83rem;
}
.sidebar-section { margin-top: 28px; }
.sidebar-label {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: #6f83a4;
    margin: 0 10px 10px;
}
.sidebar-nav { display: grid; gap: 6px; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    color: #d4def0;
    border: 1px solid transparent;
}
.sidebar-link:hover {
    background: rgba(255,255,255,.035);
    border-color: var(--border);
}
.sidebar-link.active {
    background: linear-gradient(135deg, rgba(37,99,235,.18) 0%, rgba(239,68,68,.15) 100%);
    border-color: rgba(96, 165, 250, 0.24);
    color: #fff;
}
.sidebar-icon {
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nav-badge,
.badge,
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.04);
    color: #dde8ff;
    font-weight: 700;
    font-size: .82rem;
}
.nav-badge {
    margin-left: auto;
    min-width: 28px;
    padding-inline: 9px;
    background: rgba(239, 68, 68, .18);
    border-color: rgba(239, 68, 68, .24);
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.footer-card {
    display: grid;
    gap: 4px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.035);
}
.footer-card span,
.footer-card small { color: var(--muted); }
.sidebar-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 12px;
    padding: 0 4px;
    font-size: .76rem;
    line-height: 1.45;
    color: #7f91ad;
}
.sidebar-legal span,
.sidebar-legal a {
    color: #7f91ad;
}
.sidebar-legal a:hover {
    color: #cdd9ee;
}
.content-wrap { min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 15, 28, .8);
    backdrop-filter: blur(20px);
}
.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.topbar-overline {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: #7291bf;
    margin-bottom: 5px;
}
.page-title {
    font-size: clamp(1.8rem, 2.6vw, 2.7rem);
    letter-spacing: -.04em;
    margin: 0;
}
.menu-toggle {
    width: 46px;
    height: 46px;
    display: none;
    border-radius: 14px;
}
.user-chip {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.035);
}
.user-chip span,
.user-chip small { color: var(--muted); }
.main-content,
.guest-content {
    padding: 28px;
}
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }
.panel-card,
.auth-card,
.stat-card,
.kpi-card {
    background: linear-gradient(180deg, rgba(13, 21, 37, .92) 0%, rgba(10, 17, 30, .96) 100%);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow);
}
.panel-card,
.auth-card { padding: 24px; }
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.section-heading h2,
.section-heading h3,
h2,
h3 { margin: 0; }
.subtle { color: var(--muted); }
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
label {
    display: grid;
    gap: 8px;
    color: var(--muted-2);
    font-weight: 600;
    font-size: .94rem;
}
input, select, textarea, button, .button {
    font: inherit;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(21, 32, 53, .96) 0%, rgba(15, 24, 40, .96) 100%);
    color: var(--text);
    padding: 14px 15px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, filter .16s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, .5);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .12);
}
textarea { min-height: 130px; resize: vertical; }
button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 16px 34px rgba(37, 99, 235, .25);
}
button:hover,
.button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.button.ghost,
button.ghost,
.link-button {
    background: rgba(255,255,255,.04);
    box-shadow: none;
    border: 1px solid var(--border-strong);
}
.button.danger,
button.danger { background: linear-gradient(135deg, #dc2626 0%, #f87171 100%); }
.button.success,
button.success { background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%); }
.button.warning,
button.warning,
.chip-warning {
    background: rgba(245, 158, 11, .14);
    border-color: rgba(245, 158, 11, .24);
    color: #fde68a;
}
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form input,
.inline-form select { min-width: 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 14px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
th {
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.flash {
    padding: 14px 16px;
    border-radius: 18px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.flash-success { background: rgba(34, 197, 94, .14); border-color: rgba(34, 197, 94, .24); }
.flash-error { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .24); }
.flash-warning { background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .24); }
.badge { padding: 6px 10px; font-size: .77rem; box-shadow: none; }
.badge-success { background: rgba(34, 197, 94, .14); border-color: rgba(34, 197, 94, .24); color: #bbf7d0; }
.badge-danger { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .24); color: #fecaca; }
.badge-warning { background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .24); color: #fde68a; }
.badge-info { background: rgba(56, 189, 248, .14); border-color: rgba(56, 189, 248, .24); color: #bae6fd; }
.badge-muted { background: rgba(148, 163, 184, .12); border-color: rgba(148, 163, 184, .18); color: #cbd5e1; }
.hint { color: var(--muted); font-size: .93rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.kpi-card { padding: 22px; position: relative; overflow: hidden; }
.kpi-card::after {
    content: "";
    position: absolute;
    inset: auto -24px -24px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,.14), rgba(59,130,246,0));
}
.kpi-value { font-size: clamp(2rem, 3vw, 2.6rem); font-weight: 900; letter-spacing: -.05em; }
.kpi-label { margin-top: 8px; color: var(--muted); font-weight: 600; }
.kpi-meta { margin-top: 14px; color: #dbeafe; font-size: .9rem; }
.empty-state {
    padding: 26px;
    border-radius: 22px;
    border: 1px dashed rgba(148, 163, 184, .18);
    background: rgba(255,255,255,.02);
}
.empty-state p { color: var(--muted); margin-bottom: 0; }
.auth-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 34px 22px 40px;
}
.guest-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 15, 28, .72);
    backdrop-filter: blur(20px);
}
.guest-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.guest-nav a {
    padding: 10px 14px;
    border-radius: 14px;
    color: #dbeafe;
}
.guest-nav a:hover { background: rgba(255,255,255,.04); }
.auth-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
    gap: 22px;
}
.auth-card {
    padding: 28px;
    min-height: 100%;
}
.auth-card.primary {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(59,130,246,.18), transparent 28%),
        linear-gradient(180deg, rgba(13, 21, 37, .92) 0%, rgba(10, 17, 30, .98) 100%);
}
.eyebrow {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(37,99,235,.14);
    border: 1px solid rgba(37,99,235,.24);
    color: #bfdbfe;
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .72rem;
    font-weight: 800;
    margin-bottom: 18px;
}
.hero-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -.06em;
    margin: 0 0 14px;
    max-width: 10ch;
}
.hero-copy { color: var(--muted-2); max-width: 60ch; line-height: 1.7; }
.auth-brand-art {
    margin-top: 22px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, .18);
    background: linear-gradient(180deg, rgba(5, 10, 20, .96) 0%, rgba(3, 7, 14, .96) 100%);
    box-shadow: 0 20px 50px rgba(2, 8, 23, .32);
}
.auth-brand-art img {
    display: block;
    width: 100%;
    height: auto;
}
.auth-brand-art-first {
    margin-top: 10px;
}
.feature-list { display: grid; gap: 16px; margin-top: 24px; }
.feature-box {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(148, 163, 184, .12);
}
.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(59,130,246,.16);
    color: #bfdbfe;
}
.feature-box p { margin: 4px 0 0; color: var(--muted); }
.form-grid { display: grid; gap: 16px; }
.info-list { display: grid; gap: 12px; margin-top: 16px; }
.info-item {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .12);
    background: rgba(255,255,255,.03);
}
.info-item strong { display: block; margin-bottom: 6px; }
.card-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
}
.log-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: rgba(3, 8, 18, .7);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .12);
    padding: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #d7e3f8;
    max-height: 260px;
    overflow: auto;
}
.status-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.metric-list {
    display: grid;
    gap: 12px;
}
.metric-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(148, 163, 184, .12);
}
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.danger-text { color: #fca5a5; }
@media (max-width: 1200px) {
    .kpi-grid,
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-split { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(88vw, 320px);
        transform: translateX(-100%);
        transition: transform .2s ease;
        z-index: 60;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .menu-toggle { display: inline-flex; }
    .auth-hero,
    .grid.cols-2,
    .grid.cols-3 { grid-template-columns: 1fr; }
    .main-content,
    .guest-content { padding: 20px; }
}
@media (max-width: 720px) {
    .topbar,
    .guest-topbar { padding: 16px; }
    .main-content,
    .guest-content { padding: 16px; }
    .kpi-grid,
    .grid.cols-4 { grid-template-columns: 1fr; }
    .hero-title { max-width: none; }
    .auth-brand-art {
        margin-top: 18px;
        border-radius: 20px;
    }
    .topbar { align-items: flex-start; }
    .topbar-right { width: 100%; justify-content: space-between; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .inline-form { align-items: stretch; }
    th, td { padding-inline: 8px; }
}

.content-wrap {
    min-width: 0;
    background: linear-gradient(180deg, rgba(4,10,18,.42) 0%, rgba(3,7,14,0) 32%);
}
.main-content,
.guest-content {
    width: min(1660px, 100%);
    margin: 0 auto;
}
.topbar {
    padding: 22px 30px;
    box-shadow: 0 12px 40px rgba(2, 8, 23, .22);
}
.page-title {
    font-size: clamp(2.2rem, 3.1vw, 3.8rem);
}
.sidebar {
    padding: 22px 18px 18px;
    box-shadow: inset -1px 0 0 rgba(148, 163, 184, 0.08);
}
.sidebar-link {
    min-height: 52px;
    font-weight: 650;
}
.sidebar-link.active {
    box-shadow: 0 14px 30px rgba(37, 99, 235, .12);
}
.sidebar-icon {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(148,163,184,.08);
    font-size: .84rem;
}
.sidebar-link.active .sidebar-icon {
    background: rgba(255,255,255,.08);
    border-color: rgba(96,165,250,.18);
}
.footer-card,
.user-chip,
.metric-item,
.info-item,
.feature-box {
    backdrop-filter: blur(14px);
}
.user-chip {
    min-width: 160px;
}
.panel-card,
.auth-card,
.stat-card,
.kpi-card {
    position: relative;
    overflow: hidden;
}
.panel-card::before,
.auth-card::before,
.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(59,130,246,.0), rgba(59,130,246,.28), rgba(239,68,68,.18), rgba(59,130,246,.0));
    pointer-events: none;
}
.toolbar-panel {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(148,163,184,.08);
}
.actions-wrap {
    flex-wrap: wrap;
}
.inline-filter,
.form-inline-panel {
    align-items: end;
}
.inline-compact button,
.inline-compact .button {
    min-width: 84px;
}
.table-wrap {
    border-radius: 22px;
    border: 1px solid rgba(148,163,184,.08);
    background: rgba(255,255,255,.015);
}
tr:hover td {
    background: rgba(255,255,255,.015);
}
th, td {
    padding: 16px 12px;
}
button,
.button {
    min-height: 50px;
    padding-inline: 18px;
}
button.ghost,
.button.ghost,
.link-button {
    background: linear-gradient(180deg, rgba(22,32,49,.9) 0%, rgba(16,24,39,.96) 100%);
}
input, select, textarea {
    width: 100%;
}
select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #90a1bc 50%), linear-gradient(135deg, #90a1bc 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 42px;
}
textarea {
    line-height: 1.6;
}
.narrow-panel {
    max-width: 720px;
    margin: 0 auto;
}
.auth-shell-wide {
    max-width: 1480px;
}
.auth-hero-card {
    min-height: 100%;
}
.auth-form-card {
    max-width: 560px;
    justify-self: end;
    width: 100%;
}
.feature-list.compact,
.info-list.compact {
    gap: 14px;
}
.section-heading.slim {
    margin-bottom: 16px;
}
.flash {
    box-shadow: 0 12px 28px rgba(2,8,23,.12);
}
.log-box {
    font-size: .95rem;
}
@media (max-width: 1280px) {
    .auth-form-card {
        justify-self: stretch;
        max-width: none;
    }
}
@media (max-width: 980px) {
    .topbar {
        padding: 18px 20px;
    }
    .page-title {
        font-size: clamp(2rem, 6vw, 2.8rem);
    }
    .main-content,
    .guest-content {
        width: 100%;
    }
}
@media (max-width: 720px) {
    .user-chip {
        display: none;
    }
    .topbar-right {
        gap: 10px;
    }
    .toolbar-panel {
        padding-bottom: 14px;
    }
}

.notice-box {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(110, 130, 180, 0.2);
    background: rgba(14, 24, 44, 0.78);
    color: var(--text-soft);
    line-height: 1.6;
}
.org-switcher {
    margin: 0;
}
.org-switcher label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 280px;
    color: var(--text-soft);
    font-size: .85rem;
}
.org-switcher select {
    min-width: 280px;
}
.compact-grid {
    gap: 14px;
}
@media (max-width: 900px) {
    .org-switcher label,
    .org-switcher select {
        min-width: 0;
        width: 100%;
    }
    .org-switcher {
        width: 100%;
    }
}

.hidden-copy {
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.mono,
textarea.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: .94rem;
    line-height: 1.55;
}
.actions .button,
.actions button,
.inline-form .button,
.inline-form button {
    min-width: 110px;
}
.cases-layout {
    align-items: start;
}
.panel-card-large {
    min-height: 100%;
}
.sticky-panel {
    position: sticky;
    top: 20px;
}
.slim-toolbar {
    margin-bottom: 14px;
}
.case-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.stack-half {
    display: grid;
    gap: 12px;
}
.toolbar-panel .subtle .mono,
.subtle.mono {
    word-break: break-word;
}
@media (max-width: 1100px) {
    .sticky-panel {
        position: static;
    }
}

.actions .button,
.actions button,
.inline-form .button,
.inline-form button {
    min-height: 44px;
    min-width: 116px;
    font-size: .92rem;
    letter-spacing: .01em;
}

.table-wrap table tr:hover td {
    background: rgba(255,255,255,.018);
}

.panel-card textarea[readonly],
.panel-card input[readonly] {
    background: linear-gradient(180deg, rgba(17, 26, 42, .96) 0%, rgba(12, 20, 34, .96) 100%);
}

.metric-list {
    display: grid;
    gap: 10px;
}
.metric-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255,255,255,.025);
}
.metric-item span { color: var(--muted); }
.log-box {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255,255,255,.03);
    color: var(--muted-2);
    line-height: 1.55;
}
.card-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
    gap: 22px;
}
@media (max-width: 1180px) {
    .card-split {
        grid-template-columns: 1fr;
    }
}

.dashboard-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1180px) {
    .dashboard-split {
        grid-template-columns: 1fr;
    }
}


.action-icons {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}
.action-icons details {
    position: relative;
}
.action-icons details > summary {
    list-style: none;
}
.action-icons details > summary::-webkit-details-marker {
    display: none;
}
.icon-btn {
    width: 50px;
    min-width: 50px !important;
    height: 50px;
    min-height: 50px !important;
    padding: 0 !important;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
    box-shadow: none;
}
.icon-btn-edit {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}
.icon-btn-view {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}
.icon-btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}
.icon-btn-global-on {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}
.icon-btn-global-off {
    background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
}
.floating-edit-form {
    position: absolute;
    right: 0;
    z-index: 10;
    width: min(360px, calc(100vw - 80px));
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.14);
    background: linear-gradient(180deg, rgba(13, 21, 37, .98) 0%, rgba(10, 17, 30, .99) 100%);
    box-shadow: var(--shadow);
}
.inline-form .icon-btn,
.actions .icon-btn {
    min-width: 50px !important;
}


.role-inline-editor {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
}
.role-inline-editor select {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}
.role-inline-editor .icon-btn {
    flex: 0 0 auto;
}
.cell-actions {
    width: 280px;
    min-width: 280px;
    white-space: nowrap;
}
.cell-actions .inline-form,
.cell-actions .action-icons {
    justify-content: center;
}
.cell-actions .action-icons {
    flex-wrap: nowrap;
    min-width: max-content;
}
.cell-actions .inline-form {
    display: inline-flex;
    gap: 0;
    flex-wrap: nowrap;
}
.cell-actions-single {
    width: 110px;
    min-width: 110px;
}
.cell-actions-single .action-icons,
.cell-actions-single .inline-form {
    justify-content: flex-start;
}
.admin-edit-grid {
    align-items: end;
}
.admin-edit-actions {
    grid-column: 1 / -1;
}
@media (max-width: 900px) {
    .role-inline-editor {
        flex-wrap: wrap;
    }
    .cell-actions {
        width: auto;
        min-width: 240px;
    }
}


.switch-form {
    display: block;
}
.switch-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}
.switch-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.switch-slider {
    position: relative;
    width: 58px;
    height: 32px;
    border-radius: 999px;
    background: rgba(148,163,184,.22);
    border: 1px solid rgba(148,163,184,.18);
    transition: .2s ease;
    flex: 0 0 auto;
}
.switch-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    transition: .2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.switch-toggle input:checked + .switch-slider {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}
.switch-toggle input:checked + .switch-slider.lock {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}
.switch-toggle input:checked + .switch-slider::after {
    transform: translateX(26px);
}
.switch-toggle.is-disabled {
    opacity: .65;
    cursor: not-allowed;
}
.switch-copy {
    font-weight: 700;
    color: var(--text-primary);
}

.state-switch {
    gap: 14px;
}
.switch-state-badge {
    min-width: 58px;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148,163,184,.28);
    background: rgba(255,255,255,.04);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: .04em;
    font-size: .9rem;
}
.switch-state-badge.is-on {
    border-color: rgba(34,197,94,.5);
    color: #c8facc;
}
.switch-state-badge.is-off {
    border-color: rgba(148,163,184,.28);
    color: #dbe4f2;
}
.switch-toggle.is-disabled .switch-slider {
    background: rgba(148,163,184,.18);
    border-color: rgba(148,163,184,.18);
}
.switch-toggle.is-disabled .switch-slider::after {
    background: rgba(255,255,255,.78);
}
.switch-toggle.is-disabled .switch-state-badge {
    opacity: .78;
    color: #b8c6db;
    border-color: rgba(148,163,184,.2);
}


.topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
}
.table-actions-center {
    justify-content: center;
}
.icon-btn {
    color: #ffffff;
}
.icon-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.icon-btn-sm {
    width: 42px;
    min-width: 42px !important;
    height: 42px;
    min-height: 42px !important;
    border-radius: 12px;
}
.icon-btn-sm svg {
    width: 18px;
    height: 18px;
}
.role-inline-editor-compact {
    gap: 8px;
}
.role-inline-editor-compact select {
    flex: 0 1 150px;
    min-width: 120px;
    width: auto;
    height: 42px;
    min-height: 42px;
    padding: 0 40px 0 16px;
    border-radius: 16px;
}
.icon-btn-lock {
    background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
}
.icon-btn-unlock {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}
@media (max-width: 720px) {
    .topbar-right {
        justify-content: flex-end;
    }
}

.bot-action-stack {
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.bot-run-form {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.bot-run-form .button,
.bot-run-form button {
    min-width: 94px;
    padding: 10px 12px;
    border-radius: 14px;
}
.bot-run-form button[disabled] {
    opacity: .55;
    cursor: not-allowed;
    filter: grayscale(.1);
}

.auth-shell-home {
    padding-top: 22px;
    padding-bottom: 18px;
}
.auth-hero-home {
    align-items: start;
}
.auth-hero-home-card,
.auth-form-card-home {
    min-height: 0;
}
.auth-brand-art-login img {
    width: 100%;
    height: clamp(280px, 38vh, 430px);
    object-fit: cover;
    object-position: center center;
}
.feature-list-home {
    gap: 12px;
    margin-top: 18px;
}
.feature-list-home .feature-box {
    padding: 14px;
}
.auth-form-actions {
    margin-top: 16px;
}
.site-footer {
    padding: 0 28px 24px;
}
.site-footer.site-footer-app {
    padding-top: 4px;
}
.site-footer-inner {
    width: min(1660px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px 18px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(255,255,255,.025);
    box-shadow: 0 14px 34px rgba(2, 8, 23, .14);
}
.site-footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}
.site-footer-brand strong {
    color: var(--text);
}
.site-footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.site-footer-links a {
    color: #dbeafe;
    font-weight: 700;
}
.site-footer-copy {
    flex: 1 1 100%;
    color: var(--muted);
    line-height: 1.6;
    white-space: pre-line;
}
.legal-shell {
    max-width: 980px;
    margin: 0 auto;
}
.legal-card {
    padding: 26px;
}
.legal-card p,
.legal-card li,
.legal-card address {
    color: var(--muted-2);
    line-height: 1.72;
}
.legal-card h2 {
    margin: 24px 0 10px;
    font-size: 1.2rem;
}
.legal-card h3 {
    margin: 18px 0 8px;
    font-size: 1rem;
}
.legal-card ul {
    padding-left: 22px;
    margin: 10px 0;
}
.legal-card address {
    font-style: normal;
}
.legal-card .legal-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.newsletter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr);
    gap: 20px;
}
.newsletter-panel {
    padding: 22px;
}
.newsletter-stack {
    display: grid;
    gap: 14px;
}
.newsletter-search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.newsletter-search-row input {
    flex: 1 1 240px;
}
.newsletter-recipient-list {
    max-height: 320px;
    overflow: auto;
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255,255,255,.02);
}
.newsletter-recipient {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    background: rgba(255,255,255,.02);
}
.newsletter-recipient:hover {
    background: rgba(255,255,255,.04);
}
.newsletter-recipient input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
}
.newsletter-recipient-meta {
    display: grid;
    gap: 3px;
}
.newsletter-recipient-meta strong {
    color: var(--text);
}
.newsletter-recipient-meta span {
    color: var(--muted);
    font-size: .92rem;
    word-break: break-word;
}
.newsletter-preview {
    width: 100%;
    min-height: 740px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 20px;
    background: #fff;
}
.newsletter-stat-list {
    display: grid;
    gap: 10px;
}
.newsletter-stat-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(148, 163, 184, .12);
}
.newsletter-inline-choice {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.newsletter-inline-choice label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
@media (max-width: 1080px) {
    .newsletter-grid {
        grid-template-columns: 1fr;
    }
    .newsletter-preview {
        min-height: 620px;
    }
}
@media (max-width: 720px) {
    .auth-shell-home {
        padding-top: 16px;
    }
    .auth-brand-art-login img {
        height: auto;
        object-fit: contain;
    }
    .site-footer {
        padding: 0 16px 16px;
    }
    .site-footer-inner {
        padding: 14px 16px;
    }
    .legal-card,
    .newsletter-panel {
        padding: 18px;
    }
    .newsletter-recipient {
        grid-template-columns: auto 1fr;
    }
    .newsletter-recipient .badge {
        grid-column: 2;
        justify-self: start;
    }
}


.auth-hero-home-compact {
    grid-template-columns: minmax(320px, .9fr) minmax(320px, .72fr) minmax(320px, .68fr);
    align-items: stretch;
    gap: 20px;
}
.auth-hero-image-card,
.auth-hero-info-card,
.auth-form-card-home-compact {
    min-height: 0;
}
.auth-hero-image-card {
    display: flex;
    flex-direction: column;
}
.auth-hero-info-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-home-info-heading {
    margin-bottom: 14px;
}
.auth-brand-art-login-contained {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.auth-brand-art-login-contained img {
    width: 100%;
    max-width: 100%;
    height: clamp(260px, 34vw, 520px);
    object-fit: contain;
    object-position: center center;
    background: #02060d;
}
.feature-list-home-tight {
    margin-top: 0;
    align-content: start;
}
.auth-form-card-home-compact {
    max-width: none;
    justify-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.site-footer-guest {
    padding-top: 6px;
}
.site-footer-inner-guest {
    justify-content: center;
    text-align: center;
    padding: 18px 22px;
}
.site-footer-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-weight: 600;
}
.site-footer-inline a,
.site-footer-inline span {
    color: var(--muted);
}
.site-footer-inline a:hover {
    color: var(--muted-2);
}
.site-footer-dot {
    opacity: .7;
}
@media (max-width: 1320px) {
    .auth-hero-home-compact {
        grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
    }
    .auth-hero-image-card {
        grid-column: 1;
    }
    .auth-hero-info-card {
        grid-column: 1;
    }
    .auth-form-card-home-compact {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    .auth-brand-art-login-contained img {
        height: clamp(240px, 28vw, 420px);
    }
}
@media (max-width: 980px) {
    .auth-hero-home-compact {
        grid-template-columns: 1fr;
    }
    .auth-form-card-home-compact,
    .auth-hero-info-card,
    .auth-hero-image-card {
        grid-column: auto;
        grid-row: auto;
    }
}
@media (max-width: 720px) {
    .site-footer-inner-guest {
        padding: 14px 16px;
    }
    .site-footer-inline {
        gap: 8px;
        font-size: .94rem;
    }
    .auth-brand-art-login-contained img {
        height: auto;
        max-height: 320px;
    }
}

.bot-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 22px;
    padding: 14px;
    border: 1px solid rgba(96, 165, 250, 0.12);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.6) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 40px rgba(2, 8, 23, .18);
}
.bot-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 18px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255,255,255,.03);
    color: #dbeafe;
    font-weight: 800;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.bot-tab:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(96, 165, 250, 0.22);
    transform: translateY(-1px);
}
.bot-tab.active {
    background: linear-gradient(135deg, rgba(37,99,235,.26) 0%, rgba(16,185,129,.18) 100%);
    border-color: rgba(96, 165, 250, 0.34);
    color: #fff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, .16);
}
.bot-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #93c5fd;
    font-size: .95rem;
    line-height: 1;
}
.bot-tab.active .bot-tab-icon {
    background: rgba(255,255,255,.12);
    border-color: rgba(191, 219, 254, .24);
    color: #fff;
}
.bot-tab-label {
    white-space: nowrap;
}
@media (max-width: 720px) {
    .bot-tabs {
        gap: 10px;
        padding: 10px;
    }
    .bot-tab {
        flex: 1 1 calc(50% - 10px);
        min-width: 0;
    }
    .bot-tab-label {
        font-size: .96rem;
    }
}
.bot-detail-split {
    align-items: start;
}
.bot-cases-split,
.bot-cases-split .panel-card,
.bot-cases-split .sticky-panel,
.bot-cases-split .case-form-group {
    overflow: visible;
}
.bot-cases-split .panel-card,
.bot-cases-split .sticky-panel {
    z-index: 1;
}
.bot-cases-split .sticky-panel {
    z-index: 6;
}
.bot-cases-split .case-field,
.bot-cases-split .case-field-label-row,
.bot-cases-split .help-tooltip {
    position: relative;
}
.bot-cases-split .case-field:hover,
.bot-cases-split .case-field:focus-within,
.bot-cases-split .help-tooltip:hover,
.bot-cases-split .help-tooltip:focus-visible {
    z-index: 20;
}
.overview-field-grid {
    align-items: start;
}
.overview-toolbar-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.overview-toggle-box {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255,255,255,.03);
}
.overview-toggle-label {
    font-weight: 800;
    color: var(--text);
}
.field-help {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.55;
}
.case-list-grid {
    display: grid;
    gap: 14px;
}
.case-list-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255,255,255,.025);
}
.case-list-card.is-disabled {
    opacity: .82;
}
.case-list-card.active {
    border-color: rgba(96, 165, 250, 0.28);
    box-shadow: 0 14px 30px rgba(37, 99, 235, .1);
}
.case-list-card-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.case-list-card-copy {
    min-width: 0;
}
.case-list-card-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.case-toggle-form {
    flex: 0 0 auto;
}
.case-list-card h3 {
    margin: 10px 0 6px;
}
.switch-inline-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
@media (max-width: 860px) {
    .case-list-card-head {
        flex-direction: column;
        align-items: stretch;
    }
    .case-toggle-form {
        align-self: flex-start;
    }
}
.bot-log-box {
    max-height: 820px;
    min-height: 440px;
}
button[disabled],
.button[disabled] {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(.08);
}
@media (max-width: 960px) {
    .overview-toolbar-grid {
        grid-template-columns: 1fr;
    }
}


.case-editor-hint {
    margin-bottom: 16px;
}
.case-form-group {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255,255,255,.025);
}
.case-form-group + .case-form-group {
    margin-top: 14px;
}
.case-form-group-head {
    margin-bottom: 14px;
}
.case-form-group-head h3 {
    margin: 0 0 6px;
}
.case-field-label-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.help-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(59, 130, 246, 0.14);
    color: #dbeafe;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    user-select: none;
}
.help-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    min-width: 220px;
    max-width: min(320px, 80vw);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.96);
    color: var(--text);
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: 0 14px 30px rgba(2, 6, 23, .36);
    opacity: 0;
    pointer-events: none;
    white-space: normal;
    z-index: 50;
    transition: opacity .16s ease, transform .16s ease;
}
.help-tooltip::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    width: 10px;
    height: 10px;
    border-right: 1px solid rgba(148, 163, 184, 0.22);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.96);
    transform: translateX(-50%) rotate(45deg);
    opacity: 0;
    pointer-events: none;
    z-index: 49;
    transition: opacity .16s ease, transform .16s ease;
}
.help-tooltip:hover::after,
.help-tooltip:hover::before,
.help-tooltip:focus-visible::after,
.help-tooltip:focus-visible::before {
    opacity: 1;
}
.help-tooltip:hover::after,
.help-tooltip:focus-visible::after {
    transform: translateX(-50%) translateY(-2px);
}
.help-tooltip:hover::before,
.help-tooltip:focus-visible::before {
    transform: translateX(-50%) translateY(-2px) rotate(45deg);
}
.case-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.case-form-grid .case-field-textarea {
    grid-column: 1 / -1;
}
.case-form-grid .case-field-bool {
    align-self: end;
}
.case-intro-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.case-intro-card {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255,255,255,.025);
}
.case-intro-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}
.case-intro-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}
.cases-search-row {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}
.cases-search-field {
    display: grid;
    gap: 8px;
}
.case-catalog-list {
    display: grid;
    gap: 14px;
}
.case-catalog-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255,255,255,.025);
}
.case-catalog-card.active {
    border-color: rgba(96, 165, 250, 0.28);
    box-shadow: 0 14px 30px rgba(37, 99, 235, .1);
}
.case-catalog-card-main {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.case-catalog-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(59, 130, 246, .14);
    border: 1px solid rgba(96, 165, 250, .22);
    color: #dbeafe;
    font-weight: 800;
}
.case-catalog-copy h3 {
    margin: 0 0 6px;
}
.case-catalog-summary {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}
.case-detail-guide {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}
@media (max-width: 980px) {
    .case-form-grid,
    .case-intro-grid,
    .case-catalog-card {
        grid-template-columns: 1fr;
    }
    .case-catalog-card .actions {
        width: 100%;
    }
}


.case-catalog-hint {
    margin-bottom: 18px;
}
.case-catalog-actions {
    display: grid;
    gap: 12px;
    align-self: center;
}
.case-catalog-actions .button,
.case-catalog-actions button {
    width: 100%;
}
.case-catalog-summary {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 980px) {
    .case-catalog-actions {
        width: 100%;
    }
}


.sort-arrows {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    vertical-align: middle;
}
.sort-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255,255,255,.04);
    color: var(--muted);
    text-decoration: none;
    font-size: .78rem;
    line-height: 1;
}
.sort-arrow:hover {
    border-color: rgba(96, 165, 250, .35);
    color: #dbeafe;
}
.sort-arrow.is-active {
    border-color: rgba(96, 165, 250, .45);
    background: rgba(59, 130, 246, .18);
    color: #eff6ff;
}

.sort-arrows.sort-arrows-compact {
    gap: 3px;
    margin-left: 4px;
}
.sort-arrow.sort-arrow-compact {
    width: 18px;
    height: 18px;
    font-size: .68rem;
}
.action-icons.action-icons-compact {
    gap: 6px;
}
.icon-btn.icon-btn-compact {
    width: 40px;
    min-width: 40px !important;
    height: 40px;
    min-height: 40px !important;
    border-radius: 12px;
}
.icon-btn.icon-btn-compact svg {
    width: 18px;
    height: 18px;
}
.cell-actions.cell-actions-compact {
    width: 188px;
    min-width: 188px;
}
.cell-actions.cell-actions-compact .action-icons {
    flex-wrap: nowrap;
    min-width: 0;
}


/* Custom selects */
.rh-select {
    position: relative;
    width: 100%;
}
.rh-select-native {
    position: absolute !important;
    inset: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}
.rh-select-trigger {
    width: 100%;
    min-height: 58px;
    padding: 0 48px 0 18px;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, .2);
    background: linear-gradient(180deg, rgba(17, 26, 42, .96) 0%, rgba(12, 20, 34, .96) 100%);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.rh-select-trigger:hover {
    border-color: rgba(96,165,250,.28);
}
.rh-select.is-open .rh-select-trigger,
.rh-select-trigger:focus-visible {
    outline: none;
    border-color: rgba(59,130,246,.55);
    box-shadow: 0 0 0 4px rgba(37,99,235,.18), 0 18px 40px rgba(2,8,23,.2);
}
.rh-select.is-disabled .rh-select-trigger {
    opacity: .6;
    cursor: not-allowed;
}
.rh-select-value {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.rh-select-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -7px;
    pointer-events: none;
}
.rh-select-arrow::before,
.rh-select-arrow::after {
    content: '';
    position: absolute;
    top: 3px;
    width: 8px;
    height: 2px;
    border-radius: 2px;
    background: #9fb5d6;
    transition: transform .18s ease;
}
.rh-select-arrow::before {
    left: 0;
    transform: rotate(45deg);
}
.rh-select-arrow::after {
    right: 0;
    transform: rotate(-45deg);
}
.rh-select.is-open .rh-select-arrow::before {
    transform: rotate(-45deg);
}
.rh-select.is-open .rh-select-arrow::after {
    transform: rotate(45deg);
}
.rh-select-menu {
    position: fixed;
    z-index: 9999;
    min-width: 180px;
    max-height: min(340px, calc(100vh - 24px));
    overflow: auto;
    padding: 10px;
    border-radius: 22px;
    border: 1px solid rgba(96,165,250,.22);
    background: linear-gradient(180deg, rgba(11, 19, 33, .985) 0%, rgba(8, 15, 28, .995) 100%);
    box-shadow: 0 28px 56px rgba(2,8,23,.5), inset 0 1px 0 rgba(255,255,255,.03);
    backdrop-filter: blur(20px);
}
.rh-select-menu[hidden] {
    display: none !important;
}
.rh-select-option {
    width: 100%;
    min-height: 46px;
    padding: 11px 16px;
    margin: 0 0 8px;
    border: 1px solid rgba(96,165,250,.08);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(7, 14, 27, .98) 0%, rgba(4, 10, 22, .99) 100%);
    color: #e7eefb;
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.rh-select-option:last-child {
    margin-bottom: 0;
}
.rh-select-option:hover,
.rh-select-option:focus-visible {
    outline: none;
    border-color: rgba(96,165,250,.18);
    background: linear-gradient(180deg, rgba(10, 26, 52, .96) 0%, rgba(6, 19, 40, .98) 100%);
    color: #ffffff;
}
.rh-select-option.is-selected {
    border-color: rgba(96,165,250,.28);
    background: linear-gradient(180deg, rgba(32, 53, 116, .98) 0%, rgba(29, 50, 112, .98) 100%);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(131,181,255,.16);
}
.rh-select-option.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}
.role-inline-editor-compact .rh-select {
    flex: 0 1 150px;
    min-width: 120px;
    width: auto;
}
.role-inline-editor-compact .rh-select-trigger {
    min-height: 42px;
    height: 42px;
    border-radius: 16px;
    padding: 0 40px 0 16px;
}
.role-inline-editor-compact .rh-select-arrow {
    right: 14px;
}
.org-switcher .rh-select,
.org-switcher .rh-select-trigger {
    min-width: 280px;
}
@media (max-width: 900px) {
    .org-switcher .rh-select,
    .org-switcher .rh-select-trigger {
        min-width: 0;
        width: 100%;
    }
}


.case-catalog-accordion {
    display: grid;
    gap: 16px;
}
.case-doc-card {
    border: 1px solid rgba(148,163,184,.12);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(10, 19, 34, .94) 0%, rgba(8, 16, 28, .98) 100%);
    overflow: hidden;
}
.case-doc-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    cursor: pointer;
}
.case-doc-summary::-webkit-details-marker {
    display: none;
}
.case-doc-summary::marker {
    content: '';
}
.case-doc-card[open] .case-doc-summary {
    border-bottom: 1px solid rgba(148,163,184,.12);
}
.case-doc-open-indicator {
    flex: 0 0 auto;
    color: var(--primary);
    font-weight: 700;
}
.case-doc-body {
    padding: 18px 22px 22px;
}
.case-doc-actions {
    gap: 12px;
}
.case-doc-add-form {
    margin: 0;
}
.case-doc-actions .button,
.case-doc-actions button {
    margin: 0;
}
@media (max-width: 900px) {
    .case-doc-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}
