:root {
    --bg-base: #030712;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --glass-bg: rgba(15, 23, 42, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(30, 41, 59, 0.6);
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.4);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.3);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

/* Cinematic Abstract Background */
.bg-abstract {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
    will-change: transform;
}
.orb-1 { width: 500px; height: 500px; background: var(--primary-glow); top: -10%; left: -10%; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: rgba(139, 92, 246, 0.3); bottom: 10%; right: -5%; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; background: rgba(14, 165, 233, 0.2); top: 40%; left: 40%; animation-delay: -10s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    border-top: none;
    border-bottom: none;
    border-left: none;
    z-index: 10;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.sidebar.collapsed {
    margin-left: -260px;
}

.brand {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.brand h2 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item:hover {
    background: var(--glass-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    padding: 1.5rem;
}

/* Main Workspace */
.main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    overflow: hidden;
    gap: 1.5rem;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-titles h1 {
    font-size: 2rem;
    font-weight: 600;
}
.header-titles .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.search-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}
.search-wrapper input {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: white;
    width: 250px;
    transition: all 0.3s ease;
    font-family: inherit;
}
.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    width: 320px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Notifications */
.notification-wrapper { position: relative; }
.notification-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--danger); color: white;
    font-size: 0.7rem; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; border: 2px solid var(--bg-base);
}
.notification-badge.hidden { display: none !important; }
.notification-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0;
    width: 350px; max-height: 400px;
    border-radius: 12px; z-index: 1000;
    display: flex; flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform-origin: top right;
    transition: all 0.2s ease;
}
.notification-dropdown.hidden {
    opacity: 0; transform: scale(0.95); pointer-events: none;
}
.dropdown-header {
    padding: 1rem; border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
}
.dropdown-header h3 { font-size: 1rem; margin: 0; }
.notification-list {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column;
}
.notification-list::-webkit-scrollbar { width: 6px; }
.notification-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.notification-item {
    padding: 1rem; border-bottom: 1px solid var(--glass-border);
    cursor: pointer; transition: background 0.2s;
    display: flex; flex-direction: column; gap: 0.25rem;
}
.notification-item:hover { background: rgba(255,255,255,0.05); }
.notification-item.unread { border-left: 3px solid var(--primary); background: rgba(59,130,246,0.05); }
.notification-item-time { font-size: 0.75rem; color: var(--text-muted); }
.notification-item-text { font-size: 0.9rem; line-height: 1.4; color: var(--text-main); }


/* Dashboard Widgets */
.widgets-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.widget {
    padding: 1.25rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.3s ease;
}
.widget:hover {
    transform: translateY(-2px);
}
.widget-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.primary-bg { background: rgba(59, 130, 246, 0.15); color: var(--primary); }
.danger-bg { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.success-bg { background: rgba(16, 185, 129, 0.15); color: var(--success); }

.widget-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}
.widget-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin-top: 0.25rem;
}

/* Filters Panel */
.filters-panel {
    border-radius: 16px;
    padding: 1.5rem;
    max-height: 500px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    opacity: 1;
}

.filters-panel.hidden {
    max-height: 0;
    padding: 0;
    opacity: 0;
    margin: 0;
    border: none;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.filters-header h3 {
    font-size: 1.1rem;
    display: flex; align-items: center; gap: 0.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.filters-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}

/* Table */
.table-container {
    flex: 1;
    overflow: auto;
    border-radius: 16px;
    position: relative;
}

.table-container::-webkit-scrollbar { width: 8px; height: 8px; }
.table-container::-webkit-scrollbar-track { background: transparent; }
.table-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.table-container::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

#casesTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1600px;
}

#casesTable th, #casesTable td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid rgba(203, 213, 225, 0.3); /* Светло сиви черти за разделяне */
    font-size: 0.9rem;
}

#casesTable th {
    background: #0f172a; /* Solid background to prevent overlap */
    position: sticky;
    top: 0;
    z-index: 5;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
}

#casesTable th.sticky-col {
    z-index: 7; /* Higher than normal headers and sticky cells */
    left: 0;
}

#casesTable .sticky-col {
    position: sticky;
    left: 0;
    background: #0f172a; /* Solid to hide text scrolling underneath */
    z-index: 6;
    border-right: 1px solid var(--glass-border);
}

/* Ensure alternating/hover rows don't break sticky col opacity */
#casesTable tbody tr {
    transition: background-color 0.2s ease;
}

#casesTable tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#casesTable tbody tr:hover td.sticky-col {
    background: #1e293b; /* Solid hover color */
}

