/* Light Theme Overhaul for IQAC Checklist Management System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #f8fafc; /* Slate 50 - Crisp, clean light background */
  --bg-secondary: #0f172a; /* Slate 900 - Premium dark sidebar contrast */
  --card-bg: #ffffff; /* Clear white card */
  --card-border: #e2e8f0; /* Slate 200 */
  --card-border-hover: rgba(139, 92, 246, 0.4);
  
  --primary: #6d28d9; /* Deep violet */
  --primary-hover: #7c3aed;
  --primary-glow: rgba(109, 40, 217, 0.08);
  
  --accent: #2563eb; /* Cobalt Blue */
  --accent-hover: #3b82f6;
  
  --success: #059669; /* Emerald Green */
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #d97706; /* Amber Warning */
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  
  --danger: #dc2626; /* Crimson Red for Late / Danger */
  --danger-bg: #fdf2f2;
  --danger-border: #fca5a5;
  
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #475569; /* Slate 600 */
  --text-inverse: #ffffff;
  
  --sidebar-width: 260px;
  --header-height: 70px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-fade-in {
  animation: fadeIn 0.35s ease forwards;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Glassmorphism/Card Panels */
.glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

/* Auth Layout (Login panel) */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at 10% 20%, rgba(109, 40, 217, 0.04) 0%, transparent 60%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.auth-logo-wrapper {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.auth-logo {
  height: 110px;
  width: auto;
  object-fit: contain;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  border-radius: 6px;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-main) 40%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 15px;
}

/* Form Controls */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.form-control {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-select {
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-main);
  outline: none;
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.form-select:focus {
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #5b21b6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(109, 40, 217, 0.25);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
}

.btn-secondary {
  background: #f1f5f9;
  border: 1px solid var(--card-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.btn-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: #b91c1c;
}

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

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-icon-only {
  padding: 10px;
  border-radius: 8px;
}

/* Credentials Helper */
.credentials-hint {
  margin-top: 24px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(109, 40, 217, 0.03);
  border: 1px solid rgba(109, 40, 217, 0.08);
  text-align: left;
}

.credentials-hint h5 {
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 6px;
  font-weight: 600;
}

.credentials-hint p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Remains dark for premium contrast) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.sidebar-menu {
  list-style: none;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #94a3b8;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
}

.menu-item a:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
}

.menu-item.active a {
  background: var(--primary);
  color: #ffffff;
}

/* Submenu styles */
.submenu-toggle {
  cursor: pointer;
}
.submenu-item a {
  display: block;
  color: #94a3b8 !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  transition: all 0.2s;
  background: transparent !important;
  border: none !important;
}
.submenu-item a:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.05) !important;
}
.submenu-item.active a {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  font-weight: 600 !important;
}


.sidebar-user {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

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

.user-name {
  font-size: 14px;
  font-weight: 600;
}

.user-role {
  font-size: 12px;
  color: #94a3b8;
}

.logout-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  transition: var(--transition);
}

.logout-btn:hover {
  color: #f87171;
}

/* Main Workspace */
.main-content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: calc(100% - var(--sidebar-width));
  width: calc(100% - var(--sidebar-width));
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subview {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Header */
.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid var(--card-border);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 9;
}

.header-title-container h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Content Frame */
.content-body {
  padding: 40px;
  flex-grow: 1;
}

/* Dashboard Statistics Widgets */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
}

.stat-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Icons */
.stat-icon-blue { background: #eff6ff; color: var(--accent); }
.stat-icon-purple { background: var(--primary-glow); color: var(--primary); }
.stat-icon-green { background: var(--success-bg); color: var(--success); }
.stat-icon-yellow { background: var(--warning-bg); color: var(--warning); }

/* Card Tables */
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Table Design */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  max-height: 450px;
  overflow-y: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 16px 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1.5px solid var(--card-border);
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 10;
}

.custom-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
  font-size: 14px;
  vertical-align: middle;
  background: #ffffff;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tr:hover td {
  background: #f8fafc;
}

