/* ===================================================================
   Scarx Dashboard – Modern Theme (Vercel-inspired)
   ------------------------------------------------------------------
   Design tokens in CSS variables, Bootstrap-class overrides on top
   of Bootstrap 5.3.3. Dark-first, Light-mode supported via
   [data-bs-theme="light"] / [data-bs-theme="dark"].
   =================================================================== */

/* ----- Design tokens -------------------------------------------------- */
:root,
[data-bs-theme="light"] {
    /* Surface */
    --scx-bg:            #fafafa;
    --scx-bg-elev-1:     #ffffff;
    --scx-bg-elev-2:     #ffffff;
    --scx-bg-hover:      #f4f4f5;
    --scx-bg-active:     #ececef;
    --scx-bg-muted:      #f4f4f5;
    --scx-bg-inverse:    #0a0a0a;

    /* Border */
    --scx-border:        #e6e6e8;
    --scx-border-strong: #d4d4d8;
    --scx-border-focus:  #0070f3;

    /* Text */
    --scx-fg:            #0a0a0a;
    --scx-fg-muted:      #52525b;
    --scx-fg-subtle:     #a1a1aa;
    --scx-fg-inverse:    #ffffff;

    /* Accent */
    --scx-accent:        #0070f3;
    --scx-accent-hover:  #0761d1;
    --scx-accent-soft:   rgba(0, 112, 243, 0.10);
    --scx-accent-fg:     #ffffff;

    /* Semantic */
    --scx-success:       #16a34a;
    --scx-success-soft:  rgba(22, 163, 74, 0.12);
    --scx-warning:       #d97706;
    --scx-warning-soft:  rgba(217, 119, 6, 0.12);
    --scx-danger:        #dc2626;
    --scx-danger-soft:   rgba(220, 38, 38, 0.12);
    --scx-info:          #0891b2;
    --scx-info-soft:     rgba(8, 145, 178, 0.12);

    /* Sidebar */
    --scx-sidebar-bg:        #18181b;
    --scx-sidebar-fg:        #a1a1aa;
    --scx-sidebar-fg-active: #ffffff;
    --scx-sidebar-hover:     rgba(255, 255, 255, 0.06);
    --scx-sidebar-active:    rgba(255, 255, 255, 0.10);
    --scx-sidebar-border:    rgba(255, 255, 255, 0.07);
    --scx-sidebar-heading:   #71717a;

    /* Shape */
    --scx-radius-sm: 6px;
    --scx-radius:    8px;
    --scx-radius-lg: 12px;

    /* Shadow */
    --scx-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --scx-shadow:    0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    --scx-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);

    /* Geometry */
    --scx-sidebar-width:        240px;
    --scx-sidebar-collapsed:    64px;
    --scx-brand-height:         56px;

    /* Motion */
    --scx-ease:        cubic-bezier(0.16, 1, 0.3, 1);
    --scx-duration:    160ms;

    color-scheme: light;
}

[data-bs-theme="dark"] {
    --scx-bg:            #0a0a0a;
    --scx-bg-elev-1:     #111111;
    --scx-bg-elev-2:     #161616;
    --scx-bg-hover:      #1a1a1a;
    --scx-bg-active:     #222222;
    --scx-bg-muted:      #161616;
    --scx-bg-inverse:    #fafafa;

    --scx-border:        #262626;
    --scx-border-strong: #333333;
    --scx-border-focus:  #3291ff;

    --scx-fg:            #fafafa;
    --scx-fg-muted:      #a1a1aa;
    --scx-fg-subtle:     #71717a;
    --scx-fg-inverse:    #0a0a0a;

    --scx-accent:        #3291ff;
    --scx-accent-hover:  #5fa8ff;
    --scx-accent-soft:   rgba(50, 145, 255, 0.14);
    --scx-accent-fg:     #ffffff;

    --scx-success:       #22c55e;
    --scx-success-soft:  rgba(34, 197, 94, 0.16);
    --scx-warning:       #f59e0b;
    --scx-warning-soft:  rgba(245, 158, 11, 0.16);
    --scx-danger:        #ef4444;
    --scx-danger-soft:   rgba(239, 68, 68, 0.16);
    --scx-info:          #06b6d4;
    --scx-info-soft:     rgba(6, 182, 212, 0.16);

    --scx-sidebar-bg:        #131316;
    --scx-sidebar-fg:        #a1a1aa;
    --scx-sidebar-fg-active: #ffffff;
    --scx-sidebar-hover:     rgba(255, 255, 255, 0.05);
    --scx-sidebar-active:    rgba(255, 255, 255, 0.09);
    --scx-sidebar-border:    rgba(255, 255, 255, 0.06);
    --scx-sidebar-heading:   #52525b;

    --scx-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --scx-shadow:    0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    --scx-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);

    color-scheme: dark;
}

/* ----- Bootstrap variable bridge ------------------------------------- */
:root {
    --bs-body-bg: var(--scx-bg);
    --bs-body-color: var(--scx-fg);
    --bs-border-color: var(--scx-border);
    --bs-border-radius: var(--scx-radius);
    --bs-border-radius-sm: var(--scx-radius-sm);
    --bs-border-radius-lg: var(--scx-radius-lg);
    --bs-primary: var(--scx-accent);
    --bs-primary-rgb: 0, 112, 243;
    --bs-link-color: var(--scx-accent);
    --bs-link-hover-color: var(--scx-accent-hover);
    --bs-secondary-color: var(--scx-fg-muted);
    --bs-tertiary-color: var(--scx-fg-subtle);
}
[data-bs-theme="dark"] {
    --bs-body-bg: var(--scx-bg);
    --bs-body-color: var(--scx-fg);
    --bs-border-color: var(--scx-border);
    --bs-primary: var(--scx-accent);
    --bs-primary-rgb: 50, 145, 255;
    --bs-link-color: var(--scx-accent);
    --bs-link-hover-color: var(--scx-accent-hover);
    --bs-secondary-color: var(--scx-fg-muted);
    --bs-tertiary-color: var(--scx-fg-subtle);
}

