html, body { width: 100%; height: 100%; margin: 0; padding: 0; }
html { background-color: var(--bg-dark); }
:root {
  --bg-dark: #0f111a;
  --bg-card: #1e2130;
  --bg-sidebar: #141722;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --border: #334155;
  --success: #10b981;
  --warning: #f59e0b;
}

body.light-theme {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
}
body.light-theme .details-row {
  background-color: rgba(0,0,0,0.03);
}
body.light-theme .nav-links li:hover,
body.light-theme .user-profile:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

/* Light theme badge text overrides for readability */
body.light-theme .status-active { color: #059669 !important; }
body.light-theme .status-dismissed { color: #dc2626 !important; }
body.light-theme .status-noshow { color: #4b5563 !important; }
body.light-theme .status-new { color: #d97706 !important; }
body.light-theme .status-transferred { color: #2563eb !important; }

body.light-theme .category-average { color: #0284c7 !important; }
body.light-theme .category-weak { color: #7e22ce !important; }
body.light-theme .category-new { color: #b45309 !important; }


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100%;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100%;

  width: 100%;}

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}
.sidebar.collapsed {
  width: 64px;
}
.sidebar.collapsed .nav-text { display: none !important; }
.sidebar.collapsed .logo { padding: 0 0 32px 0; justify-content: center; }
.sidebar.collapsed .nav-links li { padding: 12px 0; justify-content: center; }
.sidebar.collapsed .user-profile {
  padding: 16px 0;
  justify-content: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px 32px;
}
.logo-icon {
  font-size: 24px;
}
.logo h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  list-style: none;
  flex: 1;
}
.nav-links li {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.nav-links li:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--text-main);
}
.nav-links li.active {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  border-right: 3px solid var(--accent);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
}
.avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
}
.user-info .name {
  font-size: 14px;
  font-weight: 600;
}
.user-info .role {
  font-size: 12px;
  color: var(--text-muted);
}

/* Accordion Expand Logic */
.expand-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: transform 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.expand-btn:hover {
  background-color: rgba(111, 76, 255, 0.1);
}
.expand-btn.open {
  transform: rotate(180deg);
}
.details-row {
  display: none;
  background-color: rgba(0, 0, 0, 0.15);
}
.details-row.open {
  display: table-row;
}
.details-content {
  padding: 24px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.details-item {
  display: flex;
  flex-direction: column;
}
.details-item span:first-child {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.details-item span:last-child {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
}

.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-main);
}
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.top-bar h1 {
  font-size: 24px;
  font-weight: 600;
}
.actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-primary {
  background-color: var(--accent);
  color: white;
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background-color: var(--border);
}
.btn-danger {
  background-color: var(--danger);
  color: white;
}
.btn-danger:hover {
  background-color: var(--danger-hover);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Table */
.table-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
thead th {
  position: sticky;
  top: 0;
  background-color: var(--bg-card);
  z-index: 10;
}
tr {
  transition: background-color 0.2s;
}
tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}
}
tr:hover td {
  background-color: rgba(255,255,255,0.03);
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
  cursor: pointer;
}
.status-active {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
}
.status-dismissed {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
}
.status-noshow {
  background-color: rgba(156, 163, 175, 0.15) !important;
  color: #9ca3af !important;
}
.status-new {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
}
.status-transferred {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #3b82f6 !important;
}

/* Category Badges for Grades */
.category-top {
  background-color: #222 !important;
  color: #fff !important;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}
.category-average {
  background-color: rgba(56, 189, 248, 0.2) !important;
  color: #7dd3fc !important;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}
.category-weak {
  background-color: rgba(168, 85, 247, 0.2) !important;
  color: #d8b4fe !important;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}
.category-new {
  background-color: rgba(250, 204, 21, 0.2) !important;
  color: #fef08a !important;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}

.status-select {
  background: var(--bg-dark);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-card);
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px rgba(0,0,0,0.4);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-icon {
  font-size: 20px;
}
.modal-header h3 {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  color: var(--danger);
}
.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}
.close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 16px 24px;
  max-height: 65vh;
  overflow-y: auto;
}

.employee-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}
.emp-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.emp-info:last-child {
  margin-bottom: 0;
}
.emp-label {
  color: var(--text-muted);
  font-size: 14px;
}
.emp-value {
  font-weight: 600;
  font-size: 15px;
}
.ref-badge {
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}

.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
}
.required {
  color: var(--danger);
}
.form-control {
  width: 100%;
  background-color: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(111, 76, 255, 0.2);
}
.form-control.error {
  border-color: var(--danger);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid .form-group {
  margin-bottom: 0;
}
.form-group.full-width {
  grid-column: 1 / -1;
}

.help-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.highlight-yellow {
  color: #fbbf24;
  font-weight: 600;
}
.error-text {
  color: #f87171;
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: rgba(0,0,0,0.2);
  border-radius: 0 0 16px 16px;
}

/* Login Screen */
.login-container {
  display: flex;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #1a1a2e, var(--bg-dark));
}

.login-card {
  background-color: var(--bg-card);
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

.login-card .logo.justify-center {
  padding: 0;
  margin-bottom: 8px;
  justify-content: center;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.login-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-top: 10px;
}

.login-hint {
  margin-top: 24px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.nav-text {
  white-space: nowrap;
  transition: opacity 0.2s;
}
.sidebar.collapsed .nav-text { display: none !important; }




.logout-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar.collapsed .logout-btn {
  border-color: transparent;
}
.logout-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}



.login-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}



.user-profile-container {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border);
}
.sidebar.collapsed .user-profile-container {
  padding: 16px 0;
  align-items: center;
}
.user-profile-clickable {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
  transition: background 0.2s;
}
.user-profile-clickable:hover {
  background: rgba(99, 102, 241, 0.1);
}
.sidebar.collapsed .user-profile-clickable {
  justify-content: center;
}

.sidebar.collapsed .logo h2 { display: none !important; }

.sidebar.collapsed .user-info { display: none !important; }

.sidebar.collapsed .logout-text { display: none !important; }

.sidebar.collapsed .logout-btn { padding: 10px; width: 36px; height: 36px; margin: 0 auto; }

/* Copy Button Styles */
.copy-btn {
  background-color: var(--text-main);
  border: none;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.2s, transform 0.1s, background-color 0.2s;
  width: 14px;
  height: 14px;
  padding: 0;
  -webkit-mask-image: url('icons/copy_icon.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url('icons/copy_icon.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}
td:hover .copy-btn {
  opacity: 0.6;
}
.copy-btn:hover {
  opacity: 1;
  background-color: var(--text-main);
  transform: scale(1.15);
}


/* Cabs CSS */
.cabs-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: stretch;
}
.cabs-column {
  width: 100%;
  max-width: none;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overflow-x: auto;
}
.cabs-column h2 {
  font-size: 18px;
  color: var(--text-main);
  margin-top: 10px;
  margin-bottom: 10px;
  margin-left: 12px;
  text-align: left;
}
.cabs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 500px;
}
.cabs-table th {
  background: rgba(0,0,0,0.3);
  color: var(--text-muted);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--border);
}
.cabs-table td {
  padding: 6px 12px;
  border: 1px solid var(--border);
  color: var(--text-main);
}





