/* ==================== ROOT & RESET ==================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
  --bg-base: #020817;
  --bg-card: #0f172a;
  --bg-hover: #1e293b;
  --bg-gray: #1e293b;
  --border: #1e293b;
  --border-bright: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --primary: #0ea5e9;
  --accent-emerald: #10b981;
  --accent-red: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-blue: #3b82f6;

  --sidebar-w: 240px;
}

body.light-mode {
  color-scheme: light;
  --bg-base: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-gray: #f1f5f9;
  --border: #e2e8f0;
  --border-bright: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --primary: #1e3a8a;
}

/* Base utility classes for themes */
.card-theme {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.text-theme-primary {
  color: var(--text-primary);
}

.text-theme-secondary {
  color: var(--text-secondary);
}

.text-theme-muted {
  color: var(--text-muted);
}

.border-theme {
  border-color: var(--border);
}

.bg-theme-base {
  background: var(--bg-base);
}

.bg-theme-gray {
  background: var(--bg-gray);
}

/* Table styling for theme */
.table-theme {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  color: var(--text-secondary);
}

.table-theme th {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.table-theme td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

/* Badges */
.badge-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Specific light mode overrides for old code if necessary */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* ==================== LAYOUT ==================== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  z-index: 50;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.sidebar.collapsed {
  width: 60px;
  min-width: 60px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-item span:not(.nav-badge),
.sidebar.collapsed .user-mini-info {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0.6rem;
}

.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 1rem 0.5rem;
}

.sidebar.collapsed .user-mini {
  justify-content: center;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.nav-group {
  margin-bottom: 0.25rem;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 1rem 0.25rem;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  border-radius: 0;
  cursor: pointer;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-gray);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: 12px;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-red);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 0.75rem 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.user-mini:hover {
  background: var(--bg-hover);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.user-mini-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-mini-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ==================== TOPBAR ==================== */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: all 0.15s;
}

.menu-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0.75rem;
  max-width: 480px;
}

.topbar-search svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.topbar-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  padding: 0.4rem 0;
  font-family: inherit;
}

.topbar-search input::placeholder {
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.icon-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dot-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-red);
  border: 1.5px solid var(--bg-card);
}

.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* Topbar user pill */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.topbar-user:hover {
  background: var(--bg-hover);
  border-color: var(--border-bright);
}

.topbar-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

/* Status badge — Open / Closed */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.status-badge.open {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
}

.status-badge.open:hover {
  background: rgba(16, 185, 129, 0.25);
}

.status-badge.closed {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-red);
  border: 1.5px solid rgba(244, 63, 94, 0.3);
}

.status-badge.closed:hover {
  background: rgba(244, 63, 94, 0.2);
}

/* Pulsing dot inside the status badge */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-badge.closed .status-dot {
  animation: none;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.7);
  }
}

/* Theme toggle button active glow */
.theme-toggle {
  transition: all 0.2s;
}

.theme-toggle:hover {
  color: var(--accent-amber) !important;
}

/* Light mode sun icon colour */
body.light-mode .theme-toggle {
  color: var(--accent-amber);
}

/* Language dropdown — custom menu, theme-synced */
.lang-dropdown {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.lang-btn:hover {
  border-color: var(--border-bright);
}

.lang-btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.lang-btn svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.lang-chevron {
  transition: transform 0.15s ease;
}

.lang-dropdown.open .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  padding: 4px;
  display: none;
  z-index: 200;
}

.lang-dropdown.open .lang-menu {
  display: block;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.lang-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.lang-item.active {
  color: var(--text-primary);
  font-weight: 700;
}

.lang-item .tick {
  visibility: hidden;
  color: var(--primary);
  font-weight: 700;
}

.lang-item.active .tick {
  visibility: visible;
}

/* ==================== PAGE CONTENT ==================== */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  background: var(--bg-base);
}

.page-content::-webkit-scrollbar {
  width: 6px;
}

