/* ==========================================================================
   KANVAST 2026 — WORKSPACE PORTAL MODULE (USER & ADMIN DASHBOARDS)
   Components: Sidebars, Topbars, KPI Cards, Data Tables, Filter Suite, Full-Reg, QR Scanner
   ========================================================================== */

/* ==========================================
   1. SHARED PORTAL LAYOUTS & SIDEBARS
   ========================================== */
.user-layout-container,
.admin-layout-container {
  display: flex;
  min-height: 100vh;
  background: transparent;
  position: relative;
}

/* Sidebar Backdrop for Mobile */
.user-sidebar-backdrop,
.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 28, 56, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.user-sidebar-backdrop.active,
.admin-sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Sleek Translucent Dark Glass Sidebar */
.user-sidebar,
.admin-sidebar {
  width: 280px;
  background: rgba(5, 22, 48, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1.5px solid rgba(0, 180, 216, 0.25);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  box-shadow: 6px 0 32px rgba(2, 18, 38, 0.45);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.user-sidebar-header,
.admin-sidebar-header {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-sidebar-brand,
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.user-sidebar-logo,
.admin-sidebar-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.user-sidebar-title,
.admin-sidebar-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  display: block;
  line-height: 1.1;
}

.user-sidebar-sub,
.admin-sidebar-sub {
  font-size: 0.75rem;
  font-weight: 700;
  color: #00d2ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

.user-sidebar-close-btn,
.admin-sidebar-close-btn {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.user-sidebar-close-btn:hover,
.admin-sidebar-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  transform: scale(1.05);
}

/* Sidebar User Info Card */
.user-sidebar-profile,
.admin-sidebar-profile {
  margin: 1.25rem 1.25rem 1rem;
  background: linear-gradient(135deg, rgba(0, 119, 182, 0.45) 0%, rgba(3, 37, 76, 0.85) 100%);
  border: 1.5px solid rgba(0, 210, 255, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 8px 24px -4px rgba(0, 180, 216, 0.25);
}

.user-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  color: #ffffff;
  flex-shrink: 0;
}

.user-profile-info {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.user-profile-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.user-profile-school {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.user-status-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.6);
  color: #a7f3d0;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Sidebar Navigation Items */
.user-sidebar-nav,
.admin-sidebar-nav {
  padding: 0 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  padding: 0.5rem 0.75rem 0.25rem;
}

.sidebar-nav-item,
.admin-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.sidebar-nav-item:hover,
.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #00d2ff;
  transform: translateX(4px);
}

.sidebar-nav-item.active,
.admin-nav-item.active {
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(0, 180, 216, 0.4);
}

.sidebar-nav-icon {
  font-size: 1.15rem;
}

.sidebar-nav-pill {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(0, 210, 255, 0.2);
  color: #00d2ff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.sidebar-nav-item.active .sidebar-nav-pill {
  background: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.sidebar-nav-logout {
  color: #f87171;
}

.sidebar-nav-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* ==========================================
   2. TOPBAR & VIEWPORT CONTAINER
   ========================================== */
.user-main-wrapper,
.admin-main-wrapper {
  margin-left: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* When sidebar is collapsed on PC / Desktop */
@media (min-width: 993px) {
  body.sidebar-collapsed .user-sidebar,
  body.sidebar-collapsed .admin-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  body.sidebar-collapsed .user-main-wrapper,
  body.sidebar-collapsed .admin-main-wrapper {
    margin-left: 0;
  }
}

.user-topbar,
.admin-topbar,
.portal-topbar {
  background: rgba(5, 22, 48, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1.5px solid rgba(0, 180, 216, 0.22);
  padding: 1.15rem 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(2, 18, 38, 0.3);
  gap: 1rem;
}

.user-topbar-left,
.admin-topbar-left,
.portal-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.portal-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

/* Sidebar toggle button (Active & Visible on PC, Tablet, & Mobile) */
.user-mobile-toggle,
.portal-sidebar-toggle {
  display: flex !important;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.user-mobile-toggle:hover,
.portal-sidebar-toggle:hover {
  background: rgba(0, 180, 216, 0.25);
  border-color: #00d2ff;
  color: #00d2ff;
  transform: translateY(-1px);
}

.user-topbar-heading h2,
.admin-topbar-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.user-topbar-sub,
.admin-topbar-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

/* Home Button on Header */
.portal-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.portal-header-btn:hover {
  background: rgba(0, 180, 216, 0.2);
  border-color: #00d2ff;
  color: #00d2ff;
  transform: translateY(-1px);
}

/* Profile Avatar Circle Trigger */
.portal-profile-dropdown-wrapper {
  position: relative;
}

.portal-avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
  border: 2px solid rgba(0, 210, 255, 0.6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.portal-avatar-btn:hover,
.portal-avatar-btn[aria-expanded="true"] {
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.6);
  border-color: #00d2ff;
}

.admin-avatar-btn {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.admin-avatar-btn:hover,
.admin-avatar-btn[aria-expanded="true"] {
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.portal-avatar-initials {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}

/* Floating Profile Detail Dropdown Card */
.portal-profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  max-width: calc(100vw - 1.5rem);
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -4px rgba(2, 18, 38, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.9);
  padding: 1.15rem;
  z-index: 100;
  display: none;
  animation: fadeInSmooth 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portal-profile-dropdown.open {
  display: block;
}

.dropdown-profile-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.85rem;
}

.dropdown-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid #e0f2fe;
}

.dropdown-user-meta {
  min-width: 0;
  flex: 1;
}

.dropdown-user-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-school {
  font-size: 0.78rem;
  color: #64748b;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.dropdown-user-email {
  font-size: 0.75rem;
  color: #94a3b8;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0.5rem 0;
}

.dropdown-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: #0077b6;
}

.dropdown-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.25rem;
}

.dropdown-logout-btn:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.user-content-area,
.admin-content-area {
  padding: 2.5rem 3.5rem;
  max-width: 1350px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.user-profile-banner {
  background: linear-gradient(135deg, #03254c 0%, #0077b6 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.user-nav-tabs {
  display: flex;
  gap: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.user-nav-tab {
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #64748b;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.user-nav-tab:hover {
  color: #0077b6;
  background: #f1f5f9;
}

.user-nav-tab.active {
  color: #ffffff;
  background: #0077b6;
}

.user-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
}

.user-tab-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(2, 18, 38, 0.5);
}

.user-tab-desc {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.6;
}

/* ==========================================
   3. USER PROFILE & LEVEL SELECTOR
   ========================================== */
.user-profile-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.user-profile-summary-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: 0 16px 40px -6px rgba(2, 18, 38, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-profile-summary-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 50px -6px rgba(0, 119, 182, 0.3);
}

.user-profile-form-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.25rem;
  box-shadow: 0 16px 40px -6px rgba(2, 18, 38, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
}

.user-profile-big-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #03254c 0%, #0077b6 100%);
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 20px -4px rgba(0, 119, 182, 0.35);
}

.user-profile-display-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 0.35rem;
}

.user-profile-display-school {
  font-size: 0.92rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.profile-info-list {
  width: 100%;
  border-top: 1px solid #f1f5f9;
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.profile-info-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.profile-info-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-info-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.user-level-selector-box {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  padding: 1.5rem 2rem;
  box-shadow: 0 16px 36px -6px rgba(2, 18, 38, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.85);
  margin-bottom: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.level-selector-label {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-navy);
}

.user-level-btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.user-level-tab-btn, .user-level-btn {
  padding: 0.65rem 1.35rem;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-full);
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(6, 28, 56, 0.05);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
}

.user-level-tab-btn:hover, .user-level-btn:hover {
  border-color: #00d2ff;
  color: #0077b6;
  background: #f0f9ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 119, 182, 0.2);
}

.user-level-tab-btn.active, .user-level-btn.active {
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(0, 119, 182, 0.35);
  transform: translateY(-2px);
}

.btn-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.95);
  color: #03254c;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px -4px rgba(2, 18, 38, 0.3), 0 0 0 1px rgba(0, 119, 182, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-back-pill:hover {
  background: #ffffff;
  color: #0077b6;
  transform: translateX(-4px);
  box-shadow: 0 12px 28px -4px rgba(0, 119, 182, 0.4);
  border-color: #00b4d8;
}

.btn-back-pill .btn-back-icon {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.2s ease;
}

.btn-back-pill:hover .btn-back-icon {
  transform: translateX(-3px);
}

/* ==========================================
   4. FULL-PAGE REGISTRATION VIEW
   ========================================== */
.full-reg-container {
  max-width: 960px;
  margin: 0 auto;
}

.full-reg-comp-banner {
  background: linear-gradient(135deg, #041b36 0%, #0077b6 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.5rem;
  box-shadow: 0 16px 36px -6px rgba(0, 119, 182, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.full-reg-comp-banner::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.full-reg-comp-left {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex: 1;
  min-width: 280px;
  position: relative;
  z-index: 2;
}

.full-reg-comp-img {
  width: 95px;
  height: 95px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.full-reg-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
  line-height: 1.2;
}

.full-reg-tagline {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 0.6rem 0;
  line-height: 1.45;
}

.full-reg-meta-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.full-reg-comp-right {
  text-align: right;
  position: relative;
  z-index: 2;
}

.full-reg-fee-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: rgba(255, 255, 255, 0.8);
  display: block;
  margin-bottom: 0.25rem;
}

.full-reg-fee-val {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: #ffb703;
  line-height: 1;
}

.profile-card-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.profile-card-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #03254c;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.profile-card-subtitle {
  font-size: 0.95rem;
  color: #334155;
  font-weight: 500;
  line-height: 1.6;
}

/* ==========================================
   SUBJECT / MAPEL INTERACTIVE CARD SELECTOR
   ========================================== */
.subject-selection-container {
  background: #f8fafc;
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  border: 1.5px solid #e2e8f0;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(2, 18, 38, 0.03);
}

.subject-selection-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.subject-selection-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #03254c;
  margin-bottom: 0.35rem;
}

.subject-selection-badge .subject-badge-icon {
  font-size: 1.5rem;
  color: #00b4d8;
}

.subject-selection-sub {
  font-size: 0.92rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.subject-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.15rem;
}

.subject-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-xl);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 4px 12px rgba(2, 18, 38, 0.04);
}

.subject-card:hover {
  transform: translateY(-3px);
  border-color: #38bdf8;
  box-shadow: 0 10px 24px rgba(0, 119, 182, 0.18);
}

.subject-card.selected {
  border-color: #00b4d8;
  background: #f0f9ff;
  box-shadow: 0 8px 24px rgba(0, 180, 216, 0.28), 0 0 0 1px #00b4d8;
  transform: translateY(-2px);
}

.subject-card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: #00b4d8;
  color: #ffffff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 180, 216, 0.4);
}

