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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── AUTH ── */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  overflow: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: #6366f1;
  top: -100px;
  left: -100px;
  animation: float 8s ease-in-out infinite;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: #8b5cf6;
  bottom: -80px;
  right: -80px;
  animation: float 10s ease-in-out infinite reverse;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: #06b6d4;
  top: 40%;
  left: 50%;
  animation: float 12s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-30px);
  }
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 1rem;
}

.auth-card {
  background: rgba(30, 41, 59, .85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, .5);
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: .75rem;
}

.auth-brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.auth-brand-sub {
  color: var(--muted);
  font-size: .8rem;
  margin: 0;
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: .25rem;
}

.auth-subtitle {
  color: var(--muted);
  font-size: .875rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.form-group-float {
  position: relative;
  margin-bottom: 1.25rem;
}

.form-input,
.tf-input,
.tf-textarea,
.tf-select,
.filter-input,
.filter-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1rem;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-input option,
.tf-select option,
.filter-select option {
  background: var(--surface);
  color: var(--text);
}

.form-input:focus,
.tf-input:focus,
.tf-textarea:focus,
.tf-select:focus,
.filter-input:focus,
.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .2);
}

.form-group-float .form-label {
  position: absolute;
  top: .75rem;
  left: 1rem;
  color: var(--muted);
  font-size: .875rem;
  transition: .2s;
  pointer-events: none;
}

.form-group-float .form-input:focus~.form-label,
.form-group-float .form-input:not(:placeholder-shown)~.form-label {
  top: -.55rem;
  left: .75rem;
  font-size: .72rem;
  background: var(--surface);
  padding: 0 .35rem;
  color: var(--accent);
  border-radius: 4px;
}

.toggle-pw {
  position: absolute;
  right: .75rem;
  top: .75rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.toggle-pw:hover {
  color: var(--text);
}

.form-check-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.check-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .875rem;
  cursor: pointer;
}

.btn-auth {
  width: 100%;
  padding: .85rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: transform .15s, box-shadow .2s;
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, .4);
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: .875rem;
  margin-top: 1.25rem;
}

.auth-link {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  color: #fff;
}

.alert-glass {
  padding: .75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: .875rem;
  transition: opacity .5s;
}

.alert-error {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, .15);
  border: 1px solid rgba(16, 185, 129, .3);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245, 158, 11, .15);
  border: 1px solid rgba(245, 158, 11, .3);
  color: #fcd34d;
}

.field-error {
  color: #fca5a5;
  font-size: .78rem;
  margin-top: .3rem;
}

.pw-strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, .1);
  border-radius: 4px;
  margin-bottom: .25rem;
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  transition: width .3s, background .3s;
}

.pw-strength-label {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .75rem;
}

/* ── APP LAYOUT ── */
.app-body {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1050 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
  width: 64px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed span,
.sidebar.collapsed .nav-label {
  display: none;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 1.25rem 0.5rem;
}

.sidebar.collapsed .sidebar-brand .brand-link {
  display: none;
}

.sidebar.collapsed .sidebar-toggle-in-brand {
  margin: 0;
}

.sidebar-toggle-in-brand {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  text-decoration: none;
}

.sidebar-toggle-in-brand:hover {
  color: var(--accent);
}

.sidebar.collapsed .sidebar-toggle-in-brand {
  padding: 0.5rem;
}

.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  padding: 0.75rem 0;
  margin: 0 .5rem;
}

.sidebar.collapsed .sidebar-nav a i {
  font-size: 1.25rem;
  margin: 0;
  width: auto;
}

.sidebar.collapsed+.main-wrapper {
  margin-left: 64px;
}

.sidebar-collapsed-wrapper {
  margin-left: 64px !important;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  position: relative;
}

.sidebar-toggle-in-brand {
  flex-shrink: 0;
  width: 44px;
  /* Larger hit area */
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.25rem;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer !important;
  position: relative;
  z-index: 4500;
}

.sidebar-toggle-in-brand:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  flex: 1;
  overflow: hidden;
}

.brand-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
  display: none !important;
}

/* Theme specific logos display & drop-shadow accentuation */
[data-theme='light'] .brand-logo-img.logo-light,
:root:not([data-theme]) .brand-logo-img.logo-light {
  display: block !important;
  filter: drop-shadow(0 2px 6px rgba(79, 70, 229, 0.3));
}

[data-theme='dark'] .brand-logo-img.logo-dark {
  display: block !important;
  filter: drop-shadow(0 2px 6px rgba(139, 92, 246, 0.4));
}

[data-theme='midnight'] .brand-logo-img.logo-midnight {
  display: block !important;
  filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.4));
}

[data-theme='forest'] .brand-logo-img.logo-forest {
  display: block !important;
  filter: drop-shadow(0 2px 6px rgba(16, 185, 129, 0.4));
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  color: #ffffff;
}

.brand-name {
  font-weight: 800;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: .68rem;
  color: var(--muted);
  display: block;
  letter-spacing: 0.05em;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  color: #ffffff;
  flex-shrink: 0;
}

.user-name {
  font-weight: 600;
  font-size: .85rem;
}

.user-role {
  font-size: .72rem;
}

.sidebar-nav {
  flex: 1;
  list-style: none;
  padding: .75rem 0;
  overflow-y: auto;
}

.nav-label {
  padding: .5rem 1rem .25rem;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-radius: 8px;
  margin: 0 .5rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.sidebar-nav a:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
}

.sidebar-nav a.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent2) 10%, transparent));
  color: var(--accent2);
  border-color: var(--accent);
}

