/* ============================================
   ROOT VARIABLES & THEMES
   ============================================ */
:root {
  /* Layout Colors */
  --bg: #f8fafc;
  --text: #0f172a;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --line-color: #cbd5e1;

  /* Theme Colors */
  --primary: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --theme-color: #6366f1;
  --theme-glow: rgba(99, 102, 241, 0.3);

  /* Status Colors */
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  /* Sidebar */
  --sidebar-bg: #ffffff;
  --sidebar-width: 260px;
  --sidebar-main: #1e293b;
  --sidebar-muted: #94a3b8;
  --hover-bg: rgba(255, 255, 255, 0.05);
  /**/
  --bg-page: #f3f4f6; /* Cool Gray 100 */
  --bg-card: #ffffff;
  --border-color: #e5e7eb; /* Gray 200 */
  --primary: #0f172a; /* Slate 900 (Black-ish) */
  --primary-hover: #1e293b;
  --text-main: #111827; /* Gray 900 */
  --text-muted: #94a3b8; /* Gray 500 */
  --focus-ring: rgba(15, 23, 42, 0.15);
  --error-bg: #fef2f2;
  --error-text: #ef4444;
  --error-border: #fee2e2;
  /*MANAGE CENTERS*/
  --mc-bg: #f8fafc;
  --mc-text: #0f172a;
  --mc-primary: #6366f1;
  --mc-border: #e2e8f0;
  --mc-sidebar-w: 260px;
  /*CHAT MESSAGES */
  --chat-bg: #eef2f6;
  --chat-sidebar-w: 320px;
  --chat-primary: #6366f1;
  --chat-primary-light: #e0e7ff;
  --chat-me-bg: #6366f1;
  --chat-me-text: #ffffff;
  --chat-other-bg: #ffffff;
  --chat-text: #1e293b;
  /*LIBRARY*/
}

/* Dark Mode Variables */
body.dark-mode {
  --bg: #0f172a;
  --text: #f1f5f9;
  --card-bg: #1e293b;
  --border: #334155;
  --primary: #818cf8;
  --line-color: #475569;
}

/* ============================================
   GLOBAL RESETS
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}
body {

  color: var(--text);
  margin: 0;
  margin-left: 260px;
  transition: margin-left 0.3s ease, background 0.3s, color 0.3s;
  overflow-x: hidden;
  
}
button,
.icon-btn,
a {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
button:focus,
button:active,
.icon-btn:focus,
.icon-btn:active,
a:focus,
a:active,
select:focus,
input:focus {
  outline: none !important;
  box-shadow: none !important;
}
/* ============================================
   LAYOUT CONTAINERS
   ============================================ */

.container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.main-area,
.main-content {
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

/* ============================================
   TOP HEADER
   ============================================ */

.top-header {
  background: white;
  height: 72px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.3s;
}

body.dark-mode .top-header {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
}

.page-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-right: 20px;
}

.card,
.card * {
    min-width: 0;
}


/* =========================================
   11. MOBILE HEADER OPTIMIZATION
   ========================================= */

@media (max-width: 768px) {
  /* 1. Slimmer Header & Padding */
  .top-header {
    height: 60px;
    padding: 0 1rem; /* Reduce side padding */
  }

  /* 2. Smaller Title */
  .page-title {
    font-size: 1rem;
    /* Prevent long titles from breaking layout */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    margin-left: 0 !important;
  }
  
  .container{
	  padding: 1rem;
  }

  /* 3. Compact Icon Buttons */
  .header-controls {
    gap: 6px; /* Tighter gap between bells/moons */
    margin-right: 8px;
  }

  .icon-btn {
    width: 34px;
    height: 34px; /* Smaller touch targets */
    font-size: 0.95rem;
    border-radius: 8px;
  }

  /* 4. Profile: Hide Name, Show Avatar Only */
  .profile-capsule {
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0; /* This clever trick hides the text node "Admin" */
    gap: 0 !important;
  }

  .user-name,
  .user-role {
    display: none !important;
  }

  .profile-capsule:hover {
    background: transparent;
  }
  .profile-capsule:focus,
  .profile-capsule:active {
    background: transparent !important;
  }
  .profile-dropdown:focus,
  .profile-dropdown:active {
    background: transparent !important;
  }

  .avatar-circle {
    margin-right: 0 !important;
    width: 34px;
    height: 34px;
    font-size: 0.9rem; /* Restore text size for the initial inside circle */
    box-shadow: none;
  }

  /* Adjust Language Toggle Text */
  #lang-indicator {
    display: none;
  } /* Hide 'EN' text on mobile */
}

/* Extra Small Screens (Phones < 480px) */
@media (max-width: 480px) {
  /* Hide Page Title to prioritize Action Icons */
  .page-title {
    display: none;
  }

  /* Ensure hamburger is visible */
  .menu-btn {
    margin-right: 0;
  }
}

/* ============================================
   ICON BUTTONS
   ============================================ */
.icon-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 15px;
  color: var(--primary);
  background: var(--bg);
  border: 1px solid var(--theme-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
  position: relative;
}

.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.dark-mode .icon-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

body.dark-mode .header-controls .icon-btn:nth-child(1),
body.dark-mode .header-controls .icon-btn:nth-child(2),
body.dark-mode .header-controls .icon-btn:nth-child(3) {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .icon-btn:hover {
  background: var(--primary);
  color: white;
}

/* Small Icon Buttons (for tables) */
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  margin-left: 0.3rem;
}

.btn-edit.btn-icon {
  background: #fff7ed;
  color: #c2410c;
}

.btn-delete {
  background: #fef2f2;
  color: #b91c1c;
}

/* ============================================
   NOTIFICATION BADGE & DROPDOWN
   ============================================ */

.badge-dot {
  position: absolute;
  top: -6px; /* Move up */
  right: -6px; /* Move right */
  min-width: 1.1rem; /* Width for single digit */
  height: 1.1rem;
  padding: 0 4px; /* Padding for double digits (99+) */
  background: #ef4444;
  color: white;
  border: 2px solid white;
  border-radius: 10px; /* Pill shape */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  /* Flexbox to center the number text */
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  z-index: 10;
}

.badge-dot.active {
  display: flex;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}
.notif-dropdown {
  position: absolute;
  top: 4.5rem;
  right: 80px;
  width: 300px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 1000;
  overflow: hidden;
}

.notif-dropdown.active {
  display: block;
}

.notif-item {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.notif-item:hover {
  background: #f8fafc;
}

.notif-title {
  font-weight: 700;
  color: #334155;
  margin-bottom: 2px;
}

.notif-msg {
  color: #64748b;
  font-size: 0.85rem;
}

/* ============================================
   THEME PICKER
   ============================================ */

.theme-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
  border: 2px solid transparent;
}

.theme-dot:hover {
  transform: scale(1.2);
}

.theme-dot.selected {
  border-color: white;
  transform: scale(1.1);
}

/* Theme Colors */
.t-indigo {
  background: #6366f1;
}
.t-emerald {
  background: #477023;
}
.t-umber {
  background: #834f16;
}
.t-amber {
  background: #e58810;
}
.t-forest {
  background: #469125;
}
.t-purple {
  background: #6e3482;
}

/* ========================================
   SPLIT SCREEN WITH BACKGROUND IMAGE
======================================== */

#login-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  font-family: "Inter", sans-serif;
  position: relative;
  overflow: hidden;

  /* Background Image */
  background-image: url("../images/login-bg.webp");
  background-size: cover;
  background-position: center left;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Split Screen Layout */
.login-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 1400px;
  margin: auto;
  gap: 40px;
  position: relative;
  z-index: 1;
}

/* Left Side - Branding */
.login-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  color: white;
}

.login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 40px;
}

.login-brand i {
  font-size: clamp(1.2rem, 0.2714rem + 2.9714vw, 2.5rem);
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-brand-text {
  text-align: center;
}
.login-brand-text h1 {
  margin: 0;
  font-size: clamp(1.5rem, 0.4817rem + 3.2587vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  text-align: center;
}

.login-brand-text p {
  margin: 10px 0 10px 0;
  font-size: 0.8rem;
  opacity: 0.9;
  color: #fff;
  text-align: center;
  letter-spacing: 1px;
}
.sub-head {
  margin: 1rem 0;
  font-size: clamp(1rem, 0.7963rem + 0.6517vw, 1.2rem);
  opacity: 0.9;
  color: #fff;
  text-align: center;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-top: 60px;
}

/* Right Side - Glassmorphism Form */
.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-wrapper {
  width: 100%;
  max-width: 480px;
  padding: 50px 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.login-header h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.login-subtitle {
  color: #fff;
  font-size: 0.95rem;
}

/* Alert Styling */
.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 1px solid #fca5a5;
  border-radius: 10px;
  color: #991b1b;
  font-size: 0.9rem;
  margin-bottom: 25px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Styling */
#login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lgform-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #f8fafc;
}

.input-wrapper input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #000;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.password-toggle:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* Primary Button */
.login_btn--primary {
  display: flex;
  justify-content: Center;
  gap: 0.6rem;
  padding: 16px;
  background: #000;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.login_btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.login_btn--primary:active {
  transform: translateY(0);
}

/* Responsive Design */
/* Mobile-First Approach */
@media (max-width: 1024px) {
  /* Stack layout vertically */
  .login-container {
    display: grid;
    grid-template-columns: 1fr !important;
    justify-items: center;
    gap: 20px;
    padding: 0 15px;
  }
  #login-body{
       background-position: center center;
  }

  /* Hide left branding on mobile */
  .login-left {
    display: none;
  }

  /* Adjust form wrapper */
  .login-wrapper {
    max-width: 100%;
    padding: 40px 25px;
    border-radius: 16px;
  }

  /* Reduce font sizes */
  .login-header h1 {
    font-size: 1.5rem;
  }

  .login-header {
    margin-bottom: 25px;
  }

  /* Ensure buttons are full width and tappable */
  .login_btn--primary {
    padding: 12px 16px;
    font-size: 1rem;
    min-height: 48px;
  }

  /* Form inputs better sizing */
  .lgform-group input {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    padding: 12px;
  }

  .login-alert {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  /* Reduce floating orb visibility */
  #login-body::after {
    width: 300px;
    height: 300px;
    bottom: -100px;
    right: -100px;
    opacity: 0.5;
  }
}

@media (max-width: 480px) {
    
    #login-body{
        background-position: center center;
    }
    .login-right {
        padding: 0;
    }
    
   .login-wrapper {
        padding: 30px 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

  .login-header h1 {
    font-size: 1.25rem;
  }

  .login-brand-text h1 {
    font-size: 1.3rem;
  }

  .login-brand-text p {
    font-size: 0.75rem;
  }

  .sub-head {
    font-size: 0.9rem;
  }

  /* Hide decorative element entirely on very small screens */
  #login-body::after {
    display: none;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .login-container {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 20px;
  }

  .login-wrapper {
    padding: 40px 30px;
  }

  .login-left {
    padding: 40px;
  }
}

/* ============================================
    NEW CSS FOR CENTER CARDS 
   ============================================ */
.center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.center-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
  min-height: 160px;
  position: relative;
  overflow: hidden;
}
.center-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}
/* Decorative icon background */
.card-bg-icon {
  position: absolute;
  bottom: -10px;
  right: -10px;
  font-size: 5rem;
  color: rgba(0, 0, 0, 0.03);
  transform: rotate(-15deg);
}
.center-icon-box {
  width: 48px;
  height: 48px;
  background: #e0e7ff;
  color: var(--primary);
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.center-meta {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}
.center-meta__text {
  background: var(--primary);
  color: #fff;
  padding: 4px 8px;
  border-radius: 25px;
}

/* Back Button Style */
.btn-back-dash {
  display: inline-flex;
  font-size: clamp(0.7rem, 0.5rem + 1.3333vw, 1rem);
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 8px;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  margin-right: 1rem;
  transition: all 0.2s;
}
.btn-back-dash:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}
/* ============================================
   PROFILE CAPSULE & DROPDOWN
   ============================================ */