.subject-card.selected .subject-card-check {
  display: flex;
}

.subject-selection-live-status {
  margin-top: 1.25rem;
  background: #ffffff;
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  color: #034460;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 180, 216, 0.08);
}

.subject-selection-live-status strong {
  color: #0077b6;
  font-weight: 800;
  font-size: 1.05rem;
}

.btn-cancel-ticket {
  border: 1.5px solid #ef4444;
  color: #dc2626;
  background: #fff;
  transition: all 0.2s ease;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.btn-cancel-ticket:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.subject-card-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease;
}

.subject-card:hover .subject-card-icon-wrap {
  transform: scale(1.1);
}

.subject-card-name {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.subject-card.selected .subject-card-name {
  color: #0077b6;
}

@media (max-width: 576px) {
  .subject-selection-container {
    padding: 1.25rem 0.85rem;
  }
  .subject-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .subject-card {
    padding: 1.15rem 0.65rem;
    border-radius: var(--radius-lg);
  }
  .subject-card-icon-wrap {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
  }
  .subject-card-name {
    font-size: 0.88rem;
  }
}

.full-reg-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
}

.full-reg-actions-row .btn-cancel-reg {
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.full-reg-actions-row .btn-submit-reg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  white-space: normal;
  text-align: center;
  box-shadow: 0 8px 24px -4px rgba(0, 119, 182, 0.4);
}