/* ----- Base ----------------------------------------------------------- */
html, body {
    height: 100%;
    background: var(--scx-bg);
    color: var(--scx-fg);
    font-family: 'Inter', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-feature-settings: "cv11", "ss01", "ss03";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

a { color: var(--scx-accent); text-decoration: none; transition: color var(--scx-duration) var(--scx-ease); }
a:hover { color: var(--scx-accent-hover); text-decoration: none; }
a:focus { outline: none; }

hr {
    border: 0;
    border-top: 1px solid var(--scx-border);
    opacity: 1;
    margin: 1rem 0;
}

::selection { background: var(--scx-accent-soft); color: var(--scx-fg); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--scx-border-strong);
    border-radius: 10px;
    border: 2px solid var(--scx-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--scx-fg-subtle); }

/* ----- App shell ------------------------------------------------------ */
#wrapper { display: flex; min-height: 100vh; background: var(--scx-bg); }
#wrapper #content-wrapper {
    width: 100%;
    overflow-x: hidden;
    background: var(--scx-bg);
    margin-left: var(--scx-sidebar-width);
    transition: margin-left var(--scx-duration) var(--scx-ease);
}
#wrapper #content-wrapper #content { flex: 1 0 auto; }

@media (max-width: 768px) {
    #wrapper #content-wrapper { margin-left: 0; }
}

.container,
.container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.container-head {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--scx-border);
    margin-bottom: 1.5rem !important;
}
.container-head h1, .container-head .h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--scx-fg);
    letter-spacing: -0.01em;
}

/* ----- Sidebar -------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--scx-sidebar-width) !important;
    height: 100vh;
    min-height: 100vh;
    background: var(--scx-sidebar-bg);
    border-right: 1px solid var(--scx-sidebar-border);
    padding: 0 12px 16px;
    margin: 0;
    overflow: hidden;
    z-index: 100;
    list-style: none;
    display: flex;
    flex-direction: column;
    transition: transform var(--scx-duration) var(--scx-ease);
}

.sidebar .sidebar-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    margin: 0 -12px;
    padding: 0 12px;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.toggled,
    body.sidebar-mobile-open .sidebar { transform: translateX(0); }
}

.sidebar.toggled { width: var(--scx-sidebar-width) !important; }

/* ----- Mobile sidebar toggle (floating) ------------------------------ */
.mobile-sidebar-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    width: 40px;
    height: 40px;
    border-radius: var(--scx-radius);
    background: var(--scx-bg-elev-1);
    border: 1px solid var(--scx-border);
    color: var(--scx-fg);
    box-shadow: var(--scx-shadow);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    transition: background var(--scx-duration) var(--scx-ease),
                border-color var(--scx-duration) var(--scx-ease);
}
.mobile-sidebar-toggle:hover,
.mobile-sidebar-toggle:focus {
    background: var(--scx-bg-hover);
    border-color: var(--scx-border-strong);
    outline: none;
}

.mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--scx-duration) var(--scx-ease);
}

@media (max-width: 768px) {
    .mobile-sidebar-toggle { display: inline-flex; }
    body.sidebar-mobile-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.sidebar-mobile-open {
        overflow: hidden;
    }
}

/* Brand */
.sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--scx-brand-height);
    padding: 0 18px;
    margin: 0 -12px 14px -12px;
    text-decoration: none;
    border-bottom: 1px solid var(--scx-sidebar-border);
    flex-shrink: 0;
}
.sidebar .sidebar-brand .sidebar-brand-icon {
    display: flex;
    align-items: center;
    line-height: 0;
}
.sidebar .sidebar-brand img {
    height: 28px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    display: block;
    filter: brightness(1.05) contrast(1.05);
    opacity: 0.95;
}

/* Section heading */
.sidebar .sidebar-heading {
    text-align: left;
    padding: 16px 12px 6px;
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--scx-sidebar-heading);
}

.sidebar hr.sidebar-divider {
    border-top: 1px solid var(--scx-sidebar-border);
    margin: 8px 0;
    opacity: 1;
}
.sidebar hr.sidebar-divider.my-0 { display: none; }

/* Nav items */
.sidebar .nav-item { position: relative; margin: 1px 0; }
.sidebar .nav-item .nav-link {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100% !important;
    padding: 7px 10px !important;
    border-radius: var(--scx-radius-sm);
    text-align: left !important;
    color: var(--scx-sidebar-fg) !important;
    font-size: 0.8125rem;
    font-weight: 450;
    text-decoration: none;
    transition: background var(--scx-duration) var(--scx-ease),
    color var(--scx-duration) var(--scx-ease);
    border-left: none !important;
}
.sidebar .nav-item .nav-link i {
    width: 16px;
    font-size: 0.875rem !important;
    text-align: center;
    margin: 0 !important;
    color: var(--scx-sidebar-fg) !important;
    transition: color var(--scx-duration) var(--scx-ease);
}
.sidebar .nav-item .nav-link span {
    font-size: 0.8125rem !important;
    display: inline !important;
    line-height: 1.4;
}
.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item .nav-link:focus {
    background: var(--scx-sidebar-hover) !important;
    color: var(--scx-sidebar-fg-active) !important;
    border-left: none !important;
    padding-left: 10px !important;
}
.sidebar .nav-item .nav-link:hover i { color: var(--scx-sidebar-fg-active) !important; }