.sidebar-nav a i {
  width: 18px;
  text-align: center;
  font-size: .95rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.logout-btn {
  width: 100%;
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: 8px;
  color: #fca5a5;
  padding: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: .875rem;
  cursor: pointer;
  transition: background .2s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, .25);
}

/* ── MAIN ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Sidebar Overlay with modern glassmorphism blur */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 3500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  position: relative;
  z-index: 1100;
  pointer-events: auto !important;
}

.sidebar-toggle:hover {
  color: var(--accent);
}

.topbar-title {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
}

.btn-primary-sm {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  padding: .4rem .9rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: transform .15s;
}

.btn-primary-sm:hover {
  color: #fff;
  transform: translateY(-1px);
}

.btn-secondary-sm {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .4rem .9rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: all .15s;
}

.btn-secondary-sm:hover {
  background: var(--border);
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger-xs {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger-xs:hover {
  background: #ef4444;
  color: white;
}

.btn-primary-xs {
  background: var(--accent);
  color: white;
}

.btn-secondary-xs {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}

/* Delete Mode Buttons */
#toggleDeleteMode.active {
  background: #64748b;
  color: white;
  border-color: #475569;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

#bulkDeleteBtn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transition: all 0.3s ease;
}

#bulkDeleteBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.page-content {
  padding: 1.5rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.page-title i {
  color: var(--accent);
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.date-badge {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
  font-size: .85rem;
}

.flash-container {
  padding: .5rem 1.5rem 0;
}

.flash {
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .875rem;
  margin-bottom: .5rem;
}

.flash-success {
  background: rgba(16, 185, 129, .15);
  border: 1px solid rgba(16, 185, 129, .3);
  color: #6ee7b7;
}

.flash-error {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #fca5a5;
}

.flash-info {
  background: rgba(99, 102, 241, .15);
  border: 1px solid rgba(99, 102, 241, .3);
  color: #a5b4fc;
}

/* ── CARDS ── */
.section-card,
.chart-card,
.form-card,
.view-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.section-title i {
  color: var(--accent);
}

.btn-link {
  color: var(--accent2);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
}

.btn-link:hover {
  color: #fff;
}

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-total .stat-icon {
  background: rgba(99, 102, 241, .2);
  color: var(--accent);
}

.stat-progress .stat-icon {
  background: rgba(245, 158, 11, .2);
  color: var(--warning);
}

.stat-done .stat-icon {
  background: rgba(16, 185, 129, .2);
  color: var(--success);
}

.stat-overdue .stat-icon {
  background: rgba(239, 68, 68, .2);
  color: var(--danger);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  font-size: .8rem;
  margin-top: .25rem;
}

.stat-decoration {
  position: absolute;
  right: -20px;
  top: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: .08;
}

.stat-total .stat-decoration {
  background: var(--accent);
}

.stat-progress .stat-decoration {
  background: var(--warning);
}

.stat-done .stat-decoration {
  background: var(--success);
}

.stat-overdue .stat-decoration {
  background: var(--danger);
}

/* ── CHARTS ── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .charts-row {
    grid-template-columns: 1fr !important;
  }

  .chart-body canvas {
    max-height: 220px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

.chart-header {
  margin-bottom: .75rem;
}

.chart-title {
  font-size: .95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.chart-title i {
  color: var(--accent);
}

.chart-summary {}

.quick-stats {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}

.qs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .5rem;
  background: var(--surface2);
  border-radius: 8px;
}

.qs-label {
  font-size: .8rem;
  color: var(--muted);
}

.qs-val {
  font-weight: 700;
  font-size: .9rem;
  padding: .1rem .5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.qa-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .75rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  transition: transform .15s;
}

.qa-btn:hover {
  transform: translateY(-1px);
}

.qa-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
}

.qa-primary:hover {
  color: #fff;
}

.qa-excel {
  background: rgba(16, 185, 129, .15);
  border: 1px solid rgba(16, 185, 129, .3);
  color: #6ee7b7;
}

.qa-excel:hover {
  color: #6ee7b7;
}

.qa-pdf {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #fca5a5;
}

.qa-pdf:hover {
  color: #fca5a5;
}

/* ── TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  color: var(--text) !important;
}

.data-table thead th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .75rem .5rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  background-color: transparent !important;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, .05) !important;
}

.data-table tbody tr.odd {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

.data-table tbody tr.even {
  background-color: transparent !important;
}

.data-table td {
  padding: .65rem .5rem;
  vertical-align: middle;
  color: var(--text) !important;
}

.row-overdue {
  background: rgba(239, 68, 68, .05) !important;
}

.task-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.task-link:hover {
  color: var(--accent2);
}

.task-desc-preview {
  color: var(--muted);
  font-size: .78rem;
  margin-top: .15rem;
}

.overdue-tag {
  color: var(--danger);
  font-size: .72rem;
  font-weight: 600;
  margin-left: .4rem;
}

.actions-cell {
  white-space: nowrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  text-decoration: none;
  font-size: .8rem;
  border: none;
  cursor: pointer;
  margin: 0 .15rem;
  transition: transform .15s, background .15s;
}

.btn-action:hover {
  transform: scale(1.1);
}

.btn-view {
  background: rgba(99, 102, 241, .15);
  color: var(--accent2);
}

.btn-edit {
  background: rgba(245, 158, 11, .15);
  color: var(--warning);
}

.btn-pdf {
  background: rgba(239, 68, 68, .15);
  color: #fca5a5;
}

.btn-delete {
  background: rgba(239, 68, 68, .1);
  color: var(--danger);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

.empty-state i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
  opacity: .4;
}

.empty-state a {
  color: var(--accent2);
}

/* ── STATUS / PRIORITY BADGES ── */
.status-badge,
.priority-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}

.badge-todo {
  background: rgba(99, 102, 241, .15);
  color: #818cf8;
}

.badge-progress {
  background: rgba(245, 158, 11, .15);
  color: #fbbf24;
}

.badge-done {
  background: rgba(16, 185, 129, .15);
  color: #34d399;
}

.badge-cancelled {
  background: rgba(107, 114, 128, .15);
  color: #9ca3af;
}

.priority-low {
  background: rgba(16, 185, 129, .15);
  color: #34d399;
}

.priority-medium {
  background: rgba(99, 102, 241, .15);
  color: #818cf8;
}

.priority-high {
  background: rgba(245, 158, 11, .15);
  color: #fbbf24;
}

.priority-critical {
  background: rgba(239, 68, 68, .15);
  color: #f87171;
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
}

.filter-form {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  flex-wrap: wrap;
}

.filter-group {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-icon {
  position: absolute;
  left: .75rem;
  color: var(--muted);
  font-size: .8rem;
}

.filter-input {
  padding: .5rem .75rem .5rem 2rem;
  min-width: 180px;
}

.filter-select {
  padding: .5rem .75rem;
  min-width: 130px;
}

.filter-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .5rem 1rem;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.filter-reset {
  color: var(--muted);
  text-decoration: none;
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}

.filter-reset:hover {
  color: var(--text);
}

.export-btns {
  display: flex;
  gap: .5rem;
}

.export-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .85rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
}

.export-xls {
  background: rgba(16, 185, 129, .15);
  border: 1px solid rgba(16, 185, 129, .3);
  color: #6ee7b7;
}

.export-xls:hover {
  color: #6ee7b7;
}

.export-pdf {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #fca5a5;
}

.export-pdf:hover {
  color: #fca5a5;
}

/* ── TASK FORM ── */
.form-card {
  max-width: 800px;
}

.task-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tf-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.tf-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: .25rem;
}

