/* ==========================================================================
   ADMIN DASHBOARD & CS SUPPORT CONSOLE STYLES (admin.css)
   Ultra-modern glassmorphic SaaS admin design system with rich dark/light mode contrast.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --admin-sidebar-width: 280px;
  --admin-header-height: 70px;
}

/* Theme Specifications */
html[data-theme="light"],
body[data-theme="light"],
[data-theme="light"] {
  --bg-primary: #f8fafc !important;
  --bg-secondary: #ffffff !important;
  --bg-card: #ffffff !important;
  --bg-card-hover: #f1f5f9 !important;
  --bg-input: #ffffff !important;
  --bg-modal: #ffffff !important;
  
  --text-primary: #0f172a !important;
  --text-secondary: #475569 !important;
  --text-muted: #64748b !important;
  
  --border-color: rgba(120, 40, 240, 0.18) !important;
  --border-card: rgba(120, 40, 240, 0.14) !important;
  --shadow-sm: 0 4px 14px rgba(63, 10, 143, 0.08) !important;
  --shadow-md: 0 12px 36px rgba(63, 10, 143, 0.12) !important;
  --shadow-lg: 0 25px 60px rgba(63, 10, 143, 0.18) !important;
  --glass-bg: rgba(255, 255, 255, 0.95) !important;
  --glass-border: rgba(120, 40, 240, 0.18) !important;
}

html[data-theme="dark"],
body[data-theme="dark"],
[data-theme="dark"] {
  --bg-primary: #0b0f19 !important;
  --bg-secondary: #131b2e !important;
  --bg-card: #151d2f !important;
  --bg-card-hover: #1e293b !important;
  --bg-input: #0b0f19 !important;
  --bg-modal: #151d2f !important;
  
  --text-primary: #f8fafc !important;
  --text-secondary: #94a3b8 !important;
  --text-muted: #64748b !important;
  
  --border-color: rgba(255, 255, 255, 0.12) !important;
  --border-card: rgba(255, 255, 255, 0.08) !important;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.45) !important;
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
  --glass-bg: rgba(21, 29, 47, 0.95) !important;
  --glass-border: rgba(255, 255, 255, 0.12) !important;
}

/* ==========================================================================
   DYNAMIC THEME OVERRIDES (Dark & Light Mode Integration)
   ========================================================================== */