.profile-capsule {
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 6px 8px 6px 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
  position: relative;
}

.profile-capsule:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.dark-mode .profile-capsule,
body.dark-mode .user-name,
body.dark-mode .container,
body.dark-mode .main-wrapper{
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

.user-meta {
  text-align: right;
  line-height: 1.2;
}

.user-name {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: #1e293b;
}

.user-role {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  top: 115%;
  right: 0;
  width: 10rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  -webkit-tap-highlight-color: transparent;
}

.profile-dropdown.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

body.dark-mode .profile-dropdown {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  padding: 12px 16px;
  text-decoration: none;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.1s;
  border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: var(--primary);
}

.dropdown-logout {
  color: #ef4444;
}

.dropdown-logout:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* ============================================
   TOOLBAR & FILTERS
   ============================================ */
.toolbar {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filters-bar {
  background: white;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group,
.field {
  margin-bottom: 1.25rem;
}

.field-full {
  grid-column: 1 / -1;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

input,
select,
textarea {
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background-color: #f8fafc;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 500;
  transition: border 0.2s;
}

input:hover,
select:hover {
  border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input::placeholder {
  color: #9ca3af;
}

/* Select Dropdown Arrow */
select {
  padding-right: 2.5rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1em;
  appearance: none;
  min-width: 160px;
}
.input-wrapper {
  position: relative;
}
/* Checkbox Styling */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: #f8fafc;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.checkbox-label:hover {
  background: #f1f5f9;
}

.checkbox-label input[type="checkbox"],
input[type="checkbox"],
input[type="radio"] {
  width: auto;
}

.form-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-left: 0.5rem;
}

.form-footer a:hover {
  text-decoration: underline;
}

/*OTP FORM FIELDS*/

#verify-otp {
  margin: 0 auto;
}
/* BLOCK: .verify-v1 */
.verify-v1 {
  /* Local Scope Variables */
  --v-primary: #4f46e5;
  --v-primary-dark: #4f46e5;
  --v-bg: #f1f5f9;
  --v-text-main: #1e293b;
  --v-text-muted: #64748b;
  --v-border: #e2e8f0;
  --v-error-bg: #fef2f2;
  --v-error-text: #ef4444;

  /* Layout & Reset */
  font-family: "Inter", sans-serif;
  background-image: url("../images/login-bg.webp");
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ELEMENT: __card */
.verify-v1__card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* ELEMENT: __title */
.verify-v1__title {
  margin-top: 0;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* ELEMENT: __desc */
.verify-v1__desc {
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ELEMENT: __error */
.verify-v1__error {
  background-color: var(--v-error-bg);
  color: var(--v-error-text);
  font-size: 0.9rem;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #fee2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ELEMENT: __form */
.verify-v1__form {
  display: flex;
  flex-direction: column;
}

/* ELEMENT: __input */
.verify-v1__input {
  width: 100%;
  padding: 12px;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.5em; /* Cleaner spacing than 8px */
  border: 2px solid var(--v-border);
  border-radius: 8px;
  margin-bottom: 1rem;
  box-sizing: border-box;
  font-family: monospace;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* MODIFIER: Input Focus State (Pseudo-class used, but follows logic) */
.verify-v1__input:focus {
  border-color: var(--v-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ELEMENT: __btn */
.verify-v1__btn {
  display: flex;
  background: var(--v-primary);
  color: white;
  border: none;
  padding: 12px;
  width: 100%;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
  justify-content: center;
}

.verify-v1__btn:hover {
  background-color: var(--v-primary-dark);
}

/* ELEMENT: __link */
.verify-v1__link {
  display: inline-block;
  margin-top: 1.25rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.verify-v1__link:hover {
  color: var(--v-primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn,
button {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.btn-apply {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-next {
  background: #4f46e5;
  color: white;
}

.btn-back {
  background: white;
  border: 1px solid #cbd5e1;
  color: #64748b;
}

.btn-submit {
  background: #10b981;
  color: white;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-csv {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.btn-csv:hover {
  background: #dcfce7;
}

.btn-pdf {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.btn-pdf:hover {
  background: #ffe4e6;
}

.btn-print {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.btn-print:hover {
  background: #c7d2fe;
}

.btn-reset {
  margin-left: auto;
  color: #64748b;
  background: transparent;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.btn-reset:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: white;
}

.btn-save {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-delete {
  background: white;
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-delete:hover {
  background: #fef2f2;
}

.btn-approve,
.btn-primary {
  background: var(--primary-gradient) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-reject {
  background: var(--danger);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 5px;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.btn-nav:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateX(-2px);
}

.btn-nav.home {
  background: var(--bg);
}

/* ============================================
   TABLE CARD & STYLES
   ============================================ */
.table-card {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  color: #334155;
  font-size: 0.95rem;
  vertical-align: middle;
}

tr:hover {
  background: #f8fafc;
}

tr:last-child td {
  border-bottom: none;
}

/* ID Badge */
.id-badge {
  font-family: "confortaa", monospace;
  font-size: 0.75rem;
  color: #6B21A8;
  background: #F3E8FF;
  padding: 4px 12px;
  border-radius: 9999px;
  font-weight: 600;
}

.code-badge {
  font-family: "Monaco", monospace;
  background: #f1f5f9;
  color: #475569;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

/* ============================================
   ACTION BUTTONS (Table)
   ============================================ */
.actions-flex {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-view {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.btn-view:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-edit {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.btn-edit:hover {
  background: #fff7ed;
  color: #c2410c;
}

/* ============================================
   BADGES & STATUS
   ============================================ */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-admin {
  background: #e0e7ff;
  color: #4338ca;
}

.badge-teacher {
  background: #dcfce7;
  color: #166534;
}

.badge-id {
  background: #e0e7ff;
  color: #4338ca;
}

.badge-grade {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-medium {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-section {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
/* ============================================
   ADMIN STATS
   ============================================ */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.page-current {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
    margin: 0 5px;
}
.page-info {
  color: #64748b;
  font-size: 0.9rem;
}
.pagination {
  display: flex;
  gap: 5px;
}
.page-link {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #475569;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  background: white;
}
.page-link:hover:not(.disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.page-link.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}
.page-link.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}
.search-box {
  position: relative;
  max-width: 300px;
  width: 100%;
}
.search-box input {
  width: 100%;
  padding: 8px 35px 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
}
.search-box i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

/* Add this to your internal style block or CSS */
.btn-refresh-mini {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.dashboard-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  position: relative;
  border: 1px solid #f0f2f5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 12rem;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
  border-color: transparent;
}
.card-students .card-icon {
  background-color: #b06500;
  background-image: linear-gradient(315deg, #b06500 0%, #5a321a 74%) !important;
}
.card-pending .card-icon {
  background-color: #e76d2c;
  background-image: linear-gradient(315deg, #e76d2c 0%, #ffa500 74%) !important;
}
.card-inactive .card-icon {
  background-color: #e34234;
  background-image: linear-gradient(315deg, #e34234 0%, #ff3800 74%) !important;
}
.card-health .card-icon {
  background: rgb(0, 51, 102);
  background: linear-gradient(
    159deg,
    rgba(0, 51, 102, 1) 0%,
    rgba(15, 82, 186, 1) 100%
  ) !important;
}

/* === HEADER BUTTONS: MODERN PILL STYLE === */

/* 1. Language Button (Blue) */
.header-controls .icon-btn:nth-child(1) {
  color: #083987; /* Sky Blue */
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
}

/* 2. Theme Button (Amber/Gold) */
.header-controls .icon-btn:nth-child(2) {
  color: #d97706; /* Amber */
  background: #fffbeb;
  border: 1px solid #fde68a;
}

/* 3. Notification Button (Indigo - Matches Brand) */
.header-controls .icon-btn:nth-child(3) {
  color: #6366f1; /* Indigo */
  background: #eef2ff;
  border: 1px solid #e0e7ff;
}

/* Hover Effects (Slightly Darker) */
.header-controls .icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: #f8fafc;
  color: #64748b;
  transition: all 0.3s ease;
}

.dashboard-card .card-icon {
  background: currentColor; /* Background becomes the card's theme color */
}
.dashboard-card .card-icon i {
  color: white;
}

/* Specific Hover Colors */
.card-users .card-icon {
  color: hsl(249.38deg 97.96% 61.57%);
}
.card-centers .card-icon {
  color: hsl(31.1deg 89.34% 47.84%);
}
.card-ips .card-icon {
  color: hsl(104.43deg 100% 25.69%);
}
.card-repos .card-icon {
  color: hsl(275.71deg 69.42% 47.45%);
}

.card-assessments .card-icon {
    color: hsl(222deg 79.84% 29.33%)
}

.card-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--primary);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 500px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header i {
  color: var(--primary);
  background: #e0e7ff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.9rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
}

.card-body {
  padding: 1.5rem;
}

.edit-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
}

.wizard-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* ============================================
   DOMAIN & ENTRY CARDS
   ============================================ */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.domain-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.domain-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.domain-card:hover .icon-circle {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.3);
}
body.dark-mode body,
body.dark-mode .domain-card,
body.dark-mode .entry-card,
body.dark-mode .skill-item,
body.dark-mode .center-card,
body.dark-mode .chat-layout,
body.dark-mode .chat-sidebar,
body.dark-mode .cm-messages,
body.dark-mode .cm-header,
body.dark-mode .cs-header,
body.dark-mode .channel-item,
body.dark-mode .ch-name,
body.dark-mode .sidebar,
body.dark-mode .brand,
body.dark-mode .dashboard-card,
body.dark-mode .btn-back-dash,
body.dark-mode .cm-footer,
body.dark-mode #msgInput,
body.dark-mode .chbtn-icon,
body.dark-mode .input-container,
body.dark-mode .btn-view {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .btn-delete,
body.dark-mode .btn-back {
  background: var(--card-bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
body.dark-mode .item-icon {
  background: var(--primary-light) !important;
  color: var(--primary);
}
body.dark-mode i,
body.dark-mode .nav-item,
body.dark-mode .theme-trigger,
body.dark-mode .chat-sidebar__title,
body.dark-mode .cm-title,
body.dark-mode .card-value,
body.dark-mode .card-label,
body.dark-mode .nav-item.active:hover i {
  color: var(--text);
}
body.dark-mode .theme-trigger:hover,
body.dark-mode .theme-trigger:hover i,
body.dark-mode .nav-item:hover i {
  color: #000;
}
.icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.entry-card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 20px;
  text-align: left;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.entry-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.entry-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--border);
  transition: background 0.3s;
}

.entry-card:hover::before {
  background: var(--primary);
}

.entry-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg);
  color: var(--primary);
}

/* ============================================
   SKILL LIST & FILES
   ============================================ */
.skill-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 40px;
}

.skill-wrapper {
  position: relative;
  margin-bottom: 0;
}

.skill-wrapper:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 44px; /* Aligns with center of the icon (24px padding + 20px half-icon) */
  top: 60px; /* Starts below the icon */
  bottom: -10px; /* Extends to the next item */
  width: 2px;
  background-color: var(--line-color, #cbd5e1);
  z-index: 0;
}

.skill-item,
.file-item {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  position: relative;
  z-index: 2;
  margin-bottom: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-item:hover,
.file-item:hover {
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--primary);
}

.pending-item {
  background-color: #fffbeb !important;
  border-left-color: var(--warning) !important;
}

.approved-item {
  border-left-color: var(--success) !important;
}

.item-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-right: 1.5rem;
  flex-shrink: 0;
}
/* ============================================
   CALENDAR WIDGET
   ============================================ */
/* --- TOAST NOTIFICATIONS (Fixed Position) --- */
/* === DARK MODE CALENDAR OVERRIDES === */
body.dark-mode #adminCalendar {
  /* 1. Base Text & Background */
  --fc-page-bg-color: #1e293b; /* Dark Blue-Grey Background */
  --fc-neutral-bg-color: #334155; /* Slightly lighter for headers */
  --fc-list-event-hover-bg-color: #334155;

  /* 2. Borders & Lines */
  --fc-border-color: #334155; /* Dark border */
  --fc-today-bg-color: rgba(99, 102, 241, 0.15); /* Indigo tint for 'Today' */
}

/* Specific Element Fixes for Dark Mode */
body.dark-mode .fc-col-header-cell-cushion,
body.dark-mode .fc-daygrid-day-number {
  color: #e2e8f0 !important; /* Light text for dates/headers */
  text-decoration: none;
}

body.dark-mode .fc .fc-toolbar-title {
  color: #f8fafc !important; /* White title */
}

body.dark-mode .fc-theme-standard td,
body.dark-mode .fc-theme-standard th {
  border-color: #334155 !important; /* Force dark borders */
}

/* Event Pills in Dark Mode */
body.dark-mode .fc-notion-block {
  background-color: #334155 !important; /* Dark pill background */
  border: 1px solid #475569 !important;
  color: #e2e8f0 !important; /* Light text inside events */
}

/* Fix the "Global/Center" Legend text below title */
body.dark-mode .calendar-section .card {
  background: #1e293b !important; /* Dark card background */
  border: 1px solid #334155;
}
body.dark-mode .calendar-section h3 {
  color: #f8fafc !important;
}
body.dark-mode .calendar-section div {
  color: #94a3b8 !important; /* Subtitle text */
}

/* Buttons (Month/List/Prev/Next) */
body.dark-mode .fc-button-primary {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}
body.dark-mode .fc-button-primary:hover {
  background-color: #475569 !important;
}
body.dark-mode .fc-button-active {
  background-color: #6366f1 !important; /* Indigo for active view */
  border-color: #6366f1 !important;
}

#toast-container {
  position: fixed; /* Floats on top of everything */
  top: 20px; /* 20px from the top edge */
  right: 20px; /* 20px from the right edge */
  z-index: 10000; /* Ensures it sits above modals and calendars */
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid #3b82f6;
  animation: slideIn 0.3s ease-out;
  min-width: 250px;
}
.toast.success {
  border-left-color: #10b981;
}
.toast.error {
  border-left-color: #ef4444;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

 .toast-msg {
    background: #fff; border-left: 4px solid #10b981; color: #1e293b;
    padding: 12px 16px; border-radius: 6px; 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 500;
    display: flex; align-items: center; gap: 10px; min-width: 250px;
    opacity: 0; transform: translateX(100%); transition: all 0.3s ease-out;
    pointer-events: auto;
}
.toast-msg.error { border-left-color: #ef4444; }
.toast-msg.show { opacity: 1; transform: translateX(0); }

/* Notion-style Event Blocks */
.fc-notion-block {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  width: 100%;
  overflow: hidden;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #37352f !important; /* Notion Black */
  border-radius: 4px;
  line-height: 1.2;
}

.fc-notion-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.fc-event {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
#adminCalendar {
  max-height: 500px; /* Forces the calendar to be shorter */
  font-size: 0.85rem; /* Makes text more compact */
}

/* 2. Shrink the height of each day cell */
/* This overrides the default ~100px height that FullCalendar calculates */
.fc .fc-daygrid-day-frame {
  min-height: 60px !important;
  height: auto !important;
}

/* 3. Make the events look like small "pills" */
.fc-notion-block {
  padding: 1px 4px !important;
  font-size: 0.75rem !important;
  margin: 1px 0 !important;
  line-height: 1.2;
}

/* 4. Responsive Header (Prevent buttons from overlapping title) */
.fc .fc-toolbar {
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 0.5rem !important;
}

.fc .fc-toolbar-title {
  font-size: 1.1rem !important; /* Smaller Title */
}

.fc .fc-button {
  padding: 0.2rem 0.5rem !important; /* Smaller Buttons */
  font-size: 0.8rem !important;
}

/* Hide default dots in List View for cleaner look */
.fc-list-event-dot {
  display: none;
}

/* --- CALENDAR LAYOUT --- */
.calendar-section {
  margin-top: 40px; /* Adds space between Center Cards and Calendar */
}

/* FullCalendar Customization */
.fc-theme-standard td,
.fc-theme-standard th {
  border-color: #e9e9e7;
}
.fc-toolbar-title {
  font-size: 1.1rem !important;
  font-weight: 600;
  color: #37352f;
}
.fc-event {
  border: none !important;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 500;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fc-header-toolbar {
    flex-direction: column;
    gap: 10px;
  }
}

/* --- CALENDAR & MODAL STYLES --- */
.fc-theme-standard td,
.fc-theme-standard th {
  border-color: #e9e9e7;
}
.fc-toolbar-title {
  font-size: 1.1rem !important;
  font-weight: 600;
  color: #37352f;
}
.fc-event {
  border: none !important;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 500;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

/* Modal Overlay */
/* ============================================
   USER MODAL - BEM Structure
   ============================================ */
 
/* ============================================
   USER MODAL - BEM Structure
   ============================================ */

/* Block: user-modal (Overlay) */
.user-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    overflow-y: auto;
    padding: 1rem;
}

.user-modal--active {
    display: flex;
}

/* Element: Container */
.user-modal__container {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}

/* Element: Title */
.user-modal__title {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Element: Form */
.user-modal__form {
    /* Form inherits default styles */
}

/* Element: Field (Form Group) */
.user-modal__field {
    margin-bottom: 1.25rem;
}

/* Element: Label */
.user-modal__label {
    display: block;
    margin-bottom: 0.5rem;
    color: #334155;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Element: Hint (small text in labels) */
.user-modal__hint {
    color: #64748b;
    font-weight: 400;
    font-size: 0.85rem;
}

/* Element: Input */
.user-modal__input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.user-modal__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Modifier: Flex input (for input groups) */
.user-modal__input--flex {
    flex: 1;
}

/* Element: Select */
.user-modal__select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: white;
}

.user-modal__select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Element: Input Group */
.user-modal__input-group {
    display: flex;
    gap: 10px;
}

/* Element: Generate Button */
.user-modal__btn-generate {
    padding: 0 15px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--primary);
    font-size: 1rem;
}

.user-modal__btn-generate:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.user-modal__btn-generate:active {
    transform: scale(0.98);
}

/* Element: Fieldset (OTP section) */
.user-modal__fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    background: #f8fafc;
}

/* Element: Legend */
.user-modal__legend {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    padding: 0 0.5rem;
}

.user-modal__fieldset .user-modal__field {
    margin-bottom: 0.75rem;
}

.user-modal__fieldset .user-modal__field:last-child {
    margin-bottom: 0;
}

/* Element: Password Hint */
.user-modal__password-hint {
    color: #64748b;
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

/* Element: Actions (Button Container) */
.user-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Element: Button */
.user-modal__btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    border: none;
}

/* Modifier: Cancel Button */
.user-modal__btn--cancel {
    background: white;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

.user-modal__btn--cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Modifier: Primary Button */
.user-modal__btn--primary {
    background: var(--primary);
    color: white;
}

.user-modal__btn--primary:hover {
    background: var(--primary);
}

.user-modal__btn--primary:active {
    transform: scale(0.98);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .user-modal__container {
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .user-modal__title {
        font-size: 1.35rem;
    }
    
    .user-modal__input,
    .user-modal__select {
        font-size: 0.95rem;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .user-modal {
        padding: 0.5rem;
    }
    
    .user-modal__container {
        width: 100%;
        padding: 1.25rem;
        border-radius: 12px;
        max-height: 90vh;
    }
    
    .user-modal__title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .user-modal__field {
        margin-bottom: 1rem;
    }
    
    .user-modal__input,
    .user-modal__select {
        padding: 0.65rem;
        font-size: 0.95rem;
    }
    
    .user-modal__actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .user-modal__btn {
        width: 100%;
        padding: 0.85rem;
    }
    
    .user-modal__fieldset {
        padding: 0.85rem;
    }
    
    .user-modal__btn-generate {
        padding: 0 12px;
        font-size: 0.9rem;
    }
}

/* Very small screens (360px and below) */
@media (max-width: 360px) {
    .user-modal__container {
        padding: 1rem;
    }
    
    .user-modal__label {
        font-size: 0.9rem;
    }
}
.custom-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}
.custom-modal {
  background: white;
  padding: 24px;
  border-radius: 12px;
  width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  font-family: "Inter", sans-serif;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 500;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.btn-ghost {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-primary {
  background: #37352f;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}
/* --- RESPONSIVE CALENDAR --- */
@media (max-width: 768px) {
  .fc-header-toolbar {
    flex-direction: column;
    gap: 10px;
  }
  .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  .fc-toolbar-title {
    font-size: 1rem !important;
  }
  /* Hide the long "Month/Week/Day" buttons on mobile, keep only simple nav */
  .fc-right {
    display: none;
  }

  /* Make events easier to tap */
  .fc-event {
    font-size: 0.75rem !important;
    padding: 4px !important;
  }

  /* Modals need to fit mobile screens */
  .custom-modal {
    width: 90% !important;
    margin: 0 auto;
  }
}
/* ============================================
   KPI CARDS
   ============================================ */
.kpi-grid {
  display: grid;
  /* Cards will wrap automatically if less than 240px space available */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.kpi-card {
  background: white;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.kpi-content {
  display: flex;
  flex-direction: column;
}
.kpi-link {
	text-decoration: none;
}
.kpi-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}
.kpi-lbl {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

/* 3. CHART GRID (Desktop Default) */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 Equal Columns */
  gap: 1.5rem;
}

.chart-card {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  min-height: 350px; /* Ensure height for the canvas */

  /* CRITICAL FIX: Allows Chart.js to shrink inside a Grid Item */
  min-width: 0;
}

.chart-header {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-body {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 250px;
}

/* ============================================
   BTN
   ============================================ */
.btn-view {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-view:hover {
  background: white;
  color: var(--primary);
  border-color: var(--primary);
}

/* ============================================
   CHARTS
   ============================================ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.chart-card {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.chart-header {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-body {
  position: relative;
  height: 250px;
  width: 100%;
}

/* ============================================
   PROFILE HERO (VIEW STUDENT)
   ============================================ */
.view-student-v1 {
  /* Scope Variables */
  --vs-primary: #4f46e5;
  --vs-bg: #f8fafc;
  --vs-card-bg: #ffffff;
  --vs-text: #0f172a;
  --vs-text-muted: #64748b;
  --vs-border: #e2e8f0;
  --vs-success-bg: #dcfce7;
  --vs-success-text: #166534;
  --vs-danger-bg: #fee2e2;
  --vs-danger-text: #991b1b;

  font-family: "Inter", sans-serif;
  padding: 2rem;
  flex: 1;
  background-color: var(--vs-bg);
  box-sizing: border-box;
}
.view-student-v1 {
  max-width: 1200px;
  margin: 0 auto;
}

/* ELEMENT: Header (Top Bar) */
.view-student-v1__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-student-v1__header-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ELEMENT: Buttons */
.view-student-v1__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s;
}

/* MODIFIERS: Buttons */
.view-student-v1__btn--back {
  background: white;
  color: var(--vs-text-muted);
  border-color: var(--vs-border);
}
.view-student-v1__btn--back:hover {
  color: var(--vs-primary);
  border-color: var(--vs-primary);
}

.view-student-v1__btn--print {
  background: white;
  color: var(--vs-text);
  border-color: var(--vs-border);
}
.view-student-v1__btn--print:hover {
  background: #f1f5f9;
}

.view-student-v1__btn--edit {
  background: var(--vs-primary);
  color: white;
}
.view-student-v1__btn--edit:hover {
  background: #4338ca;
}

.view-student-v1__menu-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--vs-text-muted);
  cursor: pointer;
  margin-right: 0.5rem;
}
@media (min-width: 768px) {
  .view-student-v1__menu-toggle {
    display: none;
  }
}

/* ELEMENT: Hero Section */
.view-student-v1__hero {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
@media (max-width: 600px) {
  .view-student-v1__hero {
    flex-direction: column;
    text-align: center;
  }
}

.view-student-v1__avatar-wrapper {
  flex-shrink: 0;
  width: 8.75rem;
  height: 8.75rem;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #e0e7ff;
}

.view-student-v1__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.view-student-v1__avatar-placeholder {
  width: 100%;
  height: 100%;
  background: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--vs-primary);
}

.view-student-v1__hero-info h1 {
  margin: 0 0 0.75rem 0;
  font-size: 1.75rem;
  color: var(--vs-text);
}

.view-student-v1__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
@media (max-width: 600px) {
  .view-student-v1__badges {
    justify-content: center;
  }
}

/* ELEMENT: Badges */
.view-student-v1__badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.view-student-v1__badge--id {
  background: #f1f5f9;
  color: var(--vs-text-muted);
}
.view-student-v1__badge--info {
  background: #e0e7ff;
  color: var(--vs-primary);
}

.view-student-v1__hero-meta {
  color: var(--vs-text-muted);
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 600px) {
  .view-student-v1__hero-meta {
    justify-content: center;
  }
}

/* ELEMENT: Grid Layout */
.view-student-v1__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* ELEMENT: Card */
.view-student-v1__card {
  background: var(--vs-card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  /*height: fit-content;*/
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.view-student-v1__card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--vs-border);
  padding-bottom: 1rem;
}

.view-student-v1__card-header6,.view-student-v1__card-header7 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--vs-border);
    padding-bottom: 1rem;
}
@media (max-width: 768px) {
    
    .view-student-v1__card-header6,.view-student-v1__card-header7 {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        border-bottom: 1px solid var(--vs-border);
        flex-direction: column;
        padding-bottom: 1rem;
    }
}

.view-student-v1__card-header i {
  font-size: 1.25rem;
  color: var(--vs-primary);
}

.view-student-v1__card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--vs-text);
}

/* ELEMENT: Info Row */
.view-student-v1__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.view-student-v1__row:last-child {
  margin-bottom: 0;
}

.view-student-v1__label {
  color: var(--vs-text-muted);
  flex: 1;
  font-weight: 500;
}

.view-student-v1__value {
  color: var(--vs-text);
  font-weight: 600;
  text-align: right;
  flex: 1.5;
  word-break: break-word;
}

/* ELEMENT: Flag Tags (Sensory) */
.view-student-v1__flag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.view-student-v1__flag {
  background: var(--vs-danger-bg);
  color: var(--vs-danger-text);
  padding: 0.1rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.view-student-v1__flag--safe {
  background: var(--vs-success-bg);
  color: var(--vs-success-text);
}

/* ELEMENT: Medical Alert Box */
.view-student-v1__alert {
  background: #fff1f2;
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 1rem;
  border-left: 3px solid #f43f5e;
}
.view-student-v1__alert-title {
  display: block;
  font-size: 0.75rem;
  color: #881337;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.view-student-v1__alert-text {
  color: #9f1239;
  font-size: 0.9rem;
}
/* SECTION DIVIDER (Spans full grid width) */
.section-divider {
  grid-column: 1 / -1; /* Forces it to take the full row */
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  margin-bottom: 5px;
  color: #334155;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* The line effect */
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
/* Icon color */
.section-divider i {
  color: #4f46e5;
  font-size: 1rem;
}
.view-student-v1__card--wide {
  grid-column: 1 / -1;
}

/* NEW: Grid Layout for Dolch Cards */
.dolch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Force 3 columns */
  gap: 1.5rem;
  align-items: start;
}

.dolch-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%; /* Equal height cards */
}

.dolch-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

/* Card Header: Stage Name & Date */
.dc-header {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
}
.dc-stage {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}
.dc-date {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Card Body: Stats */
.dc-body {
  flex-grow: 1; /* Pushes footer down */
}
.dc-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #475569;
}

/* Progress Bar */
.dc-progress-track {
  background: #f1f5f9;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
  margin-top: 4px;
}
.dc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #818cf8);
  border-radius: 4px;
}

/* Footer: Big Numbers & Actions */
.dc-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
  margin-top: auto;
}
.dc-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}
.dc-gain-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 6px;
}

.gain-pos {
  background: #dcfce7;
  color: #166534;
}
.gain-neg {
  background: #fee2e2;
  color: #991b1b;
}
.gain-neu {
  background: #f1f5f9;
  color: #64748b;
}

/* Action Buttons (Absolute positioned top-right) */
.dc-actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 8px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.dolch-card:hover .dc-actions {
  opacity: 1;
}
.dc-btn {
    background: var(--primary);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}
#btnToggleHistory{
    background: var(--primary);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 25px;
    text-decoration: none;
}
.dc-btn i {
    color: #fff;
}
.dc-btn-edit {
  color: #64748b;
}
.dc-btn-edit:hover {
  color: #4f46e5;
}
.dc-btn-del {
  color: #cbd5e1;
}
.dc-btn-del:hover {
  color: #ef4444;
}

/* Responsiveness */
@media (max-width: 1024px) {
  .dolch-grid {
    grid-template-columns: repeat(2, 1fr);
  } /* 2 cards on tablet */
}
@media (max-width: 640px) {
  .dolch-grid {
    grid-template-columns: 1fr;
  } /* 1 card on mobile */
}

/* The Grid Container */
.dolch-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

/* The Stat Boxes (Initial vs Current) */
.ds-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ds-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  background: #fff;
  border-color: #cbd5e1;
}

/* Typography inside boxes */
.ds-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.ds-val {
  font-size: 1.5rem; /* Larger, bolder number */
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.ds-meta {
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-weight: 500;
}

/* Progress Bar Styles */
.ds-prog-track {
  height: 10px; /* Thicker bar */
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid #e2e8f0;
}

.ds-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #6366f1); /* Gradient pop */
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icons within meta text */
.ds-meta i {
  color: #cbd5e1;
}


/* Block: Master Report Container */
.master-report {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: auto;
    margin-top: 20px;
    position: relative;
}

/* Block: Scrollable Table Wrapper */
.report-scroll-area {
    overflow: auto; /* Enables both X and Y scrolling */
    flex: 1;
    width: 100%;
    position: relative;
}

/* Block: Data Grid Table */
.data-grid {
    width: 100%;
    border-collapse: separate; /* Required for sticky */
    border-spacing: 0;
}

/* --- STICKY HEADERS (Vertical Scroll) --- */
.data-grid__head {
    position: sticky;
    top: 0;
    z-index: 20; /* Higher than columns */
    background-color: #f8fafc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.data-grid__th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    border-bottom: 1px solid #cbd5e1;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
    background-color: #f8fafc; /* Opaque background for overlap */
}

/* Header Groups Colors */
.data-grid__th--group-en {
    background-color: #eef2ff !important;
    color: #4338ca;
    text-align: center;
    border-bottom: 1px solid #c7d2fe;
}

.data-grid__th--group-ta {
    background-color: #f0fdf4 !important;
    color: #15803d;
    text-align: center;
    border-bottom: 1px solid #bbf7d0;
}

/* --- STICKY COLUMNS (Horizontal Scroll) --- */
.data-grid__col-sticky {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: #fff;
    border-right: 2px solid #e2e8f0; /* Separation line */
}

/* Fix: When header is also a sticky column (Top-Left Corner) */
.data-grid__head .data-grid__col-sticky {
    z-index: 30; /* Highest priority */
    background-color: #f8fafc; 
}

/* --- ROWS & CELLS --- */
.data-grid__row:hover .data-grid__td {
    background-color: #f1f5f9;
}
/* Ensure sticky columns also change color on hover */
.data-grid__row:hover .data-grid__col-sticky {
    background-color: #f1f5f9;
}

.data-grid__td {
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    vertical-align: middle;
    white-space: nowrap;
    background-color: #fff;
}

/* Cell Status Colors */
.data-grid__td--numeric { font-family: 'JetBrains Mono', monospace; font-weight: 500; }
.data-grid__td--good { color: #16a34a; font-weight: 600; background: #f0fdf4; }
.data-grid__td--warn { color: #d97706; background: #fffbeb; }
.data-grid__td--bad { color: #dc2626; background: #fef2f2; }
.data-grid__td--empty { color: #cbd5e1; font-style: italic; text-align: center;}

/* --- FILTER BAR --- */
.report-controls {
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    z-index: 25;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #334155;
}

.report-input:focus {
    border-color: #4f46e5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.btn-filter {
    background: #0f172a;
    color: white;
    border: none;
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-reset {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

/* --- FOOTER PAGINATION --- */
.report-footer {
    padding: 12px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/*TAMIL ASSESSMENTS */
.ta-container {
  max-width: 1200px;
  margin: 2rem auto;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  padding: 2.5rem;
  font-family: "Inter", sans-serif;
}
#tamilHistoryWrapper {
    display: block; /* Override any inline display:none */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
	opacity 0.4s ease, 
	transform 0.4s ease;
}
#tamilHistoryWrapper.expanded {
	max-height: 2000px;
	opacity: 1;
	transform: translateY(0);
	margin-top: 15px;
}


.ta-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.ta-table__head {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ta-table__th {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.ta-table__body {
    font-size: 0.9rem;
}

.ta-table__row {
    transition: background-color 0.2s ease;
}
.ta-table__row:hover {
    background-color: #f8fafc; /* Hover effect */
}

.ta-table__cell {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.ta-table__cell:last-child {
    border-bottom: 0; /* Remove border for visual cleanliness if needed */
}

.ta-table__input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ta-table__input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}
.ta-table__input--select {
    background-color: #fff;
    cursor: pointer;
}

.ta-table__btn-remove {
    border: none;
    background: #fee2e2;
    color: #ef4444;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ta-table__btn-remove:hover {
    background: #fecaca;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .ta-table__th, .ta-table__cell { padding: 8px 4px; font-size: 0.8rem; }
    .ta-table__input { padding: 4px; }
}

/* --- ENHANCED ADD BUTTON (Notion Style) --- */
.ta-table__add-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    margin-top: 12px;    
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;    
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon styling */
.ta-table__add-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #e2e8f0;
    border-radius: 50%;
    font-size: 0.75rem;
    color: #475569;
    transition: background-color 0.2s ease;
}

/* Hover Effects */
.ta-table__add-btn:hover {
    background-color: #eff6ff;     /* Light Indigo Background */
    border-color: #6366f1;         /* Indigo Border */
    color: #4f46e5;                /* Indigo Text */
    transform: translateY(-1px);   /* Subtle Lift */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ta-table__add-btn:hover .ta-table__add-icon {
    background-color: #6366f1;
    color: white;
}

/* Active/Click Effect */
.ta-table__add-btn:active {
    transform: translateY(0);
    background-color: #e0e7ff;
}

/* Disabled State (e.g. when max rows reached) */
.ta-table__add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #e2e8f0;
    background-color: #f1f5f9;
    color: #94a3b8;
    transform: none;
    box-shadow: none;
}
.ta-table__add-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #e2e8f0;
    border-radius: 50%;
    font-size: 0.75rem;
    color: #475569;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* --- THE NEW COUNTER BADGE --- */
.ta-table__count-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    background-color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

/* Hover Effects */
.ta-table__add-btn:hover {
    background-color: #eff6ff;     
    border-color: #6366f1;         
    color: #4f46e5;                
    transform: translateY(-1px);   
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ta-table__add-btn:hover .ta-table__add-icon {
    background-color: #6366f1;
    color: white;
}

/* Make the badge 'pop' slightly on hover too */
.ta-table__add-btn:hover .ta-table__count-badge {
    background-color: #c7d2fe;
    color: #4338ca;
}

/* Element: Header */
.ta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.ta-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.ta-header__link {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  padding: 6px 12px;
  border-radius: 15px;
}
.ta-header__link:hover {
  color: #fff;
}

/* Block: Meta Data Box */
.ta-meta {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.ta-meta__item label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
}
.ta-meta__value {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

/* Block: Form Section */
.ta-section {
  margin-bottom: 2.5rem;
  animation: fadeIn 0.4s ease-out;
}
.ta-section__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 1.25rem;
  padding-left: 12px;
  border-left: 4px solid #4f46e5;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Block: Grid Layout */
.ta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* Block: Form Group */
.ta-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ta-group__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
}
.ta-group__hint {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Element: Input & Select (Scoped to prevent global conflict) */
.ta-input,
.ta-select,
.ta-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #1e293b;
  background: #fff;
  transition: all 0.2s;
  box-sizing: border-box; /* Crucial fix */
}
.ta-input:focus,
.ta-select:focus,
.ta-textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.ta-input--readonly {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

/* Element: Button */
.ta-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, box-shadow 0.2s;
  width: 100%;
  max-width:15rem;
  background: var(--primary);
  color: white;
}
.ta-btn--primary {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}
.ta-btn--primary:hover {
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
}
.ta-btn--primary:active {
  transform: translateY(0);
}

/* Block: History Table */
.ta-history {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.ta-history th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
}
.ta-history td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 0.9rem;
}
.ta-history tr:last-child td {
  border-bottom: none;
}
.ta-badge {
  background: #e0e7ff;
  color: #3730a3;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ============================================
   TAMIL TRACKER CSS
   ============================================ */
.tt-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.tt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}
.tt-title h1 {
  margin: 0;
  font-size: clamp(0.8rem, 0.1111rem + 1.8519vw, 1.2rem);
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tt-stats {
  display: flex;
  gap: 20px;
}
.tt-stat-pill {
  background: #f1f5f9;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: clamp(0.75rem, 0.4833rem + 0.5556vw, 0.9rem);
  color: #000000;
  font-weight: 600;
}

/* Grid Table */
.tt-table-wrapper {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}
.tt-table {
  width: 100%;
  border-collapse: collapse;
}
.tt-table th {
  background: #f8fafc;
  padding: 16px;
  text-align: left;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  border-bottom: 2px solid #e2e8f0;
}
.tt-table td {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.tt-table tr:hover td {
  background: #f8fafc;
}

/* Status Badges */
.badge-level {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
}
.badge-fluent {
  background: #dcfce7;
  color: #166534;
}
.badge-emerging {
  background: #fef9c3;
  color: #854d0e;
}
.badge-beginning {
  background: #fee2e2;
  color: #991b1b;
}

/* Action Button */
.tt-container .btn-assess {
  text-decoration: none;
  background: #4f46e5;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tt-container .btn-assess:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}
.tt-container .btn-history {
  text-decoration: none;
  color: #64748b;
  padding: 8px;
  border-radius: 6px;
  margin-right: 5px;
  transition: background 0.2s;
}
.tt-container .btn-history:hover {
  background: #f1f5f9;
  color: #0f172a;
}
/* Professional Pagination Footer */
.pagination-container {
  display: flex;
  justify-content: space-between; /* Pushes Info left, Buttons right */
  align-items: center;
  padding: 20px;
  margin-top: 20px; /* Added spacing from grid */
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 8px 8px; /* Rounds bottom corners if inside a card */
}
.pagination-info {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.page-btn i{
	line-height: 0;
}
.page-btn:hover:not(.disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}
.page-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: #f1f5f9; /* Visual cue for disabled */
   /* Visual cue for disabled */
  color: #8e8b8b;
}

@media (max-width: 1200px){
    .tt-table-wrapper {
        overflow-x: scroll;
    }
}

@media (max-width: 768px) {
  .tt-table th:nth-child(3),
  .tt-table td:nth-child(3),
  .tt-table th:nth-child(4),
  .tt-table td:nth-child(4) {
    display: none;
  } /* Hide extra columns on mobile */
}

/* Utility for Print */
@media print {
  .view-student-v1__header,
  .menu-btn {
    display: none !important;
  }
  .view-student-v1 {
    padding: 0;
    background: white;
  }
  .view-student-v1__hero {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  .view-student-v1__card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}

/* ============================================
   DETAILS & INFO ROWS
   ============================================ */
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.info-label {
  color: var(--text-muted);
}

.info-val {
  font-weight: 500;
  color: #334155;
  text-align: right;
  max-width: 60%;
}

/* ============================================
   FLAGS & ALERTS
   ============================================ */
.flag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.flag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.flag.safe {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
  background: white;
  width: 100%;
  max-width: 450px;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-overlay,
#successModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal.active,
.modal-overlay.active,
#successModal.active {
  display: flex;
}

.modal-content {
  background: white;
  width: 95%;
  max-width: 800px;
  border-radius: 16px;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 2.5rem;
  text-align: center;
  max-width: 450px;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

/* ============================================
   FILE VIEWER
   ============================================ */
.file-viewer-container {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  height: 75vh;
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

.viewer-header {
  padding: 15px 25px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viewer-body {
  flex: 1;
  background: #000;
  position: relative;
}

iframe,
video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary);
}
/* ============================================
   MANAGE CENTERS
   ============================================ */

/* BLOCK: .edit-student-v1 */
.edit-student-v1 {
  /* Scope Variables */
  --es-primary: #4f46e5;
  --es-danger: #dc2626;
  --es-bg: #f8fafc;
  --es-card-bg: #ffffff;
  --es-text: #0f172a;
  --es-text-muted: #64748b;
  --es-border: #e2e8f0;

  font-family: "Inter", sans-serif;
  padding: 2rem;
  flex: 1;
  background-color: var(--es-bg);
  box-sizing: border-box;
  margin: 0 auto;
}
.edit-student-v1 {
  max-width: 960px;
}

/* ELEMENT: Header */
.edit-student-v1__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.edit-student-v1__heading {
  margin: 0;
  font-size: 1.8rem;
  color: var(--es-text);
}

.edit-student-v1__back-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
    background: var(--primary);
    padding: 4px 8px;
    border-radius: 25px;
    font-size: 1rem;
}
.edit-student-v1__back-link:hover {
  color: #ffffff;
}

/* ELEMENT: Notification Messages */
.edit-student-v1__msg {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
}
.edit-student-v1__msg--success {
  background: #dcfce7;
  color: #166534;
}
.edit-student-v1__msg--error {
  background: #fee2e2;
  color: #991b1b;
}

/* ELEMENT: Card (Section) */
.edit-student-v1__card {
  background: var(--es-card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.edit-student-v1__card-title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: var(--es-text);
  border-bottom: 1px solid var(--es-border);
  padding-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.edit-student-v1__card-title i {
  color: var(--es-primary);
}

/* ELEMENT: Grid Layout */
.edit-student-v1__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* ELEMENT: Form Field */
.edit-student-v1__field {
  display: flex;
  flex-direction: column;
}

/* MODIFIER: Full width field */
.edit-student-v1__field--full {
  grid-column: 1 / -1;
}

.edit-student-v1__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--es-text-muted);
  margin-bottom: 0.5rem;
}

/* ELEMENT: Inputs & Selects */
.edit-student-v1__input,
.edit-student-v1__select,
.edit-student-v1__textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--es-border);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}

.edit-student-v1__input:focus,
.edit-student-v1__select:focus,
.edit-student-v1__textarea:focus {
  outline: none;
  border-color: var(--es-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* MODIFIER: Disabled Input */
.edit-student-v1__input--disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ELEMENT: Checkbox Group */
.edit-student-v1__checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.edit-student-v1__checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ELEMENT: Footer Actions */
.edit-student-v1__actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--es-border);
}

/* ELEMENT: Buttons */
.edit-student-v1__btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}
.edit-student-v1__btn:hover {
  opacity: 0.9;
}

/* MODIFIERS: Buttons */
.edit-student-v1__btn--primary {
  background-color: var(--es-primary);
  color: white;
}
.edit-student-v1__btn--danger {
  background-color: #fee2e2; /* Subtle style for delete */
  color: var(--es-danger);
  border: 1px solid #fee2e2;
}
.edit-student-v1__btn--danger:hover {
  background-color: #fee2e2;
}

/* ============================================
   MANAGE CENTERS
   ============================================ */

/* Header & Layout */
.mc-header {
  background: white;
  height: 72px;
  border-bottom: 1px solid var(--mc-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.mc-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.mc-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.mc-grid-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Cards & Forms */
.mc-card {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--mc-border);
  overflow: hidden;
}

.mc-card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--mc-border);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: #1e293b;
}

.mc-card-body {
  padding: 1.5rem;
}

.mc-form-group {
  margin-bottom: 1.25rem;
}

.mc-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

.mc-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
}

.mc-btn-primary {
  width: 100%;
  background: var(--mc-primary);
  color: white;
  border: none;
  padding: 0.85rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Table */
.mc-table-wrapper {
  overflow-x: auto;
}

.mc-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
}

.mc-th {
  text-align: left;
  padding: 1rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid var(--mc-border);
}

.mc-td {
  padding: 1rem;
  border-bottom: 1px solid var(--mc-border);
  font-size: 0.9rem;
  color: #334155;
  vertical-align: middle;
}

.mc-code-badge {
  font-family: "Monaco", monospace;
  background: #f1f5f9;
  color: #475569;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  border: 1px solid #e2e8f0;
}

/* Action Buttons */
.mc-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  transition: 0.2s;
}

.mc-btn-edit {
  background: #fff7ed;
  color: #c2410c;
}

.mc-btn-edit:hover {
  background: #ffedd5;
}

.mc-btn-del {
  background: #fef2f2;
  color: #b91c1c;
}

.mc-btn-del:hover {
  background: #fee2e2;
}

/* Modal */
.mc-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.mc-modal {
  background: white;
  width: 100%;
  max-width: 450px;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Alerts */
.mc-alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: opacity 0.5s ease-out;
  /* Smooth fade out */
}

.mc-alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.mc-alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

@media (max-width: 1024px) {
  .mc-grid-layout {
    grid-template-columns: 1fr;
  }

  .mc-menu-btn {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
}

@media (max-width: 640px) {
  .mc-grid-layout {
    display: flex;
    flex-direction: column;
    align-items: inherit;
  }
}

.mc-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
}

/* ============================================
   MANAGE IPS
   ============================================ */

/* Specific Styles for the Accordion Transition */
.security-panel {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 24px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.security-header {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  cursor: pointer;
  user-select: none;
}

.security-header:hover {
  background: #f8fafc;
}

.ip-badge {
  background: #ecfdf5;
  color: #059669;
  padding: 6px 12px;
  border-radius: 20px;
  font-family: monospace;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid #d1fae5;
}

.toggle-trigger {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.security-header:hover .toggle-trigger {
  color: #334155;
}

.chevron {
  transition: transform 0.3s ease;
}

.security-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

.security-body-content {
  padding: 20px 24px;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Active State classes handled by JS */
.security-panel.active .chevron {
  transform: rotate(180deg);
}

.security-panel.active .security-body {
  /* max-height is set via JS for perfect slide */
  border-top: 1px solid #e2e8f0;
}
/* ============================================
   MANAGGE / USERS
============================================ */
.input-group {
  display: flex;
  gap: 8px;
}
.btn-generate {
  padding: 0 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  color: #475569;
  transition: all 0.2s;
}
.btn-generate:hover {
  background: #e2e8f0;
  color: var(--primary);
}
/* ============================================
   CHAT / MESSAGES
   ============================================ */
.user-list-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.2s;
}
.user-list-item:hover {
  background: #f8fafc;
}
.user-list-item:hover i {
  color: var(--chat-primary) !important;
}

.chbtn-icon {
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
  border: none;
  background: none;
  margin-bottom: 0;
}
.chbtn-icon:hover {
  color: var(--chat-primary);
}

/* ============================================
   1. VARIABLES & RESET
   ============================================ */
:root {
  --chat-sidebar-w: 320px;
  --chat-header-h: 64px;
  --chat-bg: #fff;
  --chat-primary: #4f46e5; /* Indigo 600 */
  --chat-primary-light: #e0e7ff; /* Indigo 100 */
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #64748b; /* Slate 500 */
  --border-color: #e2e8f0; /* Slate 200 */
}

/* ============================================
   2. MAIN LAYOUT SHELL
   ============================================ */
.chat-layout {
  display: flex;
  height: calc(100vh - 4.5rem); /* Adjust based on your top nav height */
  background: #fff;
  overflow: hidden;
  position: relative;
}

#chat-body {
  background: var(--chat-bg);
  height: 100vh;
  overflow: hidden;
}
.chat-main {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cm-messages {
  flex-grow: 1;
  overflow-y: auto;
  background: #f1f5f9; /* Light Grey background to contrast the white bubbles */
}

/* Sub-Item Active State */
.active-sub {
  color: var(--chat-primary) !important;
  font-weight: 600;
  background: #eff6ff;
}
/* ============================================
   3. SIDEBAR (BEM STRUCTURE)
   ============================================ */
.chat-sidebar {
  width: var(--chat-sidebar-w);
  background: white;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  z-index: 20;
}

/* -- Header -- */
.chat-sidebar__header {
  height: var(--chat-header-h);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

.chat-sidebar__title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.1rem;
  margin: 0;
}

.chat-sidebar__action {
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  font-size: 1.1rem;
}
.chat-sidebar__action:hover {
  background: #f1f5f9;
  color: var(--chat-primary);
}

/* -- List Area -- */
.chat-sidebar__list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

/* -- Channel Item (Standard DM) -- */
.channel-item {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  gap: 12px;
  align-items: center;
}
.channel-item:hover {
  background: #f8fafc;
}

/* Modifier: Active State */
.channel-item--active {
  background: var(--chat-primary-light);
  border-right: 3px solid var(--chat-primary);
}
.channel-item--active .ch-name {
  color: var(--chat-primary);
}

/* -- Channel Group (Accordion for Centers) -- */
.channel-group {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #f8fafc;
}

.channel-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}
.channel-group__header:hover {
  background: #f8fafc;
}

/* The Dropdown List (Hidden by default) */
.channel-group__list {
  display: none; /* JS toggles this */
  background: #f8fafc;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

/* Sub-items (Teachers inside Center) */
.channel-subitem {
  padding: 10px 15px 10px 3.5rem; /* Deep Indentation */
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: color 0.2s;
}
.channel-subitem:hover {
  color: var(--chat-primary);
  background: white;
}

/* -- Avatars & Status -- */
.ch-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  font-size: 1rem;
}
.channel-item--active .ch-avatar {
  background: white;
  color: var(--chat-primary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  position: absolute;
  bottom: 0;
  right: 0;
  background: #cbd5e1;
}
.status-dot.online {
  background: #22c55e;
}

/* Text Truncation */
.ch-info {
  flex: 1;
  min-width: 0;
}
.ch-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-last {
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ============================================
   4. MAIN CHAT AREA (RIGHT PANE)
   ============================================ */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  position: relative;
  min-width: 0;
  width: 100%;
}

/* -- Header -- */
.cm-header {
  height: var(--chat-header-h);
  background: white;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  z-index: 10;
}
.cm-title {
  font-weight: 600;
  color: var(--text-main);
  font-size: 1rem;
}
.cm-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* -- Messages Container -- */
.cm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* -- Message Bubbles -- */
.msg-row {
  display: flex;
  max-width: 100%;
  margin-bottom: 4px;
}
.msg-row.me {
  justify-content: flex-end;
}
.msg-row.other {
  justify-content: flex-start;
}

.msg-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  max-width: 75%;
  min-width: 80px;
  word-wrap: break-word;
}
.msg-menu-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  opacity: 0; /* Hidden until hover */
  transition: opacity 0.2s;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

/* Show arrow on hover */
.msg-bubble:hover .msg-menu-btn,
.msg-menu-btn.active {
  opacity: 1;
}

/* The Actual Dropdown Box */
.msg-dropdown {
  display: none; /* HIDDEN BY DEFAULT */
  position: absolute;
  top: 25px;
  right: 10px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 100;
  min-width: 100px;
  overflow: hidden;
  border: 1px solid #f1f5f9;
}

/* Show when JS adds class 'show' */
.msg-dropdown.show {
  display: block !important;
  animation: fadeIn 0.1s ease-out;
}

.msg-dropdown-item {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #ef4444; /* Red for delete */
  cursor: pointer;
  transition: background 0.1s;
}
.msg-dropdown-item:hover {
  background: #fef2f2;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* My Messages (Green/Primary) */
.msg-row.me .msg-bubble {
  background: #d9fdd3; /* WhatsApp Green */
  color: #111b21;
  border-top-right-radius: 0;
}

/* Other Messages (White) */
.msg-row.other .msg-bubble {
  background: #ffffff;
  color: #111b21;
  border-top-left-radius: 0;
}

.msg-sender {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--chat-primary);
  margin-bottom: 4px;
  display: block;
}

.msg-meta {
  font-size: 0.65rem;
  color: rgba(0, 0, 0, 0.45);
  float: right;
  margin-left: 8px;
  margin-top: 6px;
}

/* -- Attachments -- */
.msg-img {
  max-width: 200px;
  border-radius: 8px;
  margin-top: 5px;
  cursor: pointer;
  display: block;
}
.msg-file {
  background: rgba(0, 0, 0, 0.05);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  text-decoration: none;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 500;
}
/* =========================================
   BLOCK: MC-TABS
   Namespace: Module Chat Tabs
   ========================================= */
.mc-tabs__btn {
  background: none;
  border: 1px solid;
  /*border-bottom: 2px solid transparent;*/
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
}

.mc-tabs__btn--active {
  border-color: #4f46e5;
  color: #4f46e5;
}

/* =========================================
   BLOCK: MC-SEARCH
   Namespace: Module Chat Search
   ========================================= */
.mc-search {
  background: white;
  border: 1px solid #cbd5e1;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  border-radius: 6px;
}

.mc-search__input {
  border: none;
  outline: none;
  width: 100%;
  padding: 5px;
  /* Reset inheritance conflicts */
  background: transparent;
  box-shadow: none;
}

.mc-search__icon {
  color: #94a3b8;
  margin-right: 5px;
}

/* =========================================
   BLOCK: MC-USER-LIST
   ========================================= */
.mc-user-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 0 1rem 1rem;
}

/* =========================================
   BLOCK: MC-FORM
   ========================================= */
.mc-form__input {
  width: 100%;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box; /* Prevent padding overflow */
}

/* =========================================
   BLOCK: MC-CHIP
   ========================================= */
.mc-chip {
  background: #e0e7ff;
  color: #4338ca;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mc-chip__remove {
  cursor: pointer;
  transition: color 0.2s;
}

.mc-chip__remove:hover {
  color: #312e81;
}

/* =========================================
   BLOCK: MC-BTN
   ========================================= */
.mc-btn {
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mc-btn--primary {
  background: #4f46e5;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.mc-btn--primary:hover {
  background: #4338ca;
}

.mc-btn--close {
  background: none;
  font-size: 1.5rem;
  color: #64748b;
  padding: 0;
}

/* ============================================
   5. FOOTER & INPUTS
   ============================================ */
.cm-footer {
  padding: 1rem 1.5rem;
  background: white;
  border-top: 1px solid var(--border-color);
  position: relative;
}

.input-container {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  padding: 6px 15px;
  transition: border 0.2s;
}
.input-container:focus-within {
  border-color: var(--chat-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  outline: none;
  font-size: 0.95rem;
  max-height: 100px;
  overflow-y: auto;
  resize: none;
  line-height: 1.4;
}
#msgInput {
  background-color: inherit;
  box-shadow: none;
}
.chbtn-send {
  background: var(--chat-primary);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 0;
}
.chbtn-send:hover {
  transform: scale(1.05);
  background: #4338ca;
}

/* Emoji Drawer */
.emoji-drawer {
  max-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  transition: max-height 0.3s ease-out;
  background: #f8fafc;
  white-space: nowrap;
}
.emoji-drawer.open {
  max-height: 60px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.quick-emoji {
  cursor: pointer;
  font-size: 1.4rem;
  padding: 0 8px;
  transition: transform 0.2s;
  display: inline-block;
}
.quick-emoji:hover {
  transform: scale(1.25);
}

/* ============================================
   6. UTILITIES & MODALS
   ============================================ */
.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}
.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: #e2e8f0;
}

/* New Chat Modal */
.mc-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.mc-modal {
  background: white;
  width: 90%;
  max-width: 450px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================================
   7. MOBILE RESPONSIVENESS
   ============================================ */
.btn-back-mobile {
  display: none;
}

@media (max-width: 768px) {
  /* Stack Sidebar and Main */
  .chat-sidebar {
    width: 100%;
    position: absolute;
    height: 100%;
  }
  .chat-main {
    width: 100%;
    position: absolute;
    height: 100%;
    transform: translateX(100%); /* Hidden by default */
    transition: transform 0.3s ease-in-out;
    z-index: 30;
  }

  /* Toggling Views */
  /* If body has 'view-chat', hide sidebar, show chat */
  body.view-chat .chat-sidebar {
    transform: translateX(-20%);
    opacity: 0;
  }
  body.view-chat .chat-main {
    transform: translateX(0);
  }

  /* If body has 'view-list', show sidebar, hide chat */
  body.view-list .chat-sidebar {
    transform: translateX(0);
    opacity: 1;
  }
  body.view-list .chat-main {
    transform: translateX(100%);
  }

  /* Mobile Controls */
  .btn-back-mobile {
    display: block;
    margin-right: 15px;
    font-size: 1.2rem;
  }
  .cm-footer {
    padding: 10px;
  }
  .chat-sidebar__header {
    padding: 0 1rem;
  }
}
/* ============================================
   WIZARD FORM
   ============================================ */
.wizard-header {
  background: #1e1b4b;
  padding: 2rem;
  color: white;
}

.wizard-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.wizard-header p {
  color: #94a3b8;
  margin: 0.5rem 0 0;
}

.steps-container {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  position: relative;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  position: relative;
  width: 20%;
}

.step-circle {
  width: 35px;
  height: 35px;
  background: #312e81;
  border: 2px solid #4338ca;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.step-label {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: #94a3b8;
  font-weight: 500;
}

.step-item.active .step-circle {
  background: #4f46e5;
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.step-item.active .step-label {
  color: white;
}

.step-item.completed .step-circle {
  background: #10b981;
  border-color: #10b981;
}

.progress-line-bg {
  position: absolute;
  top: 17px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #312e81;
  z-index: 1;
}

.progress-line-fill {
  position: absolute;
  top: 17px;
  left: 10%;
  height: 2px;
  background: #4f46e5;
  z-index: 1;
  width: 0%;
  transition: width 0.3s ease;
}

.step-content {
  display: none;
  animation: slideUp 0.4s ease;
}

.step-content.active {
  display: block;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  font-size: 1.1rem;
  color: #1e293b;
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title i {
  color: var(--primary);
}

h2.section-title {
  font-size: 1.25rem;
  color: #1e293b;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f1f5f9;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
}

/* ============================================
   ACTIONS & FOOTERS
   ============================================ */
.actions,
.action-bar {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #f1f5f9;
}

.action-bar {
  justify-content: flex-end;
  margin-bottom: 1.5rem;
  border-top: none;
  padding-top: 0;
}

.action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.action-footer {
  position: sticky;
  bottom: 20px;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e2e8f0;
  margin-top: 2rem;
}

/* ============================================
   NAVIGATION
   ============================================ */
#nav-container {
  display: none;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.breadcrumb {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: #64748b;
}

.breadcrumb a {
  text-decoration: none;
  color: #64748b;
}

.breadcrumb span {
  margin: 0 0.5rem;
  color: #cbd5e1;
}

.breadcrumb .current {
  color: #1e293b;
  font-weight: 600;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-main);
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgb(139 139 139 / 23%);
  z-index: 1000;
  transition: transform 0.3s ease;
}

.brand {
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgb(139 139 139 / 33%);
  height: 72px;
}

.brand span {
  color: var(--theme-color);
  transition: color 0.3s;
}

.nav-links {
  flex: 1;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  color: #1e293b;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-item.active {
  background: var(--theme-color);
  color: white;
  border: 1px solid var(--theme-glow);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3);
}

.nav-item:hover:not(.active) {
  background: #dfdfdf;
  color: #1e293b;
  transform: translateX(4px);
}

.nav-logout {
  margin: 0.5rem 1rem 1rem;
  color: var(--theme-color);
  border: 1px solid var(--theme-color);
  background: rgba(255, 255, 255, 0.1);
  justify-content: center;
}

.nav-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  transform: none;
}

.theme-wrapper {
  margin-top: auto;
  padding: 0 1rem 1rem;
}

.theme-trigger {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  color: #1e293b;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: 0.2s;
}

.theme-trigger:hover {
  color: #000;
  background: #fff;
}

.theme-palette {
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  opacity: 0;
}

.theme-palette.open {
  height: 40px;
  opacity: 1;
  margin-top: 0.5rem;
}
/* === SIDEBAR FOOTER ENHANCEMENT === */

/* The Container */
.sidebar-footer {
  margin-top: auto; /* Pushes to bottom of screen */
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background-color: #f8fafc; /* Slight contrast (very light grey) */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* The Buttons (Appearance & Logout) */
.nav-item-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Hover Effect: Turns into a clean white card */
.nav-item-footer:hover {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

/* Specific Logic for Logout (Red interaction) */
.nav-item-footer.btn-logout {
  margin-top: 4px; /* Tiny spacing separation */
}

.nav-item-footer.btn-logout:hover {
  background: #fef2f2; /* Light Red bg */
  color: #dc2626; /* Red text */
  box-shadow: none; /* Flat look for logout */
}

/* Icon Alignment */
.nav-item-footer i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  opacity: 0.8;
}

/* ============================================
   LIBRARY A-Z
   ============================================ */
/* --- Modern Alpha Filter Bar --- */
.alpha-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  padding: 1.5rem 0;
  overflow: hidden; /* Clean edges */
  border-bottom: 1px solid #e2e8f0;
}

/* Scrollable area for letters */
.alpha-scroll-area {
  display: flex;
  gap: 8px;
  overflow-x: auto; /* Horizontal Scroll on Mobile */
  scrollbar-width: none; /* Hide scrollbar Firefox */
  -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
  scroll-behavior: smooth;
}

.alpha-scroll-area::-webkit-scrollbar {
  height: 6px; /* Visible but thin */
  display: block; /* Force display on desktop */
}
.alpha-scroll-area::-webkit-scrollbar-track {
  background: #f1f5f9; /* Light gray track */
  border-radius: 4px;
}

.alpha-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1; /* Darker gray handle */
  border-radius: 4px;
}

.alpha-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #94a3b8; /* Darker on hover */
}

/* The Buttons - Keep them from squishing */
.alpha-btn {
  flex-shrink: 0;
  /* ... keep your other button styles ... */
}

/* The Letter Buttons (Pill Design) */
.alpha-btn {
  border: 1px solid #cbd5e1;
  background: white;
  color: #64748b;
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 36px;
  height: 36px;
  border-radius: 10px; /* Modern Soft Square */
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Prevent squishing on mobile */
}

/* Hover State */
.alpha-btn:hover {
  border-color: #4f46e5;
  color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1);
}

/* Active State (Selected) */
.alpha-btn.active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ============================================
   DOLCH
   ============================================ */

:root {
  --surface: #ffffff;
  --background: #f1f5f9;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;

  --primary: #4f46e5;
  --primary-light: #eef2ff;

  /* Group Colors */
  --init-bg: #f0fdf4;
  --init-border: #bbf7d0;
  --init-text: #15803d;

  --curr-bg: #fff7ed;
  --curr-border: #fed7aa;
  --curr-text: #c2410c;
}

body {
  background-color: var(--bg);
  font-family: "Inter", sans-serif;
  color: var(--text-primary);
}
.dt-container {
  max-width: 100%;
  padding: 1.5rem 2rem;
  margin: 0 auto;
}

/* HEADER */
.dt-header {
  background: var(--surface);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}
.dt-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}
.stage-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--background);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.stage-select {
  border: none;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* GRID WRAPPER */
.grid-wrapper {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative;
}

.dt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

/* HEADERS */
.dt-th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 20;
}
.th-group-init {
  background: var(--init-bg);
  color: var(--init-text);
  border-bottom: 2px solid var(--init-border);
  text-align: center;
}
.th-group-curr {
  background: var(--curr-bg);
  color: var(--curr-text);
  border-bottom: 2px solid var(--curr-border);
  text-align: center;
}

/* FIXED COLUMNS */
.sticky-col {
  position: sticky;
  z-index: 10;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.col-idx {
  left: 0;
  width: 50px;
  text-align: center;
  background: #fdfdfd;
}
.col-id {
  left: 50px;
  width: 100px;
  text-align: center;
  background: #fdfdfd;
}
.col-name {
  left: 150px;
  width: 220px;
  box-shadow: 4px 0 8px -2px rgba(0, 0, 0, 0.05);
  border-right: 1px solid var(--border-hover);
}

/* CELLS */
.dt-tr:hover td {
  background-color: #f8fafc !important;
}
.dt-td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  border-right: 1px dashed var(--border);
  height: 52px;
  vertical-align: middle;
  background: var(--surface);
}

/* INPUTS & ACTIONS */
.dt-input-wrapper {
  position: relative;
  height: 38px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}
.dt-input-wrapper:hover {
  background: #fff;
  border-color: var(--border-hover);
}
.dt-input-wrapper:focus-within {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.dt-input,
.dt-select {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0 10px;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  outline: none;
}
.dt-input:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
  color: #94a3b8;
}

/* THE LOCK BUTTON STYLES */
.action-btn {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  margin-right: 4px;
}
.action-btn.unlock {
  color: var(--primary);
  background: #eef2ff;
}
.action-btn.unlock:hover {
  background: var(--primary);
  color: white;
}

.locked-icon {
  color: #94a3b8;
  padding: 0 10px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  transform: translateY(150px);
  transition: transform 0.3s;
  z-index: 100;
}

/*My_Students php*/
.std-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.std-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.std-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}
.std-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1.2rem;
}
.std-info h4 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
  font-weight: 600;
}
.std-meta {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.std-badge {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .dt-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .dt-header > div {
    width: 100%;
  } /* Force Title block full width */

  .dt-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto; /* Select takes space, Button takes min */
    gap: 0.5rem;
  }

  .dt-controls__stage-wrapper {
    width: 100%;
    justify-content: space-between;
    box-sizing: border-box; /* Prevent padding overflow */
  }
}

/* UX BADGES */
.ux-badge-id {
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  color: #000;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.ux-badge-grade {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
}

/* INPUTS */
.dt-grid__input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0 16px;
  font-family: inherit;
  font-size: inherit;
  color: #334155;
  transition: all 0.2s;
}
.dt-grid__input:focus {
  background: white;
  box-shadow: inset 0 0 0 2px var(--dt-primary);
  outline: none;
}
.dt-grid__input:disabled {
  background: repeating-linear-gradient(
    45deg,
    #f8fafc,
    #f8fafc 10px,
    #f1f5f9 10px,
    #f1f5f9 20px
  );
  color: #94a3b8;
  cursor: not-allowed;
}

.dt-grid__select {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0 12px;
  cursor: pointer;
  -webkit-appearance: none;
  color: #334155;
}
.dt-grid__select:focus {
  box-shadow: inset 0 0 0 2px var(--dt-primary);
  outline: none;
  background: white;
}

/* ACTIONS */
.dt-btn {
  border: none;
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  margin: 0 auto;
}
.dt-btn--submit {
  color: var(--dt-primary);
  background: #eff6ff;
}
.dt-btn--submit:hover {
  background: var(--dt-primary);
  color: white;
}

.dt-status--locked {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

/* TOAST */
.dt-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1e293b;
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(150px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}

/* Responsive Tweaks */
@media (max-width: 768px) {
  .alpha-filter-wrapper {
    gap: 8px;
  }
  .alpha-btn {
    min-width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.divider span {
  padding: 0 10px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (min-width: 1025px) {
  body {
    margin-left: 260px;
  }
}

@media (max-width: 1024px) {
  body {
    margin-left: 0 !important;
  }

  .menu-btn {
    display: block;
  }

  .container,
  .main-area,
  .main-content {
    padding: 1.5rem;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-reset {
    margin-left: 0;
    text-align: center;
    justify-content: center;
    padding: 0.5rem;
  }

  .grid-layout {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr; /* Force 1 Column */
    gap: 1rem;
  }

  /* E. Reset the "Full Width" enrollment chart to behave normally in the stack */
  .chart-card[style*="grid-column"] {
    grid-column: auto !important;
  }
}

@media (max-width: 768px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group,
  .action-group {
    width: 100%;
  }

  select,
  .btn-tool {
    width: 100%;
    justify-content: center;
  }

  .grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .lib-container {
    margin-left: 0 !important;
  }
}
/*Page Load Stats*/
.perf-stats {
  text-align: center;
  font-size: 0.7rem;
  color: #cbd5e1;
  padding: 20px;
  font-family: "Courier New", monospace; /* Monospaced for metrics */
}

.perf-time {
  color: #10b981; /* Green for execution time */
  font-weight: 600;
}

.perf-mem {
  color: #3b82f6; /* Blue for memory */
  font-weight: 600;
}

/* Add color coding for performance warnings */
.perf-time.slow {
  color: #f59e0b;
} /* Orange if > 500ms */
.perf-time.very-slow {
  color: #ef4444;
} /* Red if > 1000ms */
/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .sidebar,
  .top-header,
  .toolbar,
  .actions-cell,
  .btn,
  .action-header,
  .menu-btn {
    display: none !important;
  }

  body {
    margin: 0;
    background: white;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .table-card {
    border: none;
    box-shadow: none;
  }

  table {
    width: 100%;
    font-size: 10pt;
  }

  th,
  td {
    padding: 5px;
    border: 1px solid #ddd;
  }
}

#btnToggleHistory{
    background: var(--primary);
    border: none;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}
/* Reveal the UI once this file is processed */
html {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s ease-in;
}
/* FORCE Font Awesome 6.x (Fixes 'Empty Squares') */