.tf-label i {
  color: var(--accent2);
}

.required {
  color: var(--danger);
}

.tf-textarea {
  resize: vertical;
  min-height: 120px;
}

.tf-select option {
  background: var(--surface);
  color: var(--text);
}

.tf-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.tf-error {
  color: #fca5a5;
  font-size: .78rem;
}

.tf-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: .5rem;
}

.tf-submit {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: transform .15s, box-shadow .2s;
}

.tf-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, .4);
}

.tf-cancel {
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}

.tf-cancel:hover {
  color: var(--danger);
}

/* ── VIEW CARD ── */
.view-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.view-task-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.view-badges {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.view-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.meta-item {
  background: var(--surface2);
  border-radius: 10px;
  padding: .75rem;
}

.meta-label {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .25rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}

.meta-value {
  font-weight: 600;
  font-size: .9rem;
}

.view-description {
  margin-bottom: 1.5rem;
}

.view-desc-label {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.view-desc-body {
  background: var(--surface2);
  border-radius: 10px;
  padding: 1rem;
  line-height: 1.7;
  font-size: .9rem;
  white-space: pre-wrap;
}

.view-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.va-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.1rem;
  border-radius: 9px;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}

.va-btn:hover {
  transform: translateY(-2px);
}

.va-edit {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
}

.va-edit:hover {
  color: #fff;
}

.va-pdf {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #fca5a5;
}

.va-pdf:hover {
  color: #fca5a5;
}

.va-excel {
  background: rgba(16, 185, 129, .15);
  border: 1px solid rgba(16, 185, 129, .3);
  color: #6ee7b7;
}

.va-excel:hover {
  color: #6ee7b7;
}

.va-delete {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #fca5a5;
}

.va-delete:hover {
  color: #fca5a5;
}

/* ── DATATABLES DARK OVERRIDE ── */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: .3rem .5rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--muted) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  border-radius: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--surface2) !important;
  color: var(--text) !important;
}

/* ── RESPONSIVE ── */
/* ── QUIZ ATTEMPT ── */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.option-tile {
  position: relative;
}

.option-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.option-tile:hover .option-label {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ── TOPBAR USER PANEL ── */
.user-panel-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 4px 12px 4px 4px;
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.user-panel-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent2);
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
}

.user-dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 0.5rem;
  margin-top: 10px !important;
}

.user-dropdown-menu .dropdown-item {
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 0.6rem 1rem;
}

.user-dropdown-menu .dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text);
}

.theme-selection-menu {
  min-width: 180px;
}

/* ── LANDING PAGE ── */
.landing-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.hero-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  position: relative;
}

.hero-content {
  max-width: 800px;
  text-align: center;
  z-index: 10;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-hero {
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-hero-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-hero-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
  color: white;
}

.btn-hero-secondary {
  border: 2px solid var(--border);
  color: white;
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-3px);
}

/* ── DUAL DASHBOARD HOME ── */
.dash-home-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.dash-choice-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  max-width: 440px;
  min-width: 320px;
}

.dash-choice-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.05) 100%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.choice-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  transition: all 0.3s;
}

.dash-choice-card:hover .choice-icon {
  background: var(--accent);
  color: white;
  transform: rotate(10deg);
}

.choice-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.choice-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