/* Dark Mode Overrides */
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .table-container {
  background: #151d2f !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .data-table th {
  background: #111827 !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .admin-table td,
html[data-theme="dark"] .data-table td {
  background: transparent !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .admin-table tr:hover,
html[data-theme="dark"] .data-table tr:hover {
  background: rgba(120, 40, 240, 0.15) !important;
}

html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .cs-console-wrap,
html[data-theme="dark"] .side-chat-drawer {
  background: #151d2f !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .admin-sidebar,
html[data-theme="dark"] .sidebar-footer,
html[data-theme="dark"] .cs-session-queue,
html[data-theme="dark"] .queue-header {
  background: #131b2e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .admin-topbar {
  background: rgba(19, 27, 46, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .input-admin,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #0b0f19 !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

html[data-theme="dark"] .form-label,
html[data-theme="dark"] .panel-title,
html[data-theme="dark"] .topbar-title-wrap h2,
html[data-theme="dark"] .stat-card h4,
html[data-theme="dark"] strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] .menu-item-btn {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .menu-item-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .menu-item-btn.active {
  background: rgba(120, 40, 240, 0.25) !important;
  color: #c084fc !important;
}

/* Light Mode Overrides */
html[data-theme="light"] .table-responsive,
html[data-theme="light"] .table-container {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .admin-table th,
html[data-theme="light"] .data-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] .admin-table td,
html[data-theme="light"] .data-table td {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #f1f5f9 !important;
}

html[data-theme="light"] .admin-table tr:hover,
html[data-theme="light"] .data-table tr:hover {
  background: #faf5ff !important;
}

html[data-theme="light"] .panel-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .modal-card,
html[data-theme="light"] .cs-console-wrap,
html[data-theme="light"] .side-chat-drawer {
  background: #ffffff !important;
  border-color: rgba(120, 40, 240, 0.14) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .admin-sidebar,
html[data-theme="light"] .sidebar-footer,
html[data-theme="light"] .cs-session-queue,
html[data-theme="light"] .queue-header {
  background: #ffffff !important;
  border-color: rgba(120, 40, 240, 0.14) !important;
}

html[data-theme="light"] .admin-topbar {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(120, 40, 240, 0.14) !important;
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .input-admin,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .form-label,
html[data-theme="light"] .panel-title,
html[data-theme="light"] .topbar-title-wrap h2,
html[data-theme="light"] .stat-card h4,
html[data-theme="light"] strong {
  color: #0f172a !important;
}

html[data-theme="light"] .menu-item-btn {
  color: #475569 !important;
}

html[data-theme="light"] .menu-item-btn:hover {
  background: rgba(120, 40, 240, 0.08) !important;
  color: #7828F0 !important;
}
html[data-theme="light"] .menu-item-btn:hover svg {
  stroke: #7828F0 !important;
}

html[data-theme="light"] .menu-item-btn.active {
  background: linear-gradient(135deg, #7828F0, #3F0A8F) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(120, 40, 240, 0.35) !important;
}
html[data-theme="light"] .menu-item-btn.active span,
html[data-theme="light"] .menu-item-btn.active .menu-icon,
html[data-theme="light"] .menu-item-btn.active svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* Layout Architecture */
.admin-app {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Sidebar Navigation */
.admin-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  height: var(--admin-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  min-width: 0;
  flex: 1;
}
.sidebar-brand img {
  display: block;
  flex-shrink: 1;
  max-height: 36px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}
.sidebar-brand span {
  display: inline-flex;
  align-items: center;
  line-height: 1.25;
}

.brand-badge {
  background: var(--grad-primary);
  color: #ffffff;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.sidebar-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1rem;
}

/* Separated Navigation Sections */
.sidebar-section {
  margin-bottom: 1.75rem;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-primary);
  opacity: 0.85;
  margin: 0 0.5rem 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.menu-item-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.menu-item-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-primary);
}

.menu-item-btn.active {
  background: var(--grad-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.menu-item-btn.active span,
.menu-item-btn.active .menu-icon,
.menu-item-btn.active svg {
  background: transparent !important;
  color: #ffffff !important;
  stroke: #ffffff !important;
  box-shadow: none !important;
}

.menu-item-btn .menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.badge-unread-pill {
  background: var(--accent-pink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  margin-left: auto;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.btn-portal-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.btn-portal-switch:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
}

/* Main Content Area */
.admin-main {
  flex: 1;
  margin-left: var(--admin-sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  height: var(--admin-header-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title-wrap h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cs-operator-selector {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
}

.operator-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-secondary);
}

.operator-select {
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  outline: none;
}

.operator-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.operator-static-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.cs-readonly-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  color: #fbbf24;
  font-size: 0.88rem;
  width: 100%;
  box-sizing: border-box;
  margin-top: auto;
}

/* Tab Views Container */
.admin-content-body {
  padding: 2rem;
  flex: 1;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

.tab-panel {
  display: none !important;
  animation: fadeIn 0.25s ease forwards;
}

.tab-panel.active {
  display: block !important;
}

#tab-cs-archive.active,
#tab-cs-chat.active {
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - 140px);
  box-sizing: border-box;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Widgets */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.icon-bg-purple { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.icon-bg-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-secondary); }
.icon-bg-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.icon-bg-pink { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }

.stat-card h4 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.stat-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

/* Forms & Editor Panels */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group-admin {
  margin-bottom: 1.25rem;
}

.form-group-admin label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.form-group-admin label .hint {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.input-admin {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: var(--transition-fast);
}

.input-admin:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Tables & Lists - Modern Clean Light Theme */
.table-responsive,
.table-container {
  overflow-x: auto;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.admin-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th,
.data-table th {
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
  border-bottom: 1.5px solid #e2e8f0;
  background: #f8fafc;
  white-space: nowrap;
  text-align: center !important;
  vertical-align: middle !important;
}

.admin-table td,
.data-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
  vertical-align: middle;
  color: #1e1b4b;
}

.admin-table tr:last-child td,
.data-table tr:last-child td {
  border-bottom: none;
}

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

.tutor-info-chip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tutor-avatar-sm {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--accent-primary);
}

.action-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-action {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.btn-icon-action:hover {
  background: var(--accent-primary);
  color: #fff;
}

.btn-icon-action.btn-delete:hover {
  background: #ef4444;
}

/* ==========================================
   ADMIN CS LIVE CHAT DESK (Split Screen Console)
   ========================================== */
.cs-console-wrap {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - var(--admin-header-height) - 4rem);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Left Pane: Session Queue */
.cs-session-queue {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.queue-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
}

.queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem;
  background: var(--bg-secondary);
}

.session-card {
  padding: 1rem 1.15rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: var(--glass-bg);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.session-card:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(2px);
}

.session-card.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.08) 100%);
  border: 1.5px solid var(--accent-primary);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.15);
}

@keyframes pulse-buka {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(99, 102, 241, 0.5); }
  50% { transform: scale(1.03); box-shadow: 0 0 18px rgba(236, 72, 153, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 8px rgba(99, 102, 241, 0.5); }
}

.session-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.visitor-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent-emerald);
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-emerald);
}

.session-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.visitor-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.meta-pill-b1 { background: rgba(6, 182, 212, 0.2); color: var(--accent-secondary); }
.meta-pill-topic { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }

.session-preview {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right Pane: Active Conversation Desk */
.cs-conversation-desk {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  position: relative;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.desk-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--glass-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.visitor-header-info h4 {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.visitor-header-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.desk-messages-stream {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.queue-list::-webkit-scrollbar,
.desk-messages-stream::-webkit-scrollbar {
  width: 6px;
}

.queue-list::-webkit-scrollbar-track,
.desk-messages-stream::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.queue-list::-webkit-scrollbar-thumb,
.desk-messages-stream::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.35);
  border-radius: 4px;
}

.queue-list::-webkit-scrollbar-thumb:hover,
.desk-messages-stream::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.chat-bubble {
  max-width: 75%;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.5;
  position: relative;
}

.bubble-user {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
}

.bubble-cs {
  align-self: flex-end;
  background: var(--grad-primary);
  color: #ffffff;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  opacity: 0.85;
}

.cs-initial-badge {
  font-weight: 800;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* Quick Responses Bar */
.quick-responses-bar {
  padding: 0.6rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  flex-shrink: 0;
}

.quick-btn {
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* Reply Input Box */
.reply-input-area {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.reply-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.8rem 1.5rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.reply-input:focus {
  border-color: var(--accent-primary);
}

.btn-send-reply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--grad-emerald);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-send-reply:hover {
  transform: scale(1.06);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .cs-console-wrap {
    grid-template-columns: 1fr;
  }
  .cs-session-queue {
    max-height: 280px;
  }
}

@media (max-width: 768px) {
  :root { --admin-sidebar-width: 0px; }
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.mobile-open { transform: translateX(0); width: 280px; }
  .admin-main { margin-left: 0; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   AUTHENTICATION LOGIN OVERLAY & QUICK DEMO BUTTONS
   ========================================================================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: rgba(8, 10, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.auth-card {
  width: 100%;
  max-width: 450px;
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 30px rgba(99, 102, 241, 0.25);
  animation: authPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authPopIn {
  0% { transform: scale(0.92) translateY(15px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header .logo-icon {
  width: 54px;
  height: 54px;
  font-size: 1.35rem;
  margin: 0 auto 0.85rem;
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.4);
}

.auth-header h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.auth-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quick-login-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-color);
}

.quick-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent-secondary);
  text-transform: uppercase;
  margin-bottom: 0.85rem;
  letter-spacing: 0.5px;
}

.quick-btns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.btn-quick-role {
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-quick-role:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  color: #fff;
}

.btn-quick-admin {
  grid-column: span 2;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
  text-align: center;
  font-weight: 800;
}

.btn-quick-admin:hover {
  background: var(--accent-emerald);
  color: #fff;
}


/* ==========================================================================
   SIDEBAR LOGGED USER CHIP & ROLE BADGES
   ========================================================================== */
.logged-user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.logged-user-chip:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.15);
}

.user-avatar-dot {
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  flex-shrink: 0;
}

.user-chip-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.role-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 700;
  margin-top: 2px;
}


/* ==========================================================================
   CS KNOWLEDGE BASE CARDS (BUKU SAKU CS)
   ========================================================================== */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
}

.kb-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-bounce);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.kb-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}

.kb-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
}

.kb-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.kb-badge-level {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  color: #fff;
  white-space: nowrap;
}

.kb-card-body {
  flex: 1;
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.kb-price-list {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 0.5rem;
}

.price-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.price-item-row span:last-child {
  font-weight: 700;
  color: var(--accent-emerald);
}

.btn-copy-kb {
  margin-top: 1.25rem;
  width: 100%;
  padding: 0.65rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-copy-kb:hover {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-copy-kb.copied {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #10b981 !important;
}

/* Role-based hidden helper */
body[data-user-role="cs"] [data-role="admin"],
body[data-user-role="cs"] [data-role="admin-only"] {
  display: none !important;
}

/* Grid for 3 columns (hero stats editor) */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* Features cards editor grid */
.features-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.feature-edit-card {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.feature-edit-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.feature-edit-card .input-admin {
  margin-bottom: 0.5rem;
}

/* Repeater rows for certificates / education */
.repeater-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.12);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.repeater-row .form-control {
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
}

.repeater-row .btn-remove-row {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.repeater-row .btn-remove-row:hover {
  background: #ef4444;
  color: #fff;
}

/* Page status badges */
.status-published {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(16,185,129,0.18);
  color: #10b981;
}

.status-draft {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(245,158,11,0.18);
  color: #f59e0b;
}

@media (max-width: 768px) {
  .form-grid-3 { grid-template-columns: 1fr; }
  .repeater-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   DAILY SCHEDULE & ADMIN SISWA DASHBOARD STYLES (Matching Reference UI)
   ========================================================================== */

/* Date Navigation Bar */
.daily-date-nav-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 16px);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.date-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.date-nav-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.date-nav-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-hari-ini {
  background: #10b981;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  letter-spacing: 0.5px;
}

.btn-pilih-tanggal {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-pilih-tanggal:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Schedule Status Filter Bar */
.schedule-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.schedule-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-filter-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-filter-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
}

.pill-filter-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

.schedule-counter-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

/* Status Badges Matching Reference Screenshot */
.status-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-badge-item::before {
  content: '•';
  font-size: 1.1rem;
}

.status-selesai {
  background: #f1f5f9;
  color: #475569;
}
.status-berlangsung {
  background: #dbeafe;
  color: #1d4ed8;
}
.status-selanjutnya {
  background: #f3e8ff;
  color: #7e22ce;
}
.status-ditunda {
  background: #fef3c7;
  color: #b45309;
}
.status-dijadwalkan_ulang {
  background: #fee2e2;
  color: #b91c1c;
}

/* Tutor Dot Avatar in Table */
.tutor-avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.tutor-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.tutor-dot-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* RBAC Sidebar Visibility Rules */
body[data-user-role="cs"] #groupGeneralAdmin { display: none !important; }
body[data-user-role="cs"] #groupAdminSiswa { display: none !important; }

/* Custom Non-Generic Calendar Filter Bar */
.archive-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.55rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.archive-custom-datepicker-btn {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 0.42rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.archive-custom-datepicker-btn:hover {
  background: rgba(99, 102, 241, 0.16);
  border-color: var(--accent-primary);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.25);
}

.onyx-calendar-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 999;
  width: 290px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  padding: 1rem;
  animation: fadeIn 0.2s ease forwards;
}

.calendar-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.btn-cal-nav {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cal-nav:hover:not(:disabled) {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-cal-nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* Sub-Tab Navigation inside Tab Panels */
.sub-tab-btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}

.sub-tab-btn.active {
  background: var(--grad-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3) !important;
}

/* Info Icon & Hover Tooltip */
.archive-info-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.archive-info-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: all 0.2s ease;
  user-select: none;
}

.archive-info-icon:hover {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.archive-info-tooltip {
  visibility: hidden;
  opacity: 0;
  width: 270px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  pointer-events: none;
  text-align: left;
}

.archive-info-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent var(--border-card) transparent;
}

.archive-info-wrapper:hover .archive-info-tooltip,
.archive-info-icon:focus + .archive-info-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-day-cell:hover:not(.disabled) {
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent-primary);
}

.cal-day-cell.selected {
  background: var(--grad-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
}

.cal-day-cell.disabled {
  opacity: 0.22;
  cursor: not-allowed;
  color: var(--text-muted);
}

.archive-preset-btn {
  padding: 0.38rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.archive-preset-btn:hover,
.archive-preset-btn.active {
  background: var(--grad-primary) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.35) !important;
}

/* Day Divider in Archive Queue List */
.archive-day-divider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(99, 102, 241, 0.08);
  border-left: 3.5px solid var(--accent-primary);
  border-radius: 4px 10px 10px 4px;
}

.archive-day-divider:first-child {
  margin-top: 0.25rem;
}

.archive-day-divider span {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-primary);
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

/* Comprehensive RBAC Sidebar Visibility Rules */
body[data-user-role="admin_siswa"] [data-role="admin"],
body[data-user-role="admin_siswa"] #groupOverview,
body[data-user-role="admin_siswa"] #groupSystem {
  display: none !important;
}

body[data-user-role="cs"] [data-role="admin"],
body[data-user-role="cs"] [data-role="admin_siswa"],
body[data-user-role="cs"] #groupOverview,
body[data-user-role="cs"] #groupTutors,
body[data-user-role="cs"] #groupAdminSiswa,
body[data-user-role="cs"] #groupSystem {
  display: none !important;
}

/* Custom Themed Purple Dropdowns (Light Mode & Web-Harmonized Rounded) */
select.form-control,
select {
  display: inline-block !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237c3aed'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 1rem 1rem !important;
  color: #1e1b4b !important;
  border: 1.5px solid #d8b4fe !important;
  border-radius: 10px !important;
  padding: 0.42rem 2.2rem 0.42rem 0.85rem !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  width: auto !important;
  max-width: 100% !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 4px rgba(124, 58, 237, 0.08) !important;
}

select.form-control:hover,
select:hover {
  border-color: #7c3aed !important;
  background-color: #faf5ff !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15) !important;
}

select.form-control:focus,
select:focus {
  border-color: #7c3aed !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3.5px rgba(124, 58, 237, 0.18) !important;
  outline: none !important;
}

select.form-control option,
select option {
  background-color: #ffffff !important;
  color: #1e1b4b !important;
  padding: 10px 12px !important;
  font-weight: 600 !important;
}

/* ===== ADMIN SISWA — Premium Stat Cards ===== */
.siswa-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.siswa-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.siswa-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.07;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 50%, currentColor, transparent 70%);
  pointer-events: none;
}

