/**
 * SafeCortex BusinessOS — Enterprise Theme
 * Premium, corporate-grade design system
 * Version: 2.0.0
 */

/* ══════════════════════════════════════════════════════════
   1. DESIGN TOKENS (CSS Custom Properties)
   ══════════════════════════════════════════════════════════ */
:root {
    /* Brand Colors */
    --sc-primary:       #1a56db;
    --sc-primary-rgb:   26, 86, 219;
    --sc-primary-dark:  #1042a3;
    --sc-primary-light: #e1effe;
    --sc-accent:        #0e9f6e;
    --sc-accent-rgb:    14, 159, 110;

    /* Neutrals */
    --sc-gray-50:  #f9fafb;
    --sc-gray-100: #f3f4f6;
    --sc-gray-200: #e5e7eb;
    --sc-gray-300: #d1d5db;
    --sc-gray-400: #9ca3af;
    --sc-gray-500: #6b7280;
    --sc-gray-600: #4b5563;
    --sc-gray-700: #374151;
    --sc-gray-800: #1f2937;
    --sc-gray-900: #111827;

    /* Semantic */
    --sc-success:  #059669;
    --sc-warning:  #d97706;
    --sc-danger:   #dc2626;
    --sc-info:     #2563eb;

    /* Sidebar */
    --sc-sidebar-bg:       #0f172a;
    --sc-sidebar-hover:    rgba(255,255,255,0.06);
    --sc-sidebar-active:   rgba(26,86,219,0.25);
    --sc-sidebar-text:     #94a3b8;
    --sc-sidebar-text-active: #ffffff;
    --sc-sidebar-width:    264px;
    --sc-sidebar-width-collapsed: 72px;
    --sc-sidebar-border:   rgba(255,255,255,0.06);

    /* Typography */
    --sc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --sc-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --sc-header-height: 60px;
    --sc-page-padding:  1.5rem;
    --sc-radius-sm:     0.375rem;
    --sc-radius-md:     0.5rem;
    --sc-radius-lg:     0.75rem;
    --sc-radius-xl:     1rem;

    /* Shadows */
    --sc-shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
    --sc-shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --sc-shadow-md:  0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --sc-shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --sc-shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.04);

    /* Transitions */
    --sc-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --sc-transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --sc-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Override Tabler */
    --tblr-primary:      var(--sc-primary);
    --tblr-primary-rgb:  var(--sc-primary-rgb);
    --tblr-font-sans-serif: var(--sc-font-sans);
}

/* ══════════════════════════════════════════════════════════
   2. GLOBAL RESETS & BASE
   ══════════════════════════════════════════════════════════ */
body {
    font-family: var(--sc-font-sans);
    font-size: 0.875rem;
    color: var(--sc-gray-700);
    background-color: var(--sc-gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.011em;
}

::selection {
    background: rgba(var(--sc-primary-rgb), 0.15);
    color: var(--sc-primary-dark);
}

a { color: var(--sc-primary); text-decoration: none; transition: color var(--sc-transition-fast); }
a:hover { color: var(--sc-primary-dark); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sc-gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sc-gray-400); }

/* ══════════════════════════════════════════════════════════
   3. SIDEBAR — Enterprise Dark Navigation
   ══════════════════════════════════════════════════════════ */
.sc-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sc-sidebar-width);
    background: var(--sc-sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width var(--sc-transition-slow);
    border-right: 1px solid var(--sc-sidebar-border);
    overflow: hidden;
}

.sc-sidebar-brand {
    height: var(--sc-header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--sc-sidebar-border);
    flex-shrink: 0;
}

.sc-sidebar-brand-logo {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--sc-primary) 0%, #3b82f6 100%);
    border-radius: var(--sc-radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.875rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(var(--sc-primary-rgb), 0.35);
}

.sc-sidebar-brand-text { margin-left: 0.75rem; overflow: hidden; }

.sc-sidebar-brand-name {
    color: #fff; font-weight: 700; font-size: 0.95rem;
    letter-spacing: -0.02em; line-height: 1.2;
}

.sc-sidebar-brand-sub {
    color: var(--sc-gray-400); font-size: 0.65rem;
    text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
}

/* Nav Section Labels */
.sc-sidebar-label {
    padding: 1.25rem 1.25rem 0.5rem;
    font-size: 0.65rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--sc-gray-500);
}

/* Nav Items */
.sc-sidebar-nav {
    flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0.5rem 0;
}

.sc-sidebar-nav::-webkit-scrollbar { width: 4px; }
.sc-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sc-nav-item { position: relative; margin: 1px 0.5rem; }

.sc-nav-link {
    display: flex; align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--sc-sidebar-text);
    border-radius: var(--sc-radius-sm);
    font-size: 0.8125rem; font-weight: 450;
    transition: all var(--sc-transition-fast);
    cursor: pointer; text-decoration: none;
    gap: 0.75rem; line-height: 1.4;
    border: 1px solid transparent;
}

.sc-nav-link:hover {
    background: var(--sc-sidebar-hover);
    color: #e2e8f0;
}

.sc-nav-link.active {
    background: var(--sc-sidebar-active);
    color: var(--sc-sidebar-text-active);
    font-weight: 550;
    border-color: rgba(var(--sc-primary-rgb), 0.2);
}

.sc-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--sc-primary);
    border-radius: 0 3px 3px 0;
}

.sc-nav-icon {
    width: 20px; height: 20px;
    font-size: 1.125rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; opacity: 0.7;
}

.sc-nav-link.active .sc-nav-icon,
.sc-nav-link:hover .sc-nav-icon { opacity: 1; }

.sc-nav-badge {
    margin-left: auto;
    font-size: 0.65rem; padding: 0.15rem 0.45rem;
    border-radius: 10px; font-weight: 600;
}

/* Dropdown submenu */
.sc-nav-dropdown-toggle::after {
    content: '';
    border: solid var(--sc-sidebar-text);
    border-width: 0 1.5px 1.5px 0;
    display: inline-block; padding: 2.5px;
    margin-left: auto;
    transform: rotate(45deg);
    transition: transform var(--sc-transition-fast);
    opacity: 0.5;
}