.sidebar .nav-item .nav-link.active {
    background: var(--scx-sidebar-active) !important;
    color: var(--scx-sidebar-fg-active) !important;
    font-weight: 500;
    border-left: none !important;
    padding-left: 10px !important;
}
.sidebar .nav-item .nav-link.active i { color: var(--scx-sidebar-fg-active) !important; }

/* Sidebar toggle button */
.sidebar #sidebarToggle { display: none; }

/* ----- Sidebar Header (Gateway + User) ------------------------------- */
.sidebar .sidebar-header {
    flex-shrink: 0;
    margin: 0 -12px 8px;
    padding: 4px 12px 10px;
    border-bottom: 1px solid var(--scx-sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar .sidebar-heading-gateway {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 16px;
    padding-bottom: 6px;
}

.sidebar .sidebar-gateway-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--scx-sidebar-hover);
    border: 1px solid var(--scx-sidebar-border);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: none;
    line-height: 1.4;
}
.sidebar .sidebar-gateway-pill-label {
    color: var(--scx-sidebar-heading);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.sidebar .sidebar-gateway-pill-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    min-width: 7ch;
    text-align: right;
    display: inline-block;
}

.sidebar .sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    justify-content: space-evenly;
}
.sidebar .sidebar-user-image {
    height: 28px;
    width: 28px;
    border-radius: 50%;
    border: 1px solid var(--scx-sidebar-border);
    flex-shrink: 0;
    object-fit: cover;
}
.sidebar .sidebar-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    overflow: hidden;
    min-width: 0;
}
.sidebar .sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--scx-sidebar-fg-active);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar .sidebar-user-role {
    font-size: 0.6875rem;
    color: var(--scx-sidebar-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .sidebar-user-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar .sidebar-user-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--scx-radius-sm);
    color: var(--scx-sidebar-fg) !important;
    font-size: 0.8125rem;
    font-weight: 450;
    text-decoration: none;
    transition: background var(--scx-duration) var(--scx-ease),
                color var(--scx-duration) var(--scx-ease);
}
.sidebar .sidebar-user-action i {
    width: 16px;
    font-size: 0.875rem;
    text-align: center;
    color: var(--scx-sidebar-fg);
    transition: color var(--scx-duration) var(--scx-ease);
}
.sidebar .sidebar-user-action:hover,
.sidebar .sidebar-user-action:focus {
    background: var(--scx-sidebar-hover);
    color: var(--scx-sidebar-fg-active) !important;
    text-decoration: none;
}
.sidebar .sidebar-user-action:hover i,
.sidebar .sidebar-user-action:focus i {
    color: var(--scx-sidebar-fg-active);
}

/* ----- Cards ---------------------------------------------------------- */
.card {
    background: var(--scx-bg-elev-1) !important;
    border: 1px solid var(--scx-border) !important;
    border-radius: var(--scx-radius-lg) !important;
    box-shadow: none !important;
    overflow: hidden;
    transition: border-color var(--scx-duration) var(--scx-ease);
}
.card.shadow { box-shadow: var(--scx-shadow-sm) !important; }
.card:hover { border-color: var(--scx-border-strong) !important; }

.card .card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--scx-border) !important;
    padding: 14px 18px !important;
    color: var(--scx-fg);
}
.card .card-header h6,
.card .card-header .h6 {
    font-size: 0.875rem;
    font-weight: 600 !important;
    color: var(--scx-fg) !important;
    letter-spacing: -0.005em;
    margin: 0;
}
.card .card-header .text-primary { color: var(--scx-fg) !important; }

.card .card-body {
    padding: 18px !important;
    color: var(--scx-fg);
    background: transparent !important;
}

.card .card-header .row { margin: 0; align-items: center; flex-wrap: nowrap; gap: 8px; }
.card .card-header .col { padding: 0; }

/* ----- Tables --------------------------------------------------------- */
.table {
    color: var(--scx-fg) !important;
    border-color: var(--scx-border) !important;
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-color: var(--scx-fg);
    --bs-table-border-color: var(--scx-border);
    --bs-table-hover-bg: var(--scx-bg-hover);
    --bs-table-hover-color: var(--scx-fg);
}
.table th, .table td {
    border-top: 1px solid var(--scx-border) !important;
    border-color: var(--scx-border) !important;
    padding: 10px 12px;
    vertical-align: middle;
    font-size: 0.8125rem;
}
.table thead th,
.table thead.thead-dark th {
    background: var(--scx-bg-muted) !important;
    color: var(--scx-fg-muted) !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--scx-border) !important;
    border-top: none !important;
}
.table-bordered { border: 1px solid var(--scx-border) !important; }
.table-bordered th, .table-bordered td { border: 1px solid var(--scx-border) !important; }
.table-sm th, .table-sm td { padding: 2px 10px; font-size: 0.8125rem; }
.table-xs td, .table-xs th { padding: 4px 8px; font-size: 0.75rem; }
.table-hover > tbody > tr:hover { background: var(--scx-bg-hover); }
.table-responsive { border-radius: 0; }