.siswa-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.siswa-stat-blue {
  background: linear-gradient(135deg, rgba(124,58,237,0.12) 0%, rgba(99,102,241,0.08) 100%);
  border-color: rgba(124,58,237,0.25);
  color: #a78bfa;
}

.siswa-stat-emerald {
  background: linear-gradient(135deg, rgba(16,185,129,0.12) 0%, rgba(52,211,153,0.08) 100%);
  border-color: rgba(16,185,129,0.2);
  color: #10b981;
}

.siswa-stat-purple {
  background: linear-gradient(135deg, rgba(139,92,246,0.12) 0%, rgba(168,85,247,0.08) 100%);
  border-color: rgba(139,92,246,0.2);
  color: #8b5cf6;
}

.siswa-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(4px);
}

.siswa-stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.siswa-stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.siswa-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .siswa-stats-row {
    grid-template-columns: 1fr;
  }
}

/* Candidate Student Card Hover Animation & Elevation */
.candidate-student-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.candidate-student-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.08) !important;
}

/* =======================================================
   CENTRALIZED UNIFIED BUTTON STYLES (KELAS, KUPON, VIDEO, LIBUR, AKUN, CHAT)
   ======================================================= */

/* 1. Header Action Add / Create Button (Primary Purple) */
.btn-action-add,
.btn-action-create,
.btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  background: linear-gradient(135deg, #7c3aed, #6366f1) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.86rem !important;
  padding: 0.5rem 1.15rem !important;
  border-radius: 10px !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28) !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.btn-action-add:hover,