.page-content::-webkit-scrollbar-track {
  background: transparent;
}

.page-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.page {
  display: none;
  animation: fadeIn 0.25s ease;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-emerald);
  color: var(--text-primary);
}

.btn-primary:hover {
  background: #0da271;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-bright);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-emerald);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-link:hover {
  opacity: 0.8;
}

.btn-xs {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11.5px;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-xs:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.btn-sm {
  font-size: 12.5px;
  padding: 0.4rem 0.75rem;
}

.icon-btn-sm {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.icon-btn-sm:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==================== METRICS GRID ==================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  transition: border-color 0.2s, transform 0.2s;
}

.metric-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon svg {
  width: 18px;
  height: 18px;
}

.metric-icon.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.metric-icon.violet {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
}

.metric-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.metric-icon.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.metric-icon.teal {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent-teal);
}

.metric-icon.red {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-red);
}

.metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-change {
  font-size: 11px;
  margin-top: 3px;
}

.metric-change.positive {
  color: var(--accent-emerald);
}

.metric-change.negative {
  color: var(--accent-red);
}

.metric-change.neutral {
  color: var(--text-muted);
}

/* ==================== DASHBOARD GRID ==================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.table-container,
/* visitorAdminUI / messageLogAdminUI / oldStudentAdminUI wrap their tables in
   .table-responsive, which previously had no rule at all. Without it the wide
   (10-11 column) tables had nothing to scroll inside and simply spilled out of
   .card — which is what the owner was seeing as "everything overlapping". */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

.student-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}

.sub-text {
  font-size: 11px;
  color: var(--text-muted);
}

.amount {
  font-weight: 600;
  color: var(--text-primary);
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-align: center;
}

.badge-paid {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.badge-overdue {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-red);
}

.badge-absent {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-red);
}

.badge-present {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}

.method-badge {
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

/* ==================== ATTENDANCE LIST ==================== */
.attendance-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.attendance-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: 8px;
  transition: background 0.15s;
}

.attendance-item:hover {
  background: var(--bg-hover);
}

.att-info {
  flex: 1;
  min-width: 0;
}

.att-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.att-time {
  font-size: 11.5px;
  color: var(--text-muted);
}

.seat-tag {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.seat-tag.ground {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.seat-tag.first {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.seat-tag.second {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
}

/* ==================== ANNOUNCEMENT ==================== */
.announcement-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.ann-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ann-content {
  flex: 1;
}

.ann-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
}

.ann-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==================== TOOLBAR ==================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0.75rem;
  flex: 1;
  max-width: 300px;
}

.search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  padding: 0.45rem 0;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.filter-tabs {
  display: flex;
  gap: 0.25rem;
}

.filter-tab {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.filter-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-tab.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

/* ==================== SEAT MAP ==================== */
.seat-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 3px;
}

.legend-dot.occupied {
  background: var(--accent-violet);
}

.legend-dot.available {
  background: var(--accent-emerald);
}

.legend-dot.maintenance {
  background: var(--accent-amber);
}

.legend-dot.reserved {
  background: var(--accent-blue);
}

.seat-floors {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.floor-card {
  padding: 1.25rem;
}

.floor-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 0.5rem;
}

.seat {
  aspect-ratio: 1;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  border: 1.5px solid transparent;
  letter-spacing: 0.02em;
}

.seat span {
  pointer-events: none;
}

.seat.occupied {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
  border-color: rgba(139, 92, 246, 0.3);
}

.seat.available {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

.seat.maintenance {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.seat.reserved {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.3);
}

.seat:hover {
  transform: scale(1.08);
  filter: brightness(1.2);
}

/* ==================== MEMBERSHIPS ==================== */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
  transition: all 0.2s;
}

.plan-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.plan-card.featured {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.07), var(--bg-card));
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-emerald);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.plan-top {
  margin-bottom: 1rem;
}

.plan-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.plan-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
}