.btn-arrow-icon {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.full-reg-actions-row .btn-submit-reg:hover .btn-arrow-icon {
  transform: translateX(4px);
}

/* ==========================================
   5. ADMIN DASHBOARD & KPI STATS
   ========================================== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon-blue { background: #dbeafe; color: #0369a1; }
.stat-icon-yellow { background: #fef3c7; color: #92400e; }
.stat-icon-green { background: #dcfce7; color: #166534; }
.stat-icon-purple { background: #f3e8ff; color: #7e22ce; }

.stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

/* Admin Card & Table */
.admin-glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  padding: 2.25rem 2rem;
  box-shadow: 0 16px 40px -6px rgba(2, 18, 38, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
}

.admin-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1.5px solid #e2e8f0;
}

.admin-section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #061c38;
  margin: 0;
}

.admin-section-desc {
  font-size: 0.88rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.table-container,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid #e2e8f0;
  margin-top: 1rem;
}

.table,
.admin-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th,
.admin-table th {
  background: #f8fafc;
  padding: 0.9rem 1.15rem;
  font-weight: 800;
  color: #334155;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.table td,
.admin-table td {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.table tr:hover,
.admin-table tr:hover {
  background: #f8fafc;
}

.admin-verif-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
}

/* ==========================================
   6. ADMIN FILTER & SEARCH SUITE
   ========================================== */
.admin-filter-panel {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 16px -2px rgba(6, 28, 56, 0.04);
}

.admin-filter-grid {
  display: grid;
  grid-template-columns: 2fr 1.3fr 1.3fr auto;
  gap: 1.25rem;
  align-items: flex-end;
}

@media (max-width: 1024px) {
  .admin-filter-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .admin-filter-grid { grid-template-columns: 1fr; }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #034078;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.filter-search-icon {
  position: absolute;
  left: 0.9rem;
  font-size: 1rem;
  color: #94a3b8;
  pointer-events: none;
}

.filter-search-input {
  padding-left: 2.5rem !important;
  padding-right: 2.25rem !important;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1.5px solid #cbd5e1;
  font-size: 0.9rem;
  transition: all var(--trans-fast);
  width: 100%;
}

.filter-search-input:focus {
  border-color: #0077b6;
  box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.15);
}