.btn-action-create:hover,
.btn-primary:hover {
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4) !important;
  filter: brightness(1.06) !important;
  color: #ffffff !important;
}

/* 2. Unified Standard Table Action Buttons */
.btn-tbl-edit,
.btn-action-edit,
.btn-edit,
.btn-tbl-delete,
.btn-tbl-danger,
.btn-action-delete,
.btn-delete,
.btn-tbl-hapus,
.btn-tbl-manage,
.btn-action-view,
.btn-tbl-detail,
.btn-detail,
.btn-tbl-save,
.btn-action-save,
.btn-save,
.btn-tbl-video,
.btn-tbl-toggle,
.btn-action-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  padding: 0.38rem 0.8rem !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

.btn-tbl-edit svg,
.btn-action-edit svg,
.btn-edit svg,
.btn-tbl-delete svg,
.btn-tbl-danger svg,
.btn-action-delete svg,
.btn-delete svg,
.btn-tbl-hapus svg,
.btn-tbl-manage svg,
.btn-action-view svg,
.btn-tbl-detail svg,
.btn-detail svg,
.btn-tbl-save svg,
.btn-action-save svg,
.btn-save svg,
.btn-tbl-video svg,
.btn-tbl-toggle svg,
.btn-action-toggle svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Edit Button (Indigo / Violet) */
.btn-tbl-edit,
.btn-action-edit,
.btn-edit {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #6366f1 !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
}
.btn-tbl-edit:hover,
.btn-action-edit:hover,
.btn-edit:hover {
  background: rgba(99, 102, 241, 0.22) !important;
  color: #4f46e5 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.2) !important;
}