.table-indent { background: var(--scx-bg-muted) !important; }
.table-xdark { background: var(--scx-bg-elev-2) !important; color: var(--scx-fg) !important; }
.table-xdark > th, .table-xdark > td { background: var(--scx-bg-elev-2); color: var(--scx-fg); }

/* ----- Buttons -------------------------------------------------------- */
.btn {
    border-radius: var(--scx-radius-sm) !important;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid transparent;
    box-shadow: none !important;
    transition: background var(--scx-duration) var(--scx-ease),
    border-color var(--scx-duration) var(--scx-ease),
    color var(--scx-duration) var(--scx-ease);
    line-height: 1.4;
}
.btn:focus { box-shadow: 0 0 0 2px var(--scx-accent-soft) !important; }
.btn-sm { padding: 4px 10px; font-size: 0.75rem; }
.btn-lg { padding: 10px 18px; font-size: 0.9375rem; }

.btn-primary {
    background: var(--scx-fg) !important;
    border-color: var(--scx-fg) !important;
    color: var(--scx-fg-inverse) !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--scx-fg-muted) !important;
    border-color: var(--scx-fg-muted) !important;
    color: var(--scx-fg-inverse) !important;
}

.btn-outline-primary {
    background: transparent !important;
    border-color: var(--scx-border-strong) !important;
    color: var(--scx-fg) !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--scx-bg-hover) !important;
    border-color: var(--scx-fg-muted) !important;
    color: var(--scx-fg) !important;
}

.btn-secondary {
    background: var(--scx-bg-muted) !important;
    border-color: var(--scx-border) !important;
    color: var(--scx-fg) !important;
}
.btn-secondary:hover {
    background: var(--scx-bg-hover) !important;
    border-color: var(--scx-border-strong) !important;
}