.sc-nav-dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg);
}

.sc-nav-submenu {
    overflow: hidden; max-height: 0;
    transition: max-height var(--sc-transition-slow);
}
.sc-nav-submenu.show { max-height: 500px; }

.sc-nav-submenu .sc-nav-link {
    padding-left: 2.75rem;
    font-size: 0.78rem; color: var(--sc-gray-400);
}
.sc-nav-submenu .sc-nav-link:hover { color: #e2e8f0; }
.sc-nav-submenu .sc-nav-link.active {
    color: var(--sc-sidebar-text-active);
    background: transparent; border-color: transparent;
}
.sc-nav-submenu .sc-nav-link.active::before { display: none; }
.sc-nav-submenu .sc-nav-link.active::after {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%; background: var(--sc-primary);
    position: absolute; left: 1.5rem; top: 50%;
    transform: translateY(-50%);
}

/* Sidebar Footer */
.sc-sidebar-footer {
    border-top: 1px solid var(--sc-sidebar-border);
    padding: 0.75rem 1rem; flex-shrink: 0;
}

.sc-sidebar-user {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 0.375rem 0.25rem;
    border-radius: var(--sc-radius-sm);
    transition: background var(--sc-transition-fast);
    cursor: pointer; text-decoration: none;
}
.sc-sidebar-user:hover { background: var(--sc-sidebar-hover); }

.sc-sidebar-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 600; flex-shrink: 0;
    background: rgba(var(--sc-primary-rgb), 0.2); color: #93c5fd;
}

.sc-sidebar-user-info { overflow: hidden; flex: 1; min-width: 0; }

.sc-sidebar-user-name {
    color: #e2e8f0; font-size: 0.78rem; font-weight: 550;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sc-sidebar-user-role {
    color: var(--sc-gray-500); font-size: 0.65rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════
   4. TOPBAR / HEADER
   ══════════════════════════════════════════════════════════ */
.sc-topbar {
    height: var(--sc-header-height);
    background: #fff;
    border-bottom: 1px solid var(--sc-gray-200);
    display: flex; align-items: center;
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 1030;
    box-shadow: var(--sc-shadow-xs);
}

.sc-topbar-left { display: flex; align-items: center; gap: 1rem; }

.sc-topbar-toggle {
    display: none;
    background: none; border: none;
    color: var(--sc-gray-500); cursor: pointer;
    padding: 0.375rem; border-radius: var(--sc-radius-sm);
    transition: all var(--sc-transition-fast);
}
.sc-topbar-toggle:hover { background: var(--sc-gray-100); color: var(--sc-gray-700); }

.sc-topbar-search { position: relative; width: 280px; }

.sc-topbar-search input {
    width: 100%; height: 36px;
    padding: 0 0.75rem 0 2.25rem;
    background: var(--sc-gray-50);
    border: 1px solid var(--sc-gray-200);
    border-radius: var(--sc-radius-md);
    font-size: 0.8125rem; color: var(--sc-gray-700);
    transition: all var(--sc-transition-fast);
}
.sc-topbar-search input::placeholder { color: var(--sc-gray-400); }
.sc-topbar-search input:focus {
    outline: none;
    border-color: var(--sc-primary);
    box-shadow: 0 0 0 3px rgba(var(--sc-primary-rgb), 0.1);
    background: #fff;
}

.sc-topbar-search-icon {
    position: absolute; left: 0.625rem; top: 50%;
    transform: translateY(-50%);
    color: var(--sc-gray-400); pointer-events: none; font-size: 1rem;
}

.sc-topbar-search-kbd {
    position: absolute; right: 0.5rem; top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem; padding: 0.125rem 0.375rem;
    background: var(--sc-gray-200); border-radius: 4px;
    color: var(--sc-gray-500); font-family: var(--sc-font-mono);
    pointer-events: none;
}

.sc-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }

.sc-topbar-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--sc-radius-sm);
    border: none; background: transparent;
    color: var(--sc-gray-500); cursor: pointer;
    transition: all var(--sc-transition-fast);
    position: relative;
}
.sc-topbar-btn:hover { background: var(--sc-gray-100); color: var(--sc-gray-700); }
.sc-topbar-btn .badge-dot {
    position: absolute; top: 8px; right: 8px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--sc-danger); border: 2px solid #fff;
}

.sc-topbar-divider {
    width: 1px; height: 24px;
    background: var(--sc-gray-200); margin: 0 0.5rem;
}

.sc-topbar-org {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--sc-radius-sm);
    font-size: 0.78rem; color: var(--sc-gray-600);
    cursor: pointer;
    transition: background var(--sc-transition-fast);
}
.sc-topbar-org:hover { background: var(--sc-gray-100); }

.sc-topbar-org-icon {
    width: 24px; height: 24px;
    background: var(--sc-primary-light);
    border-radius: var(--sc-radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: var(--sc-primary);
}

.sc-topbar-user {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--sc-radius-sm);
    cursor: pointer;
    transition: background var(--sc-transition-fast);
    text-decoration: none; color: inherit;
}
.sc-topbar-user:hover { background: var(--sc-gray-100); }

.sc-topbar-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--sc-primary-light); color: var(--sc-primary);
    font-size: 0.75rem; font-weight: 600;
}

.sc-topbar-user-name {
    font-size: 0.8125rem; font-weight: 550;
    color: var(--sc-gray-800); line-height: 1.2;
}

.sc-topbar-user-email {
    font-size: 0.7rem; color: var(--sc-gray-400); line-height: 1.2;
}

/* ══════════════════════════════════════════════════════════
   5. PAGE LAYOUT
   ══════════════════════════════════════════════════════════ */
.sc-page-wrapper {
    margin-left: var(--sc-sidebar-width);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left var(--sc-transition-slow);
}

.sc-page-header { padding: 1.25rem 1.5rem 0; }

.sc-page-header-row {
    display: flex; align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; gap: 0.75rem;
}