/* Delete Button (Soft Danger Red) */
.btn-tbl-delete,
.btn-tbl-danger,
.btn-action-delete,
.btn-delete,
.btn-tbl-hapus {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
.btn-tbl-delete:hover,
.btn-tbl-danger:hover,
.btn-action-delete:hover,
.btn-delete:hover,
.btn-tbl-hapus:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #dc2626 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.2) !important;
}

/* Manage / Status / View Button */
.btn-tbl-manage,
.btn-action-view,
.btn-tbl-detail,
.btn-detail {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}
.btn-tbl-manage:hover,
.btn-action-view:hover,
.btn-tbl-detail:hover,
.btn-detail:hover {
  background: var(--bg-card-hover) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08) !important;
}

/* Save / ACC Button */
.btn-tbl-save,
.btn-action-save,
.btn-save {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}
.btn-tbl-save:hover,
.btn-action-save:hover,
.btn-save:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #059669 !important;
  transform: translateY(-1px) !important;
}

/* Video / Zoom Button */
.btn-tbl-video {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #3b82f6 !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
.btn-tbl-video:hover {
  background: rgba(59, 130, 246, 0.22) !important;
  color: #2563eb !important;
  transform: translateY(-1px) !important;
}

/* Toggle Operational Status Switch Button */
.btn-tbl-toggle,
.btn-action-toggle {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}
.btn-tbl-toggle:hover,
.btn-action-toggle:hover {
  background: var(--bg-card-hover) !important;
  transform: translateY(-1px) !important;
}

/* 7. Modal Secondary / Cancel Button & Close Button */
.btn-modal-cancel,
.btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  background: var(--bg-card) !important;
  color: var(--text-secondary) !important;
  border: 1.5px solid var(--border-color) !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  padding: 0.45rem 0.95rem !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
}