.plan-price span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.plan-features {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.plan-feature {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.plan-feature.muted {
  color: var(--text-muted);
}

.plan-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.plan-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== ADMISSIONS FORM ==================== */
.admission-form-card {
  max-width: 760px;
}

.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s;
}

.step.active .step-circle {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: var(--text-primary);
}

.step-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.step.active .step-label {
  color: var(--accent-emerald);
  font-weight: 600;
}

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 0.5rem;
  min-width: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-emerald);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

/* Placeholders vanish the moment a field is clicked/focused — everywhere. */
input:focus::placeholder,
textarea:focus::placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
*:focus,
*:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.input-field {
  background: var(--bg-base);
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 0.45rem 0.75rem;
  outline: none;
  transition: border-color 0.15s;
}

.input-field:focus {
  border-color: var(--accent-emerald) !important;
  outline: none !important;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ==================== STAFF ==================== */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.staff-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.2s;
}

.staff-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
}

.staff-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 auto 0.75rem;
}

.staff-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.staff-role {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.staff-contact {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ==================== TASKS ==================== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.task-item:last-child {
  border-bottom: none;
}

.task-item:hover {
  background: var(--bg-hover);
  border-radius: 8px;
}

.task-item input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-emerald);
  flex-shrink: 0;
  cursor: pointer;
}

.task-info {
  flex: 1;
}

.task-info.done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.task-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================== DOCUMENTS ==================== */
.docs-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 0.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-item:hover {
  background: var(--bg-hover);
  border-radius: 8px;
}

.doc-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.doc-info {
  flex: 1;
}

.doc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.doc-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================== NOTIFICATIONS ==================== */
.notif-list {
  display: flex;
  flex-direction: column;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  position: relative;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--bg-hover);
  border-radius: 8px;
}

.notif-item.unread {
  background: rgba(16, 185, 129, 0.03);
}

.notif-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.notif-icon.red {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-red);
}

.notif-icon.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.notif-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.notif-icon.violet {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
}

.notif-content {
  flex: 1;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-body {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.dot-unread {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ==================== ANALYTICS ==================== */
.chart-area {
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 160px;
  padding: 0 0.5rem;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: rgba(16, 185, 129, 0.3);
  height: var(--h);
  transition: all 0.3s;
  position: relative;
  min-height: 4px;
}

.bar:hover {
  background: rgba(16, 185, 129, 0.6);
}

.bar.active-bar {
  background: var(--accent-emerald);
}

.bar-label {
  font-size: 11px;
  color: var(--text-muted);
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1.5rem;
  padding-top: 0.5rem;
}

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-box.emerald {
  background: var(--accent-emerald);
}

.plan-dist {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 0.5rem;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dist-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 130px;
  flex-shrink: 0;
}

.dist-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-base);
  border-radius: 999px;
  overflow: hidden;
}

.dist-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s;
}

.dist-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  width: 24px;
  text-align: right;
}

/* ==================== REPORTS ==================== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}

.report-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.report-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
}

.report-icon.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.report-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.report-icon.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.report-icon.violet {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
}

.report-icon.red {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-red);
}

.report-icon.teal {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent-teal);
}

.report-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.report-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* ==================== SETTINGS ==================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 800px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.settings-card {}

.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.settings-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.settings-toggle:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  transition: 0.2s;
}

.toggle input:checked+.slider {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.toggle input:checked+.slider::before {
  transform: translateX(16px);
  background: #fff;
}

/* ==================== GLOBAL SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .page-content {
    padding: 1rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .stepper {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .step-line {
    display: none;
  }
}

/* Seat Map Overrides */
.seat-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 13px;
  font-weight: 500;
  flex-wrap: wrap;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
}

.legend-pill.available {
  color: #166534;
  border-color: #bbf7d0;
}

.legend-pill.occupied {
  color: #991b1b;
  border-color: #fecaca;
}

.legend-pill.reserved {
  color: #92400e;
  border-color: #fde68a;
}