@media(max-width:768px) {



  /* Mobile: Sidebar collapsed (thin) by default */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 64px;
    /* Thin strip showing icons */
    height: 100vh;
    z-index: 3000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex !important;
    overflow: hidden;
    background: var(--surface);
    border-right: 1px solid var(--border);
  }

  /* Sidebar expanded on mobile */
  .sidebar.show-mobile {
    width: 260px !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 4000 !important;
  }

  /* Main wrapper adjusts to thin sidebar */
  .main-wrapper {
    margin-left: 64px !important;
    width: calc(100% - 64px) !important;
    min-width: 0;
    transition: none !important;
    /* Don't transition content on mobile expansion */
  }

  /* Ensure icons are centered and stacked when collapsed */
  .sidebar .sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    width: 100%;
    min-height: auto;
  }

  .sidebar .sidebar-brand .brand-link {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    justify-content: center;
    width: 100%;
  }

  .sidebar .sidebar-nav a {
    justify-content: center;
    padding: 0.75rem 0;
    margin: 0 .5rem;
  }

  .sidebar .sidebar-nav a i {
    font-size: 1.25rem;
    margin: 0;
    width: auto;
  }

  .sidebar span,
  .sidebar .nav-label {
    display: none;
  }

  /* When expanded, show text and align horizontally */
  .sidebar.show-mobile .sidebar-brand {
    flex-direction: row !important;
    justify-content: flex-start !important;
    padding: 1.25rem 1rem !important;
    gap: 0.75rem !important;
  }

  .sidebar.show-mobile .sidebar-brand .brand-link {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    justify-content: flex-start !important;
    width: auto !important;
  }

  .sidebar.show-mobile .sidebar-nav a {
    justify-content: flex-start;
    padding: 0.65rem 1rem;
    margin: 0 .5rem;
  }

  .sidebar.show-mobile .sidebar-nav a i {
    font-size: 0.95rem;
    margin-right: 0.75rem;
    width: 18px;
  }

  .sidebar.show-mobile span {
    display: inline-block !important;
  }

  .sidebar.show-mobile .nav-label {
    display: block !important;
  }

  /* Topbar adjustment */
  .topbar {
    padding: 0.5rem 0.75rem !important;
    z-index: 2000;
  }

}

/* Full-width mode (phone-sidebar-hidden) on all devices */
html.phone-sidebar-hidden .sidebar {
  display: none !important;
}
html.phone-sidebar-hidden .main-wrapper {
  margin-left: 0 !important;
  width: 100% !important;
}

.option-radio:checked+.option-label {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.option-letter {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.option-radio:checked+.option-label .option-letter {
  background: var(--accent);
  color: #fff;
}

.option-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

/* ── UTILS ── */
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  color: white;
  font-size: 0.85rem;
  gap: 12px;
  backdrop-filter: blur(4px);
}

/* ── COLLAPSIBLE SIDEBAR MODULES ── */
.nav-label.collapsible-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding-right: 1.25rem;
  transition: color 0.2s ease;
}

.nav-label.collapsible-header:hover {
  color: var(--text);
}

.nav-label.collapsible-header .toggle-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  color: var(--muted);
}

.nav-label.collapsible-header:hover .toggle-arrow {
  color: var(--accent);
}

.nav-label.collapsible-header.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.nav-item-collapsible {
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease, padding 0.25s ease;
  max-height: 55px;
  opacity: 1;
  overflow: hidden;
}

.nav-item-collapsible.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  pointer-events: none;
}

/* Collapsed sidebar logout centering */
.sidebar.collapsed .logout-btn {
  justify-content: center !important;
  padding: 0.75rem 0 !important;
  margin: 10px 0.5rem 0 !important;
  width: calc(100% - 1rem) !important;
}

.sidebar.collapsed .logout-btn span {
  display: none !important;
}

/* ── MAINS QUILL RICH TEXT EDITOR ── */
.mains-editor-wrapper {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
  background: var(--surface);
}

.mains-editor-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .2);
}

.mains-editor-wrapper .ql-toolbar {
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  background: var(--surface2);
  padding: 8px 12px;
  border-radius: 0;
}

.mains-editor-wrapper .ql-container {
  border: none !important;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  min-height: 120px;
}

.mains-editor-wrapper .ql-editor {
  min-height: 120px;
  padding: 14px 16px;
  color: #000 !important;
  background-color: #fff !important;
  overflow-y: hidden;
  /* auto-expand: no internal scroll */
}

.mains-editor-wrapper .ql-editor.ql-blank::before {
  color: var(--muted);
  font-style: normal;
  font-size: 0.95rem;
}

.mains-editor-wrapper .ql-toolbar .ql-stroke {
  stroke: var(--muted);
}

.mains-editor-wrapper .ql-toolbar .ql-fill {
  fill: var(--muted);
}

.mains-editor-wrapper .ql-toolbar .ql-picker {
  color: var(--muted);
}

.mains-editor-wrapper .ql-toolbar button:hover .ql-stroke,
.mains-editor-wrapper .ql-toolbar button.ql-active .ql-stroke {
  stroke: var(--accent);
}

.mains-editor-wrapper .ql-toolbar button:hover .ql-fill,
.mains-editor-wrapper .ql-toolbar button.ql-active .ql-fill {
  fill: var(--accent);
}

.mains-editor-wrapper .ql-toolbar button:hover,
.mains-editor-wrapper .ql-toolbar button.ql-active {
  color: var(--accent);
}

.mains-editor-wrapper .ql-picker-label:hover,
.mains-editor-wrapper .ql-picker-label.ql-active {
  color: var(--accent) !important;
}

/* Draft auto-save banner */
.draft-restore-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(139, 92, 246, .08));
  border: 1px solid rgba(99, 102, 241, .35);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1.25rem;
  animation: slideInDown .3s ease;
}

.draft-restore-banner .draft-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: .875rem;
}

.draft-restore-banner .draft-info i {
  color: var(--accent);
  font-size: 1.1rem;
}

.draft-restore-banner .draft-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.draft-restore-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}

.draft-restore-btn:hover {
  transform: translateY(-1px);
  opacity: .9;
}