.btn-success { background: var(--scx-success) !important; border-color: var(--scx-success) !important; color: #fff !important; }
.btn-danger  { background: var(--scx-danger)  !important; border-color: var(--scx-danger)  !important; color: #fff !important; }
.btn-warning { background: var(--scx-warning) !important; border-color: var(--scx-warning) !important; color: #fff !important; }
.btn-info    { background: var(--scx-info)    !important; border-color: var(--scx-info)    !important; color: #fff !important; }

.btn-link {
    color: var(--scx-accent) !important;
    background: transparent !important;
    border-color: transparent !important;
    padding: 6px 8px;
}
.btn-link:hover { color: var(--scx-accent-hover) !important; text-decoration: none; background: var(--scx-bg-hover) !important; }

/* ----- Forms ---------------------------------------------------------- */
.form-control,
.form-select {
    background: var(--scx-bg-elev-1) !important;
    border: 1px solid var(--scx-border) !important;
    color: var(--scx-fg) !important;
    border-radius: var(--scx-radius-sm) !important;
    font-size: 0.8125rem;
    padding: 7px 10px;
    box-shadow: none !important;
    transition: border-color var(--scx-duration) var(--scx-ease),
    box-shadow var(--scx-duration) var(--scx-ease);
}
.form-control:focus,
.form-select:focus {
    background: var(--scx-bg-elev-1) !important;
    border-color: var(--scx-border-focus) !important;
    box-shadow: 0 0 0 3px var(--scx-accent-soft) !important;
    color: var(--scx-fg) !important;
}
.form-control::placeholder { color: var(--scx-fg-subtle); opacity: 1; }
.form-control:disabled, .form-select:disabled { background: var(--scx-bg-muted) !important; color: var(--scx-fg-muted) !important; }

.form-select-sm {
    padding: 0 1rem !important;
}

.form-label, .col-form-label {
    color: var(--scx-fg);
    font-size: 0.8125rem;
    font-weight: 500;
}

.form-check-input {
    background-color: var(--scx-bg-elev-1);
    border-color: var(--scx-border-strong);
}
.form-check-input:checked {
    background-color: var(--scx-accent);
    border-color: var(--scx-accent);
}

.input-group-text {
    background: var(--scx-bg-muted) !important;
    border: 1px solid var(--scx-border) !important;
    color: var(--scx-fg-muted) !important;
    font-size: 0.8125rem;
}

/* ----- Dropdowns ------------------------------------------------------ */
.dropdown-menu {
    background: var(--scx-bg-elev-1) !important;
    border: 1px solid var(--scx-border) !important;
    border-radius: var(--scx-radius) !important;
    box-shadow: var(--scx-shadow-lg) !important;
    padding: 4px !important;
    font-size: 0.8125rem;
    min-width: 180px;
}
.dropdown-item {
    color: var(--scx-fg) !important;
    padding: 7px 10px !important;
    border-radius: var(--scx-radius-sm) !important;
    font-size: 0.8125rem !important;
    transition: background var(--scx-duration) var(--scx-ease);
}
.dropdown-item:hover, .dropdown-item:focus {
    background: var(--scx-bg-hover) !important;
    color: var(--scx-fg) !important;
}
.dropdown-divider {
    border-top: 1px solid var(--scx-border) !important;
    margin: 4px 0;
}

/* ----- Modals --------------------------------------------------------- */
.modal-content {
    background: var(--scx-bg-elev-1) !important;
    border: 1px solid var(--scx-border) !important;
    border-radius: var(--scx-radius-lg) !important;
    box-shadow: var(--scx-shadow-lg) !important;
    color: var(--scx-fg);
}
.modal-header {
    border-bottom: 1px solid var(--scx-border) !important;
    padding: 16px 20px;
}
.modal-body { padding: 20px; }
.modal-footer {
    border-top: 1px solid var(--scx-border) !important;
    padding: 14px 20px;
    gap: 8px;
}
.modal-header .close,
.modal-header .btn-close {
    background: transparent;
    border: 0;
    color: var(--scx-fg-muted);
    font-size: 1.25rem;
    padding: 4px 8px;
    border-radius: var(--scx-radius-sm);
    opacity: 1;
}
.modal-header .close:hover { background: var(--scx-bg-hover); color: var(--scx-fg); }

/* ----- Badges --------------------------------------------------------- */
.badge {
    font-weight: 500;
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.01em;
}
.badge.bg-primary, .badge.badge-primary { background: var(--scx-accent-soft) !important; color: var(--scx-accent) !important; }
.badge.bg-success, .badge.badge-success { background: var(--scx-success-soft) !important; color: var(--scx-success) !important; }
.badge.bg-danger,  .badge.badge-danger  { background: var(--scx-danger-soft)  !important; color: var(--scx-danger)  !important; }
.badge.bg-warning, .badge.badge-warning { background: var(--scx-warning-soft) !important; color: var(--scx-warning) !important; }
.badge.bg-info,    .badge.badge-info    { background: var(--scx-info-soft)    !important; color: var(--scx-info)    !important; }

/* ----- Progress ------------------------------------------------------- */
.progress {
    background: var(--scx-bg-muted) !important;
    height: 26px;
    border-radius: 999px;
    overflow: hidden;
    font-size: 0.6875rem;
}
.progress-bar {
    background: var(--scx-accent);
    border-radius: 999px;
    transition: width 600ms var(--scx-ease);
    font-weight: 500;
}

/* ----- Footer --------------------------------------------------------- */
footer.sticky-footer {
    padding: 1.5rem;
    background: transparent !important;
    border-top: 1px solid var(--scx-border);
    color: var(--scx-fg-subtle);
    font-size: 0.75rem;
}

/* ----- Utility colors ------------------------------------------------- */
.text-primary { color: var(--scx-fg) !important; }
.text-secondary { color: var(--scx-fg-muted) !important; }
.text-muted { color: var(--scx-fg-muted) !important; }
.text-success { color: var(--scx-success) !important; }
.text-danger  { color: var(--scx-danger)  !important; }
.text-warning { color: var(--scx-warning) !important; }
.text-info    { color: var(--scx-info)    !important; }

.bg-primary { background-color: var(--scx-accent) !important; }
.bg-success { background-color: var(--scx-success) !important; }
.bg-danger  { background-color: var(--scx-danger)  !important; }
.bg-warning { background-color: var(--scx-warning) !important; }
.bg-info    { background-color: var(--scx-info)    !important; }

/* Legacy gray scale → modern foreground hierarchy */
.text-gray-100 { color: var(--scx-fg) !important; }
.text-gray-200 { color: var(--scx-fg) !important; }
.text-gray-300 { color: var(--scx-fg-muted) !important; }
.text-gray-400 { color: var(--scx-fg-muted) !important; }
.text-gray-500 { color: var(--scx-fg-muted) !important; }
.text-gray-600 { color: var(--scx-fg-muted) !important; }
.text-gray-700 { color: var(--scx-fg) !important; }
.text-gray-800 { color: var(--scx-fg) !important; }
.text-gray-900 { color: var(--scx-fg) !important; }

.bg-gray-100, .bg-gray-200 { background-color: var(--scx-bg-muted) !important; }
.bg-gray-300, .bg-gray-400 { background-color: var(--scx-bg-hover) !important; }
.bg-gray-500, .bg-gray-600 { background-color: var(--scx-bg-active) !important; }
.bg-gray-700, .bg-gray-800, .bg-gray-900 { background-color: var(--scx-bg-inverse) !important; color: var(--scx-fg-inverse) !important; }

.bg-gradient-primary,
.bg-gradient-blue { background: var(--scx-sidebar-bg) !important; background-image: none !important; }

.font-weight-bold { font-weight: 600 !important; }

/* Brand colored statuses */
.scarx-c-black  { color: var(--scx-fg) !important; }
.scarx-c-green  { color: var(--scx-success) !important; }
.scarx-c-yellow { color: var(--scx-warning) !important; }
.scarx-c-red    { color: var(--scx-danger) !important; }

/* ----- Bootstrap 4 spacing compat (mr-*, ml-*) ------------------------ */
.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }
.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }
.ml-md-3 { margin-left: 1rem !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.pl-0 { padding-left: 0 !important; }
.pr-0 { padding-right: 0 !important; }

/* ----- Scroll-to-top + reload buttons --------------------------------- */
.scroll-to-top,
.reload-button {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    color: var(--scx-fg) !important;
    background: var(--scx-bg-elev-1) !important;
    border: 1px solid var(--scx-border);
    border-radius: var(--scx-radius);
    box-shadow: var(--scx-shadow-sm);
    transition: border-color var(--scx-duration) var(--scx-ease), background var(--scx-duration) var(--scx-ease);
}
.scroll-to-top:hover, .reload-button:hover {
    background: var(--scx-bg-hover) !important;
    border-color: var(--scx-border-strong) !important;
    color: var(--scx-fg) !important;
}
.scroll-to-top { right: 4rem !important; }

/* ----- Toasts (Blazored) --------------------------------------------- */
.blazored-toast {
    border-radius: var(--scx-radius-lg) !important;
    box-shadow: var(--scx-shadow-lg) !important;
    border: 1px solid var(--scx-border);
    color: #fff;
    backdrop-filter: blur(8px);
}
.blazored-toast-info    { background: var(--scx-info)    !important; }
.blazored-toast-success { background: var(--scx-success) !important; }
.blazored-toast-warning { background: var(--scx-warning) !important; }
.blazored-toast-error   { background: var(--scx-danger)  !important; }

/* ----- Tooltip (custom) ---------------------------------------------- */
.tooltip-wrapper { border-bottom: 1px dotted var(--scx-fg-subtle); }
.tooltip-wrapper .tooltip-wrapper-tooltip {
    background-color: var(--scx-bg-inverse);
    color: var(--scx-fg-inverse);
    border-radius: var(--scx-radius-sm);
    padding: 6px 10px;
    font-size: 0.75rem;
}
.tooltip-wrapper .tooltip-wrapper-tooltip::after {
    border-color: var(--scx-bg-inverse) transparent transparent transparent;
}

/* ----- Misc cleanup -------------------------------------------------- */
/* Disable jQuery legacy darkmode overrides; we handle theme via tokens */
.darkmode { color: inherit !important; }
.darkmode .card,
.darkmode .modal-content,
.darkmode .dropdown-menu,
.darkmode .input-group-text,
.darkmode .card-header,
.darkmode .table,
.darkmode input,
.darkmode select { background: unset !important; border-color: unset !important; color: unset !important; }
.darkmode #content-wrapper,
.darkmode .sticky-footer { background-color: unset !important; }
.darkmode .table-indent { background-color: var(--scx-bg-muted) !important; }
.darkmode .table th, .darkmode .table td { border-top: 1px solid var(--scx-border) !important; }
.darkmode .progress { background-color: var(--scx-bg-muted) !important; }
.darkmode .progress-bar { background-color: var(--scx-accent) !important; border: none !important; }
.darkmode .text-primary { color: var(--scx-fg) !important; }

/* Auth views */
.logout-page-index, .login-page-index {
    background: var(--scx-bg) !important;
}
.account-log-page .card-login {
    background: var(--scx-bg-elev-1) !important;
    background-image: none !important;
    border: 1px solid var(--scx-border);
    border-radius: var(--scx-radius-lg);
    box-shadow: var(--scx-shadow);
}
.account-log-page .form-style {
    background: var(--scx-bg-muted) !important;
    color: var(--scx-fg) !important;
    border: 1px solid var(--scx-border) !important;
    box-shadow: none !important;
    border-radius: var(--scx-radius-sm);
}
.account-log-page .input-icon { color: var(--scx-accent); }
.account-log-page .btn-login {
    background: var(--scx-fg) !important;
    color: var(--scx-fg-inverse) !important;
    border-radius: var(--scx-radius-sm) !important;
    box-shadow: none !important;
}
.account-log-page .btn-login:hover {
    background: var(--scx-fg-muted) !important;
    color: var(--scx-fg-inverse) !important;
    box-shadow: none !important;
}

/* IconWithText animation refinement */
.icon-with-text .icon-with-text-text-container {
    transition: max-width 600ms var(--scx-ease);
}

/* Page heading actions */
.container-head .btn-outline-primary {
    background: var(--scx-bg-elev-1) !important;
    border: 1px solid var(--scx-border) !important;
    color: var(--scx-fg-muted) !important;
}
.container-head .btn-outline-primary:hover {
    background: var(--scx-bg-hover) !important;
    color: var(--scx-fg) !important;
    border-color: var(--scx-border-strong) !important;
}

/* Card collapse chevron */
.card-header .fa-chevron-down,
.card-header .fa-chevron-right {
    color: var(--scx-fg-subtle);
    font-size: 0.75rem;
    transition: color var(--scx-duration) var(--scx-ease);
}
.card-header .fa-chevron-down:hover,
.card-header .fa-chevron-right:hover { color: var(--scx-fg); }

/* ===================================================================
   Page primitives — for page content UX (heroes, stats, sections)
   =================================================================== */

/* Page Hero — top of content area, sets the tone */
.page-hero {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--scx-border);
}
.page-hero-eyebrow {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--scx-fg-subtle);
}
.page-hero-title {
    font-size: 1.625rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--scx-fg);
    margin: 0;
    line-height: 1.2;
}
.page-hero-subtitle {
    font-size: 0.875rem;
    color: var(--scx-fg-muted);
    margin: 0;
    max-width: 60ch;
}