.sc-page-title {
    font-size: 1.25rem; font-weight: 700;
    color: var(--sc-gray-900); letter-spacing: -0.02em;
    line-height: 1.3; margin: 0;
}

.sc-page-subtitle {
    font-size: 0.8125rem; color: var(--sc-gray-500);
    margin-top: 0.25rem;
}

.sc-page-body {
    flex: 1;
    padding: var(--sc-page-padding);
}

/* ══════════════════════════════════════════════════════════
   6. CARDS — Enterprise Style
   ══════════════════════════════════════════════════════════ */
.card {
    background: #fff;
    border: 1px solid var(--sc-gray-200);
    border-radius: var(--sc-radius-lg);
    box-shadow: var(--sc-shadow-xs);
    transition: box-shadow var(--sc-transition-fast);
}
.card:hover { box-shadow: var(--sc-shadow-sm); }

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--sc-gray-100);
    background: transparent;
}
.card-header .card-title {
    font-size: 0.875rem; font-weight: 600;
    color: var(--sc-gray-800); margin: 0;
}

.card-body { padding: 1.25rem; }

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--sc-gray-100);
    background: var(--sc-gray-50);
    border-radius: 0 0 var(--sc-radius-lg) var(--sc-radius-lg);
}

/* Stats Cards (admin — component stats_card.php) */
.sc-stats-card {
    display: block;
    background: #fff;
    border: 1px solid var(--sc-gray-200);
    border-radius: var(--sc-radius-lg);
    box-shadow: var(--sc-shadow-xs);
    position: relative; overflow: hidden;
    transition: all var(--sc-transition-base);
    text-decoration: none; color: inherit;
}
a.sc-stats-card:hover { color: inherit; text-decoration: none; }
.sc-stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sc-shadow-md);
}

.sc-stats-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
}

.sc-stats-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sc-stats-label {
    font-size: 0.75rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--sc-gray-500); margin-bottom: 0.5rem;
    display: block;
}

.sc-stats-value {
    font-size: 1.75rem; font-weight: 700;
    color: var(--sc-gray-900); letter-spacing: -0.02em;
    line-height: 1; display: block;
}

.sc-stats-icon {
    width: 44px; height: 44px;
    border-radius: var(--sc-radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}

.sc-stats-trend {
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.75rem; font-weight: 600;
    padding: 0.125rem 0.5rem; border-radius: 20px;
    margin-top: 0.625rem;
}
/* BEM modifiers (used by stats_card.php component) */
.sc-stats-trend--up,
.sc-stats-trend.up { background: rgba(5, 150, 105, 0.1); color: var(--sc-success); }
.sc-stats-trend--down,
.sc-stats-trend.down { background: rgba(220, 38, 38, 0.1); color: var(--sc-danger); }
.sc-stats-trend--neutral { background: rgba(100, 116, 139, 0.1); color: var(--sc-gray-500); }

/* Portal Stat Cards (portal dashboard) */
.sc-stat-card {
    border: none;
    box-shadow: var(--sc-shadow-sm);
    transition: all var(--sc-transition-base);
}
.sc-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sc-shadow-md);
}
.sc-stat-card .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}
.sc-stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--sc-radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.375rem; flex-shrink: 0;
}
.sc-stat-icon.text-primary { background: rgba(var(--sc-primary-rgb), 0.08); color: var(--sc-primary); }
.sc-stat-icon.text-warning { background: rgba(217, 119, 6, 0.08); color: var(--sc-warning); }
.sc-stat-icon.text-danger  { background: rgba(220, 38, 38, 0.08); color: var(--sc-danger); }
.sc-stat-icon.text-success { background: rgba(5, 150, 105, 0.08); color: var(--sc-success); }
.sc-stat-icon.text-info    { background: rgba(37, 99, 235, 0.08); color: var(--sc-info); }
.sc-stat-content { min-width: 0; }
.sc-stat-value {
    display: block;
    font-size: 1.5rem; font-weight: 700;
    color: var(--sc-gray-900); letter-spacing: -0.02em;
    line-height: 1.2;
}
.sc-stat-label {
    display: block;
    font-size: 0.75rem; font-weight: 500;
    color: var(--sc-gray-500); margin-top: 0.125rem;
    text-transform: uppercase; letter-spacing: 0.03em;
}

/* ══════════════════════════════════════════════════════════
   7. TABLES — Enterprise Data Grid
   ══════════════════════════════════════════════════════════ */
.table { font-size: 0.8125rem; margin: 0; }

.table thead th {
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--sc-gray-500); background: var(--sc-gray-50);
    border-bottom: 1px solid var(--sc-gray-200);
    padding: 0.75rem 1rem; white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem; vertical-align: middle;
    border-bottom: 1px solid var(--sc-gray-100);
    color: var(--sc-gray-700);
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover td { background: rgba(var(--sc-primary-rgb), 0.02); }

