:root {
  /* Dark blue color palette */
  --primary-dark: #0a1f4d;
  --primary-light: #1a3a7a;
  --primary-accent: #0a1f4d;
  --secondary-color: #ffffff;
  --text-dark: #0a1f4d;
  --text-light: #ffffff;
  --border-color: #d1d5db;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #0ea5e9;
  --background-color: #f0f4f9;
  --card-background: #ffffff;
  /* Dark blue light backgrounds instead of light blue */
  --dark-blue-light: #f8fafd;
  --dark-blue-lighter: #e8eef8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  background-color: var(--background-color);
  line-height: 1.6;
}

/* Login Page Styles */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  /* Updated gradient to use only dark blue shades */
  background: linear-gradient(135deg, #0a1f4d 0%, #1a3a7a 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-box {
  background: var(--card-background);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(10, 31, 77, 0.2);
  padding: 30px;
  /* decreased padding from 50px to 40px for more compact layout */
  /* Updated border color to dark blue */
  border-top: 5px solid var(--primary-dark);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
  /* Updated border to dark blue */
  border-bottom: 3px solid var(--primary-dark);
  padding-bottom: 20px;
}

/* Added logo styling */
.login-logo {
  font-size: 48px;
  color: var(--primary-dark);
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
}

.login-header h1 {
  color: var(--primary-dark);
  font-size: 28px;
  margin-bottom: 5px;
  font-weight: 700;
}

.login-header p {
  color: #6b7280;
  font-size: 14px;
}

/* Added styling for login instruction note with icon and blue left border */
.login-instruction {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 24px;
  background-color: var(--dark-blue-lighter);
  border-left: 4px solid var(--primary-dark);
  border-radius: 6px;
  font-size: 12px;
  color: var(--primary-dark);
}

.login-instruction i {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary-dark);
  font-size: 16px;
}

.login-instruction strong {
  font-weight: 700;
}

.login-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: #666;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

/* Added styling for form group labels with icons */
.form-group label {
  display: flex;
  align-items: center;
  color: var(--primary-dark); /* Changed from --text-primary to --primary-dark as --text-primary is not defined */
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group label i {
  margin-right: 8px;
  color: var(--primary-dark);
  width: 16px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color); /* Changed from 2px to 1px */
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease; /* Added ease */
}

.form-group input:focus {
  outline: none;
  /* Updated focus border to dark blue */
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(10, 31, 77, 0.1);
}

.form-group input::placeholder {
  color: #9ca3af;
}

/* Updated password-field styling to position toggle inside the input */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-dark);
  font-size: 16px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.password-toggle:hover {
  color: var(--primary-light);
}

.password-toggle:focus {
  outline: none;
}

/* Added styling for forgot password link and form footer */
.form-footer {
  margin-bottom: 20px;
  text-align: right;
}

.forgot-password {
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.login-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: #666;
}

/* Button Styles */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  /* Updated button to use dark blue */
  background-color: var(--primary-dark);
  color: var(--secondary-color);
  width: 100%;
  box-shadow: 0 4px 12px rgba(10, 31, 77, 0.3);
}

/* Updated btn-primary to align icon and text properly */
.btn-primary i {
  margin-right: 8px;
}

.btn-primary:hover {
  background-color: var(--primary-light);
  box-shadow: 0 6px 16px rgba(10, 31, 77, 0.4);
}

