﻿:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f8ff;
  color: #10253f;
  --bg: #f4f8ff;
  --surface: #ffffff;
  --surface-muted: #eff4ff;
  --text: #10253f;
  --muted: #6b7280;
  --primary: #4f46e5;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow-card: 0 24px 60px rgba(15, 23, 42, 0.12);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 24%),
              linear-gradient(180deg, #f7fbff 0%, #eef5fb 100%);
  color: var(--text);
}
body.dark-mode {
  background: linear-gradient(180deg, #07101f 0%, #102348 100%);
  color: #e7efff;
}
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode label,
body.dark-mode span,
body.dark-mode div,
body.dark-mode a,
body.dark-mode button,
body.dark-mode td,
body.dark-mode th,
body.dark-mode small,
body.dark-mode li {
  color: #ffffff !important;
}
body.dark-mode .text-muted {
  color: #cfd8dc !important;
}
body.dark-mode .app-header,
body.dark-mode .card,
body.dark-mode .stat-card {
  background: #112041;
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode textarea {
  background: #0b1a35;
  border-color: rgba(148, 163, 184, 0.18);
  color: #ffffff;
}
body.dark-mode .form-control::placeholder,
body.dark-mode textarea::placeholder {
  color: #b0bec5;
}
body.dark-mode .form-label {
  color: #ffffff !important;
}
body.dark-mode .table-light {
  background: #142d57;
  color: #ffffff;
}
body.dark-mode .table tbody tr {
  background: #0d1a35;
  color: #ffffff;
}
body.dark-mode .table tbody tr td {
  color: #ffffff;
}
body.dark-mode .table tbody tr:hover {
  background: rgba(255, 255, 255, 0.08);
}
body.dark-mode .table thead th {
  background: rgba(20, 45, 87, 0.98);
  color: #b0bec5;
  border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .status-chip {
  color: #ffffff;
}
body.dark-mode .btn-outline-primary {
  color: #dbe4ff;
  border-color: rgba(255, 255, 255, 0.16);
}
body.dark-mode .btn-outline-primary:hover {
  background: rgba(59, 130, 246, 0.16);
  color: #ffffff;
}
body.dark-mode .btn-outline-secondary {
  color: #c7d2e8;
  border-color: rgba(255, 255, 255, 0.16);
}
body.dark-mode .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
body.dark-mode .btn-outline-danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
body.dark-mode .btn-outline-danger:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #ffffff;
}
body.dark-mode .btn-outline-success {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.3);
}
body.dark-mode .btn-outline-success:hover {
  background: rgba(134, 239, 172, 0.15);
  color: #ffffff;
}
body.dark-mode .btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}
body.dark-mode .btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}
body.dark-mode .btn-success {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}
body.dark-mode .btn-success:hover {
  background: #15803d;
  border-color: #15803d;
  color: #ffffff;
}
body.dark-mode .btn-primary {
  color: #ffffff;
}
body.dark-mode input::placeholder {
  color: #b0bec5;
}
header.app-header {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(79, 70, 229, 0.16));
  border-radius: 28px;
  margin: 1rem;
  padding: 0;
  box-shadow: var(--shadow-card);
}
header.app-header .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(79, 70, 229, 0.18);
  color: var(--primary);
  font-size: 1.35rem;
}
main.container {
  max-width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-top: 1rem;
  padding-bottom: 2rem;
}
@media (min-width: 1200px) {
  main.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}