.draft-discard-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.draft-discard-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Auto-save indicator pill */
.autosave-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: color .3s, border-color .3s;
}

.autosave-indicator.saved {
  color: #22c55e;
  border-color: rgba(34, 197, 94, .3);
}

.autosave-indicator.saving {
  color: var(--accent);
  border-color: rgba(99, 102, 241, .3);
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── MAINS CONTENT VIEWER (Rich HTML Display) ── */
.mains-content-view {
  font-size: 1rem;
  line-height: 1.8;
  color: #000 !important;
  background-color: #fff !important;
  padding: 1rem;
  border-radius: 8px;
}

.mains-content-view p {
  margin-bottom: .75rem;
}

.mains-content-view p:last-child {
  margin-bottom: 0;
}

.mains-content-view strong,
.mains-content-view b {
  font-weight: 700;
  color: var(--text);
}

.mains-content-view em,
.mains-content-view i {
  font-style: italic;
}

.mains-content-view u {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mains-content-view ul,
.mains-content-view ol {
  padding-left: 1.6rem;
  margin-bottom: .75rem;
}

.mains-content-view ul {
  list-style-type: disc;
}

.mains-content-view ol {
  list-style-type: decimal;
}

.mains-content-view li {
  margin-bottom: .35rem;
  line-height: 1.7;
}

.mains-content-view h1,
.mains-content-view h2,
.mains-content-view h3,
.mains-content-view h4,
.mains-content-view h5,
.mains-content-view h6 {
  font-size: 1.05em;
  /* Prevent pasted headings from being huge */
  font-weight: 600;
  line-height: 1.5;
  margin: 0.6em 0 0.2em;
  color: inherit;
}

/* Removed override for inline colors to preserve original formatting pasted from Word/Docs */

/* Style pasted HTML tables neatly */
.mains-content-view table {
  width: 100%;
  margin-bottom: 1rem;
  border: 1px solid #dee2e6;
  border-collapse: collapse;
}

.mains-content-view table td,
.mains-content-view table th {
  padding: 0.75rem;
  vertical-align: top;
  border: 1px solid #dee2e6;
}

.mains-content-view blockquote {
  border-left: 4px solid var(--accent);
  padding: .5rem 1rem;
  margin: .75rem 0;
  background: rgba(99, 102, 241, .06);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--muted);
}

/* ── QUILL INDENT LEVELS (for saved rich-text display in view pages) ── */
.mains-content-view .ql-indent-1,
.mains-content-view li.ql-indent-1 {
  padding-left: 2em;
}

.mains-content-view .ql-indent-2,
.mains-content-view li.ql-indent-2 {
  padding-left: 4em;
}

.mains-content-view .ql-indent-3,
.mains-content-view li.ql-indent-3 {
  padding-left: 6em;
}

.mains-content-view .ql-indent-4,
.mains-content-view li.ql-indent-4 {
  padding-left: 8em;
}

.mains-content-view .ql-indent-5,
.mains-content-view li.ql-indent-5 {
  padding-left: 10em;
}

.mains-content-view .ql-indent-6,
.mains-content-view li.ql-indent-6 {
  padding-left: 12em;
}

.mains-content-view .ql-indent-7,
.mains-content-view li.ql-indent-7 {
  padding-left: 14em;
}

.mains-content-view .ql-indent-8,
.mains-content-view li.ql-indent-8 {
  padding-left: 16em;
}

/* ── VAJIRAM STYLE MODEL ANSWER BOX ── */
.model-answer-box {
  background-color: #dff0d8;
  border: 1px solid #d6e9c6;
  border-radius: 6px;
  padding: 1.25rem;
  color: #3c763d;
}

.model-answer-box .mains-content-view {
  color: #2b542c;
}

/* ── RESPONSIVE BUTTONS COLLAPSE ON MOBILE ── */
@media (max-width: 768px) {

  /* Prevent header items from wrapping/overflowing and force neat wrapping instead of layout breakage */
  .page-header {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .page-header .d-flex {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  /* Target all buttons that contain an icon (i, svg, fa class) */
  .btn:has(i, svg, [class*="fa-"]),
  .btn-primary-sm:has(i, svg, [class*="fa-"]),
  .btn-secondary-sm:has(i, svg, [class*="fa-"]),
  .btn-warning-sm:has(i, svg, [class*="fa-"]),
  .btn-danger-sm:has(i, svg, [class*="fa-"]),
  .btn-success-sm:has(i, svg, [class*="fa-"]),
  .btn-xs:has(i, svg, [class*="fa-"]),
  .btn-hero:has(i, svg, [class*="fa-"]),
  a[class*="btn-"]:has(i, svg, [class*="fa-"]) {
    font-size: 0 !important;
    gap: 0 !important;
    padding: 6px 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 32px !important;
    min-width: 32px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
  }

  /* Maintain layout/size for icons inside collapsed buttons */
  .btn:has(i, svg, [class*="fa-"]) i,
  .btn-primary-sm:has(i, svg, [class*="fa-"]) i,
  .btn-secondary-sm:has(i, svg, [class*="fa-"]) i,
  .btn-warning-sm:has(i, svg, [class*="fa-"]) i,
  .btn-danger-sm:has(i, svg, [class*="fa-"]) i,
  .btn-success-sm:has(i, svg, [class*="fa-"]) i,
  .btn-xs:has(i, svg, [class*="fa-"]) i,
  .btn-hero:has(i, svg, [class*="fa-"]) i,
  a[class*="btn-"]:has(i, svg, [class*="fa-"]) i {
    font-size: 0.9rem !important;
    margin: 0 !important;
  }

  /* Explicitly size the badges inside so they don't shrink to 0px */
  .btn:has(i, svg, [class*="fa-"]) .badge,
  .btn-primary-sm:has(i, svg, [class*="fa-"]) .badge,
  .btn-secondary-sm:has(i, svg, [class*="fa-"]) .badge,
  .btn-warning-sm:has(i, svg, [class*="fa-"]) .badge,
  .btn-danger-sm:has(i, svg, [class*="fa-"]) .badge,
  .btn-success-sm:has(i, svg, [class*="fa-"]) .badge,
  a[class*="btn-"]:has(i, svg, [class*="fa-"]) .badge {
    font-size: 0.75rem !important;
    margin-left: 2px !important;
  }

  /* Expand the button and show the text on Hover, Focus, or Active tap */
  .btn:has(i, svg, [class*="fa-"]):hover,
  .btn:has(i, svg, [class*="fa-"]):focus,
  .btn-primary-sm:has(i, svg, [class*="fa-"]):hover,
  .btn-primary-sm:has(i, svg, [class*="fa-"]):focus,
  .btn-secondary-sm:has(i, svg, [class*="fa-"]):hover,
  .btn-secondary-sm:has(i, svg, [class*="fa-"]):focus,
  .btn-warning-sm:has(i, svg, [class*="fa-"]):hover,
  .btn-warning-sm:has(i, svg, [class*="fa-"]):focus,
  .btn-danger-sm:has(i, svg, [class*="fa-"]):hover,
  .btn-danger-sm:has(i, svg, [class*="fa-"]):focus,
  .btn-success-sm:has(i, svg, [class*="fa-"]):hover,
  .btn-success-sm:has(i, svg, [class*="fa-"]):focus,
  .btn-xs:has(i, svg, [class*="fa-"]):hover,
  .btn-xs:has(i, svg, [class*="fa-"]):focus,
  .btn-hero:has(i, svg, [class*="fa-"]):hover,
  .btn-hero:has(i, svg, [class*="fa-"]):focus,
  a[class*="btn-"]:has(i, svg, [class*="fa-"]):hover,
  a[class*="btn-"]:has(i, svg, [class*="fa-"]):focus {
    font-size: 0 !important;
    gap: 0 !important;
    padding: 6px 10px !important;
    min-width: 32px !important;
  }

  /* Add margin to icons when button is expanded */
  .btn:has(i, svg, [class*="fa-"]):hover i,
  .btn:has(i, svg, [class*="fa-"]):focus i,
  .btn-primary-sm:has(i, svg, [class*="fa-"]):hover i,
  .btn-primary-sm:has(i, svg, [class*="fa-"]):focus i,
  .btn-secondary-sm:has(i, svg, [class*="fa-"]):hover i,
  .btn-secondary-sm:has(i, svg, [class*="fa-"]):focus i,
  .btn-warning-sm:has(i, svg, [class*="fa-"]):hover i,
  .btn-warning-sm:has(i, svg, [class*="fa-"]):focus i,
  .btn-danger-sm:has(i, svg, [class*="fa-"]):hover i,
  .btn-danger-sm:has(i, svg, [class*="fa-"]):focus i,
  .btn-success-sm:has(i, svg, [class*="fa-"]):hover i,
  .btn-success-sm:has(i, svg, [class*="fa-"]):focus i,
  .btn-xs:has(i, svg, [class*="fa-"]):hover i,
  .btn-xs:has(i, svg, [class*="fa-"]):focus i,
  .btn-hero:has(i, svg, [class*="fa-"]):hover i,
  .btn-hero:has(i, svg, [class*="fa-"]):focus i,
  a[class*="btn-"]:has(i, svg, [class*="fa-"]):hover i,
  a[class*="btn-"]:has(i, svg, [class*="fa-"]):focus i {
    margin-right: 4px !important;
  }
}

/* ── ADDITIONAL GLOBAL RESPONSIVE RULES ── */
@media (max-width: 768px) {

  /* Ensure table headers and cell contents wrap natively without forcing huge widths */
  .data-table th,
  .data-table td,
  .table th,
  .table td {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* Stack inline forms on mobile */
  form.d-flex.gap-2.align-items-end,
  .accordion-body form.d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  form.d-flex.gap-2.align-items-end>div,
  .accordion-body form.d-flex>div {
    width: 100% !important;
  }

  /* Accordion button layout vertical stacking of headers and inline actions */
  .accordion-button>div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .accordion-button>div>div.d-flex {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  /* Quill editor color selector wrapping */
  .custom-bg-selector {
    float: none !important;
    display: flex !important;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
}

/* Prevent transition animations on page load */
.no-transition,
.no-transition * {
  transition: none !important;
}

#notifDropdown {
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 6px) !important;
  width: 340px !important;
  max-height: 420px !important;
  overflow-y: auto !important;
  z-index: 1050 !important;
  background: var(--card-bg, #fff) !important;
}

/* Responsive Notification Dropdown in Mobile View */
@media (max-width: 576px) {
  #notifDropdown {
    position: fixed !important;
    top: 60px !important;
    left: 72px !important;
    right: 12px !important;
    width: auto !important;
    max-height: calc(100vh - 100px) !important;
    z-index: 4500 !important;
  }

  html.phone-sidebar-hidden #notifDropdown {
    left: 12px !important;
  }
}

/* Fixed/sticky topbar irrespective of anything happening in system */
.topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1040 !important;
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.header-stack {
  position: sticky !important;
  top: 0 !important;
  z-index: 1040 !important;
  background: var(--surface) !important;
}

/* Ensure crop modal and all Bootstrap modals show above fixed sidebars on mobile */
.modal {
  z-index: 5000 !important;
}
.modal-backdrop {
  z-index: 4990 !important;
}

/* ====== FORCE DATATABLES BACKGROUND TRANSPARENCY ====== */
table.dataTable,
table.dataTable tbody tr,
table.dataTable tbody td,
table.dataTable thead th,
table.dataTable.display tbody tr.odd > .sorting_1,
table.dataTable.display tbody tr.even > .sorting_1 {
  background-color: transparent !important;
  box-shadow: none !important;
  color: var(--text) !important;
}
table.dataTable tbody tr.odd {
  background-color: rgba(0,0,0, 0.05) !important;
}
[data-theme='dark'] table.dataTable tbody tr.odd,
[data-theme='midnight'] table.dataTable tbody tr.odd,
[data-theme='forest'] table.dataTable tbody tr.odd {
  background-color: rgba(255,255,255, 0.03) !important;
}
table.dataTable tbody tr:hover {
  background-color: rgba(0,0,0, 0.08) !important;
}
[data-theme='dark'] table.dataTable tbody tr:hover,
[data-theme='midnight'] table.dataTable tbody tr:hover,
[data-theme='forest'] table.dataTable tbody tr:hover {
  background-color: rgba(255,255,255, 0.08) !important;
}

/* Allow custom background colors to show through instead of being covered by white */
.model-answer-box .mains-content-view,
.question-container .mains-content-view,
[style*="background"] > .mains-content-view {
  background-color: transparent !important;
}

/* ====== GLASSMORPHIC THEME PICKER ====== */
.theme-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: themeFadeIn 0.25s ease-out;
}

@keyframes themeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.theme-picker-card {
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.65) !important;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease-out;
  animation: themeSlideUp 0.25s ease-out;
}

/* Specific background styles for different themes */
[data-theme='dark'] .theme-picker-card {
  background: rgba(24, 24, 27, 0.65) !important;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
[data-theme='midnight'] .theme-picker-card {
  background: rgba(15, 23, 42, 0.65) !important;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
[data-theme='forest'] .theme-picker-card {
  background: rgba(6, 78, 59, 0.65) !important;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

@keyframes themeSlideUp {
  from { transform: translateY(20px); }
  to { transform: translateY(0); }
}

.theme-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.theme-picker-header h5 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.theme-picker-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.theme-picker-close:hover {
  opacity: 1;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 576px) {
  .theme-grid {
    grid-template-columns: 1fr;
  }
  .theme-picker-card {
    max-width: 100%;
    margin: 10px;
    background: rgba(255, 255, 255, 0.7) !important;
  }
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.theme-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-color: var(--border);
}

.theme-option.active {
  border-color: var(--accent) !important;
  background: var(--surface2);
}

.theme-preview-box {
  width: 100%;
  height: 50px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Dynamic styling for option preview boxes */
.light-preview {
  background: #f8fafc;
  position: relative;
}
.light-preview::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 10px;
  right: 20px;
  bottom: 10px;
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.08);
}

.dark-preview {
  background: #09090b;
  position: relative;
}
.dark-preview::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 10px;
  right: 20px;
  bottom: 10px;
  background: #18181b;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
}

.midnight-preview {
  background: #020617;
  position: relative;
}
.midnight-preview::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 10px;
  right: 20px;
  bottom: 10px;
  background: #0f172a;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}

.forest-preview {
  background: #052e16;
  position: relative;
}
.forest-preview::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 10px;
  right: 20px;
  bottom: 10px;
  background: #064e3b;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
}

.theme-option span {
  font-weight: 600;
  font-size: 0.9rem;
}



.ai-mode-btn {
  padding: 5px 12px;
}
@media (max-width: 576px) {
  .ai-mode-btn {
    padding: 3px 8px;
  }
}

/* Attachment card mobile fixes */
.collapsible-attachment-card .d-flex.flex-wrap {
  flex-wrap: wrap !important;
}
.collapsible-attachment-card .fw-semibold {
  word-break: break-word;
  white-space: normal;
  flex: 1 1 auto;
  min-width: 0;
}
.collapsible-attachment-card .btn-link {
  flex-shrink: 0;
}

/* Topbar link buttons hover adjustments to prevent invisibility on light themes */
.topbar button.btn-link {
  color: var(--text-primary) !important;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.2s;
}
.topbar button.btn-link:hover {
  opacity: 1;
  color: var(--accent) !important;
  text-decoration: none;
}

/* ── MOBILE SIDEBAR & LAYOUT ALIGNMENT FIXES ── */
@media (max-width: 768px) {
  /* Prevent horizontal viewport stretching */
  html, body {
    overflow-x: hidden !important;
  }
  .main-wrapper {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  /* Compact padding for main content area on small screens */
  .page-content {
    padding: 0.75rem 0.5rem !important;
  }

  /* Compact topbar elements to fit alongside the sidebar on mobile */
  .topbar {
    position: fixed !important;
    top: 0 !important;
    left: 64px !important;
    right: 0 !important;
    width: calc(100% - 64px) !important;
    padding: 0.5rem !important;
    gap: 0.25rem !important;
    z-index: 2000 !important;
  }
  html.phone-sidebar-hidden .topbar {
    left: 0 !important;
    width: 100% !important;
  }
  .main-wrapper {
    padding-top: 54px !important;
  }
  .topbar-left {
    min-width: 0;
    flex: 1;
    gap: 0.25rem !important;
  }
  .topbar-title {
    font-size: 0.85rem !important;
    max-width: 75px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-right {
    gap: 4px !important;
    flex-shrink: 0;
  }

  /* Compact user avatar & controls */
  #userAvatarBtn {
    gap: 4px !important;
  }
  #topbarAvatarImg {
    width: 28px !important;
    height: 28px !important;
  }

  /* Shrink chat & mode toggle buttons in topbar */
  .btn-ai-chat,
  .ai-mode-btn {
    padding: 4px 8px !important;
    font-size: 0.7rem !important;
  }
  #notifBellBtn {
    font-size: 1.1rem !important;
    padding: 2px !important;
  }

  /* Stack page headers to prevent clipping actions */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
  }
  .page-title {
    font-size: 1.25rem !important;
    margin-bottom: 0 !important;
  }
  .page-header-actions {
    width: 100% !important;
    display: flex;
    justify-content: flex-start;
  }
  .page-header-actions button,
  .page-header-actions .btn-primary-sm {
    width: 100% !important;
    text-align: center;
    justify-content: center;
  }

  /* Minimize nested panel padding */
  .form-card .section-card,
  .form-card .chart-card {
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }
  .section-card,
  .chart-card,
  .form-card,
  .view-card {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  /* Compact stats cards on Task Dashboard */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  .stat-card {
    padding: 0.75rem !important;
    gap: 0.5rem !important;
    margin-bottom: 0 !important;
  }
  .stat-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    font-size: 0.95rem !important;
  }
  .stat-value {
    font-size: 1.1rem !important;
  }
  .stat-label {
    font-size: 0.7rem !important;
  }

  /* Stack notification title and timestamps vertically */
  .notification-item {
    padding: 0.75rem !important;
  }
  .notification-item .d-flex.justify-content-between.align-items-center {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }
  .notification-item h5 {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
  }
  .notification-item .extra-small {
    font-size: 0.7rem !important;
  }
  .notification-item p {
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
    margin-top: 4px !important;
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  /* Stack notification limit and show selectors vertically */
  .form-card .section-card.d-flex.flex-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }
  .form-card .section-card.d-flex.flex-wrap > * {
    width: 100% !important;
    justify-content: space-between !important;
  }
}