.btn-secondary {
  background-color: #6b7280;
  color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-success {
  background-color: var(--success-color);
  color: var(--secondary-color);
}

.btn-danger {
  background-color: var(--danger-color);
  color: var(--secondary-color);
}

.btn-small {
  padding: 8px 12px;
  font-size: 12px;
}

/* Added button action styles for grades and manage actions */
.btn-grades {
  background-color: #10b981;
  color: var(--secondary-color);
  padding: 8px 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.btn-grades:hover {
  background-color: #059669;
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-manage {
  background-color: #3b82f6;
  color: var(--secondary-color);
  padding: 8px 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.btn-manage:hover {
  background-color: #2563eb;
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Alert Styles */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 6px;
  border-left: 4px solid;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border-color: #10b981;
}

.alert-error,
.alert-danger {
  background-color: #fee2e2;
  color: #7f1d1d;
  border-color: #ef4444;
}

.alert-info {
  /* Updated info alert to use dark blue theme */
  background-color: var(--dark-blue-lighter);
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

/* Navigation Styles */
.navbar {
  background-color: var(--primary-dark);
  color: var(--secondary-color);
  padding: 0;
  box-shadow: 0 4px 12px rgba(10, 31, 77, 0.15);
}

/* Remove max-width from navbar-container to make navbar full-width */
.navbar-container {
  width: 100%;
  margin: 0;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.navbar-brand {
  font-size: 20px;
  font-weight: 700;
}

.navbar-menu {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

.navbar-menu a {
  color: var(--secondary-color);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
  position: relative;
}

.navbar-menu a:hover,
.navbar-menu a.active {
  /* Updated hover/active color to dark blue light */
  color: var(--primary-light);
}

.navbar-menu a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 3px;
  /* Updated underline to dark blue light */
  background-color: var(--primary-light);
  border-radius: 2px;
}

/* Added comprehensive user-profile and related navbar styling */
.navbar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.user-profile:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--secondary-color);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--secondary-color);
  letter-spacing: 0.3px;
}

.user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  text-transform: capitalize;
}

.hamburger-menu {
  background: none;
  border: none;
  color: var(--secondary-color);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  transition: color 0.3s ease;
  display: none;
}

.hamburger-menu:hover {
  color: var(--primary-light);
}

@media (max-width: 768px) {
  .hamburger-menu {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .user-info {
    display: none;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .navbar-brand {
    font-size: 16px;
  }
}

/* Sidebar Styles */
/* Updated container to allow full-width layout for sections page */
.container {
  display: flex;
  width: 100%;
  gap: 20px;
}

/* Enhanced Sidebar Styling with icons, better spacing, and visual hierarchy */
/* Improved Sidebar Styling - height depends on content, submenus display below items */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, var(--primary-dark) 0%, #091a3f 100%);
  padding: 20px 15px;
  border-radius: 0;
  /* Removed border-radius to make corners sharp */
  height: calc(100vh - 80px); /* Extended sidebar to cover entire screen height */
  position: fixed; /* changed from sticky to fixed so sidebar follows when content scrolls */
  top: 80px;
  left: 0; /* added left: 0 to position sidebar at the left edge */
  box-shadow: 0 8px 24px rgba(10, 31, 77, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto; /* Changed overflow-y from visible to auto for scrolling */
}

/* Added sidebar header styling */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 15px;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}

.sidebar-title h2 {
  font-size: 16px;
  margin: 0;
  color: #fff;
  font-weight: 700;
}

.sidebar-title p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin: 4px 0 0 0;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu > li {
  margin-bottom: 4px;
}

.sidebar-menu > li > a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-menu > li > a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-left-color: #4ade80;
  padding-left: 15px;
}

.sidebar-menu > li > a.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  border-left-color: #60a5fa;
  font-weight: 600;
  color: #fff;
}

.sidebar-menu a i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: inherit;
}

/* Add submenu styles for expandable menu items */
.sidebar-submenu {
  list-style: none;
  margin: 0;
  margin-top: 8px;
  padding: 0;
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.sidebar-submenu li {
  margin: 0;
}

.sidebar-submenu a {
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px 10px 47px;
  border-radius: 0;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 400;
  border-left: 2px solid transparent;
}

.sidebar-submenu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-left-color: #4ade80;
  padding-left: 51px;
}

.sidebar-submenu a.active {
  background-color: rgba(96, 165, 250, 0.15);
  color: #fff;
  border-left-color: #60a5fa;
  font-weight: 500;
}

.sidebar-menu > li > a .expand-icon {
  margin-left: auto;
  transition: transform 0.3s ease;
  font-size: 12px;
}

.sidebar-menu > li > a.expanded .expand-icon {
  transform: rotate(180deg);
}