#casesTable .deadline-warning {
    background-color: rgba(239, 68, 68, 0.08) !important;
}
#casesTable .deadline-warning td {
    color: #fca5a5;
}
#casesTable .deadline-warning td.sticky-col {
    background-color: #1a0f14 !important; /* Solid dark red-tinted bg */
    border-left: 3px solid var(--danger);
}
#casesTable .deadline-warning:hover td.sticky-col {
    background-color: #2a1114 !important;
}

/* Column Widths */
#casesTable th[data-sort="case_number"], #casesTable td:nth-child(2) {
    min-width: 110px;
    width: 110px;
}
#casesTable th[data-sort="previous_number"], #casesTable td:nth-child(16) {
    min-width: 110px;
    width: 110px;
    max-width: 110px;
    white-space: normal;
    word-wrap: break-word;
}
#casesTable th[data-sort="next_action_date"], #casesTable td:nth-child(15) {
    min-width: 100px;
    width: 100px;
    max-width: 100px;
    white-space: normal;
    text-align: center;
}
#casesTable th[data-sort="for_decision"], #casesTable td:nth-child(12) {
    min-width: 90px;
    width: 90px;
    max-width: 90px;
    white-space: normal;
    text-align: center;
}
#casesTable td:nth-child(12) {
    text-align: center;
}
#casesTable th[data-sort="notes"], #casesTable td:nth-child(13) {
    min-width: 280px;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none; border-radius: 8px;
    font-family: inherit; font-weight: 500; font-size: 0.9rem;
    cursor: pointer; transition: all 0.2s ease;
}
.btn i { font-size: 1.1rem; }
.full-width { width: 100%; padding: 0.75rem 1rem; }

.btn.primary {
    background: var(--primary); color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn.primary:hover {
    background: var(--primary-hover); transform: translateY(-1px);
}
.btn.danger { background: var(--danger); color: white; box-shadow: 0 4px 14px var(--danger-glow); }
.btn.danger:hover { background: var(--danger-hover); }

.btn.secondary {
    background: rgba(255, 255, 255, 0.08); color: white;
    border: 1px solid var(--glass-border);
}
.btn.secondary:hover { background: rgba(255, 255, 255, 0.15); }
.btn.outline { background: transparent; }
.btn.text-btn { background: transparent; color: var(--text-muted); }
.btn.text-btn:hover { color: white; background: rgba(255, 255, 255, 0.05); }

.icon-btn {
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 1.2rem; padding: 0.4rem; border-radius: 6px;
    transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.icon-btn.danger-text:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.icon-btn.success-text { color: var(--success); }
.icon-btn.success-text:hover { color: #34d399; background: rgba(16, 185, 129, 0.1); }
.icon-btn.primary-text { color: var(--primary); }
.icon-btn.primary-text:hover { color: #60a5fa; background: rgba(59, 130, 246, 0.1); }

/* Inputs */
.filter-group, .input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.filter-group label, .input-group label {
    font-size: 0.85rem; color: #cbd5e1; font-weight: 500;
}
.filter-group input, .filter-group select, 
.input-group input, .input-group select, .input-group textarea {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px; padding: 0.75rem;
    color: white; font-family: inherit; font-size: 0.9rem;
    transition: all 0.2s ease;
}
.filter-group input:focus, .filter-group select:focus,
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none; border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
}
.input-group.full-width { grid-column: 1 / -1; }

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex; flex-direction: column;
    z-index: 100; opacity: 1; transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: 2rem 0;
}
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal-content {
    width: 90%; max-width: 850px;
    border-radius: 20px; display: flex; flex-direction: column;
    transform: translateY(0) scale(1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(15, 23, 42, 0.85);
    margin: auto;
}
.modal-overlay.hidden .modal-content { transform: translateY(20px) scale(0.95); }
.modal-content.small-modal { max-width: 400px; }

.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 1.25rem; font-weight: 600; }
.modal-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.text-center { text-align: center; }
.text-center .subtitle { margin-top: 0.5rem; color: var(--text-muted); font-size: 0.9rem; }
.danger-text { color: var(--danger) !important; }

form { display: flex; flex-direction: column; overflow: hidden; flex: 1; min-height: 0; }
.form-grid {
    padding: 1.5rem; overflow-y: auto; display: grid;
    grid-template-columns: 1fr 1fr; gap: 1.25rem;
    flex: 1; min-height: 0;
}
.form-grid::-webkit-scrollbar { width: 6px; }
.form-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }

.modal-footer {
    padding: 1.5rem; border-top: 1px solid var(--glass-border);
    display: flex; justify-content: flex-end; gap: 1rem;
}
.justify-center { justify-content: center; }

/* Modal Tabs */
.modal-tabs {
    display: flex; gap: 1rem; border-bottom: 1px solid var(--glass-border); padding: 0 1.5rem;
}
.tab-btn {
    background: none; border: none; padding: 1rem 0; color: var(--text-muted); cursor: pointer;
    font-weight: 500; font-size: 0.95rem; font-family: inherit;
    border-bottom: 2px solid transparent; transition: all 0.2s ease;
}
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn.hidden { display: none; }

.tab-content { display: none; flex-direction: column; flex: 1; min-height: 0; }
.tab-content.active { display: flex; }
/* History List Items */
.history-item {
    background: rgba(255,255,255,0.05); padding: 1rem; border-radius: 8px; border: 1px solid var(--glass-border);
}
.history-item-header {
    display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-muted);
}
.history-item-action { font-weight: 600; color: var(--text-main); }
.history-item-details { font-size: 0.9rem; line-height: 1.4; }