/* Sidebar footer collapsed & mobile styles */
.sidebar.collapsed .sidebar-footer .sidebar-user-name,
.sidebar.collapsed .sidebar-footer .footer-note,
.sidebar.collapsed .sidebar-footer button span {
  display: none !important;
}

.sidebar.collapsed .sidebar-footer {
  padding: 0.5rem !important;
}

.sidebar.collapsed .sidebar-footer button {
  padding: 0.5rem !important;
  justify-content: center !important;
}

@media (max-width: 768px) {
  .sidebar:not(.show-mobile) .sidebar-footer .sidebar-user-name,
  .sidebar:not(.show-mobile) .sidebar-footer .footer-note,
  .sidebar:not(.show-mobile) .sidebar-footer button span {
    display: none !important;
  }
  .sidebar:not(.show-mobile) .sidebar-footer {
    padding: 0.5rem !important;
  }
  .sidebar:not(.show-mobile) .sidebar-footer button {
    padding: 0.5rem !important;
    justify-content: center !important;
  }
}

/* Preserve formatting/line breaks for Match Lists and tabular layouts in Quiz/Mains Questions */
.ql-editor,
.ql-view,
.mains-content-view,
.question-container,
.q-text-content,
.recent-q-text,
.detailed-review-box,
.detailed-review-box *:not(table):not(thead):not(tbody):not(tr):not(th):not(td),
.section-card ol li div.fw-medium,
.section-card ul li div.fw-medium,
.section-card ol li .fw-medium,
.section-card ul li .fw-medium,
.scoreboard-question-text {
  white-space: pre-wrap !important;
}