/* Added menu category styling */
.menu-category {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 15px 15px 8px 15px;
  margin-top: 10px;
  margin-bottom: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-category:first-child {
  border-top: none;
  margin-top: 0;
}

.main-content {
  flex: 1;
  padding: 20px;
  max-width: 100%;
}

/* Reduced main heading font size for dashboard pages */
.main-content h1 {
  font-size: 24px;
  margin-bottom: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* Dashboard Styles */
/* Improved dashboard grid layout with better spacing and alignment */
/* Reduce dashboard card grid size for better layout */
.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

/* Reduce card padding and font sizes for more compact appearance */
.card {
  background: var(--card-background);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(10, 31, 77, 0.08);
  padding: 14px;
  transition: all 0.3s ease;
  border-left: 5px solid var(--primary-dark);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.card:hover {
  box-shadow: 0 12px 24px rgba(10, 31, 77, 0.15);
}

.card:hover .card-icon {
}

/* Added card icon styling and color-coded cards for different card types */

/* Color-coded cards for different metrics */
.card-users {
  border-left-color: #3b82f6;
}

.card-users .card-icon {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.card-teachers {
  border-left-color: #8b5cf6;
}

.card-teachers .card-icon {
  background-color: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.card-students {
  border-left-color: #10b981;
}

.card-students .card-icon {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.card-subjects {
  border-left-color: #f59e0b;
}

.card-subjects .card-icon {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.card-action {
  border-left-color: #ec4899;
}

.card-action .card-icon {
  background-color: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.card-sections {
  border-left-color: #6366f1;
}

.card-sections .card-icon {
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.card-assignments {
  border-left-color: #8b5cf6;
}

.card-assignments .card-icon {
  background-color: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.card-enrollments {
  border-left-color: #06b6d4;
}

.card-enrollments .card-icon {
  background-color: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}

.card-pending {
  border-left-color: #f59e0b;
}

.card-pending .card-icon {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.card-verified {
  border-left-color: #10b981;
}

.card-verified .card-icon {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.card-units {
  border-left-color: #3b82f6;
}

.card-units .card-icon {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.card-classes {
  border-left-color: #8b5cf6;
}

.card-classes .card-icon {
  background-color: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.card-student-id {
  border-left-color: #3b82f6;
}

.card-student-id .card-icon {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.card-year-level {
  border-left-color: #10b981;
}

.card-year-level .card-icon {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.card-enrollment-count {
  border-left-color: #f59e0b;
}

.card-enrollment-count .card-icon {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

/* Updated card title font size to 13px to match sidebar styling */
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Reduced card content font size from 28px to 24px */
.card-content {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 4px 0;
}

/* Reduced card footer font size to 12px */
.card-footer {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

/* Table Styles */
.table-container {
  background: var(--card-background);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(10, 31, 77, 0.08);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table thead {
  background-color: var(--primary-dark);
  color: var(--secondary-color);
}

/* Reduced table content font sizes */
table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
}

table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  color: #000000;
  font-weight: normal;
}

table tbody tr:hover {
  background-color: var(--dark-blue-light);
}

/* Updated zebra stripes to maintain striping pattern even on hover */
table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

table tbody tr:nth-child(odd):hover {
  background-color: #e8eef8;
}

table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

table tbody tr:nth-child(even):hover {
  background-color: #e8eef8;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background-color: #fee2e2;
  color: #7f1d1d;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-info {
  /* Updated info badge to use dark blue theme */
  background-color: var(--dark-blue-lighter);
  color: var(--primary-dark);
}

/* Added overflow: visible to wrapper to allow dropdown to overflow without clipping */
.custom-select-wrapper {
  position: relative;
  width: 100%;
  z-index: 100;
  overflow: visible; /* Allow dropdown to overflow the wrapper */
}

.search-input {
  width: 100%;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  font-size: 12px;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(10, 31, 77, 0.1);
}

/* Changed dropdown from fixed to absolute positioning so it follows the input field during scroll */
/* Updated dropdown width to match input field size */
/* Increased max-height from 300px to 500px for better visibility of many options */
/* Updated dropdown positioning to overlap elements below and prevent layout shift */
.custom-select-dropdown {
  position: absolute;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  max-height: 500px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 100%;
  top: calc(100% + 2px);
  left: 0;
  right: auto;
  /* Added isolation and pointer-events to prevent interaction with elements behind the dropdown */
  isolation: isolate;
  pointer-events: auto;
}

.custom-select-dropdown.active {
  /* Increased z-index for active dropdown to ensure it appears above all other elements */
  z-index: 10001;
}

.custom-select-wrapper {
  /* Added position relative and changed overflow to allow dropdown to overlap elements */
  position: relative;
  overflow: visible;
}

/* Increased option padding and ensured consistent sizing for better visibility */
.select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
  min-height: 45px;
}

.select-option:hover {
  background-color: var(--dark-blue-light);
}

.select-option i {
  color: var(--primary-dark);
  font-size: 14px;
}

.option-content {
  flex: 1;
}

.option-name {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 12px;
}

.option-subtitle {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

/* Two-column layout for sections page */
.sections-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