/* Section header — separates groups within a page */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 24px 0 12px;
}
.section-header-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--scx-fg);
    margin: 0;
    letter-spacing: -0.005em;
}
.section-header-subtitle {
    font-size: 0.8125rem;
    color: var(--scx-fg-muted);
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

/* Stat card — single key metric with optional accent */
.stat-card {
    background: var(--scx-bg-elev-1);
    border: 1px solid var(--scx-border);
    border-radius: var(--scx-radius-lg);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color var(--scx-duration) var(--scx-ease);
}
.stat-card:hover { border-color: var(--scx-border-strong); }
.stat-card-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--scx-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}
.stat-card-value {
    font-size: 1.625rem;
    font-weight: 600;
    color: var(--scx-fg);
    letter-spacing: -0.02em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.stat-card-meta {
    font-size: 0.75rem;
    color: var(--scx-fg-subtle);
    margin: 0;
}
.stat-card-accent-success { border-left: 2px solid var(--scx-success); }
.stat-card-accent-warning { border-left: 2px solid var(--scx-warning); }
.stat-card-accent-danger  { border-left: 2px solid var(--scx-danger); }
.stat-card-accent-info    { border-left: 2px solid var(--scx-accent); }

/* Status dot — colored circle for inline status indication */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--scx-fg-subtle);
    flex-shrink: 0;
}
.status-dot-success { background: var(--scx-success); box-shadow: 0 0 0 3px var(--scx-success-soft); }
.status-dot-warning { background: var(--scx-warning); box-shadow: 0 0 0 3px var(--scx-warning-soft); }
.status-dot-danger  { background: var(--scx-danger);  box-shadow: 0 0 0 3px var(--scx-danger-soft); }
.status-dot-muted   { background: var(--scx-fg-subtle); }