.legend-pill.maintenance {
  color: #1e40af;
  border-color: #bfdbfe;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.floor-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-gray);
  padding: 4px;
  border-radius: 999px;
  display: inline-flex;
}

.floor-tab {
  background: transparent;
  border: none;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.floor-tab.active {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
}

.seat {
  height: 80px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.2s;
  background: var(--bg-card);
}

.seat.available {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.seat.occupied {
  color: #991b1b;
  border-color: #fecaca;
  background: #fef2f2;
}

.seat.reserved {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.seat.maintenance {
  color: #1e40af;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.topbar-search {
  border-radius: 999px !important;
  background: var(--bg-hover) !important;
  border: 1px solid var(--border) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-search:hover {
  border-color: var(--border-bright) !important;
}

.topbar-search:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18) !important;
}

.topbar-search svg {
  color: var(--text-muted) !important;
}

.topbar-search input {
  color: var(--text-primary) !important;
  background: transparent !important;
}

.topbar-search input::placeholder {
  color: var(--text-muted) !important;
}

/* User Dropdown */
.topbar-user {
  position: relative;
  cursor: pointer;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.topbar-user:hover .user-dropdown,
.topbar-user:focus-within .user-dropdown {
  display: flex;
}

.dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.dropdown-item {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Modal Backdrop */
dialog {
  margin: auto !important;
  max-width: min(94vw, 560px) !important;
  box-sizing: border-box !important;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

/* Autofill Dark Mode Fix */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill,
input:-webkit-autofill:hover,
textarea:-webkit-autofill:hover,
select:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill:focus,
select:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill:active,
select:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--bg-base) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ==================== WEBSITE MANAGEMENT MODULE ENHANCEMENTS ==================== */
.website-tab-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.website-tab-bar::-webkit-scrollbar {
  display: none;
}

.website-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.website-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

body.light-mode .website-tab-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.website-tab-btn.active {
  background: var(--bg-card) !important;
  color: var(--primary) !important;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  border-color: var(--border-bright) !important;
}

body.light-mode .website-tab-btn.active {
  background: #ffffff !important;
  color: #1e3a8a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.website-tab-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2px;
  flex-shrink: 0;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.website-tab-btn.active svg {
  stroke: var(--primary);
  transform: scale(1.08);
}

/* Plan Card Styles */
.website-plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.website-plan-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.2);
}

.website-plan-card.featured-card {
  border: 2px solid var(--primary);
  box-shadow: 0 4px 20px -2px rgba(14, 165, 233, 0.15);
}

.website-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-primary);
  margin: 3px;
  transition: background 0.15s ease;
}

.website-pill-tag:hover {
  background: var(--bg-base);
}

.website-sync-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* ==================== FORM CONTROLS & THEME SUPPORT ==================== */
.form-control {
  width: 100% !important;
  display: block;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-hover);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  outline: none;
  box-sizing: border-box;
}

body.light-mode .form-control {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2) !important;
  background-color: var(--bg-card) !important;
}

body.light-mode .form-control:focus {
  border-color: #1e3a8a !important;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12) !important;
  background-color: #ffffff !important;
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

body.light-mode .form-control::placeholder {
  color: #94a3b8;
}

.form-control-sm {
  padding: 0.4rem 0.65rem !important;
  font-size: 12.5px !important;
  border-radius: 6px !important;
}

textarea.form-control {
  min-height: 76px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
}

.btn-secondary:hover {
  background: var(--border-bright);
  color: var(--text-primary);
}

body.light-mode .btn-secondary {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

body.light-mode .btn-secondary:hover {
  background: #e2e8f0;
}

/* Facility & Amenity Cards */
.facility-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.light-mode .facility-card-item {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.facility-card-item:hover {
  border-color: var(--border-bright);
}

body.light-mode .facility-card-item:hover {
  border-color: #cbd5e1;
}

.facility-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .facility-form-grid {
    grid-template-columns: 1fr;
  }
}

.facility-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

body.light-mode .facility-label {
  color: #475569;
}

.photo-preview-box {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg-hover);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

body.light-mode .photo-preview-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.amenity-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.light-mode .amenity-card-item {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.amenity-card-item:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.2);
}

body.light-mode .amenity-card-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ==================== WEBSITE MANAGEMENT MOBILE RESPONSIVENESS ==================== */
#page-website-manager {
  max-width: 100%;
  box-sizing: border-box;
}