.filter-clear-btn {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.9rem;
  display: none;
}

.filter-select {
  height: 44px;
  border-radius: var(--radius-md);
  border: 1.5px solid #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  background-color: #ffffff;
  padding: 0 1rem;
  cursor: pointer;
  transition: all var(--trans-fast);
  width: 100%;
}

.filter-select:focus {
  border-color: #0077b6;
  box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.15);
}

.btn-filter-reset {
  height: 44px;
  padding: 0 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-filter-chips {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed #e2e8f0;
  flex-wrap: wrap;
}

.filter-chip-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  margin-right: 0.25rem;
}

.filter-chip {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.filter-chip.active {
  background: #03254c;
  color: #ffffff;
  border-color: #03254c;
  box-shadow: 0 2px 8px rgba(3, 37, 76, 0.25);
}

.filter-chip.chip-waiting.active {
  background: #b37d3e;
  border-color: #b37d3e;
}

.filter-chip.chip-paid.active {
  background: #047857;
  border-color: #047857;
}

.filter-chip.chip-unpaid.active {
  background: #dc2626;
  border-color: #dc2626;
}

.chip-counter {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
}

.filter-chip:not(.active) .chip-counter {
  background: #e2e8f0;
  color: #0f172a;
}

/* ==========================================
   7. LIVE CAMERA SCANNER & LASER OVERLAY
   ========================================== */
.scanner-viewport-wrap,
.scanner-viewport-box,
.scanner-active-overlay {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #021226;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-overlay-box,
.scanner-target {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 2.5px solid #00d2ff;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 4000px rgba(2, 18, 38, 0.55);
  pointer-events: none;
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background: #00d2ff;
  box-shadow: 0 0 12px #00d2ff, 0 0 20px #00d2ff;
  animation: laserScan 2s ease-in-out infinite;
}

@keyframes laserScan {
  0% { top: 0%; opacity: 0.8; }
  50% { top: 100%; opacity: 1; }
  100% { top: 0%; opacity: 0.8; }
}

.scan-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.scan-status-badge.active { background: #dcfce7; color: #15803d; border: 1px solid #a7f3d0; }
.scan-status-badge.paused { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }

.scan-result-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-top: 1.25rem;
  display: none;
}

.scan-result-success { background: #ecfdf5; border: 2px solid #10b981; color: #065f46; }
.scan-result-loading { background: #f0f9ff; border: 2px solid #38bdf8; }

.scan-countdown-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.85rem;
}

.scan-countdown-bar {
  height: 100%;
  background: #10b981;
  width: 100%;
  border-radius: 999px;
  animation: countdownShrink 3s linear forwards;
}

.scan-countdown-bar-warning {
  background: #f59e0b;
  animation-duration: 5s;
}

@keyframes countdownShrink {
  from { width: 100%; }
  to { width: 0%; }
}

.scanner-canvas-hidden { display: none; }
.camera-controls { display: flex; justify-content: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* ==========================================
   USER & ADMIN RESPONSIVE OVERRIDES (MOBILE & TABLET)
   ========================================== */
@media (max-width: 992px) {
  .user-sidebar, .admin-sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 40px rgba(2, 18, 38, 0.6);
  }
  .user-sidebar.open, .admin-sidebar.open {
    transform: translateX(0);
  }
  .user-sidebar-close-btn, .admin-sidebar-close-btn { display: flex; }
  .user-mobile-toggle, .portal-sidebar-toggle { display: flex !important; }
  .user-main-wrapper, .admin-main-wrapper { margin-left: 0 !important; }
  .user-content-area, .admin-content-area { padding: 1.5rem 1rem; }
  .user-profile-layout { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 768px) {
  .portal-topbar,
  .user-topbar,
  .admin-topbar {
    padding: 0.65rem 0.85rem;
    gap: 0.5rem;
  }

  .portal-topbar-left,
  .user-topbar-left,
  .admin-topbar-left {
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
  }

  .user-topbar-heading h2,
  .admin-topbar-heading,
  #admin-topbar-title {
    font-size: 1rem !important;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
  }

  .user-topbar-sub,
  .admin-topbar-sub,
  #admin-topbar-sub {
    display: none !important;
  }

  .portal-topbar-right {
    gap: 0.45rem;
  }

  .portal-header-btn-text,
  .topbar-btn-text {
    display: none !important;
  }

  .portal-header-btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
  }

  .portal-avatar-btn {
    width: 38px;
    height: 38px;
  }

  .user-mobile-toggle,
  .portal-sidebar-toggle {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  /* Admin Content Card & Controls */
  .admin-content-area,
  .user-content-area {
    padding: 1rem 0.65rem;
  }

  .admin-glass-card {
    padding: 1.25rem 0.85rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
  }

  .admin-section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .admin-section-head .btn,
  .admin-section-head a,
  .admin-section-head > div:last-child {
    width: 100%;
    justify-content: center;
  }

  .admin-section-head .btn-primary {
    height: 46px;
    font-size: 0.95rem;
    font-weight: 700;
  }

  .admin-filter-panel {
    padding: 1rem 0.85rem;
  }

  .admin-filter-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }

  .admin-filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
  }

  .filter-chip {
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
  }

  /* Admin Verification Grid */
  .admin-verif-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }

  /* Full Registration Banner on Mobile */
  .full-reg-comp-banner {
    padding: 1.35rem 1.15rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.25rem !important;
    border-radius: var(--radius-lg) !important;
  }

  .full-reg-comp-left {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .full-reg-comp-img {
    width: 65px !important;
    height: 65px !important;
  }

  .full-reg-title {
    font-size: 1.3rem !important;
    line-height: 1.25 !important;
  }

  .full-reg-tagline {
    font-size: 0.88rem !important;
  }

  .full-reg-comp-right {
    width: 100% !important;
    text-align: left !important;
    padding-top: 0.85rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .full-reg-fee-val {
    font-size: 1.45rem !important;
  }

  /* Registration Form Card on Mobile */
  .user-profile-form-card {
    padding: 1.5rem 1.15rem !important;
    border-radius: var(--radius-lg) !important;
    margin-top: 1.25rem !important;
  }

  .profile-card-header {
    margin-bottom: 1.25rem !important;
    padding-bottom: 0.85rem !important;
  }

  .profile-card-title {
    font-size: 1.25rem !important;
  }

  .profile-card-subtitle {
    font-size: 0.88rem !important;
  }

  /* Full Registration Action Buttons (Stacked, 100% Width, Zero Overflow on Mobile) */
  .full-reg-actions-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
    margin-top: 1.5rem !important;
    padding-top: 1.25rem !important;
  }

  .full-reg-actions-row .btn-submit-reg {
    width: 100% !important;
    font-size: 0.92rem !important;
    padding: 0.9rem 1rem !important;
    white-space: normal !important;
    text-align: center !important;
    justify-content: center !important;
    line-height: 1.35 !important;
    box-sizing: border-box !important;
    order: 1 !important;
  }

  .full-reg-actions-row .btn-cancel-reg {
    width: 100% !important;
    font-size: 0.9rem !important;
    padding: 0.75rem 1rem !important;
    text-align: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    order: 2 !important;
  }

  /* Dynamic Team Member Rows on Mobile */
  .team-member-row {
    padding: 0.85rem !important;
  }

  .team-member-row .form-row {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .team-member-row .form-group {
    width: 100% !important;
    margin-bottom: 0.35rem !important;
  }

  /* Level Filter Selector on Mobile */
  .user-level-selector-box {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 1.15rem 1rem !important;
    gap: 0.85rem !important;
  }

  .user-level-btn-group {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }

  .user-level-tab-btn, .user-level-btn {
    width: 100% !important;
    text-align: center !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.88rem !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* Form Row stacking on Mobile */
  .form-row {
    flex-direction: column !important;
    gap: 0.85rem !important;
  }

  .form-row .form-group {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Back Pill Button on Mobile */
  .btn-back-pill {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.88rem !important;
    padding: 0.65rem 1rem !important;
    box-sizing: border-box !important;
  }

  /* Modals on Mobile */
  .modal-box {
    max-height: 94vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 100%;
    transform: translateY(100%);
  }

  .form-control {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
  }
}

@media (max-width: 480px) {
  .user-topbar-heading h2,
  .admin-topbar-heading,
  #admin-topbar-title {
    max-width: 140px;
    font-size: 0.92rem !important;
  }

  .full-reg-actions-row .btn-submit-reg {
    font-size: 0.88rem !important;
    padding: 0.85rem 0.75rem !important;
  }
}

/* ==========================================
   ANALYTICS & BI DASHBOARD ENHANCEMENTS
   ========================================== */

/* Top Utility Action Bar */
.analytics-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--radius-lg, 14px);
  padding: 0.85rem 1.35rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
}

