/* ============================================
   SRCOE TP Portal - Modern UI Framework
   ============================================ */

/* CSS Custom Properties */
:root {
  --primary: #15803d;
  --primary-light: #22c55e;
  --primary-dark: #166534;
  --primary-50: rgba(21, 128, 61, 0.08);
  --primary-100: rgba(21, 128, 61, 0.15);

  --accent: #f59e0b;
  --accent-light: #fbbf24;

  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #f1f5f9;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Dark Mode
   ============================================ */
body.dark-mode {
  --surface: #1e293b;
  --surface-soft: #0f172a;
  --surface-muted: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
}

body.dark-mode .main-header.navbar {
  background: #1e293b !important;
  border-color: #334155 !important;
}

body.dark-mode .card, body.dark-mode .card-table, body.dark-mode .search-card,
body.dark-mode .modern-card, body.dark-mode .small-box, body.dark-mode .stat-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .table-dark, body.dark-mode thead.table-dark {
  background: #0f172a !important;
}

body.dark-mode .content-wrapper {
  background: #0f172a !important;
}

body.dark-mode .dropdown-menu {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .dropdown-item { color: #e2e8f0; }
body.dark-mode .dropdown-item:hover { background: #334155 !important; }

.dark-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: var(--transition);
}
.dark-toggle:hover { background: rgba(255,255,255,0.25); }

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed; top: 80px; right: 20px; z-index: 99999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 300px; max-width: 420px; padding: 14px 18px;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px;
  font-size: 0.88rem; font-weight: 500;
  pointer-events: auto; cursor: pointer;
  animation: toastSlideIn 0.35s ease-out;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}
.toast.removing { animation: toastSlideOut 0.3s ease-in forwards; }

.toast-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.toast-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.toast-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.toast-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.toast .toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast .toast-msg { flex: 1; }
.toast .toast-close { background: none; border: none; color: inherit; opacity: 0.5; cursor: pointer; font-size: 1rem; padding: 0 4px; }
.toast .toast-close:hover { opacity: 1; }

.toast .toast-progress {
  position: absolute; bottom: 0; left: 0; height: 3px; border-radius: 0 0 var(--radius) var(--radius);
  transition: width linear;
}
.toast-success .toast-progress { background: #16a34a; }
.toast-error .toast-progress { background: #dc2626; }
.toast-warning .toast-progress { background: #d97706; }
.toast-info .toast-progress { background: #2563eb; }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-heading { height: 28px; margin-bottom: 12px; width: 50%; }
.skeleton-card { height: 100px; border-radius: var(--radius); margin-bottom: 1rem; }
.skeleton-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.skeleton-row .skeleton-col { flex: 1; height: 60px; border-radius: var(--radius); }

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Counter Animation
   ============================================ */
.counter-animated {
  display: inline-block;
  transition: all 0.3s ease;
}

/* ============================================
   Sort Headers
   ============================================ */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--primary) !important; background: rgba(21,128,61,0.08); }
th.sortable .sort-icon { margin-left: 4px; font-size: 0.65rem; opacity: 0.6; }
th.sorted-asc .sort-icon, th.sorted-desc .sort-icon { opacity: 1; color: var(--primary); }

/* ============================================
   Filter Pills
   ============================================ */
.filter-pill {
  padding: 6px 14px; border: 1px solid #e2e8f0; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; cursor: pointer; background: #fff;
  color: #64748b; transition: all 0.15s; text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.filter-pill:hover { background: #f1f5f9; text-decoration: none; }
.filter-pill.active { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
.filter-pill .cnt { background: rgba(0,0,0,0.1); padding: 1px 7px; border-radius: 10px; font-size: 0.7rem; }
.filter-pill.active .cnt { background: rgba(255,255,255,0.25); }

/* Row colors */
tr.row-paid td { background: #f0fdf4 !important; }
tr.row-pending td { background: #fffbeb !important; }
tr.row-paid:hover td { background: #dcfce7 !important; }
tr.row-pending:hover td { background: #fef3c7 !important; }

/* ============================================
   Bulk Actions Bar
   ============================================ */
.bulk-bar {
  display: none; position: sticky; bottom: 0; background: var(--primary);
  color: white; padding: 10px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 100;
  align-items: center; justify-content: space-between; gap: 1rem;
}
.bulk-bar.show { display: flex; }
.bulk-bar .bulk-count { font-weight: 600; }
.bulk-bar .bulk-actions { display: flex; gap: 8px; }
.bulk-bar .btn { padding: 6px 14px; font-size: 0.8rem; color: white; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); }
.bulk-bar .btn:hover { background: rgba(255,255,255,0.3); }

/* ============================================
   Date Range Picker (lightweight)
   ============================================ */
.date-range-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.date-range-bar select, .date-range-bar input[type="date"] {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.82rem; font-family: var(--font); background: white; color: var(--text);
}

/* ============================================
   Export Bar
   ============================================ */
.export-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.export-bar .label { font-size: 0.78rem; color: var(--text-secondary); font-weight: 600; margin-right: 4px; }

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .main-sidebar, .main-header, .main-footer, .dark-toggle, .export-bar,
  .filter-bar, .search-card, .bulk-bar, .btn, .pagination, .mock-banner,
  .content-wrapper > .content-header, .toast-container { display: none !important; }

  .content-wrapper { padding: 0 !important; margin: 0 !important; }
  .content-wrapper .container-fluid { padding: 0 !important; }

  body { background: white !important; color: black !important; font-size: 11pt; }
  .card-table, .card, .stat-card, .modern-card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }

  .badge-success { background: #d4edda !important; color: #155724 !important; }
  .badge-warning { background: #fff3cd !important; color: #856404 !important; }

  tr.row-paid td, tr.row-pending td { background: transparent !important; }

  table { font-size: 10pt; }
  th { background: #f0f0f0 !important; color: black !important; }
  td, th { padding: 5px 8px !important; }

  a[href]::after { content: none !important; }
}

/* ============================================
   Responsive Table (mobile cards)
   ============================================ */
@media (max-width: 768px) {
  .table-responsive { font-size: 0.82rem; }
  .stat-card { padding: 1rem; }
  .stat-icon { width: 44px; height: 44px; font-size: 1.1rem; }
  .stat-content h3 { font-size: 1.2rem; }
  .filter-bar { gap: 6px; }
  .filter-pill { padding: 4px 10px; font-size: 0.72rem; }
  .export-bar .btn { padding: 4px 8px; font-size: 0.7rem; }
}

/* ============================================
   Student Profile Modal
   ============================================ */
.profile-modal .profile-header {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
}
.profile-modal .profile-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--primary);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; flex-shrink: 0;
}
.profile-modal .profile-info h4 { margin: 0; font-size: 1.1rem; }
.profile-modal .profile-info p { margin: 0; color: var(--text-secondary); font-size: 0.85rem; }
.profile-modal .detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 0.88rem; }
.profile-modal .detail-row:last-child { border-bottom: none; }
.profile-modal .detail-label { color: var(--text-secondary); }
.profile-modal .detail-value { font-weight: 600; }

/* ============================================
   Animations (existing + new)
   ============================================ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.animate-fade-in { animation: fadeIn 0.4s ease-out; }
.animate-slide-in { animation: slideIn 0.3s ease-out; }

/* ============================================
   PUBLIC-FACING: Navbar, Hero, Footer
   ============================================ */

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Navbar */
.modern-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
  position: sticky; top: 0; z-index: 1000;
  box-shadow: var(--shadow-sm);
}
.modern-navbar .container {
  display: flex; align-items: center; justify-content: space-between;
}
.modern-navbar .brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.modern-navbar .brand-logo {
  width: 42px; height: 42px; border-radius: 50%; object-fit: contain;
}
.modern-navbar .brand-text {
  font-size: 1.1rem; font-weight: 800; line-height: 1.2; color: var(--primary-dark);
}
.modern-navbar .brand-text small {
  display: block; font-size: 0.65rem; font-weight: 500; color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.modern-navbar .nav-links {
  display: flex; list-style: none; margin: 0; padding: 0; gap: 4px;
  align-items: center;
}
.modern-navbar .nav-links li a {
  padding: 7px 14px; border-radius: var(--radius-sm); font-size: 0.85rem;
  font-weight: 600; color: var(--text-secondary); text-decoration: none;
  transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px;
}
.modern-navbar .nav-links li a:hover {
  background: var(--primary-50); color: var(--primary);
}
.modern-navbar .nav-links li a.btn-nav {
  background: var(--primary); color: white !important; border-radius: var(--radius);
  padding: 7px 18px;
}
.modern-navbar .nav-links li a.btn-nav:hover { background: var(--primary-dark); }
.modern-navbar .menu-toggle {
  display: none; background: none; border: none; font-size: 1.3rem;
  color: var(--text); cursor: pointer; padding: 8px;
}
@media (max-width: 768px) {
  .modern-navbar .menu-toggle { display: block; }
  .modern-navbar .nav-links {
    display: none; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--surface);
    border-bottom: 1px solid var(--border); padding: 1rem;
    box-shadow: var(--shadow-md); z-index: 999;
  }
  .modern-navbar .nav-links.open { display: flex; }
  .modern-navbar .nav-links li a { padding: 10px 14px; width: 100%; }
}

/* Hero */
.modern-hero {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 50%, #22c55e 100%);
  color: white; padding: 4rem 1.5rem 3rem; text-align: center;
}
.modern-hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 0.8rem; line-height: 1.2; }
.modern-hero p { font-size: 1.05rem; opacity: 0.9; max-width: 600px; margin: 0 auto 1.5rem; }
.modern-hero .hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.modern-hero .btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px;
  border-radius: var(--radius); font-size: 0.95rem; font-weight: 700;
  text-decoration: none; transition: all var(--transition); border: 2px solid transparent;
}
.modern-hero .btn-primary { background: white; color: var(--primary-dark); }
.modern-hero .btn-primary:hover { background: #f0fdf4; transform: translateY(-2px); }
.modern-hero .btn-outline { border-color: rgba(255,255,255,0.5); color: white; background: transparent; }
.modern-hero .btn-outline:hover { border-color: white; background: rgba(255,255,255,0.1); }
@media (max-width: 768px) {
  .modern-hero { padding: 2.5rem 1rem 2rem; }
  .modern-hero h1 { font-size: 1.6rem; }
  .modern-hero p { font-size: 0.9rem; }
}

/* Modern Card */
.modern-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); border: 1px solid var(--border-light);
  padding: 2rem; margin-bottom: 2rem;
}

/* Footer */
.modern-footer {
  background: #0f172a; color: #e2e8f0; padding: 3rem 1.5rem 1.5rem;
}
.modern-footer .footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; align-items: start;
}
.modern-footer .footer-brand { font-weight: 700; font-size: 1.1rem; opacity: 1; color: #ffffff; }
.modern-footer .footer-desc {
  margin: 0.5rem 0 0; font-size: 0.85rem; line-height: 1.6; color: #94a3b8; max-width: 34ch;
}
.modern-footer .footer-links h4 {
  margin: 0 0 0.75rem; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: #ffffff;
}
.modern-footer .footer-links ul { list-style: none; margin: 0; padding: 0; }
.modern-footer .footer-links li { margin-bottom: 0.5rem; }
.modern-footer .footer-links a {
  color: #94a3b8; text-decoration: none; font-size: 0.88rem;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color var(--transition);
}
.modern-footer .footer-links a:hover { color: var(--primary-light); }
.modern-footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; margin-top: 2rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: 0.82rem; opacity: 0.7; color: #e2e8f0;
}
@media (max-width: 768px) {
  .modern-footer { padding: 2rem 1.25rem 1.25rem; }
  .modern-footer .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .modern-footer .footer-bottom { flex-direction: column; text-align: center; }
}

/* Stat cards on public page */
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); text-align: center; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin: 0 auto 0.5rem; }
.stat-icon.teal { background: rgba(21,128,61,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(22,163,74,0.1); color: var(--success); }
.stat-icon.amber { background: rgba(245,158,11,0.1); color: var(--accent); }
.stat-icon.blue { background: rgba(37,99,235,0.1); color: var(--info); }
.stat-content h3 { font-size: 1.6rem; font-weight: 800; color: var(--text); margin: 0; }
.stat-content p { font-size: 0.78rem; color: var(--text-secondary); margin: 0; }

/* Receipt card (public) */
.receipt-card { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; max-width: 500px; margin: 2rem auto; border: 1px solid var(--border); }
.receipt-header { background: var(--primary); color: white; padding: 1.5rem; text-align: center; }
.receipt-body { padding: 1.5rem; }
.receipt-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.receipt-label { color: var(--text-secondary); font-size: 0.85rem; }
.receipt-value { font-weight: 600; font-size: 0.88rem; }

/* Dark mode overrides for public */
body.dark-mode .modern-navbar { background: #1e293b; border-color: #334155; }
body.dark-mode .modern-navbar .brand-text { color: #4ade80; }
body.dark-mode .modern-navbar .brand-text small { color: #94a3b8; }
body.dark-mode .modern-navbar .nav-links li a { color: #cbd5e1; }
body.dark-mode .modern-navbar .nav-links li a:hover { background: #334155; color: #4ade80; }
body.dark-mode .modern-card { background: #1e293b; border-color: #334155; }
body.dark-mode .stat-card { background: #1e293b; border-color: #334155; }
body.dark-mode .stat-content h3 { color: #f1f5f9; }
body.dark-mode .stat-content p { color: #94a3b8; }
body.dark-mode .receipt-card { background: #1e293b; border-color: #334155; }
body.dark-mode .receipt-body { color: #e2e8f0; }
body.dark-mode .receipt-label { color: #94a3b8; }
body.dark-mode .filter-pill { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.dark-mode .filter-pill:hover { background: #334155; }

/* ============================================
   AUTH PAGES: Login, Register, Supervisor Login
   ============================================ */
.auth-wrapper {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 70px); padding: 2rem 1rem;
  background: var(--surface-soft);
}
.auth-card {
  width: 100%; max-width: 440px; background: white;
  border-radius: var(--radius-lg); padding: 2.5rem 2rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
}
.auth-card h2 {
  font-size: 1.5rem; font-weight: 800; color: var(--text);
  text-align: center; margin-bottom: 0.3rem;
}
.auth-card .subtitle {
  text-align: center; color: var(--text-secondary); font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.auth-card .divider {
  height: 1px; background: var(--border); margin: 1.2rem 0;
}
.auth-card .form-group {
  margin-bottom: 1rem;
}
.auth-card .form-group label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 0.3rem;
}
.auth-card .form-group label .required {
  color: var(--danger);
}
.auth-card .form-control {
  width: 100%; padding: 0.65rem 0.85rem; font-size: 0.9rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-soft); color: var(--text);
  transition: border-color var(--transition);
  font-family: var(--font);
}
.auth-card .form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
.auth-card .btn-primary {
  width: 100%; padding: 0.75rem; font-size: 0.95rem; font-weight: 700;
  background: var(--primary); color: white; border: none;
  border-radius: var(--radius); cursor: pointer;
  transition: all var(--transition); display: flex;
  align-items: center; justify-content: center; gap: 8px;
}
.auth-card .btn-primary:hover { background: var(--primary-dark); }
.auth-card .btn-lg { padding: 0.85rem; font-size: 1rem; }
.auth-card .btn-block { display: block; width: 100%; }
.auth-card .alert {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.85rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
}
.auth-card .alert-danger {
  background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
}
.auth-card .alert-success {
  background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
}
.auth-card .text-center { text-align: center; }

/* Dark mode auth */
body.dark-mode .auth-wrapper { background: linear-gradient(135deg, #020617 0%, #1e1b4b 100%); }
body.dark-mode .auth-card { background: #1e293b; border-color: #334155; }
body.dark-mode .auth-card h2 { color: #f1f5f9; }
body.dark-mode .auth-card .form-control {
  background: #0f172a; border-color: #334155; color: #e2e8f0;
}
body.dark-mode .auth-card .form-control:focus {
  border-color: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

/* Wide auth card for registration forms */
.auth-card.auth-card-wide {
  max-width: 720px;
}
.auth-card-wide .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.auth-card-wide .form-row .full-width {
  grid-column: 1 / -1;
}
@media (max-width: 600px) {
  .auth-card.auth-card-wide { max-width: 100%; }
  .auth-card-wide .form-row { grid-template-columns: 1fr; }
}

/* Register page — light background */
.register-page .auth-wrapper,
body:has(.auth-card-wide) .auth-wrapper {
  background: var(--surface-soft);
}

/* ============================================
   ADMIN DASHBOARD LAYOUT
   (super-admin, admin-regular, admin-special index pages)
   ============================================ */

body.dashboard-container {
  margin: 0;
  font-family: var(--font);
  background: var(--surface-muted);
  color: var(--text);
}

/* Sidebar */
body.dashboard-container .sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 240px; z-index: 1040;
  background: linear-gradient(180deg, #14532d 0%, #166534 60%, #15803d 100%);
  color: #e2e8f0;
  display: flex; flex-direction: column;
  padding: 1.25rem 0.9rem;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}
body.dashboard-container .sidebar .sidebar-heading {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.55);
  margin: 1.1rem 0.4rem 0.45rem;
}
body.dashboard-container .sidebar .sidebar-heading:first-child { margin-top: 0.2rem; }
body.dashboard-container .sidebar .nav-link {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.82); text-decoration: none;
  font-size: 0.88rem; font-weight: 600;
  padding: 0.6rem 0.75rem; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
body.dashboard-container .sidebar .nav-link i { width: 20px; text-align: center; font-size: 0.95rem; }
body.dashboard-container .sidebar .nav-link:hover {
  background: rgba(255,255,255,0.12); color: #fff;
}
body.dashboard-container .sidebar .nav-link.active {
  background: rgba(255,255,255,0.18); color: #fff;
  box-shadow: inset 3px 0 0 #fbbf24;
}

/* Main content area */
body.dashboard-container .main-content {
  margin-left: 240px;
  padding: 1.5rem 2rem 3rem;
  min-height: 100vh;
}
@media (max-width: 991.98px) {
  body.dashboard-container .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    box-shadow: none;
  }
  body.dashboard-container .sidebar.open { transform: translateX(0); box-shadow: 6px 0 24px rgba(0,0,0,0.35); }
  body.dashboard-container .main-content { margin-left: 0; padding: 1rem 1rem 2.5rem; }
}

/* Top navbar inside main content */
body.dashboard-container .main-content .navbar {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 0.7rem 1.2rem;
  box-shadow: var(--shadow-sm);
}
body.dashboard-container .main-content .navbar .navbar-brand {
  font-weight: 800; font-size: 1.15rem; color: var(--primary-dark);
  text-decoration: none; letter-spacing: -0.01em;
}
body.dashboard-container .main-content .navbar .navbar-brand span { color: var(--accent); }
body.dashboard-container .main-content .navbar .text-white { color: var(--text-secondary) !important; font-weight: 600; }

/* Cards */
body.dashboard-container .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
body.dashboard-container .card .card-header {
  background: transparent; border-bottom: 1px solid var(--border-light);
  font-weight: 700; font-size: 0.9rem; color: var(--text);
  padding: 0.85rem 1.1rem;
}
body.dashboard-container .card .card-body { padding: 1.1rem; }

/* Dashboard stat cards (icon left, value right) */
body.dashboard-container .stat-card {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: transform var(--transition), box-shadow var(--transition);
}
body.dashboard-container .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
body.dashboard-container .stat-card .stat-icon {
  width: 52px; height: 52px; margin: 0; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; font-size: 1.35rem;
  background: var(--primary-50); color: var(--primary);
}
body.dashboard-container .stat-card .stat-icon.text-success { background: rgba(22,163,74,0.12); color: var(--success); }
body.dashboard-container .stat-card .stat-icon.text-warning { background: rgba(217,119,6,0.12); color: var(--warning); }
body.dashboard-container .stat-card h3 {
  margin: 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}
body.dashboard-container .stat-card .stat-value {
  font-size: 1.45rem; font-weight: 800; color: var(--text); line-height: 1.25;
}

/* Quick stats strip */
body.dashboard-container .quick-stats {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
body.dashboard-container .quick-stat {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
  padding: 4px 10px; border-radius: var(--radius-full);
  background: var(--surface-muted);
}
body.dashboard-container .quick-stat .dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
}
body.dashboard-container .quick-stat .dot.green { background: #16a34a; }
body.dashboard-container .quick-stat .dot.orange { background: #d97706; }
body.dashboard-container .quick-stat .dot.blue { background: #2563eb; }
body.dashboard-container .quick-stat .dot.red { background: #dc2626; }

/* Dark-mode toggle + back-to-top buttons */
.sidebar-toggle {
  display: none; width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-muted); color: var(--text); cursor: pointer; margin-right: 10px;
}
@media (max-width: 991.98px) {
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
}
.dark-mode-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(21,128,61,0.1); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem; cursor: pointer; transition: var(--transition);
}
.dark-mode-toggle:hover { background: rgba(21,128,61,0.2); }
body.dark-mode .dark-mode-toggle { background: rgba(255,255,255,0.1); color: #fbbf24; }

.back-to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 1050;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 1rem;
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); cursor: pointer;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
}
.back-to-top.visible { display: inline-flex; opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); }

/* Dark mode for dashboard layout */
body.dark-mode.dashboard-container { background: #0f172a; }
body.dark-mode.dashboard-container .sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}
body.dark-mode.dashboard-container .main-content .navbar,
body.dark-mode.dashboard-container .card,
body.dark-mode.dashboard-container .stat-card,
body.dark-mode.dashboard-container .quick-stats { background: #1e293b; border-color: #334155; }
body.dark-mode.dashboard-container .card .card-header { color: #e2e8f0; border-color: #334155; }
body.dark-mode.dashboard-container .quick-stat { background: #334155; color: #cbd5e1; }
body.dark-mode.dashboard-container .stat-card h3 { color: #94a3b8; }
body.dark-mode.dashboard-container .stat-card .stat-value { color: #f1f5f9; }
body.dark-mode.dashboard-container .main-content .navbar .navbar-brand { color: #4ade80; }
body.dark-mode.dashboard-container .text-muted { color: #94a3b8 !important; }
body.dark-mode.dashboard-container .text-white { color: #e2e8f0 !important; }

/* Live Recent Registrations */
body.dashboard-container .live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; margin-left: 8px; vertical-align: middle;
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50% { opacity: 0.65; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
body.dashboard-container .table tbody tr.row-new td {
  animation: rowFlash 2.5s ease-out;
}
@keyframes rowFlash {
  0% { background-color: rgba(21, 128, 61, 0.28); }
  100% { background-color: transparent; }
}
body.dark-mode.dashboard-container .table tbody tr.row-new td {
  animation-name: rowFlashDark;
}
@keyframes rowFlashDark {
  0% { background-color: rgba(74, 222, 128, 0.35); }
  100% { background-color: transparent; }
}

/* ============================================
   Button Utility Classes (index page & search results)
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
/* Plain-color declarations come FIRST so browsers that cannot parse
   var() (old Android WebView, Opera Mini) still render filled buttons —
   dropping the var() line leaves these solid instead of transparent. */
.btn-primary { background: #15803d; background: var(--primary, #15803d); color: #fff; }
.btn-primary:hover { background: #166534; }
.btn-success { background: #16a34a; background: var(--success, #16a34a); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: #d97706; background: var(--warning, #d97706); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-danger { background: #dc2626; background: var(--danger, #dc2626); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-info { background: #0ea5e9; background: var(--info, #0ea5e9); color: #fff; }
.btn-info:hover { background: #0284c7; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-xs { padding: 3px 8px; font-size: 0.72rem; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary, #2563eb); color: var(--primary, #2563eb); }
.btn-outline:hover { background: var(--primary, #2563eb); color: #fff; }

/* ============================================
   Search Result & Receipt Cards (index page)
   ============================================ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.receipt-card {
  background: var(--surface, #fff);
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
  margin-top: 1rem;
}
.receipt-header {
  background: #0f172a;
  color: #fff;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.receipt-body {
  padding: 1rem;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border, #f1f5f9);
  font-size: 0.82rem;
}
.receipt-row:last-child { border-bottom: none; }
.receipt-label { color: var(--text-secondary, #64748b); }
.receipt-value { color: var(--text, #0f172a); font-weight: 600; text-align: right; }