.website-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.15rem;
}

.website-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
}

.amenity-inputs-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.plan-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.website-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.website-subpanel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tab-label-short {
  display: none;
}

.tab-label-full {
  display: inline;
}

@media (max-width: 768px) {
  .website-tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding: 4px;
    gap: 4px;
    scrollbar-width: thin;
  }

  .website-tab-btn {
    padding: 7px 12px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .website-header-actions {
    width: 100%;
  }

  .website-header-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .photo-preview-box {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
    gap: 0.75rem;
  }

  .photo-preview-box>div:first-child {
    width: 100% !important;
    height: 150px !important;
  }

  .facility-card-item {
    padding: 1rem;
  }

  .amenity-card-item {
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  .tab-label-full {
    display: none !important;
  }

  .tab-label-short {
    display: inline !important;
  }

  .website-tab-bar {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
    padding: 4px !important;
    overflow-x: visible !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .website-tab-btn {
    padding: 8px 2px !important;
    font-size: 11px !important;
    justify-content: center !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .website-tab-btn svg {
    width: 13px !important;
    height: 13px !important;
  }
}

@media (max-width: 600px) {
  .website-features-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }

  .website-plans-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .amenity-inputs-row {
    grid-template-columns: 1fr !important;
    gap: 0.6rem;
  }

  .plan-fields-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
  }

  .website-subpanel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .website-subpanel-header .btn {
    width: 100%;
    justify-content: center;
  }
}/* STUDENT PORTAL POLISH */
#page-student-portal .metrics-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
#page-student-portal .metric-card { flex-direction: column; align-items: center; text-align: center; padding: 1.5rem 1rem; }
#page-student-portal .metric-card .metric-value { word-break: break-word; }
.student-avatar-ring { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; border: 3px solid var(--primary); background: var(--bg-hover); margin: 0 auto 0.75rem; box-shadow: 0 4px 12px rgba(5,150,105,0.2); flex-shrink: 0; }
.student-avatar-ring img { width: 100%; height: 100%; object-fit: cover; display: block; }
#checkin-seat-modal, #profile-photo-modal, #payment-modal, #pending-payment-modal { border: none; border-radius: 14px; padding: 0; background: var(--bg-card); color: var(--text-primary); box-shadow: 0 20px 50px rgba(0,0,0,0.45); width: min(880px, calc(100vw - 24px)); max-width: min(880px, calc(100vw - 24px)); }
#profile-photo-modal, #payment-modal, #pending-payment-modal { width: min(460px, calc(100vw - 24px)); }
#checkin-seat-modal::backdrop, #profile-photo-modal::backdrop { background: rgba(0,0,0,0.6); }
@media (max-width: 768px) { #page-student-portal .metrics-grid { grid-template-columns: 1fr; } .page-header { flex-direction: column; align-items: stretch; } .page-header .btn { width: 100%; justify-content: center; } }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
/* The old rule here put `display:block` on .data-table, which drops the table
   out of table layout so <thead> no longer lines up with <tbody>. The scroll
   wrapper (.table-container / .table-responsive) already handles overflow, so
   only the card padding is needed at this width. */
@media (max-width: 640px) { .card { padding: 1rem; } .data-table { min-width: 640px; } }

/* ============ FIX: missing theme variables (used across the app) ============ */
:root {
  --danger: #f43f5e;
  --warning: #f59e0b;
  --accent-violet: #8b5cf6;
  --accent-teal: #14b8a6;
}

/* ============ STUDENT PORTAL: theme-aware banners (dark first, light overrides) ============ */
.sp-alert { font-size: 0.85rem; border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; display: flex; align-items: flex-start; gap: 0.75rem; border: 1px solid transparent; line-height: 1.5; }
.sp-alert .sp-alert-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.sp-alert svg { flex-shrink: 0; margin-top: 2px; }
.sp-alert-warn { color: #fcd34d; background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.45); }
.sp-alert-warn .sp-alert-title { color: #fbbf24; }
.sp-alert-info { color: #bae6fd; background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.45); }
.sp-alert-info .sp-alert-title { color: #7dd3fc; }
.sp-alert-ok { color: #a7f3d0; background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.45); }
.sp-alert-ok .sp-alert-title { color: #6ee7b7; }
.sp-alert-bad { color: #fecdd3; background: rgba(244,63,94,0.12); border-color: rgba(244,63,94,0.45); }
.sp-alert-bad .sp-alert-title { color: #fda4af; }
body.light-mode .sp-alert-warn { color: #78350f; background: #fef3c7; border-color: #f59e0b; }
body.light-mode .sp-alert-warn .sp-alert-title { color: #92400e; }
body.light-mode .sp-alert-info { color: #0c4a6e; background: #f0f9ff; border-color: #bae6fd; }
body.light-mode .sp-alert-info .sp-alert-title { color: #0369a1; }
body.light-mode .sp-alert-ok { color: #065f46; background: #f0fdf4; border-color: #6ee7b7; }
body.light-mode .sp-alert-ok .sp-alert-title { color: #15803d; }
body.light-mode .sp-alert-bad { color: #9f1239; background: #fff1f2; border-color: #fda4af; }
body.light-mode .sp-alert-bad .sp-alert-title { color: #be123c; }

/* Student identity card (replaces hardcoded baby-blue box) */
.sp-idcard { border-radius: 12px; padding: 1rem; display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; color: #bae6fd; background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.4); }
.sp-idcard h4 { margin: 0; color: #7dd3fc; font-size: 1.1rem; }
.sp-idcard .sp-idcard-sub { font-size: 0.85rem; color: #7dd3fc; opacity: 0.8; margin-top: 2px; }
body.light-mode .sp-idcard { color: #0c4a6e; background: #f0f9ff; border-color: #bae6fd; }
body.light-mode .sp-idcard h4 { color: #0369a1; }
body.light-mode .sp-idcard .sp-idcard-sub { color: #0c4a6e; }

/* Portal form controls follow the active theme */
.sp-input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border-bright); outline: none; background: var(--bg-card); color: var(--text-primary); }
.sp-input:focus { border-color: var(--accent-emerald); }
.sp-divider { height: 1px; background: var(--border); margin: 12px 0; }

/* Notification icon aliases used by announcement types */
.notif-icon.green { background: rgba(16,185,129,0.15); color: var(--accent-emerald); }
.notif-icon.teal { background: rgba(20,184,166,0.15); color: var(--accent-teal, #14b8a6); }

/* Student notifications page sections */
.sp-notif-section { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin: 1.25rem 0 0.25rem; }
.sp-notif-section:first-child { margin-top: 0; }
.sp-notif-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }

/* ============ FIX: collapsed-sidebar badge + hover tooltips ============ */
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-item .nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  margin: 0;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 9px;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--bg-card);
}
/* Tooltip bubble for icon-only (collapsed) sidebar */
.sidebar.collapsed .nav-item::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.sidebar.collapsed .nav-item:hover::after,
.sidebar.collapsed .nav-item:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}
/* Never show an empty tooltip */
.sidebar.collapsed .nav-item:not([data-tip])::after,
.sidebar.collapsed .nav-item[data-tip=""]::after {
  display: none;
}

/* ============ Modern animated sign-out button (all portals) ============ */
.user-dropdown {
  padding-bottom: 4px;
}
.dropdown-signout {
  margin: 10px 12px 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  box-shadow: 0 4px 14px rgba(244,63,94,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  position: relative;
  overflow: hidden;
  width: calc(100% - 24px);
}
.dropdown-signout:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 8px 22px rgba(244,63,94,0.5);
}
.dropdown-signout:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(244,63,94,0.4);
}
.dropdown-signout svg.so-arrow {
  transition: transform 0.18s ease;
  margin-left: auto;
}
.dropdown-signout:hover svg.so-arrow {
  transform: translateX(4px);
}
.dropdown-signout::after {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
  pointer-events: none;
}
.dropdown-signout:hover::after {
  left: 135%;
}
@keyframes ddIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.topbar-user:hover .user-dropdown,
.topbar-user:focus-within .user-dropdown {
  animation: ddIn 0.18s ease;
}

/* ============ STUDENT PORTAL inner-page layouts (full-width, responsive) ============ */
.sp-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
  min-width: 0;
}
.sp-stack > .card {
  margin-bottom: 0;
}
.sp-cols {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 1rem;
  min-width: 0;
}
.sp-cols > .card {
  margin-bottom: 0;
  min-width: 0;
}
@media (max-width: 900px) {
  .sp-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Renew card: full width + wrapping renew row */
.sp-renew-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  padding: 2rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.sp-renew-flex {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.sp-renew-main {
  flex: 1 1 320px;
  min-width: min(340px, 100%);
}
.sp-qr {
  flex: 0 1 220px;
  min-width: min(220px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  background: var(--bg-hover);
  border-radius: 12px;
  border: 1px dashed var(--border-bright);
  box-sizing: border-box;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .sp-renew-card {
    padding: 1.25rem;
  }
}
/* Self-admission form + summary sidebar stacks on narrow screens */
.sp-admit-wrap {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.sp-admit-form {
  flex: 1 1 420px;
  min-width: 0;
}
.sp-admit-side {
  flex: 0 1 280px;
  min-width: min(280px, 100%);
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (max-width: 900px) {
  .sp-admit-side {
    position: static;
    flex-basis: 100%;
  }
}

/* ============ Compact right-aligned form actions + pay submit button ============ */
.sp-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: stretch;
  flex-wrap: nowrap;
}
.sp-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  padding: 0.7rem 1rem;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .sp-actions {
    flex-wrap: wrap;
  }
  .sp-actions .btn {
    flex-basis: 100%;
  }
}
.sp-pay-submit {
  background: #22c55e;
  border: 1px solid #22c55e;
  color: #fff;
  box-shadow: 0 4px 14px rgba(34,197,94,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.sp-pay-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 8px 22px rgba(34,197,94,0.45);
  background: #16a34a;
}
.sp-pay-submit:active {
  transform: translateY(0) scale(0.98);
}
.sp-pay-submit:disabled {
  opacity: 0.7;
  transform: none;
  cursor: wait;
}

/* ============ FIX: premium themed selects (custom chevron, no OS-native look) ============ */
select.sp-input,
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px 14px;
  padding-right: 2.4rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
body.light-mode select.sp-input,
body.light-mode .form-group select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
select.sp-input:hover,
.form-group select:hover {
  border-color: var(--border-bright);
}
select.sp-input:focus,
.form-group select:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  outline: none;
}
select.sp-input:disabled,
.form-group select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
/* Native option popup follows the active theme */
option,
select.sp-input option,
.form-group select option {
  background-color: var(--bg-card);
  color: var(--text-primary);
}
/* Compact select for table footers / toolbars */
.sp-input.sp-select-sm {
  width: auto;
  padding: 0.32rem 2rem 0.32rem 0.65rem;
  background-position: right 0.5rem center;
  font-size: 12.5px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-secondary);
}
.sp-input.sp-select-sm:hover {
  color: var(--text-primary);
}