.analytics-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0369a1;
  background: rgba(2, 132, 199, 0.08);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(2, 132, 199, 0.22);
}

.analytics-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.analytics-last-update-text {
  font-size: 0.82rem;
  color: #64748b;
}

.analytics-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* KPI Grid Responsive */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}

.analytics-kpi-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: #ffffff;
  border-radius: var(--radius-lg, 14px);
  padding: 1.25rem 1.15rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
  box-sizing: border-box;
  min-height: 132px;
  min-width: 0;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analytics-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.1);
}

.analytics-kpi-card.kpi-card-blue {
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border-left: 4.5px solid #0284c7;
}

.analytics-kpi-card.kpi-card-green {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-left: 4.5px solid #10b981;
}

.analytics-kpi-card.kpi-card-amber {
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
  border-left: 4.5px solid #f59e0b;
}

.analytics-kpi-card.kpi-card-purple {
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
  border-left: 4.5px solid #8b5cf6;
}

.analytics-kpi-card.kpi-card-slate {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-left: 4.5px solid #0f172a;
}

.analytics-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.analytics-kpi-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-kpi-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.analytics-kpi-value {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.2;
  margin: 0.4rem 0 0.3rem 0;
  font-family: var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.analytics-kpi-sub {
  font-size: 0.78rem;
  line-height: 1.35;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Insights Container */
.analytics-insights-card {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
}

.analytics-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* 2-Column Responsive Charts Grid */
.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.analytics-chart-card {
  margin-bottom: 0 !important;
  padding: 1.5rem;
  min-width: 0; /* Prevents overflow in grid items */
}

.analytics-chart-card-full {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  min-width: 0;
}

/* Chart Canvas Wrappers */
.chart-box-h320 {
  position: relative;
  height: 320px;
  width: 100%;
}

.chart-box-h280 {
  position: relative;
  height: 280px;
  width: 100%;
}

.chart-box-h360 {
  position: relative;
  height: 360px;
  width: 100%;
}

/* Demographics Split Grid & Sub-Panels */
.demographics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.demographic-sub-panel {
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md, 10px);
  padding: 1.15rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.demographic-sub-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.75rem;
  text-align: center;
  width: 100%;
}

.demographic-donut-box {
  position: relative;
  width: 135px;
  height: 135px;
  margin: 0 auto 0.85rem auto;
  flex-shrink: 0;
}

.demographic-stats-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.demographic-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  width: 100%;
  box-sizing: border-box;
}