.btn-modal-cancel:hover,
.btn-secondary:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
  transform: translateY(-1px) !important;
}

.modal-close-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  background: var(--bg-card) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-color) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
}

/* 8. Modern Dot Pill Badges (Clean & Minimalist, No Emojis) */
.pill-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0.28rem 0.75rem !important;
  border-radius: 20px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

.pill-badge .badge-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.badge-success {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}
.dot-success {
  background: #10b981 !important;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}
.dot-danger {
  background: #ef4444 !important;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
.dot-warning {
  background: #f59e0b !important;
}

.badge-info {
  background: rgba(120, 40, 240, 0.16) !important;
  color: var(--accent-primary) !important;
  border: 1px solid rgba(120, 40, 240, 0.35) !important;
}
.dot-info {
  background: #8b5cf6 !important;
}

.badge-blue {
  background: rgba(59, 130, 246, 0.14) !important;
  color: #3b82f6 !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}
.dot-blue {
  background: #3b82f6 !important;
}

/* 9. Action Start Class (Green Emerald) */
.btn-action-start {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  background: #10b981 !important;
  color: #ffffff !important;
  border: 1.5px solid #059669 !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.25) !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
}

.btn-action-start:hover {
  background: #059669 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35) !important;
}

/* 10. Centralized Subtab Navigation System (Uniform Outer Box & Purple Active Style with Fluid Animation) */
::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.admin-subtab-nav,
.sub-tab-nav {
  display: inline-flex !important;
  align-items: center !important;
  background: var(--bg-card) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: 14px !important;
  padding: 5px !important;
  gap: 5px !important;
  margin-bottom: 1.5rem !important;
  box-shadow: var(--shadow-sm) !important;
  flex-wrap: wrap !important;
  position: relative !important;
}

.admin-subtab-btn,
.sub-tab-btn,
.admin-siswa-subtab,
.class-stage-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 0.5rem 1.15rem !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 9px !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
  transform: translateY(0);
}

.admin-subtab-btn:hover,
.sub-tab-btn:hover,
.admin-siswa-subtab:hover,
.class-stage-pill:hover {
  color: var(--accent-primary) !important;
  background: var(--bg-card-hover) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

.admin-subtab-btn.active,
.sub-tab-btn.active,
.admin-siswa-subtab.active,
.class-stage-pill.active {
  background: linear-gradient(135deg, #7828F0, #3F0A8F) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 10px rgba(120, 40, 240, 0.4) !important;
  transform: translateY(-1px);
}

/* 11. Uniform Action Button Layout & Centered Table Spacing */
.action-btns,
.tbl-action-grid,
.admin-table td:last-child > div,
.data-table td:last-child > div {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  margin: 0 auto !important;
  width: 100% !important;
}

.admin-table th:first-child,
.admin-table td:first-child,
.data-table th:first-child,
.data-table td:first-child {
  padding-left: 1.5rem !important;
}

.admin-table th:last-child,
.admin-table td:last-child,
.data-table th:last-child,
.data-table td:last-child {
  padding-right: 1.5rem !important;
  text-align: center !important;
}

.subtab-badge,
.badge-count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2px 7px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  border-radius: 9999px !important;
  line-height: 1 !important;
  background: rgba(255, 255, 255, 0.15) !important;
  color: inherit !important;
  transition: all 0.18s ease !important;
}

.admin-subtab-btn.active .subtab-badge,
.admin-subtab-btn.active .badge-count,
.sub-tab-btn.active .subtab-badge,
.sub-tab-btn.active .badge-count,
.admin-siswa-subtab.active .subtab-badge,
.admin-siswa-subtab.active .badge-count {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

/* ==========================================
   SECONDARY RIGHT SIDE-DRAWER LIVE CHAT ADMIN SISWA
   ========================================== */
.admin-side-chat-drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: 460px;
  max-width: 95vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -8px 0 35px rgba(0, 0, 0, 0.16);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1.5px solid #e2e8f0;
}

.admin-side-chat-drawer.open {
  right: 0;
}

.side-chat-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1.5px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.btn-side-chat-ctrl {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-side-chat-ctrl:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.side-chat-tab-bar {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.side-chat-tab-btn {
  flex: 1;
  padding: 0.65rem 0.5rem;
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.side-chat-tab-btn.active {
  color: #7c3aed;
  border-bottom-color: #7c3aed;
  background: #fdf4ff;
}

.side-chat-tab-btn.muted {
  color: #94a3b8 !important;
  border-bottom-color: transparent !important;
  background: transparent !important;
  opacity: 0.85;
  pointer-events: none !important;
  cursor: default !important;
}

.badge-mini {
  background: #7c3aed;
  color: #ffffff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.25);
}

.side-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.side-chat-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.side-chat-conv-item {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  transition: all 0.15s ease;
}

.side-chat-conv-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.side-chat-conv-item.active {
  background: #f5f3ff;
  border-color: #c4b5fd;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
}

.side-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Organic Slide Up / Down View */
.side-chat-convo-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  z-index: 20;
  transform: translateY(102%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.side-chat-convo-view.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.side-chat-student-context {
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1.5px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 0.5rem;
}

.side-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f8fafc;
}

/* Date Divider */
.side-chat-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.85rem 0 0.45rem 0;
  position: relative;
  width: 100%;
}

.side-chat-date-divider::before,
.side-chat-date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.side-chat-date-divider span {
  background: #ffffff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  margin: 0 0.65rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  letter-spacing: 0.2px;
}

.side-chat-bubble {
  max-width: 84%;
  padding: 0.65rem 0.95rem;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
}

.side-chat-bubble.student {
  align-self: flex-start;
  background: #ffffff;
  color: #1e1b4b;
  border: 1.5px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.side-chat-bubble.admin {
  align-self: flex-end;
  background: #7c3aed;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.side-chat-time {
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 0.3rem;
  display: block;
  text-align: right;
  opacity: 0.85;
}

.side-chat-bubble.student .side-chat-time {
  color: #64748b;
}

.side-chat-bubble.admin .side-chat-time {
  color: rgba(255, 255, 255, 0.85);
}

.side-chat-quick-bar {
  padding: 0.4rem 0.75rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.side-chat-input-bar {
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.side-chat-input-bar input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.side-chat-input-bar input:focus {
  border-color: #7c3aed;
}

.side-chat-input-bar button {
  background: #7c3aed;
  color: #ffffff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.side-chat-input-bar button:hover {
  background: #6d28d9;
}

/* ==========================================================================
   PROMO CHECKOUT PREVIEW MODAL - HARMONIZED WITH REGISTRATION FORM SPACING
   ========================================================================== */
#modalPromoCheckoutPreview .modal-card-reg {
  max-width: 960px;
  width: 95%;
}

#modalPromoCheckoutPreview .registration-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
}

#modalPromoCheckoutPreview .form-group {
  margin-bottom: 0.9rem;
  min-width: 0;
}

#modalPromoCheckoutPreview .form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  min-width: 0;
  margin-bottom: 0.9rem;
}

#modalPromoCheckoutPreview .form-row .form-group {
  margin-bottom: 0;
}

#modalPromoCheckoutPreview .form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

#modalPromoCheckoutPreview .form-label-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
}

#modalPromoCheckoutPreview .form-control,
#modalPromoCheckoutPreview select.form-control,
#modalPromoCheckoutPreview select {
  width: 100% !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 0.65rem 0.85rem !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  border-radius: var(--radius-md, 12px) !important;
  border: 1px solid var(--border-color) !important;
  background-color: #ffffff !important;
  color: var(--text-primary) !important;
  box-sizing: border-box !important;
  display: block !important;
}

#modalPromoCheckoutPreview select.form-control,
#modalPromoCheckoutPreview select {
  padding-right: 2.2rem !important;
  background-position: right 0.75rem center !important;
  cursor: pointer !important;
}