/* Document List Items */
.doc-item {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.05); padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--glass-border);
}
.doc-item a { color: var(--primary); text-decoration: none; font-weight: 500; }
.doc-item a:hover { text-decoration: underline; }

/* Sortable Headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}
th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
th.sortable i {
    opacity: 0.3;
    margin-left: 0.4rem;
    transition: opacity 0.2s ease;
}
th.sortable:hover i {
    opacity: 0.7;
}
th.sortable.sort-asc i {
    opacity: 1;
    color: var(--primary);
    transform: rotate(180deg); /* Or change icon if using ph-caret-up */
}
th.sortable.sort-desc i {
    opacity: 1;
    color: var(--primary);
}

/* FullCalendar Overrides */
.fc {
    height: 100% !important;
    min-height: 600px;
    background: transparent;
    width: 100% !important;
    max-width: 100%;
}
.fc-view-harness, .fc-scrollgrid {
    width: 100% !important;
    max-width: 100%;
}
.fc-scroller {
    overflow-y: auto !important;
    overflow-x: auto !important;
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
        height: auto;
        overflow: visible;
        margin: 0;
        padding: 0;
    }
    .bg-abstract, .sidebar, .top-bar .actions, .widgets-row, .modal-overlay, .actions-col, #topActions, .filters-panel {
        display: none !important;
    }
    .app-container {
        display: block;
        height: auto;
        overflow: visible;
    }
    .main-workspace {
        padding: 0 !important;
        gap: 0;
        display: block;
        overflow: visible !important;
        height: auto;
    }
    #tableViewWrapper {
        display: block !important;
        overflow: visible !important;
        height: auto;
    }
    .table-container {
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        height: auto !important;
    }
    table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto !important;
        border-collapse: collapse;
        word-wrap: break-word;
    }
    tr {
        page-break-inside: avoid;
    }
    th, td {
        border: 1px solid #cbd5e1 !important;
        padding: 4px !important;
        color: black !important;
        background: transparent !important;
        font-size: 8pt !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
    th {
        position: static !important;
        color: black !important;
        font-weight: bold !important;
    }
    .deadline-warning td {
        font-weight: bold;
    }
    @page {
        size: auto;
        margin: 10mm;
    }
}

/* FullCalendar Dark Theme Overrides */
:root {
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: rgba(255, 255, 255, 0.05);
  --fc-neutral-text-color: #f8fafc;
  --fc-border-color: rgba(255, 255, 255, 0.15);
  
  --fc-button-text-color: #fff;
  --fc-button-bg-color: var(--primary);
  --fc-button-border-color: var(--primary);
  --fc-button-hover-bg-color: var(--primary-hover);
  --fc-button-hover-border-color: var(--primary-hover);
  --fc-button-active-bg-color: #1d4ed8;
  --fc-button-active-border-color: #1d4ed8;
  
  --fc-event-bg-color: var(--primary);
  --fc-event-border-color: var(--primary);
  --fc-event-text-color: #fff;
  
  --fc-today-bg-color: rgba(59, 130, 246, 0.15);
}