/* Event text */
.event-row-title {
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.event-row-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-pending {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
}

.badge-received {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.badge-remarks {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}

.badge-delayed {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title h3 {
  font-size: 20px;
  font-weight: 600;
}

.section-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Checklist Filter System */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  margin-bottom: 24px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.filter-search {
  flex-grow: 1;
  min-width: 200px;
}

.filter-select {
  width: auto;
  min-width: 160px;
}

/* Tabs UI */
.tab-container {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-main);
  background: #f1f5f9;
}

.tab-btn.active {
  color: var(--primary);
  background: var(--primary-glow);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  overflow-y: auto;
  padding: 40px 16px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 100%;
  max-width: 500px;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--card-border);
  position: relative; /* Positioning context for absolute elements like close button */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-top: auto;
  margin-bottom: auto;
}

.modal-overlay.open .modal-container {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

/* Deadlines & Timelines */
.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.deadline-active {
  color: var(--warning);
}

.deadline-passed {
  color: var(--danger);
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: bold;
}

.empty-state h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto 24px;
}

.action-cell {
  display: flex;
  gap: 8px;
}

/* Remark Bubbles */
.remark-text-bubble {
  font-size: 12px;
  background: var(--warning-bg);
  border-left: 3px solid var(--warning);
  padding: 8px 12px;
  margin-top: 6px;
  border-radius: 0 8px 8px 0;
  color: #92400e;
  max-width: 280px;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.received-time-text {
  font-size: 11px;
  color: var(--success);
  margin-top: 4px;
  display: block;
  font-weight: 500;
}

.delayed-time-text {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  display: block;
  font-weight: 600;
}

.ontime-submission-info {
  font-size: 13px;
  color: var(--success);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.delayed-submission-info {
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Progress bar */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 16px;
  font-weight: 600;
}

.back-link:hover {
  color: var(--text-main);
}

/* Responsive (Mobile layouts) */
@media (max-width: 992px) {
  :root {
    --sidebar-width: 80px;
  }
  
  .sidebar-title, .user-info, .sidebar-brand span {
    display: none;
  }
  
  .sidebar-brand {
    padding: 0;
    justify-content: center;
  }
  
  .menu-item a {
    justify-content: center;
    padding: 12px;
  }
  
  .menu-item a span {
    display: none;
  }
  
  .sidebar-user {
    padding: 16px 0;
    justify-content: center;
  }
  
  .main-content {
    margin-left: 80px;
    max-width: calc(100% - 80px);
  }
  
  .app-header {
    padding: 0 24px;
  }
  
  .content-body {
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 64px;
    z-index: 100;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: row !important;
    align-items: center;
    top: auto;
    border-right: none;
  }
  
  .sidebar-brand {
    display: none !important;
  }
  
  .sidebar-menu {
    flex-direction: row;
    padding: 0;
    margin: 0;
    width: 100%;
    justify-content: space-around;
    height: 100%;
    align-items: center;
  }
  
  .menu-item {
    margin: 0 !important;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .menu-item a {
    flex-direction: column;
    gap: 4px;
    align-items: center;
    padding: 6px 4px;
    width: 100%;
    height: 100%;
    justify-content: center;
    border-radius: 0;
    border: none;
  }
  
  .menu-item a span {
    display: block !important;
    font-size: 10px;
    font-weight: 500;
  }
  
  .sidebar-user {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding-bottom: 80px; /* space for fixed bottom bar */
  }
  
  .app-header {
    padding: 0 16px;
    height: 60px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }
  
  .tab-container {
    overflow-x: auto;
    padding-bottom: 8px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }
  
  .tab-container::-webkit-scrollbar {
    display: none;
  }
  
  .modal-overlay {
    padding: 12px;
  }
  
  .modal-container {
    padding: 20px;
  }
}

.header-logout-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.header-logout-btn:hover {
  background: var(--bg-primary);
  color: var(--text-main);
  border-color: #cbd5e1;
}

@media (max-width: 480px) {
  .header-logout-btn span {
    display: none;
  }
  .header-logout-btn {
    padding: 8px;
  }
}

/* Public Status Dashboard Mode */
body.public-status-mode .sidebar {
  display: none !important;
}
body.public-status-mode .main-content {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
body.public-status-mode .header-logout-btn {
  display: none !important;
}

/* Split Screen Layout for Public Status */
.status-split-container {
  display: flex;
  height: calc(100vh - 120px);
  background: var(--bg-main);
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}
.status-left-panel {
  width: 380px;
  border-right: 1px solid var(--card-border);
  background: #ffffff;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.status-right-panel {
  flex: 1;
  background: #f8fafc;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.status-event-card {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: #ffffff;
  cursor: pointer;
  transition: var(--transition);
}
.status-event-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.05);
}
.status-event-card.active {
  border-color: var(--accent);
  background: #f5f3ff;
}
.status-event-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  display: block;
}
.status-event-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  display: block;
}
.status-event-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

/* Toggle Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 22px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--accent);
}
input:checked + .slider:before {
  transform: translateX(22px);
}

/* Staff Involvement Styling */
.involvement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.involvement-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.involvement-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
}
.involvement-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}
.involvement-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .status-split-container {
    flex-direction: column;
    height: auto;
  }
  .status-left-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    max-height: 300px;
  }
}

