:root {
    /* Deep Dark Theme Palette */
    --bg-color: #050505;
    --sidebar-bg: #0a0a0a;
    --card-bg: #0f0f0f;
    --border-color: #222222;
    --border-hover: #333333;

    /* Typography */
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;

    /* Accents - "Pro" Blue/Purple or just clean white/grey */
    --primary-color: #3b82f6;
    /* Modern Blue */
    --primary-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.15);

    /* Status Colors */
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;

    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 0px;
    /* No top header anymore */

    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-color);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* Layout Structure */
#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
    padding-left: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem 0.8rem;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
    font-size: 0.95rem;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.nav-item .icon {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Main Content Area */
#main-content {
    flex: 1;
    position: relative;
    background: var(--bg-color);
    overflow: hidden;
    /* Views handle their own scrolling */
}

/* View Sections */
.view-section {
    position: absolute;
    inset: 0;
    /* Top/Left/Right/Bottom: 0 */
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shared Components */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Cards & Panels */
.glass-panel,
.card-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: none;
    /* Flat design */
    /* Remove old glassmorphism blurs */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid transparent;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 12px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    /* Button text contrast */
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
}

/* Inputs */
input[type="text"],
input[type="number"],
select,
textarea {
    background: #000;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--text-secondary);
}

/* Matrix View Specifics */
.matrix-controls-bar {
    margin-bottom: 1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
}

.matrix-grid-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: auto;
    flex: 1;
    /* Take remaining height */
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.matrix-table th,
.matrix-table td {
    border-color: var(--border-color);
}

.sticky-col-header,
.teacher-col,
.sticky-col {
    background: var(--card-bg);
    /* Match card bg */
}

.sticky-col {
    border-right: 1px solid var(--border-color);
}

.teacher-col {
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.matrix-input {
    color: var(--text-primary);
}

.matrix-input:hover,
.matrix-input:focus {
    background: #222;
    border-color: var(--primary-color);
}

/* Input View Layout */
.input-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    height: 100%;
}

.input-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    height: fit-content;
}

.input-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    overflow-y: auto;
}

/* Lists */
.item-card {
    background: #161616;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.item-card:hover {
    border-color: var(--text-secondary);
    transform: none;
    /* Remove jumpy effect */
    background: #1a1a1a;
}

/* Modal */
#modal-container {
    background: #111;
    border: 1px solid #333;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-header,
.modal-footer {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-bottom: none;
    border-top: 1px solid var(--border-color);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-primary);
}

/* Dashboard Grid */
.dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
    /* 3 cols for wider screens */
}

.dashboard-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}