/* Status pill — labeled chip for inline state */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    background: var(--scx-bg-muted);
    color: var(--scx-fg-muted);
    border: 1px solid var(--scx-border);
}
.status-pill-success { background: var(--scx-success-soft); color: var(--scx-success); border-color: transparent; }
.status-pill-warning { background: var(--scx-warning-soft); color: var(--scx-warning); border-color: transparent; }
.status-pill-danger  { background: var(--scx-danger-soft);  color: var(--scx-danger);  border-color: transparent; }
.status-pill-info    { background: var(--scx-accent-soft);  color: var(--scx-accent);  border-color: transparent; }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    color: var(--scx-fg-muted);
}
.empty-state-icon {
    font-size: 2rem;
    color: var(--scx-fg-subtle);
    margin-bottom: 12px;
}
.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--scx-fg);
    margin: 0 0 4px;
}
.empty-state-text {
    font-size: 0.875rem;
    color: var(--scx-fg-muted);
    max-width: 40ch;
}

/* Sticky table head inside scrolling container */
.table-responsive {
    border: 1px solid var(--scx-border);
    border-radius: var(--scx-radius-lg);
    overflow: auto;
    max-height: none;
}
.card .table-responsive {
    border: none;
    border-radius: 0;
}
.card .card-body > .table-responsive:only-child {
    margin: -18px;
    width: calc(100% + 36px);
}

/* Tabular numbers for data tables */
.table td, .table th { font-variant-numeric: tabular-nums; }

/* ===================================================================
   Bootstrap 4 / legacy compat — globale Patterns die in vielen Pages
   wiederkehren
   =================================================================== */

/* BS4 input-group-prepend → BS5 nutzt input-group-text direkt */
.input-group { flex-wrap: nowrap; }
.input-group-prepend, .input-group-append {
    display: flex;
    align-items: stretch;
}
.input-group-prepend .input-group-text,
.input-group-append  .input-group-text {
    border-radius: 0;
    border: 1px solid var(--scx-border);
    background: var(--scx-bg-muted);
    color: var(--scx-fg-muted);
    font-size: 0.8125rem;
    padding: 0 10px !important;
    height: auto !important;
    display: inline-flex;
    align-items: center;
}
.input-group-prepend .input-group-text {
    border-right: 0;
    border-top-left-radius: var(--scx-radius-sm);
    border-bottom-left-radius: var(--scx-radius-sm);
}
.input-group-append .input-group-text {
    border-left: 0;
    border-top-right-radius: var(--scx-radius-sm);
    border-bottom-right-radius: var(--scx-radius-sm);
}
.input-group-prepend + .form-control,
.input-group-prepend ~ .form-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: 0;
}
.input-group .form-control + .input-group-append .form-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group .form-control:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group .form-control:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* BS4 form-group row → modernisiert: gleicher Stil aber bessere Spacing */
.form-group { margin-bottom: 14px; }
.form-group.row { margin-left: 0; margin-right: 0; align-items: center; }
.col-form-label {
    color: var(--scx-fg);
    font-size: 0.8125rem;
    font-weight: 500;
    padding-top: 0;
    padding-bottom: 0;
}
.col-form-label > i { color: var(--scx-fg-muted); width: 16px; text-align: center; }

/* form-check (checkbox/radio with label) modernisieren */
.form-check { padding-left: 1.5em; margin-bottom: 6px; }
.form-check .form-check-input { margin-left: -1.5em; margin-top: 0.2em; cursor: pointer; }
.form-check-label { font-size: 0.8125rem; color: var(--scx-fg); cursor: pointer; }

/* Range slider */
.form-range { accent-color: var(--scx-accent); }

/* Nav tabs — modernisieren (statt border-color inline) */
.nav-tabs {
    border-bottom: 1px solid var(--scx-border);
    margin: 16px 0 0;
    gap: 0;
}
.nav-tabs .nav-item { margin-bottom: -1px; }
.nav-tabs .nav-link {
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    color: var(--scx-fg-muted) !important;
    padding: 8px 14px !important;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0 !important;
    transition: color var(--scx-duration) var(--scx-ease),
    border-color var(--scx-duration) var(--scx-ease);
    cursor: pointer;
}
.nav-tabs .nav-link:hover {
    color: var(--scx-fg) !important;
    border-bottom-color: var(--scx-border-strong) !important;
}
.nav-tabs .nav-link.active {
    color: var(--scx-fg) !important;
    background: transparent !important;
    border-bottom: 2px solid var(--scx-fg) !important;
}