/* ================= TOAST NOTIFICATIONS ================= */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 400px;
  width: calc(100% - 48px);
}

.toast-item {
  pointer-events: auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast-item.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-message {
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.4;
  font-weight: 500;
  flex-grow: 1;
  word-break: break-word;
}

.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.toast-close:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

/* Toast Theme Colors */
.toast-success {
  border-left: 4px solid var(--success);
}
.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}
.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}
.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.toast-info {
  border-left: 4px solid var(--accent);
}
.toast-info .toast-icon {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

/* ================= EARN WHILE YOU LEARN (EWYL) STYLING ================= */
.ewyl-header-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.ewyl-month-select-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ewyl-month-select {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-main);
  color: var(--text-main);
  font-weight: 600;
  outline: none;
  cursor: pointer;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.ewyl-month-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.ewyl-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .ewyl-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* EWYL Letter pad paper container */
.letter-paper-wrapper {
  width: 100%;
  overflow-x: auto;
  padding: 24px;
  background: #f1f5f9;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  display: flex;
  justify-content: center;
}

.letter-paper {
  width: 210mm;
  min-height: 297mm;
  padding: 20mm 15mm;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  font-family: "Times New Roman", Times, serif;
  color: #000000;
  position: relative;
  text-align: left;
}

/* Header table/layout for letter pad */
.letter-header-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 5px;
  border: none !important;
}

.letter-header-table td {
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

.letter-header-logo {
  width: 100px;
  height: auto;
  display: block;
}

.letter-header-text {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  line-height: 1.3;
}

.letter-header-text h2 {
  font-size: 14px;
  margin: 0;
  font-weight: normal;
  letter-spacing: 0.5px;
  color: #000000;
}

.letter-header-text h1 {
  font-size: 18px;
  margin: 2px 0 3px 0;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #000000;
}

.letter-header-text p {
  font-size: 11px;
  margin: 2px 0;
  color: #000000;
}

.letter-header-divider {
  border-top: 1px solid #000000;
  border-bottom: 3.5px solid #000000;
  height: 3px;
  margin: 10px 0 24px 0;
}

/* Editable content blocks inside the letter */
.editable-block {
  border: 1px dashed transparent;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.editable-block:hover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.03);
}

.editable-block:focus {
  border-color: var(--accent);
  outline: none;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* The letter table style */
.letter-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
}

.letter-table th, .letter-table td {
  border: 1px solid #000000 !important;
  padding: 8px 10px !important;
  color: #000000 !important;
  background: #ffffff !important;
  text-align: left;
  line-height: 1.4;
}

.letter-table th {
  font-weight: bold;
  text-align: center;
  background: #f8fafc !important;
}

.letter-signatures {
  margin-top: 60px;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
}

.letter-sig-block {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 13.5px;
  font-weight: bold;
  line-height: 1.4;
}

/* Sidebar collapsed state (desktop/tablet) */
@media (min-width: 769px) {
  body.sidebar-collapsed {
    --sidebar-width: 80px;
  }
  body.sidebar-collapsed .sidebar-title,
  body.sidebar-collapsed .user-info,
  body.sidebar-collapsed .sidebar-brand span,
  body.sidebar-collapsed .menu-item a span,
  body.sidebar-collapsed #common-uac-menu span {
    display: none !important;
  }
  body.sidebar-collapsed .sidebar-brand {
    padding: 0;
    justify-content: center;
  }
  body.sidebar-collapsed .menu-item a {
    justify-content: center;
    padding: 12px;
  }
  body.sidebar-collapsed .sidebar-user {
    padding: 16px 0;
    justify-content: center;
  }
  body.sidebar-collapsed #sidebar-collapse-btn .chevron-icon {
    transform: rotate(180deg);
  }
}

#sidebar-collapse-btn:hover {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3) !important;
}

@media (max-width: 768px) {
  #sidebar-collapse-btn {
    display: none !important;
  }
}

/* Pulsing/Blinking collapse arrow indicator */
@keyframes pulse-arrow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
    background-color: var(--bg-secondary);
    color: #94a3b8;
  }
  50% {
    box-shadow: 0 0 15px var(--primary);
    border-color: var(--primary);
    background-color: var(--primary);
    color: #ffffff;
  }
}

#sidebar-collapse-btn {
  animation: pulse-arrow 2.5s infinite ease-in-out;
}