.stat-dot-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.dot-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-num-pct {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.stat-pct-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================
   RESPONSIVE MEDIA QUERIES FOR ANALYTICS
   ========================================== */
@media (max-width: 1200px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .analytics-charts-grid {
    grid-template-columns: 1fr; /* Stack into 1 column on tablets */
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .analytics-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 1rem;
  }

  .analytics-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .analytics-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .analytics-kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .analytics-insights-grid {
    grid-template-columns: 1fr;
  }

  .demographics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .chart-box-h320 {
    height: 260px;
  }

  .chart-box-h280 {
    height: 240px;
  }

  .chart-box-h360 {
    height: 320px;
  }
}

@media print {
  /* Print Optimization for Executive Reports */
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11pt !important;
  }

  .portal-sidebar,
  .portal-topbar,
  .parallax-bg-layer,
  .sparkles-canvas,
  button,
  .btn,
  .admin-sidebar-nav,
  .admin-nav-item,
  a,
  .analytics-actions,
  .analytics-status-pill {
    display: none !important;
  }

  .admin-main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .admin-content-area {
    padding: 0 !important;
  }

  #tab-analytics {
    display: block !important;
  }

  .admin-tab-section:not(#tab-analytics) {
    display: none !important;
  }

  .admin-glass-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    page-break-inside: avoid;
    margin-bottom: 1.5rem !important;
  }

  .analytics-charts-grid {
    grid-template-columns: 1fr !important;
  }

  canvas {
    max-width: 100% !important;
    height: auto !important;
  }
}