/* btn-dark — moderne Treatment für die häufige "compact icon button"
   Nutzung: <button class="btn btn-dark" style="padding: 0 10px; line-height: unset; font-size: inherit"> */
.btn-dark {
    background: var(--scx-bg-elev-1) !important;
    color: var(--scx-fg) !important;
    border: 1px solid var(--scx-border) !important;
    padding: 5px 10px;
    font-size: 0.75rem !important;
    font-weight: 500;
    line-height: 1.4 !important;
    border-radius: var(--scx-radius-sm) !important;
    box-shadow: none !important;
    transition: background var(--scx-duration) var(--scx-ease),
    border-color var(--scx-duration) var(--scx-ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-dark:hover, .btn-dark:focus {
    background: var(--scx-bg-hover) !important;
    color: var(--scx-fg) !important;
    border-color: var(--scx-border-strong) !important;
}
.btn-dark:disabled, .btn-dark.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-dark i { font-size: 0.75rem; }
.btn-dark.no-theme {
    /* keep inline background-color from page (used for restriction toggles) */
    color: var(--scx-fg) !important;
    border: 1px solid var(--scx-border) !important;
}

/* Custom switch (BS4 custom-control custom-switch) → Toggle */
.custom-control.custom-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-left: 0;
    min-height: auto;
}
.custom-control-input {
    position: relative;
    width: 32px;
    height: 18px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--scx-bg-active);
    border: 1px solid var(--scx-border);
    border-radius: 999px;
    cursor: pointer;
    margin: 0;
    transition: background var(--scx-duration) var(--scx-ease);
}
.custom-control-input::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--scx-duration) var(--scx-ease);
}
.custom-control-input:checked {
    background: var(--scx-accent);
    border-color: var(--scx-accent);
}
.custom-control-input:checked::after { transform: translateX(14px); }
.custom-control-label {
    font-size: 0.8125rem;
    color: var(--scx-fg-muted);
    cursor: pointer;
    margin: 0;
}

/* table-xdark → flatter, theme-aware */
.table-xdark {
    background: var(--scx-bg-elev-1) !important;
    color: var(--scx-fg) !important;
}
.table-xdark > th, .table-xdark > td,
.table-xdark thead th, .table-xdark tbody td, .table-xdark tbody th {
    background: transparent !important;
    color: var(--scx-fg) !important;
    border-color: var(--scx-border) !important;
}

/* "Pipe" separator columns in tables (legacy '|' trennspalten) */
.table th:has(> :only-child:where(:contains("|"))),
.table td:has(> :only-child:where(:contains("|"))) {
    color: var(--scx-fg-subtle);
    width: 1px;
    padding-left: 4px;
    padding-right: 4px;
}

/* Page-Heading container in MainLayout */
.container-head {
    /* In v2 hat dein Layout schon einen container-head; pages mit
       eigenem .page-hero sollen ihn gut zusammen verwendet werden */
}
.container-head:empty,
.container-head:has(> h1:empty:only-child),
.container-head:has(> h1 > #dashboard-title:empty:only-child) {
    display: none;
}

/* ScarxBotOverview-style "stat punkt" in tabellen — runde Glow-Dots */
td .scarx-c-green,
td .scarx-c-yellow,
td .scarx-c-red,
th .scarx-c-green,
th .scarx-c-yellow,
th .scarx-c-red {
    font-variant-emoji: text;
}
.scarx-c-green:not(td):not(th)::before,
.scarx-c-yellow:not(td):not(th)::before,
.scarx-c-red:not(td):not(th)::before {
    content: '';
}

/* Headers in <Card> ohne extra `font-weight-bold text-primary` —
   Da viele Pages noch das alte Markup haben, bridgen wir es */
.card .card-header h6.font-weight-bold,
.card .card-header h6.text-primary {
    font-weight: 600 !important;
    color: var(--scx-fg) !important;
}

/* Modal title heading */
.modal-title, h5.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--scx-fg);
    letter-spacing: -0.005em;
    margin: 0;
}

/* Card with nested Cards spacing — z.B. CardTable's nested Card */
.card .card { box-shadow: none !important; }

/* WorldDataPicker (von BlazorLib) — bekommt den gleichen treatment */
.world-data-picker, .world-picker {
    margin-bottom: 16px;
}

/* Chart area sizing (already in old CSS) */
.chart-area, .chart-bar { position: relative; height: 22rem; width: 100%; }
.chart-pie { position: relative; height: 22rem; width: 100%; }

/* Generic dl/dt/dd for prop lists */
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dt { font-weight: 500; color: var(--scx-fg-muted); font-size: 0.8125rem; }
dd { margin: 0; color: var(--scx-fg); font-size: 0.8125rem; }

/* InlineAdd / InlineRemove visual cleanup */
.inline-add, .inline-remove {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}


/* Sidebar-toggled body adjustment (desktop collapse) */
@media (min-width: 769px) {
    body.sidebar-toggled .sidebar { transform: translateX(0); width: var(--scx-sidebar-collapsed) !important; }
    body.sidebar-toggled #content-wrapper { margin-left: var(--scx-sidebar-collapsed); }
    body.sidebar-toggled .sidebar .sidebar-brand img { display: none; }
    body.sidebar-toggled .sidebar .sidebar-heading { display: none; }
    body.sidebar-toggled .sidebar .nav-item .nav-link span { display: none !important; }
    body.sidebar-toggled .sidebar .nav-item .nav-link { justify-content: center; padding: 9px 0 !important; }
}