.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--fc-border-color);
}
.fc .fc-daygrid-day.fc-day-today {
    background-color: var(--fc-today-bg-color);
}
.fc-daygrid-day-number {
    color: var(--text-main);
}
.fc-col-header-cell-cushion {
    color: var(--text-main);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .analytics-dashboard {
        grid-template-columns: 1fr !important;
    }
    .widgets-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1000;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.collapsed {
        margin-left: -300px;
    }
    .main-workspace {
        padding: 1rem;
    }
    .header-titles h1 {
        font-size: 1.5rem;
    }
    .widgets-row {
        grid-template-columns: 1fr !important;
    }
    .filters-grid {
        grid-template-columns: 1fr !important;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .actions {
        flex-wrap: wrap;
    }
    .search-wrapper {
        width: 100%;
    }
    .search-wrapper input {
        width: 100% !important;
    }
    #adminAddUserForm {
        grid-template-columns: 1fr !important;
    }
    .modal-content {
        width: 95%;
    }
    .widgets-row {
        grid-template-columns: 1fr !important;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ==========================================
   LIGHT THEME OVERRIDES
   ========================================== */
:root.light-theme {
    --bg-base: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(15, 23, 42, 0.08);
    --glass-hover: rgba(15, 23, 42, 0.04);
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.2);
    
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-glow: rgba(220, 38, 38, 0.2);
    
    --success: #16a34a;
    --success-glow: rgba(22, 163, 74, 0.2);
    
    /* FullCalendar Light */
    --fc-neutral-bg-color: rgba(15, 23, 42, 0.03);
    --fc-neutral-text-color: #0f172a;
    --fc-border-color: rgba(15, 23, 42, 0.08);
    --fc-today-bg-color: rgba(37, 99, 235, 0.1);
}

/* Specific element overrides for light mode */
:root.light-theme .brand h2 {
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

:root.light-theme .search-wrapper input {
    background: rgba(255, 255, 255, 0.8);
    color: #0f172a;
}

:root.light-theme #casesTable th {
    background: #e2e8f0;
    color: #0f172a;
}

:root.light-theme #casesTable th,
:root.light-theme #casesTable td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.15);
}

:root.light-theme #casesTable .sticky-col {
    background: #f8fafc;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
}

:root.light-theme #casesTable tbody tr:hover td.sticky-col {
    background: #e2e8f0;
}

:root.light-theme #casesTable tbody tr:hover {
    background-color: rgba(15, 23, 42, 0.04);
}

:root.light-theme #casesTable .deadline-warning {
    background-color: rgba(239, 68, 68, 0.12) !important;
}

:root.light-theme #casesTable .deadline-warning td {
    color: #991b1b;
}

:root.light-theme #casesTable .deadline-warning td.sticky-col {
    background-color: #fee2e2 !important;
    border-left: 3px solid var(--danger);
}

:root.light-theme #casesTable .deadline-warning:hover td.sticky-col {
    background-color: #fecaca !important;
}

:root.light-theme .btn.secondary {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

:root.light-theme .btn.secondary:hover {
    background: rgba(15, 23, 42, 0.12);
}

:root.light-theme .icon-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

:root.light-theme .btn.text-btn:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.04);
}

:root.light-theme .filter-group label,
:root.light-theme .input-group label {
    color: #64748b;
}

:root.light-theme .filter-group input,
:root.light-theme .filter-group select, 
:root.light-theme .input-group input,
:root.light-theme .input-group select,
:root.light-theme .input-group textarea {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

:root.light-theme .filter-group input:focus,
:root.light-theme .filter-group select:focus,
:root.light-theme .input-group input:focus,
:root.light-theme .input-group select:focus,
:root.light-theme .input-group textarea:focus {
    background: #ffffff;
    border-color: var(--primary);
}

:root.light-theme .modal-overlay {
    background: rgba(15, 23, 42, 0.4);
}

:root.light-theme .modal-content {
    background: #ffffff;
}

:root.light-theme .history-item,
:root.light-theme .doc-item {
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

:root.light-theme .table-container::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
}

:root.light-theme .table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

:root.light-theme .notification-list::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
}

:root.light-theme .form-grid::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
}

/* Disable buggy absolute animated orbs on Safari */
.bg-abstract {
    display: none !important;
}

/* Beautiful solid gradients directly on body to avoid GPU render bugs */
body {
    font-family: 'Inter', sans-serif;
    background-color: #030712 !important;
    background-image: radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
                      radial-gradient(at 50% 50%, rgba(14, 165, 233, 0.05) 0px, transparent 50%) !important;
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

:root.light-theme body {
    background-color: #f1f5f9 !important;
    background-image: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.08) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.05) 0px, transparent 50%) !important;
}
