/* THEME DEFINITIONS */
:root[data-theme="pastel-beige"] {
    --bg: #fdfaf5; --sidebar: #ffffff; --card: #ffffff; --text: #5d5b54;
    --accent: #d4a373; --accent-soft: #f1e3d3; --border: #e9e5d9;
}
:root[data-theme="pastel-lavender"] {
    --bg: #f9f8ff; --sidebar: #ffffff; --card: #ffffff; --text: #4a4e69;
    --accent: #9d8df1; --accent-soft: #eeecfb; --border: #e0def7;
}
:root[data-theme="light"] {
    --bg: #f4f7f6; --sidebar: #2c3e50; --card: #ffffff; --text: #333;
    --accent: #3498db; --accent-soft: #ebf5fb; --border: #d5dbdb;
}
:root[data-theme="dark"] {
    --bg: #121212; --sidebar: #1e1e1e; --card: #252525; --text: #e0e0e0;
    --accent: #bb86fc; --accent-soft: #3700b3; --border: #333;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--text); transition: all 0.3s ease; overflow-x: hidden; }
.hidden { display: none !important; }

/* Auth Styling */
.auth-wrapper { height: 100vh; display: flex; justify-content: center; align-items: center; background: var(--accent-soft); padding: 20px; }
.auth-card { background: var(--card); padding: 40px; border-radius: 30px; width: 100%; max-width: 400px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); text-align: center; }
.logo-circle { width: 50px; height: 50px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.5rem; margin: 0 auto 10px; }
.auth-tabs { display: flex; background: var(--bg); padding: 5px; border-radius: 12px; margin: 20px 0; }
.auth-tabs button { flex: 1; border: none; padding: 10px; border-radius: 8px; cursor: pointer; background: transparent; color: var(--text); font-family: inherit; }
.auth-tabs button.active { background: var(--card); color: var(--accent); font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.auth-card input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); outline: none; }
.main-btn { width: 100%; padding: 12px; background: var(--accent); color: white; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; }

/* Dashboard Layout */
.container { display: flex; min-height: 100vh; position: relative; }

/* Sidebar Responsive */
.sidebar { 
    width: 280px; background: var(--sidebar); padding: 30px 20px; 
    display: flex; flex-direction: column; border-right: 1px solid var(--border);
    transition: left 0.3s ease; z-index: 1000;
}

.logo { font-size: 1.4rem; font-weight: 600; color: var(--accent); margin-bottom: 30px; }
.sem-list { list-style: none; }
.sem-list li { padding: 12px 15px; margin-bottom: 8px; border-radius: 12px; cursor: pointer; transition: 0.2s; font-size: 0.9rem; }
.sem-list li.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sem-list li.locked { opacity: 0.5; cursor: not-allowed; }

/* Main Content Area */
.main-content { flex: 1; padding: 40px; min-width: 0; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.header-left { display: flex; align-items: center; gap: 15px; }
.menu-btn { display: none; background: var(--accent-soft); border: none; padding: 10px; border-radius: 8px; color: var(--accent); font-size: 1.2rem; cursor: pointer; }
.mobile-close { display: none; position: absolute; right: 20px; top: 20px; background: none; border: none; font-size: 1.5rem; color: var(--text); }

/* Table and Cards */
.table-container { overflow-x: auto; background: var(--card); border-radius: 24px; border: 1px solid var(--border); margin-bottom: 25px; }
.glass-card { padding: 20px; min-width: 600px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.75rem; color: #999; padding: 10px; text-transform: uppercase; }
td { padding: 12px 10px; border-top: 1px solid var(--border); }
[contenteditable] { outline: none; padding: 4px; border-radius: 4px; }
[contenteditable]:focus { background: var(--accent-soft); }
input[type="number"] { width: 60px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 5px; border-radius: 5px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-card { padding: 25px; border-radius: 20px; }
.stat-card.primary { background: var(--accent); color: white; }
.stat-card.secondary { background: var(--accent-soft); color: var(--accent); }
.stat-card.danger { background: #fff1f1; color: #e74c3c; border: 1px solid #ffcfcf; }

.theme-section { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border); }
.theme-grid { display: flex; gap: 10px; margin-top: 10px; }
.theme-opt { width: 25px; height: 25px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.theme-opt.beige { background: #d4a373; }
.theme-opt.lavender { background: #9d8df1; }
.theme-opt.light { background: #3498db; }
.theme-opt.dark { background: #121212; border-color: #444; }

.logout-btn { margin-top: 20px; background: none; border: none; color: #e74c3c; cursor: pointer; text-align: left; }

/* MOBILE RESPONSIVE QUERIES */
@media (max-width: 768px) {
    .menu-btn, .mobile-close { display: block; }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }
    .sidebar.active { left: 0; }
    
    .main-content { padding: 20px; }
    .summary-grid { grid-template-columns: 1fr; }
    .header h1 { font-size: 1.4rem; }
    .user-chip { display: none; }
}