#modalPromoCheckoutPreview .coupon-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

#modalPromoCheckoutPreview .coupon-input-group input {
  flex: 1;
  min-height: 44px !important;
  height: 44px !important;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

#modalPromoCheckoutPreview .coupon-input-group button {
  height: 44px !important;
  padding: 0 1.25rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  border-radius: var(--radius-md, 12px) !important;
}

#modalPromoCheckoutPreview .order-summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md, 14px);
  padding: 1.1rem;
}

#modalPromoCheckoutPreview .summary-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

#modalPromoCheckoutPreview .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.55rem;
}

#modalPromoCheckoutPreview .selected-plan-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: rgba(120, 40, 240, 0.12);
  border: 1px solid rgba(120, 40, 240, 0.25);
  color: var(--accent-primary);
  font-weight: 700;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.78rem;
  text-align: right;
}

#modalPromoCheckoutPreview .summary-discount {
  color: var(--accent-pink, #e11d48) !important;
  font-weight: 700;
}

#modalPromoCheckoutPreview .summary-coupon {
  color: var(--accent-emerald, #059669) !important;
  font-weight: 700;
}

#modalPromoCheckoutPreview .summary-total {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border-color);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

#modalPromoCheckoutPreview .summary-note {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  #modalPromoCheckoutPreview .registration-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SUB-TAB NAVIGATION FOR PROMO & COUPON SETTINGS
   ========================================================================== */
.sub-tab-nav {
  display: flex;
  gap: 0.65rem;
  border-bottom: 1.5px solid #e2e8f0;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
}

.sub-tab-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  padding: 0.55rem 1.25rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.sub-tab-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e1b4b;
}

.sub-tab-btn.active {
  background: #4338ca;
  border-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.25);
}

/* Modal Overlay Fullscreen Guarantees */
#modalCouponEditor,
#modalConfirmDeleteCoupon,
#modalConfirmSavePromo,
#modalPromoCheckoutPreview,
#modal2FASetup {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

#modalCouponEditor.active,
#modalConfirmDeleteCoupon.active,
#modalConfirmSavePromo.active,
#modalPromoCheckoutPreview.active,
#modal2FASetup.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}



