
/* MAPPING FOR NEW THEME COMPATIBILITY */
:root {
    --bg-primary: var(--bg-main);
    --bg-secondary: var(--bg-card);
    --bg-card: var(--bg-elevated);
    --accent-primary: var(--primary);
    --text-primary: #0f172a; 
    
    /* Re-map old vars to new system */
    --surface-1: var(--bg-card);
    --surface-2: var(--bg-elevated);
}

body.dark {
    --text-primary: #f1f5f9;
}

        :root {
            /* Executive Slate Theme */
            --bg-primary: #0f1419;
            --bg-secondary: #1a1f26;
            --bg-card: #1e252e;
            --bg-card-hover: #252d38;
            --bg-elevated: #2a3442;

            /* Accent - Corporate Blue */
            --accent-primary: #0ea5e9;
            --accent-secondary: #38bdf8;
            --accent-glow: rgba(14, 165, 233, 0.15);
            --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);

            /* Status Colors */
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --info: #3b82f6;

            /* Text */
            --text-primary: #f8fafc;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;

            /* Borders */
            --border-subtle: rgba(255, 255, 255, 0.06);
            --border-accent: rgba(245, 158, 11, 0.3);

            /* Sizing */
            --sidebar-width: 280px;
            --sidebar-collapsed: 80px;
            --header-height: 72px;
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --radius-xl: 24px;

            /* Shadows */
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
            --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
            --shadow-glow: 0 0 40px var(--accent-glow);
        }

        /* Light Theme Override */
        body.light-mode {
            --bg-primary: #f1f5f9;
            --bg-secondary: #ffffff;
            --bg-card: #ffffff;
            --bg-card-hover: #f8fafc;
            --bg-elevated: #f1f5f9;
            --text-primary: #0f172a;
            --text-secondary: #475569;
            --text-muted: #94a3b8;
            --border-subtle: rgba(0, 0, 0, 0.08);
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
            --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Outfit', sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            overflow-x: hidden;
            transition: all 0.3s ease;
        }

        /* Scrollbar Custom */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--text-muted);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-secondary);
        }

        /* ═══════════════════════════════════════
           LOGIN SCREEN
        ═══════════════════════════════════════ */
        .login-overlay {
            position: fixed;
            inset: 0;
            background: var(--bg-primary);
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 1;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }

        .login-overlay.hidden {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .login-container {
            width: 100%;
            max-width: 440px;
            padding: 2rem;
        }

        .login-card {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-xl);
            padding: 3rem;
            box-shadow: var(--shadow-lg);
            position: relative;
            overflow: hidden;
        }

        .login-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--accent-gradient);
        }

        .login-logo {
            width: auto;
            max-width: 280px;
            height: auto;
            background: transparent;
            border-radius: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1.5rem;
            box-shadow: none;
        }

        .login-logo img {
            max-width: 100%;
            height: auto;
            max-height: 100px;
        }

        .login-title {
            font-family: 'Playfair Display', serif;
            font-size: 2rem;
            text-align: center;
            margin-bottom: 0.5rem;
        }

        .login-subtitle {
            color: var(--text-secondary);
            text-align: center;
            margin-bottom: 2rem;
        }

        .form-floating {
            margin-bottom: 1rem;
        }

        .form-floating>.form-control {
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            padding: 1rem;
            height: 56px;
        }

        .form-floating>.form-control:focus {
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px var(--accent-glow);
            background: var(--bg-elevated);
        }

        .form-floating>label {
            color: var(--text-muted);
        }

        .btn-login {
            width: 100%;
            padding: 1rem;
            background: var(--accent-gradient);
            border: none;
            border-radius: var(--radius-md);
            color: white;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-top: 1rem;
        }

        .btn-login:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-glow);
        }

        /* ═══════════════════════════════════════
           SIDEBAR
        ═══════════════════════════════════════ */
        .sidebar {
            position: fixed;
            left: 0;
            top: 0;
            width: var(--sidebar-width);
            height: 100vh;
            background: var(--bg-secondary);
            border-right: 1px solid var(--border-subtle);
            display: flex;
            flex-direction: column;
            z-index: 1000;
            transition: width 0.3s ease, transform 0.3s ease;
        }

        .sidebar.collapsed {
            width: var(--sidebar-collapsed);
        }

        .sidebar-brand {
            padding: 1.5rem;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid var(--border-subtle);
        }

        .brand-icon {
            width: 44px;
            height: 44px;
            background: var(--accent-gradient);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            color: white;
            flex-shrink: 0;
        }

        .brand-text {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .brand-name {
            font-weight: 700;
            font-size: 1.25rem;
            color: var(--text-primary);
            white-space: nowrap;
        }

        .brand-tagline {
            font-size: 0.75rem;
            color: var(--text-muted);
            white-space: nowrap;
        }

        .sidebar.collapsed .brand-text {
            display: none;
        }

        .sidebar.collapsed .sidebar-brand {
            padding: 1rem;
            justify-content: center;
            overflow: hidden;
        }

        .sidebar.collapsed .sidebar-brand img {
            height: 42px !important;
            width: 42px !important;
            object-fit: contain !important;
        }

        .sidebar-nav {
            flex: 1;
            padding: 1rem 0.75rem;
            overflow-y: auto;
        }

        .nav-section-title {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            padding: 1rem 1rem 0.5rem;
            white-space: nowrap;
        }

        .sidebar.collapsed .nav-section-title {
            text-align: center;
            padding: 1rem 0 0.5rem;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 0.875rem 1rem;
            color: var(--text-secondary);
            text-decoration: none;
            border-radius: var(--radius-md);
            margin-bottom: 4px;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            white-space: nowrap;
        }

        .nav-item i {
            width: 20px;
            text-align: center;
            font-size: 1.1rem;
            flex-shrink: 0;
        }

        .nav-item:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }

        .nav-item.active {
            background: var(--accent-glow);
            color: var(--accent-primary);
        }

        .nav-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 60%;
            background: var(--accent-primary);
            border-radius: 0 3px 3px 0;
        }

        .sidebar.collapsed .nav-item {
            justify-content: center;
            padding: 0.875rem;
        }

        .sidebar.collapsed .nav-item span {
            display: none;
        }

        .nav-badge {
            background: var(--danger);
            color: white;
            font-size: 0.65rem;
            padding: 2px 6px;
            border-radius: 10px;
            margin-left: auto;
            font-weight: 600;
        }

        .sidebar.collapsed .nav-badge {
            position: absolute;
            top: 6px;
            right: 6px;
            margin: 0;
        }

        .sidebar-footer {
            padding: 1rem;
            border-top: 1px solid var(--border-subtle);
        }

        .user-card {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 0.75rem;
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
        }

        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--accent-primary);
        }

        .user-info {
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }

        .user-name {
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--text-primary);
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }

        .user-role {
            font-size: 0.75rem;
            color: var(--accent-primary);
        }

        .sidebar.collapsed .user-info,
        .sidebar.collapsed .user-logout {
            display: none;
        }

        .user-logout {
            color: var(--text-muted);
            padding: 0.5rem;
            cursor: pointer;
            transition: color 0.2s;
        }

        .user-logout:hover {
            color: var(--danger);
        }

        /* ═══════════════════════════════════════
           MAIN CONTENT
        ═══════════════════════════════════════ */
        .main-wrapper {
            margin-left: var(--sidebar-width);
            min-height: 100vh;
            transition: margin-left 0.3s ease;
        }

        .sidebar.collapsed~.main-wrapper {
            margin-left: var(--sidebar-collapsed);
        }

        /* Header */
        .main-header {
            height: var(--header-height);
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-subtle);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 2rem;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 1.5rem;
        }

        .sidebar-toggle {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.25rem;
            cursor: pointer;
            padding: 0.5rem;
            border-radius: var(--radius-sm);
            transition: all 0.2s;
        }

        .sidebar-toggle:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }

        .page-title-section h1 {
            font-size: 1.25rem;
            font-weight: 600;
            margin: 0;
        }

        .page-title-section p {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin: 0;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        /* Search */
        .search-box {
            position: relative;
            width: 280px;
        }

        .search-box input {
            width: 100%;
            padding: 0.625rem 1rem 0.625rem 2.5rem;
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-size: 0.875rem;
            transition: all 0.2s;
        }

        .search-box input:focus {
            outline: none;
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        .search-box input::placeholder {
            color: var(--text-muted);
        }

        .search-box i {
            position: absolute;
            left: 0.875rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
        }

        .search-shortcut {
            position: absolute;
            right: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            background: var(--bg-card);
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.7rem;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
        }

        /* Header Icons */
        .header-icon {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .header-icon:hover {
            background: var(--bg-card-hover);
            color: var(--text-primary);
            border-color: var(--accent-primary);
        }

        .header-icon .badge {
            position: absolute;
            top: -4px;
            right: -4px;
            width: 18px;
            height: 18px;
            background: var(--danger);
            color: white;
            font-size: 0.65rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
        }

        /* Main Content Area */
        .main-content {
            padding: 2rem;
        }

        /* ═══════════════════════════════════════
           CARDS & COMPONENTS
        ═══════════════════════════════════════ */
        .card {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            transition: all 0.2s ease;
        }

        .card:hover {
            border-color: var(--border-accent);
            box-shadow: var(--shadow-md);
        }

        .card-header {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--border-subtle);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: transparent;
        }

        .card-title {
            font-weight: 600;
            font-size: 1rem;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .card-title i {
            color: var(--accent-primary);
        }

        .card-body {
            padding: 1.5rem;
        }

        /* Stat Cards */
        .stat-card {
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 120px;
            height: 120px;
            background: var(--accent-glow);
            border-radius: 50%;
            transform: translate(30%, -30%);
            opacity: 0.5;
        }

        .stat-icon {
            width: 56px;
            height: 56px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            margin-bottom: 1rem;
        }

        .stat-icon.primary {
            background: rgba(245, 158, 11, 0.15);
            color: var(--accent-primary);
        }

        .stat-icon.success {
            background: rgba(16, 185, 129, 0.15);
            color: var(--success);
        }

        .stat-icon.info {
            background: rgba(59, 130, 246, 0.15);
            color: var(--info);
        }

        .stat-icon.danger {
            background: rgba(239, 68, 68, 0.15);
            color: var(--danger);
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
            font-family: 'JetBrains Mono', monospace;
        }

        .stat-label {
            color: var(--text-secondary);
            font-size: 0.875rem;
        }

        .stat-change {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 0.75rem;
            padding: 4px 8px;
            border-radius: 20px;
            margin-top: 0.75rem;
        }

        .stat-change.positive {
            background: rgba(16, 185, 129, 0.15);
            color: var(--success);
        }

        .stat-change.negative {
            background: rgba(239, 68, 68, 0.15);
            color: var(--danger);
        }

        /* Progress Ring */
        .progress-ring {
            position: relative;
            width: 120px;
            height: 120px;
        }

        .progress-ring svg {
            transform: rotate(-90deg);
        }

        .progress-ring circle {
            fill: none;
            stroke-width: 8;
            stroke-linecap: round;
        }

        .progress-ring .bg {
            stroke: var(--bg-elevated);
        }

        .progress-ring .progress {
            stroke: var(--accent-primary);
            stroke-dasharray: 339.292;
            transition: stroke-dashoffset 1s ease;
        }

        .progress-ring .value {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }

        .progress-ring .value strong {
            font-size: 1.75rem;
            font-weight: 700;
            display: block;
        }

        .progress-ring .value span {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Quick Actions */
        .quick-action {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 1.25rem;
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.2s;
            text-decoration: none;
            color: var(--text-primary);
            border: 1px solid transparent;
        }

        .quick-action:hover {
            background: var(--bg-card-hover);
            border-color: var(--accent-primary);
            transform: translateY(-2px);
        }

        .quick-action i {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
            color: var(--accent-primary);
        }

        .quick-action span {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        /* Activity Timeline */
        .activity-item {
            display: flex;
            gap: 1rem;
            padding: 1rem 0;
            border-bottom: 1px solid var(--border-subtle);
        }

        .activity-item:last-child {
            border-bottom: none;
        }

        .activity-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
        }

        .activity-content {
            flex: 1;
            min-width: 0;
        }

        .activity-text {
            font-size: 0.875rem;
            margin-bottom: 0.25rem;
        }

        .activity-text strong {
            color: var(--text-primary);
        }

        .activity-time {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .activity-badge {
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.7rem;
            font-weight: 500;
        }

        /* Task List */
        .task-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
            margin-bottom: 0.75rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .task-item:hover {
            background: var(--bg-card-hover);
        }

        .task-check {
            width: 20px;
            height: 20px;
            border: 2px solid var(--text-muted);
            border-radius: 50%;
            flex-shrink: 0;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .task-item.completed .task-check {
            background: var(--success);
            border-color: var(--success);
            color: white;
        }

        .task-item.completed .task-text {
            text-decoration: line-through;
            color: var(--text-muted);
        }

        .task-text {
            flex: 1;
            font-size: 0.9rem;
        }

        .task-priority {
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }

        .task-priority.high {
            background: var(--danger);
        }

        .task-priority.medium {
            background: var(--warning);
        }

        .task-priority.low {
            background: var(--success);
        }

        /* Calendar Mini */
        .mini-calendar {
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
            padding: 1rem;
        }

        .calendar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .calendar-nav {
            display: flex;
            gap: 0.5rem;
        }

        .calendar-nav button {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 0.25rem 0.5rem;
            border-radius: var(--radius-sm);
        }

        .calendar-nav button:hover {
            background: var(--bg-card);
            color: var(--text-primary);
        }

        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 4px;
            text-align: center;
        }

        .calendar-day-name {
            font-size: 0.65rem;
            color: var(--text-muted);
            padding: 0.5rem 0;
            font-weight: 500;
        }

        .calendar-day {
            padding: 0.5rem;
            font-size: 0.8rem;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s;
        }

        .calendar-day:hover {
            background: var(--bg-card);
        }

        .calendar-day.today {
            background: var(--accent-primary);
            color: white;
            font-weight: 600;
        }

        .calendar-day.has-event::after {
            content: '';
            display: block;
            width: 4px;
            height: 4px;
            background: var(--info);
            border-radius: 50%;
            margin: 2px auto 0;
        }

        .calendar-day.other-month {
            color: var(--text-muted);
            opacity: 0.5;
        }

        /* Tables */
        .data-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }

        .data-table th {
            background: var(--bg-elevated);
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-bottom: 1px solid var(--border-subtle);
        }

        .data-table td {
            padding: 1rem;
            border-bottom: 1px solid var(--border-subtle);
            font-size: 0.9rem;
        }

        .data-table tbody tr {
            transition: background 0.2s;
        }

        .data-table tbody tr:hover {
            background: var(--bg-elevated);
        }

        /* Status Badge */
        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .status-badge::before {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
        }

        .status-badge.active {
            background: rgba(16, 185, 129, 0.15);
            color: var(--success);
        }

        .status-badge.active::before {
            background: var(--success);
        }

        .status-badge.pending {
            background: rgba(245, 158, 11, 0.15);
            color: var(--warning);
        }

        .status-badge.pending::before {
            background: var(--warning);
        }

        .status-badge.completed {
            background: rgba(59, 130, 246, 0.15);
            color: var(--info);
        }

        .status-badge.completed::before {
            background: var(--info);
        }

        .status-badge.paused {
            background: rgba(239, 68, 68, 0.15);
            color: var(--danger);
        }

        .status-badge.paused::before {
            background: var(--danger);
        }

        /* Buttons */
        .btn-primary-custom {
            background: var(--accent-gradient);
            border: none;
            color: white;
            padding: 0.75rem 1.5rem;
            border-radius: var(--radius-md);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-primary-custom:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-glow);
        }

        .btn-outline-custom {
            background: transparent;
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
            padding: 0.75rem 1.5rem;
            border-radius: var(--radius-md);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-outline-custom:hover {
            border-color: var(--accent-primary);
            background: var(--accent-glow);
        }

        /* Toast Notifications */
        .toast-container {
            position: fixed;
            top: calc(var(--header-height) + 1rem);
            right: 2rem;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .toast {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            box-shadow: var(--shadow-lg);
            animation: slideIn 0.3s ease;
            min-width: 300px;
        }

        .toast.success {
            border-left: 4px solid var(--success);
        }

        .toast.error {
            border-left: 4px solid var(--danger);
        }

        .toast.warning {
            border-left: 4px solid var(--warning);
        }

        .toast.info {
            border-left: 4px solid var(--info);
        }

        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        /* Section Content */
        .content-section {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .content-section.active {
            display: block;
        }

        #section-course-viewer.active {
            display: flex;
            flex-direction: column;
            height: calc(100vh - var(--header-height) - 4rem);
        }

        #section-course-viewer.active .card {
            flex: 1;
            min-height: 0;
        }

        /* Pantalla completa: la sección ocupa todo el viewport */
        #section-course-viewer:fullscreen,
        #section-course-viewer:-webkit-full-screen {
            display: flex;
            flex-direction: column;
            height: 100vh;
            padding: 0;
            background: #000;
        }

        #section-course-viewer:fullscreen .card,
        #section-course-viewer:-webkit-full-screen .card {
            flex: 1;
            min-height: 0;
            border-radius: 0;
            border: none;
        }

        /* Mostrar botón salir solo en fullscreen */
        #section-course-viewer:fullscreen #exitFullscreenBtn,
        #section-course-viewer:-webkit-full-screen #exitFullscreenBtn {
            display: flex !important;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Chart Container */
        .chart-container {
            position: relative;
            height: 250px;
        }

        /* Team Cards */
        .team-card {
            text-align: center;
            padding: 1.5rem;
        }

        .team-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid var(--accent-primary);
            margin-bottom: 1rem;
        }

        .team-name {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 0.25rem;
        }

        .team-role {
            color: var(--text-secondary);
            font-size: 0.85rem;
            margin-bottom: 0.75rem;
        }

        .team-skills {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            justify-content: center;
        }

        .skill-tag {
            background: var(--bg-elevated);
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.7rem;
            color: var(--text-secondary);
        }

        /* Responsive */
        @media (max-width: 992px) {
            .sidebar {
                transform: translateX(-100%);
            }

            .sidebar.mobile-open {
                transform: translateX(0);
            }

            .main-wrapper {
                margin-left: 0;
            }

            .search-box {
                display: none;
            }
        }

        @media (max-width: 768px) {
            .main-content {
                padding: 1rem;
            }

            .main-header {
                padding: 0 1rem;
            }
        }

        /* Modals */
        .modal-custom {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            padding: 2rem;
        }

        .modal-custom.active {
            display: flex;
        }

        .modal-box {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-xl);
            width: 100%;
            max-width: 600px;
            max-height: 90vh;
            overflow: hidden;
            box-shadow: var(--shadow-lg);
        }

        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-subtle);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-header h3 {
            font-size: 1.25rem;
            font-weight: 600;
            margin: 0;
        }

        .modal-close {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 1.25rem;
            cursor: pointer;
            padding: 0.5rem;
            border-radius: var(--radius-sm);
        }

        .modal-close:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }

        .modal-body {
            padding: 1.5rem;
            overflow-y: auto;
            max-height: 60vh;
        }

        .modal-footer {
            padding: 1.5rem;
            border-top: 1px solid var(--border-subtle);
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
        }

        /* Form Inputs */
        .form-group {
            margin-bottom: 1.25rem;
        }

        .form-label {
            display: block;
            font-size: 0.85rem;
            font-weight: 500;
            margin-bottom: 0.5rem;
            color: var(--text-secondary);
        }

        .form-input {
            width: 100%;
            padding: 0.75rem 1rem;
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-size: 0.9rem;
            transition: all 0.2s;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        .form-input::placeholder {
            color: var(--text-muted);
        }

        select.form-input {
            cursor: pointer;
        }

        textarea.form-input {
            resize: vertical;
            min-height: 100px;
        }

        /* Notification Dropdown */
        .notification-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            width: 360px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            display: none;
            z-index: 1000;
            margin-top: 0.5rem;
        }

        .notification-dropdown.active {
            display: block;
        }

        .notification-header {
            padding: 1rem;
            border-bottom: 1px solid var(--border-subtle);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .notification-list {
            max-height: 400px;
            overflow-y: auto;
        }

        .notification-item {
            padding: 1rem;
            border-bottom: 1px solid var(--border-subtle);
            display: flex;
            gap: 0.75rem;
            cursor: pointer;
            transition: background 0.2s;
        }

        .notification-item:hover {
            background: var(--bg-elevated);
        }

        .notification-item.unread {
            background: var(--accent-glow);
        }

        .notification-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .notification-content {
            flex: 1;
            min-width: 0;
        }

        .notification-text {
            font-size: 0.85rem;
            margin-bottom: 0.25rem;
        }

        .notification-time {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Status Badges */
        .status-badge {
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
            display: inline-block;
        }

        .status-badge.active,
        .status-badge.in_progress {
            background: rgba(16, 185, 129, 0.1);
            color: var(--success);
            border: 1px solid rgba(16, 185, 129, 0.2);
        }

        .status-badge.pending {
            background: rgba(245, 158, 11, 0.1);
            color: var(--warning);
            border: 1px solid rgba(245, 158, 11, 0.2);
        }

        .status-badge.completed {
            background: rgba(59, 130, 246, 0.1);
            color: var(--info);
            border: 1px solid rgba(59, 130, 246, 0.2);
        }

        .status-badge.paused,
        .status-badge.blocked {
            background: rgba(239, 68, 68, 0.1);
            color: var(--danger);
            border: 1px solid rgba(239, 68, 68, 0.2);
        }

        /* Tasks Enhancement */
        .task-item {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            /* Increased radius */
            padding: 12px;
            margin-bottom: 12px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            cursor: pointer;
        }

        .task-item:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
            border-color: var(--accent-primary);
        }

        .task-check {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            border: 2px solid var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            margin-top: 2px;
            transition: all 0.2s;
        }

        .task-check:hover {
            transform: scale(1.1);
        }

        .task-text {
            font-size: 0.95rem;
            color: var(--text-secondary);
            font-weight: 500;
            line-height: 1.4;
        }

        .task-item.completed .task-text {
            text-decoration: line-through;
            color: var(--text-muted);
            opacity: 0.7;
        }

        /* Priority Icons Enhancement */
        .priority-icon {
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            font-size: 1.1rem;
            margin-right: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .priority-icon.high {
            background: rgba(239, 68, 68, 0.15);
            color: var(--danger);
            border: 1px solid rgba(239, 68, 68, 0.2);
        }

        .priority-icon.medium {
            background: rgba(245, 158, 11, 0.15);
            color: var(--warning);
            border: 1px solid rgba(245, 158, 11, 0.2);
        }

        .priority-icon.low {
            background: rgba(16, 185, 129, 0.15);
            color: var(--success);
            border: 1px solid rgba(16, 185, 129, 0.2);
        }

        /* Print Styles */
        @media print {

            .sidebar,
            .main-header,
            .toast-container {
                display: none !important;
            }

            .main-wrapper {
                margin-left: 0 !important;
            }

            .main-content {
                padding: 0 !important;
            }
        }

        /* ═══════════════════════════════════════
           COMPREHENSIVE DARK MODE TEXT FIXES
        ═══════════════════════════════════════ */

        /* Force text color on all structural and text elements */
        body,
        .card,
        .modal-box,
        .dropdown-menu,
        .notification-dropdown,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6,
        p,
        span,
        div,
        li,
        a,
        label,
        input,
        select,
        textarea,
        button,
        th,
        td {
            color: var(--text-primary);
        }

        /* Re-allow muted text only where explicitly defined */
        .text-muted,
        [style*="color: var(--text-muted)"] {
            color: var(--text-muted) !important;
        }

        /* Re-allow accent colors */
        .text-accent,
        [style*="color: var(--accent-primary)"] {
            color: var(--accent-primary) !important;
        }

        /* Specific Table Fixes */
        .data-table th,
        .data-table td,
        .data-table td div,
        .data-table td span {
            color: var(--text-primary) !important;
        }

        /* Specific Form Fixes */
        input::placeholder {
            color: var(--text-muted) !important;
        }

        /* Ensure Bootstrap doesn't override */
        .text-dark,
        .text-body {
            color: var(--text-primary) !important;
        }

        /* Background overrides for table hover/stripes if needed */
        .data-table tbody tr:hover {
            background-color: var(--bg-card-hover) !important;
        }

        /* Fix checkboxes/radios if needed */
        .form-check-input {
            background-color: var(--bg-elevated);
            border-color: var(--border-subtle);
        }

        .form-check-input:checked {
            background-color: var(--accent-primary);
            border-color: var(--accent-primary);
        }

        /* Custom Tabs for Modals */
        .custom-tabs {
            border-bottom: 1px solid var(--border-subtle);
            margin-bottom: 0;
            display: flex;
            padding-left: 0;
            list-style: none;
        }
        
        .custom-tabs .nav-item {
            margin-bottom: -1px;
        }
        
        .custom-tabs .nav-link {
            color: var(--text-muted);
            border: 1px solid transparent;
            border-top-left-radius: var(--radius-md);
            border-top-right-radius: var(--radius-md);
            padding: 0.75rem 1.25rem;
            font-weight: 500;
            background: transparent;
            transition: all 0.2s;
            cursor: pointer;
            margin-bottom: -1px;
        }
        
        .custom-tabs .nav-link:hover {
            color: var(--text-primary);
            border-bottom-color: var(--border-subtle);
        }
        
        .custom-tabs .nav-link.active {
            color: var(--accent-primary) !important;
            background-color: var(--bg-card);
            border-color: var(--border-subtle);
            border-bottom-color: var(--bg-card);
        }
    