.cab-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  padding: 4px;
  border-radius: 4px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.2s;
}
select.cab-input {
  cursor: pointer;
}
select.cab-input option {
  color: #000;
}
.cab-input:hover, .cab-input:focus {
  background: rgba(255,255,255,0.4);
  outline: none;
  border-color: rgba(0,0,0,0.2);
}
.cab-input::placeholder {
  color: inherit;
  opacity: 0.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.4);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.7);
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.4) transparent;
}

/* Balances Archive Scroll */
.balances-scroll-container::-webkit-scrollbar {
  height: 6px;
}
.balances-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}
.balances-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}
.balances-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Day off Styles */
#dayoffTable th, #dayoffTable td {
  padding: 10px;
  border: 1px solid var(--border);
  text-align: center;
}
#dayoffTable th {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}
#dayoffTable td.date-col {
  font-weight: bold;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}
#dayoffTable td.weekend {
  background: rgba(255, 204, 0, 0.1); /* Yellowish for weekends */
}
#dayoffTable td.cell-dayoff {
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
#dayoffTable td.cell-empty {
  cursor: pointer;
  transition: background 0.2s;
}
#dayoffTable td.cell-empty:hover {
  background: rgba(255, 255, 255, 0.05);
}
#dayoffTable td.cell-conflict {
  border: 2px solid red !important;
}