/* Enable normal table layout & cells structure inside pre-wrap containers */
.ql-editor table,
.ql-editor table *,
.ql-view table,
.ql-view table *,
.mains-content-view table,
.mains-content-view table *,
.detailed-review-box table,
.detailed-review-box table * {
  white-space: normal !important;
}

table.table-bordered {
  border: 1px solid var(--border-color, #dee2e6) !important;
}
table.table-bordered th,
table.table-bordered td {
  border: 1px solid var(--border-color, #dee2e6) !important;
  padding: 0.5rem !important;
  vertical-align: middle !important;
}

/* ── MOBILE BROWSER & PERSONALISATION GUI POLISH ── */
@media (max-width: 768px) {
  .welcome-banner {
    padding: 1.25rem 1rem !important;
    border-radius: 12px !important;
  }
  .welcome-banner h2 {
    font-size: 1.35rem !important;
  }
  .welcome-banner p {
    font-size: 0.85rem !important;
  }
  .badge {
    white-space: normal !important;
    text-align: left !important;
    line-height: 1.3 !important;
  }
  .exam-pref-check {
    width: 18px !important;
    height: 18px !important;
  }
  .pyq-hero {
    padding: 1.5rem 1rem !important;
    border-radius: 14px !important;
  }
  .pyq-hero h1 {
    font-size: 1.6rem !important;
  }
  .filter-card {
    padding: 0.85rem !important;
    gap: 0.75rem !important;
  }
  .custom-check-btn {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.8rem !important;
  }
  #examPreferenceSummaryBanner {
    font-size: 0.82rem !important;
    padding: 0.75rem 0.85rem !important;
  }
}

@media (max-width: 576px) {
  .choiceGrid, .row.g-4, .row.g-3 {
    --bs-gutter-y: 0.85rem !important;
  }
  .section-card {
    padding: 1rem !important;
    border-radius: 12px !important;
  }
  .section-card h2, .section-card h3 {
    font-size: 1.1rem !important;
  }
  .brand-name {
    font-size: 0.95rem !important;
  }
}