.table .table-actions { white-space: nowrap; text-align: right; }
.table .table-actions .btn { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

/* ══════════════════════════════════════════════════════════
   8. BUTTONS — Enterprise Style
   ══════════════════════════════════════════════════════════ */
.btn {
    font-weight: 500; font-size: 0.8125rem;
    border-radius: var(--sc-radius-sm);
    transition: all var(--sc-transition-fast);
    letter-spacing: -0.005em;
    padding: 0.4375rem 0.875rem;
}

.btn-primary {
    background: var(--sc-primary); border-color: var(--sc-primary);
    box-shadow: 0 1px 2px rgba(var(--sc-primary-rgb), 0.2);
}
.btn-primary:hover {
    background: var(--sc-primary-dark); border-color: var(--sc-primary-dark);
    box-shadow: 0 2px 4px rgba(var(--sc-primary-rgb), 0.3);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary { border-color: var(--sc-gray-300); color: var(--sc-gray-700); }
.btn-outline-primary:hover {
    background: var(--sc-primary-light);
    border-color: var(--sc-primary); color: var(--sc-primary);
}

.btn-ghost {
    background: transparent; border: none;
    color: var(--sc-gray-500); padding: 0.375rem 0.625rem;
}
.btn-ghost:hover { background: var(--sc-gray-100); color: var(--sc-gray-700); }

.btn-icon {
    width: 36px; height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-sm { font-size: 0.75rem; padding: 0.3125rem 0.625rem; }

/* ══════════════════════════════════════════════════════════
   9. FORMS — Clean Enterprise Inputs
   ══════════════════════════════════════════════════════════ */
.form-control, .form-select {
    font-size: 0.8125rem;
    border-color: var(--sc-gray-300);
    border-radius: var(--sc-radius-sm);
    padding: 0.5rem 0.75rem;
    transition: all var(--sc-transition-fast);
    color: var(--sc-gray-800);
}
.form-control:focus, .form-select:focus {
    border-color: var(--sc-primary);
    box-shadow: 0 0 0 3px rgba(var(--sc-primary-rgb), 0.1);
}

.form-label {
    font-size: 0.78rem; font-weight: 550;
    color: var(--sc-gray-700); margin-bottom: 0.375rem;
}
.form-text { font-size: 0.72rem; color: var(--sc-gray-400); }
.form-check-input:checked { background-color: var(--sc-primary); border-color: var(--sc-primary); }

/* ══════════════════════════════════════════════════════════
  10. BADGES & STATUS — Enterprise Indicators
   ══════════════════════════════════════════════════════════ */
.badge {
    font-weight: 550; font-size: 0.6875rem;
    padding: 0.25rem 0.5rem; border-radius: 20px;
    letter-spacing: 0.01em;
}

.sc-status {
    display: inline-flex; align-items: center;
    gap: 0.375rem; font-size: 0.78rem; font-weight: 500;
}

.sc-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%; flex-shrink: 0;
}
.sc-status-dot.online  { background: var(--sc-success); box-shadow: 0 0 0 2px rgba(5,150,105,0.2); }
.sc-status-dot.offline { background: var(--sc-gray-400); }
.sc-status-dot.warning { background: var(--sc-warning); box-shadow: 0 0 0 2px rgba(217,119,6,0.2); }
.sc-status-dot.danger  { background: var(--sc-danger); box-shadow: 0 0 0 2px rgba(220,38,38,0.2); }

/* ══════════════════════════════════════════════════════════
  11. ALERTS — Refined Notifications
   ══════════════════════════════════════════════════════════ */
.alert {
    border-radius: var(--sc-radius-md);
    font-size: 0.8125rem; border: none;
    padding: 0.875rem 1rem;
}
.alert-success { background: rgba(5,150,105,0.08); color: #065f46; border-left: 3px solid var(--sc-success); }
.alert-danger  { background: rgba(220,38,38,0.08); color: #991b1b; border-left: 3px solid var(--sc-danger); }
.alert-warning { background: rgba(217,119,6,0.08); color: #92400e; border-left: 3px solid var(--sc-warning); }
.alert-info    { background: rgba(37,99,235,0.08); color: #1e40af; border-left: 3px solid var(--sc-info); }

/* ══════════════════════════════════════════════════════════
  12. BREADCRUMB
   ══════════════════════════════════════════════════════════ */
.breadcrumb { font-size: 0.78rem; margin: 0; padding: 0; background: transparent; }
.breadcrumb-item + .breadcrumb-item::before { content: '\203A'; color: var(--sc-gray-400); }
.breadcrumb-item a { color: var(--sc-gray-500); }
.breadcrumb-item a:hover { color: var(--sc-primary); }
.breadcrumb-item.active { color: var(--sc-gray-600); font-weight: 500; }

/* ══════════════════════════════════════════════════════════
  13. MODAL — Enterprise Dialog
   ══════════════════════════════════════════════════════════ */
.modal-content { border-radius: var(--sc-radius-lg); border: none; box-shadow: var(--sc-shadow-xl); }
.modal-header { border-bottom: 1px solid var(--sc-gray-100); padding: 1rem 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 1.25rem; }
.modal-footer {
    border-top: 1px solid var(--sc-gray-100);
    padding: 0.75rem 1.25rem;
    background: var(--sc-gray-50);
    border-radius: 0 0 var(--sc-radius-lg) var(--sc-radius-lg);
}

/* ══════════════════════════════════════════════════════════
  14. DROPDOWN
   ══════════════════════════════════════════════════════════ */
.dropdown-menu {
    border: 1px solid var(--sc-gray-200);
    border-radius: var(--sc-radius-md);
    box-shadow: var(--sc-shadow-lg);
    padding: 0.375rem; font-size: 0.8125rem;
}
.dropdown-item {
    border-radius: var(--sc-radius-sm);
    padding: 0.4375rem 0.625rem;
    color: var(--sc-gray-700); font-weight: 450;
    transition: all var(--sc-transition-fast);
}
.dropdown-item:hover { background: var(--sc-gray-50); color: var(--sc-gray-900); }
.dropdown-item.active, .dropdown-item:active { background: var(--sc-primary-light); color: var(--sc-primary); }
.dropdown-divider { margin: 0.25rem 0; border-color: var(--sc-gray-100); }

/* ══════════════════════════════════════════════════════════
  15. TOAST — Minimal Notifications
   ══════════════════════════════════════════════════════════ */
.sc-toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    z-index: 1080;
    display: flex; flex-direction: column; gap: 0.5rem;
}

.sc-toast-item {
    background: var(--sc-gray-900); color: #fff;
    padding: 0.75rem 1rem;
    border-radius: var(--sc-radius-md);
    box-shadow: var(--sc-shadow-lg);
    font-size: 0.8125rem;
    display: flex; align-items: center; gap: 0.625rem;
    min-width: 280px; max-width: 420px;
    animation: sc-toast-in 0.3s ease-out;
}
.sc-toast-item.success { border-left: 3px solid var(--sc-success); }
.sc-toast-item.error   { border-left: 3px solid var(--sc-danger); }
.sc-toast-item.warning { border-left: 3px solid var(--sc-warning); }

@keyframes sc-toast-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scToastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ══════════════════════════════════════════════════════════
  16. EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.sc-empty-state { text-align: center; padding: 3rem 2rem; }
.sc-empty-state-icon { font-size: 3rem; color: var(--sc-gray-300); margin-bottom: 1rem; }
.sc-empty-state-title { font-size: 1rem; font-weight: 600; color: var(--sc-gray-700); margin-bottom: 0.375rem; }
.sc-empty-state-text {
    font-size: 0.8125rem; color: var(--sc-gray-400);
    margin-bottom: 1.25rem; max-width: 360px;
    margin-left: auto; margin-right: auto;
}

/* ══════════════════════════════════════════════════════════
  17. PAGINATION
   ══════════════════════════════════════════════════════════ */
.pagination { gap: 0.125rem; }
.page-link {
    font-size: 0.78rem; border-radius: var(--sc-radius-sm);
    border: 1px solid transparent;
    color: var(--sc-gray-600); padding: 0.375rem 0.625rem;
    font-weight: 500;
    transition: all var(--sc-transition-fast);
}
.page-link:hover { background: var(--sc-gray-100); border-color: var(--sc-gray-200); color: var(--sc-gray-800); }
.page-item.active .page-link {
    background: var(--sc-primary); border-color: var(--sc-primary);
    color: #fff; box-shadow: 0 1px 2px rgba(var(--sc-primary-rgb), 0.25);
}

/* ══════════════════════════════════════════════════════════
  18. FOOTER
   ══════════════════════════════════════════════════════════ */
.sc-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sc-gray-100);
    font-size: 0.72rem; color: var(--sc-gray-400);
    display: flex; align-items: center; justify-content: space-between;
}

/* ══════════════════════════════════════════════════════════
  19. AUTH PAGES — Enterprise Login
   ══════════════════════════════════════════════════════════ */
.sc-auth-page {
    min-height: 100vh; display: flex;
    background: var(--sc-gray-50);
}

.sc-auth-aside {
    width: 480px;
    background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 50%, var(--sc-primary) 100%);
    display: flex; flex-direction: column; justify-content: center;
    padding: 3rem; position: relative; overflow: hidden;
}
.sc-auth-aside::before {
    content: '';
    position: absolute; top: -50%; right: -50%;
    width: 100%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none;
}
.sc-auth-aside::after {
    content: '';
    position: absolute; bottom: -20%; left: -20%;
    width: 60%; height: 60%;
    background: radial-gradient(circle, rgba(var(--sc-primary-rgb),0.2) 0%, transparent 60%);
    pointer-events: none;
}

.sc-auth-aside-brand { position: relative; z-index: 1; }

.sc-auth-aside-logo {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--sc-radius-md);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 1.25rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
}

.sc-auth-aside-title {
    color: #fff; font-size: 1.75rem; font-weight: 700;
    letter-spacing: -0.03em; line-height: 1.25;
    margin-bottom: 1rem;
}

.sc-auth-aside-text {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem; line-height: 1.6;
    max-width: 340px;
}

.sc-auth-aside-features { margin-top: 2.5rem; list-style: none; padding: 0; }
.sc-auth-aside-features li {
    display: flex; align-items: center; gap: 0.75rem;
    color: rgba(255,255,255,0.7); font-size: 0.8125rem;
    padding: 0.5rem 0;
}
.sc-auth-aside-features li i { color: #34d399; font-size: 1.125rem; }

.sc-auth-main {
    flex: 1; display: flex;
    align-items: center; justify-content: center;
    padding: 2rem;
}

.sc-auth-form-wrapper { width: 100%; max-width: 400px; }

.sc-auth-form-header { margin-bottom: 2rem; }
.sc-auth-form-title {
    font-size: 1.375rem; font-weight: 700;
    color: var(--sc-gray-900); letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
}
.sc-auth-form-subtitle { font-size: 0.875rem; color: var(--sc-gray-500); }

.sc-auth-form .form-control { height: 44px; padding: 0.5rem 0.875rem; font-size: 0.875rem; }
.sc-auth-form .btn-primary { height: 44px; font-size: 0.875rem; font-weight: 600; }

.sc-auth-footer {
    margin-top: 2rem; text-align: center;
    font-size: 0.78rem; color: var(--sc-gray-400);
}

/* ══════════════════════════════════════════════════════════
  20. SKELETON LOADING
   ══════════════════════════════════════════════════════════ */
.sc-skeleton {
    background: linear-gradient(90deg, var(--sc-gray-100) 25%, var(--sc-gray-200) 50%, var(--sc-gray-100) 75%);
    background-size: 200% 100%;
    animation: sc-skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--sc-radius-sm);
}
@keyframes sc-skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.sc-skeleton-text { height: 12px; margin-bottom: 8px; }
.sc-skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.sc-skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.sc-skeleton-card { height: 120px; }

/* ══════════════════════════════════════════════════════════
  21. UTILITIES
   ══════════════════════════════════════════════════════════ */
.text-truncate-2 {
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.font-mono { font-family: var(--sc-font-mono); }
.text-xs   { font-size: 0.7rem; }
.text-sm   { font-size: 0.78rem; }
.fw-550    { font-weight: 550; }

/* ══════════════════════════════════════════════════════════
  22. RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .sc-sidebar { transform: translateX(-100%); z-index: 1050; }
    .sc-sidebar.show { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,0.3); }
    .sc-page-wrapper { margin-left: 0; }
    .sc-topbar-toggle { display: flex; }
    .sc-topbar-search { display: none; }
    .sc-auth-aside { display: none; }
    .sc-auth-main { padding: 1.5rem; }

    .sc-sidebar-backdrop {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.4); z-index: 1045;
        backdrop-filter: blur(2px);
    }
    .sc-sidebar-backdrop.show { display: block; }
}

@media (max-width: 575.98px) {
    .sc-page-body { padding: 1rem; }
    .sc-stats-value { font-size: 1.375rem; }
}

/* ══════════════════════════════════════════════════════════
  23. PRINT
   ══════════════════════════════════════════════════════════ */
@media print {
    .sc-sidebar, .sc-topbar, .sc-footer, .no-print { display: none !important; }
    .sc-page-wrapper { margin-left: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ══════════════════════════════════════════════════════════
  24. DARK MODE
   ══════════════════════════════════════════════════════════ */
html.dark {
    --sc-gray-50:  #1e293b;
    --sc-gray-100: #1e293b;
    --sc-gray-200: #334155;
    --sc-gray-300: #475569;
    --sc-gray-400: #64748b;
    --sc-gray-500: #94a3b8;
    --sc-gray-600: #cbd5e1;
    --sc-gray-700: #e2e8f0;
    --sc-gray-800: #f1f5f9;
    --sc-gray-900: #f8fafc;

    --sc-primary-light: rgba(26,86,219,0.15);

    --sc-shadow-xs:  0 1px 2px rgba(0,0,0,0.25);
    --sc-shadow-sm:  0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --sc-shadow-md:  0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
    --sc-shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
}

html.dark body {
    background: #0f172a;
    color: #e2e8f0;
}

html.dark .sc-page-wrapper {
    background: #0f172a;
}

html.dark .card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark .card-header {
    background: #1e293b;
    border-color: #334155;
}

html.dark .sc-topbar {
    background: #1e293b;
    border-color: #334155;
}

html.dark .sc-topbar-search input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark .sc-topbar-search-kbd {
    background: #334155;
    color: #94a3b8;
    border-color: #475569;
}

html.dark .sc-topbar-org {
    color: #94a3b8;
}

html.dark .sc-topbar-btn {
    color: #94a3b8;
}
html.dark .sc-topbar-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
}

html.dark .sc-page-header {
    background: #0f172a;
    border-color: #334155;
}

html.dark .sc-page-title {
    color: #f1f5f9;
}

html.dark .sc-page-subtitle {
    color: #94a3b8;
}

html.dark .sc-footer {
    border-color: #334155;
    color: #64748b;
}

html.dark .table {
    color: #e2e8f0;
    --tblr-table-bg: #1e293b;
    --tblr-table-striped-bg: #1a2332;
    --tblr-table-hover-bg: #253348;
    --tblr-border-color: #334155;
}

html.dark .table thead th {
    color: #94a3b8;
    border-color: #334155;
    background: #162032;
}

html.dark .table tbody td {
    border-color: #334155;
}

html.dark .dropdown-menu {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark .dropdown-item {
    color: #cbd5e1;
}
html.dark .dropdown-item:hover {
    background: #334155;
    color: #f1f5f9;
}

html.dark .alert {
    border-color: #334155;
}

html.dark .sc-stats-card {
    background: #1e293b;
    border-color: #334155;
}

html.dark .sc-stats-value { color: #f1f5f9; }

html.dark .sc-stat-card {
    background: #1e293b;
    border-color: #334155;
}
html.dark .sc-stat-value { color: #f1f5f9; }
html.dark .sc-stat-icon.text-primary { background: rgba(26,86,219,0.15); }
html.dark .sc-stat-icon.text-warning { background: rgba(217,119,6,0.15); }
html.dark .sc-stat-icon.text-danger  { background: rgba(220,38,38,0.15); }
html.dark .sc-stat-icon.text-success { background: rgba(5,150,105,0.15); }
html.dark .sc-stat-icon.text-info    { background: rgba(37,99,235,0.15); }

html.dark .form-control,
html.dark .form-select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark .form-control:focus,
html.dark .form-select:focus {
    border-color: var(--sc-primary);
    background: #162032;
}

html.dark .form-label {
    color: #cbd5e1;
}

html.dark .modal-content {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark .modal-header,
html.dark .modal-footer {
    border-color: #334155;
}

html.dark .badge.bg-secondary-lt {
    background: rgba(100,116,139,0.2) !important;
    color: #94a3b8 !important;
}

html.dark .breadcrumb-item a {
    color: #94a3b8;
}

html.dark .border-bottom {
    border-color: #334155 !important;
}

html.dark .sc-quick-action:hover {
    background: #334155;
}

html.dark code {
    color: #94a3b8;
}

/* Dark Mode Toggle Button */
.sc-dark-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--sc-radius-sm);
    background: transparent;
    cursor: pointer;
    color: var(--sc-gray-400);
    transition: all var(--sc-transition-fast);
}
.sc-dark-toggle:hover {
    background: rgba(100,116,139,0.1);
    color: var(--sc-gray-600);
}
html.dark .sc-dark-toggle:hover {
    background: rgba(255,255,255,0.06);
    color: #f1f5f9;
}

/* ── Search Overlay (Command Palette) ────────────────── */
.sc-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}
.sc-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    animation: scSearchFadeIn 0.15s ease;
}
.sc-search-panel {
    position: relative;
    width: 100%;
    max-width: 620px;
    margin: 0 1rem;
    background: #fff;
    border-radius: var(--sc-radius-lg, 12px);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    animation: scSearchSlideIn 0.2s ease;
    overflow: hidden;
}
.sc-search-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--sc-gray-100, #f1f5f9);
}
.sc-search-header-icon {
    font-size: 1.125rem;
    color: var(--sc-gray-400, #94a3b8);
    flex-shrink: 0;
}
.sc-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 0.9375rem;
    color: var(--sc-gray-800, #1e293b);
    font-family: 'Inter', sans-serif;
}
.sc-search-input::placeholder {
    color: var(--sc-gray-400, #94a3b8);
}
.sc-search-esc {
    flex-shrink: 0;
    font-size: 0.625rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--sc-gray-100, #f1f5f9);
    color: var(--sc-gray-500, #64748b);
    border: 1px solid var(--sc-gray-200, #e2e8f0);
}
.sc-search-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.sc-search-body::-webkit-scrollbar { width: 6px; }
.sc-search-body::-webkit-scrollbar-thumb { background: var(--sc-gray-200, #e2e8f0); border-radius: 3px; }

/* Loading */
.sc-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--sc-gray-400, #94a3b8);
    font-size: 0.8125rem;
}
.sc-search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--sc-gray-200, #e2e8f0);
    border-top-color: var(--sc-primary, #4f46e5);
    border-radius: 50%;
    animation: scSpin 0.6s linear infinite;
}
@keyframes scSpin { to { transform: rotate(360deg); } }

/* Group title */
.sc-search-group-title {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sc-gray-400, #94a3b8);
}

/* Search result item */
.sc-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.1s ease;
    text-decoration: none;
    color: inherit;
}
.sc-search-item:hover,
.sc-search-item.sc-search-active {
    background: var(--sc-gray-50, #f8fafc);
}
.sc-search-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--sc-radius-sm, 6px);
    background: var(--sc-gray-100, #f1f5f9);
    color: var(--sc-gray-500, #64748b);
    font-size: 1rem;
    flex-shrink: 0;
}
.sc-search-item-body {
    flex: 1;
    min-width: 0;
}
.sc-search-item-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sc-gray-800, #1e293b);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sc-search-item-sub {
    font-size: 0.6875rem;
    color: var(--sc-gray-400, #94a3b8);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sc-search-item-badge {
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--sc-gray-100, #f1f5f9);
    color: var(--sc-gray-500, #64748b);
}
.sc-search-item-arrow {
    flex-shrink: 0;
    color: var(--sc-gray-300, #cbd5e1);
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.1s;
}
.sc-search-item:hover .sc-search-item-arrow,
.sc-search-item.sc-search-active .sc-search-item-arrow {
    opacity: 1;
}

/* View all link */
.sc-search-viewall {
    display: block;
    padding: 0.375rem 1rem 0.375rem 3.75rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--sc-primary, #4f46e5);
    text-decoration: none;
    cursor: pointer;
}
.sc-search-viewall:hover {
    text-decoration: underline;
}

/* Empty state */
.sc-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: var(--sc-gray-400, #94a3b8);
}
.sc-search-empty i {
    font-size: 2rem;
    opacity: 0.5;
}
.sc-search-empty span {
    font-size: 0.8125rem;
}

/* Footer */
.sc-search-footer {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--sc-gray-100, #f1f5f9);
    font-size: 0.6875rem;
    color: var(--sc-gray-400, #94a3b8);
}
.sc-search-footer kbd {
    font-size: 0.5625rem;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--sc-gray-100, #f1f5f9);
    border: 1px solid var(--sc-gray-200, #e2e8f0);
    color: var(--sc-gray-500, #64748b);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    margin-right: 2px;
}

/* Animations */
@keyframes scSearchFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scSearchSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Keyboard Shortcut Help Panel */
.sc-shortcut-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sc-shortcut-overlay .sc-search-backdrop {
    z-index: -1;
}
.sc-shortcut-panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 1rem;
    background: #fff;
    border-radius: var(--sc-radius-lg, 12px);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: scSearchSlideIn 0.2s ease;
    overflow: hidden;
}
.sc-shortcut-panel h3 {
    padding: 1rem 1.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sc-gray-800, #1e293b);
    border-bottom: 1px solid var(--sc-gray-100, #f1f5f9);
    margin: 0;
    padding-bottom: 0.75rem;
}
.sc-shortcut-list {
    padding: 0.75rem 1.25rem;
}
.sc-shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
}
.sc-shortcut-row span {
    font-size: 0.8125rem;
    color: var(--sc-gray-600, #475569);
}
.sc-shortcut-row kbd {
    font-size: 0.625rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--sc-gray-100, #f1f5f9);
    border: 1px solid var(--sc-gray-200, #e2e8f0);
    color: var(--sc-gray-500, #64748b);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
.sc-shortcut-close {
    display: block;
    text-align: center;
    padding: 0.75rem;
    font-size: 0.6875rem;
    color: var(--sc-gray-400, #94a3b8);
    border-top: 1px solid var(--sc-gray-100, #f1f5f9);
}

/* ── Dark Mode: Search Overlay ───────────────────────── */
html.dark .sc-search-panel {
    background: #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
}
html.dark .sc-search-header {
    border-bottom-color: #334155;
}
html.dark .sc-search-input {
    color: #f1f5f9;
}
html.dark .sc-search-input::placeholder {
    color: #64748b;
}
html.dark .sc-search-esc,
html.dark .sc-search-footer kbd {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}
html.dark .sc-search-item:hover,
html.dark .sc-search-item.sc-search-active {
    background: #334155;
}
html.dark .sc-search-item-icon {
    background: #334155;
    color: #94a3b8;
}
html.dark .sc-search-item-title {
    color: #f1f5f9;
}
html.dark .sc-search-item-badge {
    background: #334155;
    color: #94a3b8;
}
html.dark .sc-search-footer {
    border-top-color: #334155;
}
html.dark .sc-search-body::-webkit-scrollbar-thumb {
    background: #475569;
}
html.dark .sc-shortcut-panel {
    background: #1e293b;
}
html.dark .sc-shortcut-panel h3 {
    color: #f1f5f9;
    border-bottom-color: #334155;
}
html.dark .sc-shortcut-row span {
    color: #cbd5e1;
}
html.dark .sc-shortcut-row kbd {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}
html.dark .sc-shortcut-close {
    border-top-color: #334155;
}

/* ──────────────────────────────────────────────────────────
   NOTIFICATIONS DROPDOWN (topbar bell)
   ────────────────────────────────────────────────────────── */
.sc-notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}
html.dark .sc-notif-badge { box-shadow: 0 0 0 2px #0f172a; }

.sc-notif-menu {
    width: 380px;
    max-width: calc(100vw - 1rem);
    padding: 0;
    margin-top: 0.5rem;
    border: 1px solid var(--sc-gray-200, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 10px 30px -8px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}
html.dark .sc-notif-menu {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.5);
}

.sc-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--sc-gray-100, #f3f4f6);
    background: var(--sc-gray-50, #f9fafb);
}
html.dark .sc-notif-header {
    background: #0f172a;
    border-bottom-color: #334155;
}
.sc-notif-header-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sc-gray-900, #111827);
}
html.dark .sc-notif-header-title { color: #f1f5f9; }
.sc-notif-header-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    background: var(--sc-primary, #1a56db);
    color: #fff;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
}
.sc-notif-header-action {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--sc-primary, #1a56db);
    font-size: 0.6875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}
.sc-notif-header-action:hover { background: rgba(var(--sc-primary-rgb, 26,86,219), 0.08); }
.sc-notif-header-action i { font-size: 0.875rem; }

.sc-notif-body {
    max-height: 420px;
    overflow-y: auto;
}

.sc-notif-item {
    position: relative;
    border-bottom: 1px solid var(--sc-gray-100, #f3f4f6);
}
.sc-notif-item:last-child { border-bottom: 0; }
html.dark .sc-notif-item { border-bottom-color: #334155; }
.sc-notif-item.is-unread { background: rgba(var(--sc-primary-rgb, 26,86,219), 0.04); }
html.dark .sc-notif-item.is-unread { background: rgba(96, 165, 250, 0.08); }

.sc-notif-item-link {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: inherit;
    text-decoration: none;
    transition: background 0.12s ease;
}
.sc-notif-item-link:hover { background: var(--sc-gray-50, #f9fafb); }
html.dark .sc-notif-item-link:hover { background: #0f172a; }

.sc-notif-avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--sc-gray-100, #f3f4f6);
    color: var(--sc-gray-600, #4b5563);
}
.sc-notif-avatar i { font-size: 1.05rem; }
.sc-notif-avatar[data-cat="ticket"]     { background: #dbeafe; color: #1d4ed8; }
.sc-notif-avatar[data-cat="deal"]       { background: #ede9fe; color: #6d28d9; }
.sc-notif-avatar[data-cat="contract"]   { background: #e0e7ff; color: #4338ca; }
.sc-notif-avatar[data-cat="billing"]    { background: #dcfce7; color: #15803d; }
.sc-notif-avatar[data-cat="work"]       { background: #fef3c7; color: #b45309; }
.sc-notif-avatar[data-cat="project"]    { background: #cffafe; color: #0e7490; }
.sc-notif-avatar[data-cat="monitoring"] { background: #fee2e2; color: #b91c1c; }
.sc-notif-avatar[data-cat="account"]    { background: #fce7f3; color: #be185d; }
html.dark .sc-notif-avatar { background: #1e293b; color: #cbd5e1; }
html.dark .sc-notif-avatar[data-cat="ticket"]     { background: rgba(59,130,246,0.18);  color: #93c5fd; }
html.dark .sc-notif-avatar[data-cat="deal"]       { background: rgba(139,92,246,0.18);  color: #c4b5fd; }
html.dark .sc-notif-avatar[data-cat="contract"]   { background: rgba(99,102,241,0.18);  color: #a5b4fc; }
html.dark .sc-notif-avatar[data-cat="billing"]    { background: rgba(34,197,94,0.18);   color: #86efac; }
html.dark .sc-notif-avatar[data-cat="work"]       { background: rgba(245,158,11,0.18);  color: #fcd34d; }
html.dark .sc-notif-avatar[data-cat="project"]    { background: rgba(6,182,212,0.18);   color: #67e8f9; }
html.dark .sc-notif-avatar[data-cat="monitoring"] { background: rgba(239,68,68,0.18);   color: #fca5a5; }
html.dark .sc-notif-avatar[data-cat="account"]    { background: rgba(236,72,153,0.18);  color: #f9a8d4; }

.sc-notif-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    flex: 1;
}
.sc-notif-title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--sc-gray-900, #111827);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
html.dark .sc-notif-title { color: #f1f5f9; }
.sc-notif-content .sc-notif-body {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--sc-gray-500, #6b7280);
    max-height: none;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
html.dark .sc-notif-content .sc-notif-body { color: #94a3b8; }
.sc-notif-meta {
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    color: var(--sc-gray-400, #9ca3af);
}

.sc-notif-dot {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--sc-primary, #1a56db);
    cursor: pointer;
}
.sc-notif-dot:hover { box-shadow: 0 0 0 4px rgba(var(--sc-primary-rgb, 26,86,219), 0.18); }

.sc-notif-footer {
    border-top: 1px solid var(--sc-gray-100, #f3f4f6);
    background: var(--sc-gray-50, #f9fafb);
}
html.dark .sc-notif-footer {
    background: #0f172a;
    border-top-color: #334155;
}
.sc-notif-footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    color: var(--sc-primary, #1a56db);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.12s ease;
}
.sc-notif-footer a:hover { background: rgba(var(--sc-primary-rgb, 26,86,219), 0.06); }
.sc-notif-footer a i { font-size: 0.875rem; }

/* Empty state */
.sc-notif-empty {
    padding: 2rem 1rem 1.75rem;
    text-align: center;
}
.sc-notif-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
    background: var(--sc-gray-100, #f3f4f6);
    color: var(--sc-gray-400, #9ca3af);
    border-radius: 999px;
    font-size: 1.5rem;
}
html.dark .sc-notif-empty-icon { background: #1e293b; color: #64748b; }
.sc-notif-empty-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sc-gray-700, #374151);
    margin-bottom: 0.125rem;
}
html.dark .sc-notif-empty-title { color: #cbd5e1; }
.sc-notif-empty-sub {
    font-size: 0.75rem;
    color: var(--sc-gray-500, #6b7280);
}

/* Skeleton loader */
.sc-notif-skeleton { padding: 0.25rem 0; }
.sc-notif-skel-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}
.sc-skel-avatar,
.sc-skel-lines span {
    background: linear-gradient(90deg, var(--sc-gray-100, #f3f4f6) 25%, var(--sc-gray-200, #e5e7eb) 50%, var(--sc-gray-100, #f3f4f6) 75%);
    background-size: 200% 100%;
    animation: scSkelPulse 1.4s ease-in-out infinite;
    border-radius: 8px;
}
.sc-skel-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
}
.sc-skel-lines {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}
.sc-skel-lines span { height: 10px; }
.sc-skel-lines span:first-child { width: 70%; }
.sc-skel-lines span:last-child  { width: 45%; }
html.dark .sc-skel-avatar,
html.dark .sc-skel-lines span {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}
@keyframes scSkelPulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