.nav-month-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-month-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--text-muted);
}

.prime-border-right {
  border-right: 2px solid rgba(128, 128, 128, 0.35) !important;
}


/* Toast Notifications */
.toast-msg {
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease-out forwards;
  transition: opacity 0.3s;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-msg.fade-out {
  opacity: 0;
}

/* Icons for Category Dropdown */
.status-select {
    padding-left: 26px !important;
    background-position: left 6px center !important;
    background-repeat: no-repeat !important;
    background-size: 14px 14px !important;
}
.category-top { background-image: url('icons/top_icon.svg'); }
.category-average { background-image: url('icons/middle_icon.svg'); }
.category-weak { background-image: url('icons/weak_icon.svg'); }
.category-new { background-image: url('icons/begginer_icon.svg'); }

.exit-icon-mask {
  display: inline-block;
  width: 14px;
  height: 14px;
  -webkit-mask-image: url('icons/logout_icon.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-image: url('icons/logout_icon.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  vertical-align: middle;
  margin-right: 6px;
  background-color: white;
}

/* Light theme override */


.sidebar.collapsed .exit-icon-mask { margin-right: 0; }


/* Status Filter Colors (Inactive State) */
#statusFilters .filter-btn:nth-child(1):not(.active) {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}
#statusFilters .filter-btn:nth-child(1):not(.active):hover {
  background: rgba(16, 185, 129, 0.2);
}

#statusFilters .filter-btn:nth-child(2):not(.active) {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
}
#statusFilters .filter-btn:nth-child(2):not(.active):hover {
  background: rgba(245, 158, 11, 0.2);
}

#statusFilters .filter-btn:nth-child(3):not(.active) {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}
#statusFilters .filter-btn:nth-child(3):not(.active):hover {
  background: rgba(239, 68, 68, 0.2);
}

#statusFilters .filter-btn:nth-child(4):not(.active) {
  background: rgba(100, 116, 139, 0.2);
  border-color: rgba(100, 116, 139, 0.4);
  color: #94a3b8;
}
#statusFilters .filter-btn:nth-child(4):not(.active):hover {
  background: rgba(100, 116, 139, 0.3);
}

#statusFilters .filter-btn:nth-child(5):not(.active) {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}
#statusFilters .filter-btn:nth-child(5):not(.active):hover {
  background: rgba(59, 130, 246, 0.2);
}

/* Custom Status Dropdown */
.custom-select-container {
  position: relative;
  display: inline-block;
  min-width: 120px;
}
.custom-select-trigger {
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  font-weight: 600;
  border: none;
  outline: none;
}
.custom-select-arrow {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 10px;
  margin-bottom: 2px;
}
.custom-select-options {
  display: block;
  visibility: hidden;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-5px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s, max-height 0s 0.2s;
  position: absolute;
  top: calc(100% + 4px);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 10;
  min-width: 120px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  padding: 0;
}

