/* ==========================================================================
   CM-Hub Master Stylesheet (60-30-10 Professional Harmony)
   Base: #f8fafc (60%) | Navy/Crimson: #1e3a8a, #2563eb, #e11d48 (30%) | Accent: #0d9488 (10%)
   Typography: Sarabun across all viewports
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  --font-family-base: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* 60% Dominant Base */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  
  /* 30% Secondary Brand */
  --brand-navy-dark: #1e293b;
  --brand-navy-primary: #1e3a8a;
  --brand-blue: #2563eb;
  --brand-blue-light: #3b82f6;
  --brand-crimson: #e11d48;
  --brand-crimson-hover: #be123c;
  
  /* 10% Accent */
  --accent-teal: #0d9488;
  --accent-teal-light: #14b8a6;
  --accent-gold: #f59e0b;
  
  /* Text & Border */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-base);
  background-color: var(--bg-app);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Navbar Top */
.cm-navbar {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1e293b 100%);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.brand-badge {
  background: linear-gradient(135deg, #e11d48, #be123c);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Layout Workspace */
.app-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.cm-sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  z-index: 1020;
}

.cm-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: 10px;
  margin: 0.2rem 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.cm-sidebar .nav-link i {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.cm-sidebar .nav-link:hover {
  background: #f1f5f9;
  color: var(--brand-navy-primary);
}

.cm-sidebar .nav-link.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.cm-sidebar .nav-link.active i {
  color: #ffffff;
}

/* Main Content Container */
.cm-main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  background-color: var(--bg-app);
}

/* Modern Card */
.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.stat-icon.primary {
  background: #eff6ff;
  color: #2563eb;
}

.stat-icon.success {
  background: #f0fdf4;
  color: #16a34a;
}

.stat-icon.warning {
  background: #fffbeb;
  color: #d97706;
}

.stat-icon.danger {
  background: #fff1f2;
  color: #e11d48;
}

.stat-icon.teal {
  background: #f0fdfa;
  color: #0d9488;
}

/* Glassmorphism Section Card */
.content-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.content-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Pill Badges */
.badge-soft-primary {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.badge-soft-success {
  background: #dcfce7;
  color: #15803d;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.badge-soft-warning {
  background: #fef3c7;
  color: #b45309;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.badge-soft-danger {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.badge-soft-secondary {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Action Buttons */
.btn-action-view {
  background: #3b82f6;
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.btn-action-view:hover {
  background: #2563eb;
  color: #ffffff;
}

.btn-action-reset {
  background: #f59e0b;
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.btn-action-reset:hover {
  background: #d97706;
  color: #ffffff;
}

.btn-action-edit {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.btn-action-edit:hover {
  background: #059669;
  color: #ffffff;
}

/* Loading Modal */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s ease;
}

.loading-overlay.show {
  visibility: visible;
  opacity: 1;
}

.loading-card {
  background: #ffffff;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  text-align: center;
  min-width: 300px;
}

/* DataTables Custom Overrides */
table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
}

table.dataTable thead th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 600 !important;
  border-bottom: 1px solid var(--border-light) !important;
  padding: 0.85rem 1rem !important;
  font-size: 0.9rem;
}

table.dataTable tbody td {
  padding: 0.85rem 1rem !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 0.9rem;
}

table.dataTable tbody tr:hover {
  background-color: #f8fafc !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
}

/* ==========================================================================
   Landing Page & Dual-Channel Auth Card (Modern Wave & Purple Theme)
   ========================================================================== */
.landing-viewport {
  min-height: 100vh;
  background: radial-gradient(circle at 15% 15%, #8b5cf6 0%, #6d28d9 45%, #4f46e5 100%);
  position: relative;
  overflow-x: hidden;
}

.landing-card {
  width: 100%;
  max-width: 960px;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  border: none;
  box-shadow: 0 25px 60px -15px rgba(30, 27, 75, 0.4) !important;
}

.hero-pane {
  background: linear-gradient(155deg, #38bdf8 0%, #0ea5e9 40%, #2563eb 100%);
  position: relative;
  overflow: hidden;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
}

.hero-waves {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 175px;
  pointer-events: none;
  z-index: 1;
}

.brand-logo-pill {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: #ffffff;
}

.hero-welcome-text {
  font-size: 2.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.hero-pill-badge {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 500;
  text-align: center;
  color: #ffffff;
}

.text-cyan-light { color: #a5f3fc !important; }
.text-teal-light { color: #99f6e4 !important; }
.text-rose-light { color: #fecdd3 !important; }

.auth-pane {
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
  background: #ffffff;
}

.auth-heading-purple {
  color: #8b5cf6;
  font-size: 2.1rem;
  letter-spacing: -0.5px;
}

.auth-tabs-wrapper {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.auth-tab-btn {
  border-radius: 999px;
  border: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: #64748b;
  padding: 0.45rem 0.6rem;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: #ffffff !important;
  color: #7c3aed !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.12);
  font-weight: 600;
}

.form-label-clean {
  font-size: 0.84rem;
  font-weight: 600;
  color: #94a3b8;
}

.form-control-clean {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  color: #1e293b;
  background: #ffffff;
  transition: all 0.2s ease;
}

.form-control-clean:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
  background: #ffffff;
}

.btn-clean-eye {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0 8px 8px 0;
  color: #94a3b8;
  padding: 0.65rem 0.85rem;
  transition: all 0.2s;
}

.btn-clean-eye:hover {
  color: #6d28d9;
  background: #f8fafc;
}

.custom-check-purple .form-check-input {
  border-color: #cbd5e1;
}

.custom-check-purple .form-check-input:checked {
  background-color: #8b5cf6;
  border-color: #8b5cf6;
}

.custom-check-purple .form-check-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.btn-login-purple {
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 60%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  transition: all 0.2s ease;
}

.btn-login-purple:hover {
  background: linear-gradient(135deg, #7e22ce 0%, #6d28d9 60%, #4f46e5 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.text-purple {
  color: #7c3aed !important;
}

.text-purple:hover {
  color: #5b21b6 !important;
}

.google-auth-box {
  background: #fbfbfe;
  border-color: #f1f5f9 !important;
}

.google-icon-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  border: 1px solid #f1f5f9;
}

.btn-google-official {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.btn-google-official:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.badge-footer-pill {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.74rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
}

.footer-credit {
  font-size: 0.76rem;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* SweetAlert Modern Clean Styling */
.swal2-popup {
  border-radius: 20px !important;
  font-family: 'Sarabun', sans-serif !important;
  padding: 1.5rem !important;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18) !important;
}
.swal2-title {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
.swal2-html-container {
  font-size: 0.9rem !important;
  color: #475569 !important;
  line-height: 1.5 !important;
}
.swal2-icon {
  margin: 0.75rem auto 0.5rem auto !important;
  transform: scale(0.8);
}
.swal2-actions {
  margin-top: 1rem !important;
}
.swal2-styled.swal2-confirm {
  border-radius: 10px !important;
  padding: 0.5rem 1.5rem !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
}

@media (max-width: 991.98px) {
  .landing-card {
    max-width: 480px;
  }
  .hero-pane {
    border-radius: 24px 24px 0 0;
  }
  .auth-pane {
    border-radius: 0 0 24px 24px;
  }
  .text-nowrap {
    white-space: normal !important;
  }
/* ==========================================================================
   Filter Cards & Segmented Pills (Student Master Redesign)
   ========================================================================== */
.filter-card-year {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.filter-card-year:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.08);
}

.filter-card-year.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.filter-card-year.active .card-icon-bubble {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.filter-card-year.active .card-year-title {
  color: rgba(255, 255, 255, 0.9) !important;
}

.filter-card-year.active .card-year-count {
  color: #ffffff !important;
}

.filter-card-year.active .card-year-sub {
  color: rgba(255, 255, 255, 0.75) !important;
}

.card-icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.card-year-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 2px;
}

.card-year-count {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.card-year-sub {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* Sub-filter Segmented Pills */
.filter-pill-btn {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  transition: all 0.18s ease;
  cursor: pointer;
  user-select: none;
}

.filter-pill-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.filter-pill-btn.active {
  background: #1e3a8a !important;
  border-color: #1e3a8a !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2);
}

.filter-pill-btn.status-active.active {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.filter-pill-btn.status-graduated.active {
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
}

.filter-pill-btn.status-inactive.active {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}
