/* ========================================================= */
/* 1. DESIGN TOKENS & THEMING                                */
/* ========================================================= */
:root {
  /* Light Mode Colors (Matching your screenshots) */
  --bg-primary: #f8fafd;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent-blue: #2563eb;
  --accent-blue-light: #eff6ff;
  --accent-purple: #7c3aed;
  --accent-purple-light: #f5f3ff;
  --accent-teal: #0d9488;
  --accent-teal-light: #f0fdfa;
  --border-color: #e2e8f0;
  --danger-color: #ef4444;
  --danger-light: #fef2f2;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Dark Mode Overrides */
body.dark-theme {
  --bg-primary: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --accent-blue-light: rgba(37, 99, 235, 0.1);
  --accent-purple-light: rgba(124, 58, 237, 0.1);
  --accent-teal-light: rgba(13, 148, 136, 0.1);
}

/* ========================================================= */
/* 2. BASE RESET & LAYOUT                                    */
/* ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.dashboard-body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* ========================================================= */
/* 3. SIDEBAR NAVIGATION                                     */
/* ========================================================= */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
  color: var(--accent-purple);
}

.brand-icon {
  font-size: 2rem !important;
}

.sidebar-menu {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--bg-primary);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
  font-weight: 600;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.course-dropdown {
  width: 100%;
  padding: 10px 12px;
  background-color: #0b1329;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.logout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background-color: var(--danger-light);
  color: var(--danger-color);
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.logout-button:hover {
  background-color: #fca5a5;
}

/* ========================================================= */
/* 4. MAIN WORKING PANEL                                     */
/* ========================================================= */
.main-panel {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dashboard-header {
  height: 70px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-avatar {
  color: var(--accent-blue);
  font-size: 1.5rem !important;
}

.content-wrapper {
  padding: 32px;
  flex-grow: 1;
}

/* ========================================================= */
/* 5. DYNAMIC VIEWS ARCHITECTURE                             */
/* ========================================================= */
.dashboard-view {
  animation: fadeIn 0.25s ease-in-out;
}

.hidden-view {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.dashboard-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 1.15rem;
}

.inline-icon {
  color: var(--text-muted);
}

/* ========================================================= */
/* 6. OVERVIEW COMPONENT GRAPHICS                            */
/* ========================================================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.card-icon {
  font-size: 2.5rem !important;
  padding: 12px;
  border-radius: 14px;
}

.blue-icon { background-color: var(--accent-blue-light); color: var(--accent-blue); }
.purple-icon { background-color: var(--accent-purple-light); color: var(--accent-purple); }
.teal-icon { background-color: var(--accent-teal-light); color: var(--accent-teal); }

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-list li {
  padding: 12px 16px;
  background-color: var(--bg-primary);
  border-radius: 8px;
  font-size: 0.95rem;
  border-left: 4px solid var(--accent-blue);
}

/* ========================================================= */
/* 7. FORMS, LISTS, & COMPONENT OBJECTS                      */
/* ========================================================= */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="datetime-local"],
.form-group input[type="date"],
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-size: 0.95rem;
}

.primary-btn {
  background-color: var(--accent-blue);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.primary-btn:hover {
  opacity: 0.9;
}

.attendance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

.styled-student-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.styled-student-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: var(--bg-primary);
  border-radius: 8px;
}

.user-avatar-small {
  color: var(--text-muted);
}

/* ========================================================= */
/* 8. REFINED ANALYTICS & GRID FIXES                         */
/* ========================================================= */
.mock-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 20px;
  height: 240px;
  padding: 24px;
  background-color: var(--bg-primary);
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 80px;
}

.chart-bar {
  width: 100%;
  background-color: var(--accent-blue) !important;
  border-radius: 6px 6px 0 0;
  min-height: 10px; 
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
  transition: height 0.3s ease;
  animation: growUp 0.5s ease-out;
}

@keyframes growUp {
  from { height: 0; }
}

.bar-wrapper span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Accessibility Hidden Labels */
.field-label-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);

    display:flex;
    justify-content:center;
    align-items:center;

    z-index:9999;
}

.hidden{
    display:none;
}

.modal-content{
    width:600px;
    max-width:95%;
    background:white;
    border-radius:18px;
    padding:24px;
    display:flex;
    flex-direction:column;
    gap:14px;
    box-shadow:0 20px 60px rgba(0,0,0,.2);
}

.modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:12px;
}