.custom-select-options.show {
  visibility: visible;
  opacity: 1;
  max-height: 500px;
  padding: 4px;
  transform: translateY(0);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s, max-height 0s, padding 0s;
}
.custom-option {
  cursor: pointer;
  padding: 6px 12px;
  margin-bottom: 2px;
  border-radius: 4px;
  font-weight: 600;
  transition: filter 0.1s;
  display: block !important;
  border: none !important;
}
.custom-option:last-child {
  margin-bottom: 0;
}
.custom-option:hover {
  filter: brightness(1.2);
}

/* Filter Dropdown System */
.filter-dropdown {
  position: relative;
  display: inline-block;
}

.filter-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.filter-dropdown-btn:hover {
  background-color: var(--border);
}





.filter-dropdown-content label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.filter-dropdown-content select {
  width: 100%;
}

.filter-icon-mask {
  display: inline-block;
  width: 16px;
  height: 16px;
  -webkit-mask-image: url('icons/filter_icon.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url('icons/filter_icon.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  background-color: currentColor;
  opacity: 0.7;
}

/* --- SMOOTH ANIMATIONS --- */

@keyframes slideDownFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}



.btn:active, .filter-btn:active, .filter-dropdown-btn:active, .close-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

#dashboardContent, #gradesContent, #profilesContent, #cabsContent, #dayoffContent, #teamStatsContent, #profileView, #infoContent, #settingsContent {
  animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rowFadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

tbody.animate-rows tr {
  animation: rowFadeIn 0.3s ease-out;
}

.form-control {
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.table-card {
  transition: box-shadow 0.3s ease;
}

.table-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.filter-dropdown-content {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 250px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 1000;
  gap: 12px;
  
  /* Smooth open/close */
  visibility: hidden;
  opacity: 0;
  max-height: 0;
  padding: 0 16px;
  overflow: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.2s, max-height 0s 0.2s, padding 0s 0.2s;
}


.filter-dropdown-content.show {
  visibility: visible;
  opacity: 1;
  max-height: 500px;
  padding: 16px;
  transform: translateY(0);
  transition: opacity 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.2s, max-height 0s, padding 0s;
}


/* Scale UI Controls */
.scale-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.scale-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-main);
}
.scale-btn:active {
  transform: scale(0.95);
}
body.light-theme .scale-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-main);
}

/* Clear Search Button Logic */
input:placeholder-shown ~ .clear-search-btn { display: none !important; }
input:not(:placeholder-shown) ~ .clear-search-btn { display: flex !important; }
.clear-search-btn:hover { opacity: 1 !important; color: var(--text-main); }

/* Sidebar Nav Icons Coloring */
.nav-icon {
  filter: invert(72%) sepia(13%) saturate(415%) hue-rotate(178deg) brightness(91%) contrast(90%);
  transition: filter 0.2s;
}

.nav-links li:hover .nav-icon {
  filter: invert(99%) sepia(2%) saturate(433%) hue-rotate(193deg) brightness(115%) contrast(85%); /* Closer to --text-main */
}

.nav-links li.active .nav-icon {
  filter: invert(41%) sepia(85%) saturate(3015%) hue-rotate(224deg) brightness(99%) contrast(92%); /* Accent color */
}

/* Light Theme Overrides */
body.light-theme .nav-icon {
  filter: invert(30%) sepia(11%) saturate(760%) hue-rotate(179deg) brightness(95%) contrast(87%); /* Darker slate */
}

body.light-theme .nav-links li:hover .nav-icon {
  filter: invert(10%) sepia(10%) saturate(800%) hue-rotate(180deg) brightness(90%) contrast(100%); /* Closer to black */
}

body.light-theme .nav-links li.active .nav-icon {
  filter: invert(41%) sepia(85%) saturate(3015%) hue-rotate(224deg) brightness(99%) contrast(92%); /* Accent color */
}

/* Sidebar toggle overrides */

.sidebar-top-toggle button:hover {
  background: rgba(128,128,128,0.1) !important;
  color: var(--text-main) !important;
}