.stat-card {
  border-radius: 16px;
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-card .d-flex {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start;
  gap: 16px;
}
.stat-icon {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}
.card {
  border: none;
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}
.card-body {
  padding: 1.75rem;
}
.card-footer {
  background: transparent;
}
.form-label {
  font-weight: 600;
  margin-bottom: 0.6rem;
  display: block;
  color: var(--text);
}
.form-control,
.form-select,
textarea.form-control {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fbfdff;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
  outline: none;
}
.mb-3 {
  margin-bottom: 1.25rem;
}
.mb-4 {
  margin-bottom: 1.75rem;
}
input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}
.btn {
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}
.btn-primary {
  background: linear-gradient(135deg, #5b65ff, #2563eb);
  border: none;
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.18);
  color: white;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4c5ae8, #1d4ed8);
}
.btn-outline-secondary {
  border-color: rgba(15, 23, 42, 0.14);
  color: var(--text);
}
.btn-outline-secondary:hover {
  background: rgba(15, 23, 42, 0.04);
}
.btn-outline-danger {
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}
.btn-outline-danger:hover {
  background: rgba(220, 38, 38, 0.08);
}
.btn-outline-success {
  border-color: rgba(22, 163, 74, 0.3);
  color: #16a34a;
}
.btn-outline-success:hover {
  background: rgba(22, 163, 74, 0.08);
}
.btn-outline-primary {
  border-color: rgba(79, 70, 229, 0.3);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background: rgba(79, 70, 229, 0.08);
}
.btn-success {
  background: #16a34a;
  color: white;
}
.btn-success:hover {
  background: #15803d;
}
#dashboardCards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  #dashboardCards {
    grid-template-columns: repeat(3, 1fr);
  }
}
#dashboardCards .col-md-4 {
  display: contents;
}
.stat-card {
  border-radius: 16px;
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  min-height: 120px;
}
.stat-card .d-flex {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start;
  gap: 16px;
}
.table-responsive {
  width: 100%;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  overflow-x: auto;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.08);
}
.table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0 0.85rem;
}
.table thead th,
.table tbody tr td {
  vertical-align: middle !important;
}
.table thead th {
  border: none;
  color: #475569;
  padding: 1.1rem 1rem;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(248, 250, 252, 0.98);
  z-index: 2;
}
.table tbody tr {
  background: #ffffff;
  border-radius: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.table tbody tr td {
  border: none;
  padding: 1rem 1rem;
  vertical-align: middle;
}
.table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12);
}
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.37rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.status-chip.new-enquiry {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}
.status-chip.follow-up-pending {
  background: rgba(249, 115, 22, 0.14);
  color: #c2410c;
}
.status-chip.interested {
  background: rgba(139, 92, 246, 0.14);
  color: #6d28d9;
}
.status-chip.admission-confirmed {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}
.status-chip.not-interested {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}
.empty-state {
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
}
.empty-state i {
  font-size: 2.3rem;
  margin-bottom: 0.85rem;
}
@media (max-width: 991px) {
  .table-responsive {
    overflow-x: auto;
  }
}
@media (max-width: 767px) {
  header.app-header {
    margin: 0.75rem;
    border-radius: 22px;
  }
  main.container {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 1.5rem;
  }
  .card-body {
    padding: 1.25rem;
  }
  .stat-card {
    min-height: 150px;
  }
  #dashboardCards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Dark mode strict overrides to ensure no white surfaces remain */
body.dark-mode {
  background: #0f172a !important;
  color: #ffffff !important;
}
body.dark-mode, body.dark-mode .card, body.dark-mode .card-body, body.dark-mode .card-footer, body.dark-mode .table-responsive, body.dark-mode .table {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #ffffff !important;
}
body.dark-mode .text-muted {
  color: #cbd5e1 !important;
}
body.dark-mode .table-responsive {
  background: #0f172a !important;
  box-shadow: none !important;
}
body.dark-mode .table thead th {
  background: transparent !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}
/* Dark mode table body and rows specifically */
body.dark-mode .table {
  background: transparent !important;
  color: #ffffff !important;
}
body.dark-mode .table tbody {
  background: #0f172a !important; /* table body background */
}
body.dark-mode .table tbody tr {
  background: #1e293b !important; /* row background */
  color: #ffffff !important;
  border-bottom: 1px solid #334155 !important;
}
body.dark-mode .table tbody tr td,
body.dark-mode .table tbody tr th {
  background: transparent !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}
/* Ensure empty state row uses dark backgrounds */
body.dark-mode .table tbody tr.empty-state td {
  background: #0f172a !important;
  color: #cbd5e1 !important;
}
/* Status chip and actions cells */
body.dark-mode .table tbody td .status-chip {
  background: transparent !important;
  color: #ffffff !important;
}
body.dark-mode .table tbody td.actions-col,
body.dark-mode th.actions-col {
  background: transparent !important;
  color: #ffffff !important;
}

/* Strict: apply dark theme to all enquiry grid/table elements */
body.dark-mode table,
body.dark-mode tbody,
body.dark-mode tbody tr,
body.dark-mode td,
body.dark-mode .table,
body.dark-mode .table-responsive,
body.dark-mode .enquiry-table,
body.dark-mode .table-container {
  background: #1e293b !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

/* Ensure table cells and headers inherit dark backgrounds */
body.dark-mode .table thead th,
body.dark-mode .table tbody td,
body.dark-mode .table tbody th {
  background: #1e293b !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

/* Force even/odd rows to the same dark background so Bootstrap can't override */
body.dark-mode tbody tr:nth-child(even),
body.dark-mode tbody tr:nth-child(odd) {
  background: #1e293b !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

/* Make sure any table striping from Bootstrap is neutralized */
body.dark-mode .table-striped tbody tr.table-active,
body.dark-mode .table-striped tbody tr > td,
body.dark-mode .table-striped tbody tr > th {
  background: #1e293b !important;
}

/* Footer styles */
.app-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: #475569;
  background: transparent;
}
.app-footer small { font-size: 0.85rem; }

/* Dark mode footer */
body.dark-mode .app-footer {
  border-top: 1px solid #334155 !important;
  color: #cbd5e1 !important;
}
body.dark-mode .app-footer strong { color: #ffffff !important; }
body.dark-mode .form-control, body.dark-mode .form-select, body.dark-mode textarea {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #ffffff !important;
}
body.dark-mode .form-control::placeholder, body.dark-mode textarea::placeholder {
  color: #cbd5e1 !important;
}
body.dark-mode .status-chip {
  color: #ffffff !important;
}
/* Ensure header and footer areas use dark background */
body.dark-mode header.app-header {
  background: #0f172a !important;
  border-color: #334155 !important;
  box-shadow: none !important;
}

/* Removed custom layout overrides to let Bootstrap grid control column layout */
/* left-panel / right-panel and forced flex removed to prevent stacking on desktop */

/* Table responsiveness and column sizing */
.table { width: 100% !important; table-layout: fixed; }
.table thead th { white-space: nowrap; }
.table tbody td { overflow: hidden; text-overflow: ellipsis; }
.actions-col, th.actions-col { min-width: 180px; width: 180px; }

/* Inline status edit area */
.status-edit { display: none; gap:0.5rem; align-items:center; }
.status-edit.show { display: inline-flex !important; }

/* Reduce excess paddings */
.card-body { padding: 1rem !important; }
.card { border-radius: 14px; }

/* Prevent extra horizontal scroll */
.table-responsive { overflow-x: auto; }
