        :root {
            --bg-body: #f1f5f9;
            --bg-card: #ffffff;
            --border-color: #e2e8f0;
            --primary: #073763;
            --primary-hover: #052441;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --accent: #479dff;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
        }

        :root.dark-mode {
            --bg-body: #0f172a;
            --bg-card: #1e293b;
            --border-color: #334155;
            --primary: #1e3a8a;
            --primary-hover: #1e40af;
            --text-main: #f1f5f9;
            --text-muted: #94a3b8;
        }
        :root.dark-mode .nav-bar {
            background-color: #0f172a;
            border-bottom: 1px solid #334155;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: 'Inter', sans-serif;
            background: var(--bg-body);
            color: var(--text-main);
            min-height: 100vh;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            line-height: 1.6;
        }
        .container {
            max-width: 1000px;
            width: 100%;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 2rem;
            animation: fadeIn 0.8s ease-out;
            padding: 2rem 1rem;
            flex: 1;
            transition: max-width 0.3s;
        }
        #adminPanel {
            max-width: 98%;
        }
        .container.full-width {
            max-width: 100% !important;
            padding: 2rem 0 !important;
        }
        header { text-align: center; padding: 3rem 2rem; background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-color); box-shadow: var(--shadow); position: relative; overflow: hidden; }
        header::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
        h1 { font-size: 2.1rem; background: linear-gradient(to right, #073763, #479dff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.5rem; }
        
        .search-container { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; background: var(--bg-card); padding: 2rem; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: var(--shadow); }
        .search-container label { font-size: 1rem; color: var(--text-main); font-weight: 600; }
        .input-wrapper { position: relative; width: 100%; }
        .input-wrapper i { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.2rem; }
        input { width: 100%; background: #f1f5f9; border: 2px solid #cbd5e1; color: var(--text-main); padding: 1rem 1rem 1rem 3.5rem; border-radius: 12px; font-size: 1.2rem; outline: none; transition: all 0.3s; font-family: inherit; }
        input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(71, 157, 255, 0.2); background: #ffffff; }
        
        .filters-summary { font-size: 1.1rem; color: var(--primary); margin-bottom: 1rem; font-weight: 500; text-align: center; }
        
        .grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
        .card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s; position: relative; overflow: hidden; border-left: 5px solid var(--success); box-shadow: var(--shadow); }
        .card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        
        .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-color); }
        .card-title { font-size: 1.25rem; font-weight: 600; color: var(--text-main); margin-bottom: 0.25rem; }
        .badge { background: #d1fae5; color: #047857; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
        
        .detail-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; font-size: 1.05rem; color: var(--text-main); }
        .detail-row i { color: var(--primary); width: 20px; text-align: center; }
        
        .empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); font-size: 1.2rem; }
        .empty-state i { font-size: 4rem; opacity: 0.4; margin-bottom: 1.5rem; display: block; }
        
        .download-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; background: #ef4444; color: #fff; border: none; padding: 0.75rem 1.5rem; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; margin-top: 1rem; outline: none; }
        .download-btn:hover { background: #dc2626; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
 
        .export-mode { background: #ffffff !important; padding: 2rem; }
        .export-mode .filters-summary { color: #000000 !important; }
        .export-mode .card { box-shadow: none !important; border: 2px solid #000000 !important; background: #ffffff !important; }
        .export-mode .card * { color: #000000 !important; }
        .export-mode .card i { color: #000000 !important; }
        .export-mode .badge { border: 1px solid #000000 !important; background: transparent !important; color: #000000 !important; }
        .export-mode .detail-row { border-color: #000000 !important; }
 
        /* Navigation Bar */
        .nav-bar {
            background-color: var(--primary);
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .nav-container {
            max-width: 1000px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
        }
        .nav-logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
            color: #ffffff;
            font-weight: 700;
            font-size: 1.2rem;
        }
        .nav-logo i {
            font-size: 1.5rem;
            color: var(--accent);
        }
        .nav-menu {
            display: flex;
            gap: 1.5rem;
        }
        .nav-menu a {
            color: rgba(255, 255, 255, 0.85);
            text-decoration: none;
            font-weight: 500;
            font-size: 0.95rem;
            transition: color 0.2s ease;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }
        .nav-menu a:hover {
            color: #ffffff;
        }

        /* Footer */
        footer {
            background-color: var(--primary);
            color: rgba(255, 255, 255, 0.8);
            padding: 3rem 1rem 1.5rem;
            margin-top: auto;
            border-top: 4px solid var(--accent);
        }
        .footer-container {
            max-width: 1000px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 2.5rem;
            margin-bottom: 2rem;
        }
        .footer-section h3 {
            color: #ffffff;
            font-size: 1.1rem;
            margin-bottom: 1rem;
            font-weight: 600;
            position: relative;
            padding-bottom: 0.5rem;
        }
        .footer-section h3::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 40px;
            height: 2px;
            background-color: var(--accent);
        }
        .footer-section p, .footer-section ul {
            font-size: 0.9rem;
            line-height: 1.6;
        }
        .footer-section ul {
            list-style: none;
            padding: 0;
        }
        .footer-section ul li {
            margin-bottom: 0.5rem;
        }
        .footer-section ul li a {
            color: rgba(255, 255, 255, 0.8);
            text-decoration: none;
            transition: color 0.2s ease;
        }
        .footer-section ul li a:hover {
            color: #ffffff;
        }
        .footer-bottom {
            max-width: 1000px;
            margin: 0 auto;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding-top: 1.5rem;
            text-align: center;
            font-size: 0.85rem;
        }

        @media (max-width: 768px) {
            .nav-container {
                flex-direction: column;
                gap: 1rem;
                text-align: center;
            }
            .nav-menu {
                flex-wrap: wrap;
                justify-content: center;
                gap: 1rem;
            }
        }

        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    
        .admin-main-wrapper {
            background: var(--bg-card);
            padding: 2rem;
            border-radius: 16px;
            box-shadow: var(--shadow);
            border: 1px solid var(--border-color);
            transition: padding 0.3s;
        }
        
        .admin-main-wrapper.matrix-mode {
            padding: 1rem 0; /* Matrix needs full width */
            border: none;
            box-shadow: none;
            background: transparent;
        }

        .admin-tabs {
            display: inline-flex;
            gap: 0.5rem;
            background: #e2e8f0;
            padding: 0.35rem;
            border-radius: 99px;
            margin-bottom: 2rem;
            overflow-x: auto;
            max-width: 100%;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none; /* Firefox */
        }
        .admin-tabs::-webkit-scrollbar {
            display: none; /* Safari and Chrome */
        }
        .admin-tab {
            padding: 0.75rem 1.5rem;
            cursor: pointer;
            font-weight: 600;
            color: var(--text-muted);
            border-radius: 99px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            white-space: nowrap;
            font-size: 0.95rem;
        }
        .admin-tab:hover {
            color: var(--text-main);
        }
        .admin-tab.active {
            background: #ffffff;
            color: var(--primary);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }
        .admin-section {
            display: none;
            animation: fadeIn 0.4s ease-out;
        }
        .admin-section.active {
            display: block;
        }
        .admin-table-container {
            overflow-x: auto;
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            margin-bottom: 2rem;
            border: 1px solid var(--border-color);
        }
        .admin-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            text-align: left;
            min-width: 600px;
        }
        .admin-table th, .admin-table td {
            padding: 1.25rem 1rem;
            border-bottom: 1px solid var(--border-color);
            transition: background-color 0.2s;
        }
        .admin-table tbody tr:hover td {
            background-color: #f8fafc;
        }
        .admin-table tbody tr:last-child td {
            border-bottom: none;
        }
        .admin-table th {
            background: #f8fafc;
            font-weight: 600;
            color: var(--text-main);
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 0.05em;
            position: sticky;
            top: 0;
            z-index: 10;
        }
        .action-btn {
            background: transparent;
            border: none;
            cursor: pointer;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            transition: all 0.2s;
            margin-right: 0.25rem;
        }
        .action-btn.edit { color: var(--primary); background: #e0f2fe; }
        .action-btn.edit:hover { background: #bae6fd; transform: translateY(-2px); }
        .action-btn.delete { color: #e11d48; background: #ffe4e6; }
        .action-btn.delete:hover { background: #fecdd3; transform: translateY(-2px); }
        
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        .stat-card {
            background: white;
            padding: 1.5rem;
            border-radius: 12px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            border: 1px solid var(--border-color);
            text-align: center;
        }
        .stat-card h3 {
            font-size: 1rem;
            color: var(--text-muted);
            margin-bottom: 0.5rem;
        }
        .stat-card .stat-value {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--primary);
        }
        
        .modal-form-group {
            margin-bottom: 1rem;
            text-align: left;
        }
        .modal-form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
        }
        .modal-form-group input, .modal-form-group select {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: 8px;
        }

    
        .matrix-table {
            width: max-content;
            border-collapse: collapse;
            font-size: 0.85rem;
        }
        .matrix-table th, .matrix-table td {
            border: 1px solid var(--border-color);
            padding: 0.5rem;
            vertical-align: top;
            min-width: 150px;
            max-width: 250px;
        }
        .matrix-table th {
            background: var(--light-bg);
            position: sticky;
            top: 0;
            z-index: 10;
        }
        .matrix-table th:first-child, .matrix-table td:first-child {
            position: sticky;
            left: 0;
            background: var(--light-bg);
            z-index: 20;
            font-weight: bold;
        }
        .matrix-cell-virtual {
            background-color: #f8f9fa;
            color: #adb5bd;
            text-align: center;
            vertical-align: middle !important;
            font-style: italic;
        }
        .matrix-cell-presencial {
            background-color: #e8f4fd;
            border-left: 3px solid var(--primary) !important;
        }
        .matrix-aula {
            font-weight: bold;
            color: var(--primary);
            margin-bottom: 0.5rem;
            display: block;
            border-bottom: 1px solid rgba(0,0,0,0.1);
            padding-bottom: 0.2rem;
        }
        .matrix-prof-list {
            margin: 0;
            padding-left: 1rem;
        }
        .matrix-prof-list li {
            margin-bottom: 0.2rem;
            color: var(--text-color);
        }

