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

:root {
  --primary: #2563EB;
  --primary-dark: #1E3A8A;
  --primary-light: #EFF6FF;
  --accent: #F97316;
  --accent-hover: #EA580C;
  --white: #FFFFFF;
  --bg-main: #F8FAFC;
  --text-main: #0F172A;
  --text-secondary: #64748B;
  --border-color: #E2E8F0;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(37, 99, 235, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* LAYOUT & SIDEBAR */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--primary-dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-title span {
  color: var(--accent);
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  color: #94A3B8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.nav-item.active {
  background-color: var(--primary);
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

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

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 0.75rem;
  color: #94A3B8;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.content-body {
  padding: 2rem;
  flex: 1;
}

/* CARDS & CONTAINERS */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-cols-4, .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
}

/* STAT CARDS & GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ACTIVE ATTEMPTS ALERT */
.active-attempts-alert {
  border-left: 4px solid var(--accent);
  margin-bottom: 1.75rem;
  background: #FFF7ED;
  padding: 1.25rem;
}
.alert-title {
  font-weight: 700;
  color: #C2410C;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}
.alert-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

/* CATEGORY HEADER & CARDS */
.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.category-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}
.category-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.category-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #BFDBFE;
}

.cat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.cat-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.category-card:hover .cat-icon-box {
  transform: scale(1.08);
}

.cat-action-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-main);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.category-card:hover .cat-action-arrow {
  background: var(--primary);
  color: var(--white);
  transform: translateX(2px);
}

.cat-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.cat-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

.cat-btn-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: #F1F5F9;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, color 0.2s ease;
}

.category-card:hover .cat-btn-footer {
  background: var(--primary);
  color: var(--white);
}

/* BUTTONS & BADGES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: #1D4ED8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--white);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.btn-secondary {
  background-color: #E2E8F0;
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #CBD5E1;
}

.btn-danger {
  background-color: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background-color: #DC2626;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-info    { background: var(--primary-light); color: var(--primary-dark); }

/* TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.table th {
  background: #F1F5F9;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-color);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.table tbody tr:hover {
  background: #F8FAFC;
}

/* CBT EXAM INTERFACE */
.cbt-container {
  display: flex;
  gap: 1.5rem;
  min-height: calc(100vh - 120px);
}

.cbt-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cbt-sidebar {
  width: 320px;
}

.timer-box {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.timer-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.timer-value {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: monospace;
  margin-top: 0.25rem;
}

.q-number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.q-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.q-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.q-btn.answered {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.q-btn.doubtful {
  background: var(--warning);
  color: var(--white);
  border-color: var(--warning);
}

.option-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--white);
  margin-bottom: 0.85rem;
}

.option-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.option-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E2E8F0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.option-card.selected .option-badge {
  background: var(--primary);
  color: var(--white);
}

.question-img {
  max-width: 100%;
  max-height: 520px;
  border-radius: var(--radius-md);
  margin: 1rem auto;
  border: 1px solid #E2E8F0;
  object-fit: contain;
  background: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  padding: 0.5rem;
}

/* FORM CONTROL */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* AUTH CARD */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0F172A 100%);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

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

.auth-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--white);
  margin: 0 auto 1rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

/* OPTION ITEM UTILITIES */
.option-item {
  border: 1px solid var(--border-color);
  background: #F8FAFC;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.option-item.key-option {
  border-color: #16A34A;
  background: #DCFCE7;
}

.option-item.user-wrong {
  border-color: #DC2626;
  background: #FEE2E2;
}

.option-item.correct-option {
  border-color: #16A34A;
  background: #DCFCE7;
}

/* RESULT PAGE UTILITIES */
.q-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.q-box.correct { background: #F0FDF4; }
.q-box.wrong { background: #FEF2F2; }
.q-box.unanswered { background: #FFFBEB; }

.opt-box {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  border: 2px solid var(--border-color);
  background: var(--white);
}
.opt-box.key {
  background: #DCFCE7;
  border-color: #16A34A;
}
.opt-box.wrong {
  background: #FEE2E2;
  border-color: #DC2626;
}

.rentera-feature-card {
  background: var(--white);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  border: 1px solid #F1F5F9;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.rentera-feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.12);
  border-color: #BFDBFE;
}

.rentera-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}


.glass-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.stars-rating {
  color: #F59E0B;
  display: flex;
  gap: 0.2rem;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.workflow-step {
  text-align: center;
  position: relative;
  padding: 1.5rem;
}

.step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.faq-question {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.faq-answer {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  padding-left: 2rem;
}

/* MODAL STYLES */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: all 0.25s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: var(--bg-main);
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: var(--bg-main);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* GLOBAL RESPONSIVE SAFETY & MOBILE UTILITIES */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* MOBILE MENU TOGGLE & OVERLAY BACKDROP */
.btn-mobile-menu {
  display: none;
  background: var(--primary);
  color: #ffffff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.15rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-mobile-menu:active {
  transform: scale(0.95);
}

.mobile-sidebar-close {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  transition: background 0.2s ease;
}

.mobile-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mobile-sidebar-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .btn-mobile-menu {
    display: inline-flex !important;
  }
  .mobile-sidebar-close {
    display: flex !important;
  }
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    z-index: 1000 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 5px 0 30px rgba(0,0,0,0.4) !important;
    max-width: 280px !important;
    width: 80vw !important;
  }
  .sidebar.active {
    transform: translateX(0) !important;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .topbar {
    padding: 0.85rem 1rem !important;
    gap: 0.75rem !important;
  }
  .page-title {
    font-size: 1.15rem !important;
  }
  .page-subtitle {
    font-size: 0.78rem !important;
  }
  .content-body {
    padding: 1rem 0.75rem !important;
  }

  /* DASHBOARD COMPACT MOBILE LAYOUT */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.45rem !important;
    margin-bottom: 0.85rem !important;
  }

  .stat-card {
    padding: 0.6rem 0.4rem !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.3rem !important;
    border-radius: 10px !important;
  }

  .stat-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
  }

  .stat-val {
    font-size: 1.15rem !important;
  }

  .stat-label {
    font-size: 0.65rem !important;
    line-height: 1.1 !important;
  }

  .category-header {
    margin-bottom: 0.5rem !important;
  }

  .category-header h2 {
    font-size: 1rem !important;
  }

  .category-subtitle {
    display: none !important;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
  }

  .category-card {
    padding: 0.65rem 0.6rem !important;
    border-radius: 10px !important;
  }

  .cat-card-top {
    margin-bottom: 0.35rem !important;
  }

  .cat-icon-box {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.95rem !important;
    border-radius: 8px !important;
  }

  .cat-action-arrow {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.65rem !important;
  }

  .cat-title {
    font-size: 0.82rem !important;
    margin-bottom: 0.2rem !important;
    line-height: 1.2 !important;
  }

  .cat-desc {
    font-size: 0.68rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .cat-btn-footer {
    display: none !important; /* Hide bulky footer button on mobile */
  }
}

@media (max-width: 380px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem !important;
  }
  .category-card {
    padding: 0.55rem 0.45rem !important;
  }
  .cat-title {
    font-size: 0.78rem !important;
  }
  .cat-desc {
    font-size: 0.65rem !important;
    -webkit-line-clamp: 1 !important;
  }
}

/* SWEETALERT2 HIGH Z-INDEX OVERRIDE */
.swal2-container {
  z-index: 100000 !important;
}

/* ==========================================================================
   RESPONSIVE RESULT & IST PSYCHOMETRIC REPORT STYLES
   ========================================================================== */

.result-overview-card {
  padding: 2.5rem;
}

.ist-report-card {
  margin-bottom: 2rem;
  padding: 2rem;
  background: #0B132B;
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  text-align: left;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  max-width: 100%;
}

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

.ist-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ist-user-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  word-break: break-all;
}

.ist-print-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ist-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.ist-section-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-sizing: border-box;
}

.ist-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
}

.ist-psikogram-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  font-size: 0.88rem;
  color: #F1F5F9;
}

/* ==========================================================================
   IST PSIKOGRAM DUAL-VIEW & RESPONSIVE CARDS
   ========================================================================== */
.ist-psy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.psy-header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.desktop-psikogram-wrapper {
  display: block;
  width: 100%;
}

.mobile-psy-wrapper {
  display: none;
  width: 100%;
}

.psy-view-switcher {
  display: none;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.btn-psy-view {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.btn-psy-view.active {
  background: #0284C7;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

/* Individual Subtest Card for Mobile */
.psy-mobile-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.85rem;
  box-sizing: border-box;
  width: 100%;
}

.psy-m-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.psy-m-left {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.psy-m-code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  font-weight: 800;
  font-size: 0.92rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.psy-m-info {
  min-width: 0;
  flex: 1;
}

.psy-m-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #F8FAFC;
  line-height: 1.3;
  word-break: break-word;
}

.psy-m-group {
  font-size: 0.72rem;
  color: #94A3B8;
  margin-top: 0.15rem;
  font-weight: 500;
}

.psy-m-scores {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.psy-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 34px;
}

.psy-score-lbl {
  font-size: 0.62rem;
  color: #94A3B8;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}

.psy-score-val.rw {
  font-size: 0.85rem;
  font-weight: 800;
  color: #CBD5E1;
  line-height: 1;
}

.psy-score-box.sw-box {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
}

.psy-score-box.sw-box .psy-score-lbl {
  color: #38BDF8;
}

.psy-score-val.sw {
  font-size: 0.95rem;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1;
}

/* 5-Segment Psychometric Meter */
.psy-m-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.psy-track-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 2px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.psy-track-step .step-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #475569;
  margin-bottom: 3px;
}

.psy-track-step .step-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748B;
  line-height: 1;
}

.psy-track-step .step-val {
  font-size: 0.6rem;
  color: #475569;
  margin-top: 1px;
  line-height: 1;
}

/* Active Highlight States */
.psy-track-step.is-active {
  font-weight: 800;
  transform: scale(1.02);
}

.psy-track-step.is-rs {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
}
.psy-track-step.is-rs .step-indicator {
  background: #EF4444;
  box-shadow: 0 0 8px #EF4444;
  width: 8px;
  height: 8px;
}
.psy-track-step.is-rs .step-name {
  color: #FCA5A5;
  font-size: 0.76rem;
}
.psy-track-step.is-rs .step-val {
  color: #F87171;
}

.psy-track-step.is-r {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
}
.psy-track-step.is-r .step-indicator {
  background: #F59E0B;
  box-shadow: 0 0 8px #F59E0B;
  width: 8px;
  height: 8px;
}
.psy-track-step.is-r .step-name {
  color: #FCD34D;
  font-size: 0.76rem;
}
.psy-track-step.is-r .step-val {
  color: #FBBF24;
}

.psy-track-step.is-s {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.6);
}
.psy-track-step.is-s .step-indicator {
  background: #6366F1;
  box-shadow: 0 0 8px #6366F1;
  width: 8px;
  height: 8px;
}
.psy-track-step.is-s .step-name {
  color: #A5B4FC;
  font-size: 0.76rem;
}
.psy-track-step.is-s .step-val {
  color: #818CF8;
}

.psy-track-step.is-t {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.6);
}
.psy-track-step.is-t .step-indicator {
  background: #3B82F6;
  box-shadow: 0 0 8px #3B82F6;
  width: 8px;
  height: 8px;
}
.psy-track-step.is-t .step-name {
  color: #93C5FD;
  font-size: 0.76rem;
}
.psy-track-step.is-t .step-val {
  color: #60A5FA;
}

.psy-track-step.is-ts {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.6);
}
.psy-track-step.is-ts .step-indicator {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  width: 8px;
  height: 8px;
}
.psy-track-step.is-ts .step-name {
  color: #6EE7B7;
  font-size: 0.76rem;
}
.psy-track-step.is-ts .step-val {
  color: #34D399;
}

.ist-traits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.ist-norm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.mobile-table-hint {
  display: none;
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .app-container {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .main-content {
    margin-left: 0 !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .content-body {
    padding: 0.85rem 0.65rem !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .result-overview-card {
    padding: 1.25rem 0.85rem !important;
    border-radius: 14px !important;
    margin-bottom: 1.25rem !important;
  }
  .ist-report-card {
    padding: 1.15rem 0.75rem !important;
    border-radius: 14px !important;
    margin-bottom: 1.25rem !important;
  }
  .ist-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.85rem !important;
    padding-bottom: 0.85rem !important;
  }
  .ist-header-actions {
    width: 100% !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .ist-user-badge {
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    font-size: 0.78rem !important;
  }
  .ist-print-btn {
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 0.5rem 1rem !important;
  }
  .ist-summary-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    margin-bottom: 1.25rem !important;
  }
  .ist-section-box {
    padding: 1rem 0.65rem !important;
    border-radius: 12px !important;
    margin-bottom: 1.25rem !important;
  }
  .ist-psy-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .psy-view-switcher {
    display: inline-flex !important;
  }
  .mobile-psy-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  .desktop-psikogram-wrapper {
    display: none !important;
  }
  .ist-traits-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    margin-bottom: 1.25rem !important;
  }
  .ist-norm-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem !important;
  }
  .mobile-table-hint {
    display: none;
    align-items: center !important;
    gap: 0.35rem !important;
    font-size: 0.72rem !important;
    color: #38BDF8 !important;
    font-weight: 600 !important;
  }
  .d-none-mobile {
    display: none !important;
  }
}






/* =====================================================================
   UI POLISH LAYER (Des 2026)
   Lapisan perapian tampilan global. Ditaruh paling akhir agar menimpa
   gaya lama tanpa mengubahnya. Hapus blok ini untuk kembali ke tampilan lama.
   ===================================================================== */

/* 1. Layout: konten tidak boleh lebih lebar dari layar.
      Tanpa min-width:0, tabel lebar mendorong .main-content keluar layar
      sehingga sisi kanan (form, tombol, kolom aksi) terpotong. */
.main-content { min-width: 0; }
.content-body { width: 100%; }

/* 2. Topbar & header kartu: rapi saat tombol banyak */
.topbar { gap: 1rem; flex-wrap: wrap; }
.topbar > div:last-child:not(:first-child) { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: flex-end; }
.page-title { letter-spacing: -0.01em; line-height: 1.25; }
.page-subtitle { margin-top: 0.15rem; }
.card-header { gap: 0.75rem 1rem; flex-wrap: wrap; }
.card-title { display: inline-flex; align-items: center; gap: 0.5rem; letter-spacing: -0.01em; }
.card:hover { box-shadow: var(--shadow-sm); } /* kartu statis tidak perlu "melompat" saat di-hover */

/* 3. Sidebar: menu bisa di-scroll di layar pendek, ikon sejajar */
.sidebar-nav { overflow-y: auto; gap: 0.2rem; padding: 1rem 0.85rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.nav-item { padding: 0.7rem 0.9rem; font-size: 0.9rem; line-height: 1.25; }
.nav-item i { width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-footer form { margin: 0; }

/* 4. Tombol: tidak pecah 2 baris, tinggi konsisten, fokus jelas */
.btn { white-space: nowrap; line-height: 1.2; }
.btn-sm { padding: 0.45rem 0.8rem; gap: 0.4rem; }
.btn:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-icon { width: 32px; height: 32px; padding: 0; }

/* 5. Badge: ikon & teks sejajar, tidak pecah baris */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  line-height: 1.25;
  vertical-align: middle;
  font-size: 0.7rem;
  padding: 0.28rem 0.65rem;
}
.badge i { font-size: 0.9em; }
.badge-secondary { background: #F1F5F9; color: #475569; }

/* Tag: label teks panjang (kategori, metode scoring) yang boleh 2 baris tanpa jadi "gumpalan" */
.tag {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  max-width: 220px;
}
.tag-muted { background: #F1F5F9; color: #475569; }

/* 6. Tabel: header satu baris, isi rata tengah vertikal, kode ID rapi */
.table-responsive { -webkit-overflow-scrolling: touch; }
.table th {
  white-space: nowrap;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.8rem 1rem;
  vertical-align: middle;
  border-bottom-width: 1px;
}
.table td { vertical-align: middle; line-height: 1.45; }
.table tbody tr:last-child td { border-bottom: none; }
.table td code, .table td .code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  background: #F1F5F9;
  color: #334155;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}
.cell-title { font-weight: 700; color: var(--text-main); font-size: 0.92rem; line-height: 1.35; }
.cell-sub { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; margin-top: 0.15rem; }
.cell-actions { display: flex; gap: 0.35rem; align-items: center; justify-content: center; flex-wrap: nowrap; }
.cell-actions form { display: inline-flex; margin: 0; }
.nowrap { white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-now { font-weight: 800; color: #C2410C; white-space: nowrap; }
.price-old { font-size: 0.74rem; color: #94A3B8; text-decoration: line-through; white-space: nowrap; }

/* 7. Form: fokus konsisten untuk semua input (termasuk yang memakai style inline) */
.content-body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.content-body select:focus,
.content-body textarea:focus,
.modal-container input:not([type="checkbox"]):not([type="radio"]):focus,
.modal-container select:focus,
.modal-container textarea:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.content-body select, .modal-container select { background-color: var(--white); cursor: pointer; }
.content-body textarea { resize: vertical; }

/* 8. Kartu statistik: angka besar tidak mendesak label */
.stat-card { min-width: 0; }
.stat-card > div:last-child { min-width: 0; }
.stat-label { line-height: 1.3; }

@media (max-width: 768px) {
  .topbar > div:last-child:not(:first-child) { width: 100%; justify-content: flex-start; }
  .table th, .table td { padding: 0.7rem 0.75rem; }
  .tag { max-width: 180px; }
}

/* 9. Table tools (pencarian & paginasi tabel admin) */
.tt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.tt-search { position: relative; flex: 0 1 320px; min-width: 200px; }
.tt-search i { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: #94A3B8; font-size: 0.85rem; pointer-events: none; }
.tt-search input { width: 100%; padding: 0.55rem 0.85rem 0.55rem 2.2rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 0.88rem; background: var(--white); }
.tt-info { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.tt-pager { display: flex; justify-content: flex-end; align-items: center; gap: 0.3rem; margin-top: 1rem; flex-wrap: wrap; }
.tt-page { min-width: 34px; height: 34px; padding: 0 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: var(--white); color: var(--text-main); font-weight: 600; font-size: 0.82rem; cursor: pointer; transition: all 0.15s ease; }
.tt-page:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.tt-page.active { background: var(--primary); border-color: var(--primary); color: var(--white); cursor: default; }
.tt-page:disabled { opacity: 0.45; cursor: not-allowed; }
.tt-gap { color: var(--text-secondary); padding: 0 0.2rem; }
.tt-empty td { text-align: center; color: var(--text-secondary); padding: 2rem 1rem !important; }

/* 10. Kartu katalog tes (user) */
.test-card { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: 1.35rem; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.test-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #BFDBFE; }
.test-card-title { font-size: 1.05rem; font-weight: 700; color: var(--text-main); line-height: 1.35; margin: 0.75rem 0 0.4rem; letter-spacing: -0.01em; }
.test-card-desc { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 0.85rem; }
.test-card-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.test-card-meta i { margin-right: 0.25rem; }
.test-card-footer { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.75rem; border-top: 1px solid var(--border-color); padding-top: 0.9rem; }
.test-card-price { font-size: 1.15rem; font-weight: 800; color: #C2410C; white-space: nowrap; line-height: 1.2; }
.test-card-price.is-free { color: #059669; font-size: 1rem; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 768px) {
  .test-card { padding: 1rem; }
}

/* 11. Kartu ringkasan (stat-card) di mobile: 2 kolom, bukan 1 kartu per baris */
@media (max-width: 768px) {
  .grid:has(> .stat-card) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.6rem !important;
  }
  .grid:has(> .stat-card) .stat-card { margin-bottom: 0 !important; }
}

/* =====================================================================
   12. FORM BUILDER (Des 2026) — form bertahap + pilihan kartu + preview
   ===================================================================== */
.fx-panel { padding: 0 !important; overflow: hidden; }
.fx-panel > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1.1rem 1.5rem;
  background: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 60%);
}
.fx-panel > summary::-webkit-details-marker { display: none; }
.fx-panel-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #FFF; font-size: 1.05rem;
  box-shadow: 0 6px 14px -4px rgba(37, 99, 235, 0.45);
}
.fx-panel-title { font-weight: 800; font-size: 1.05rem; color: var(--text-main); }
.fx-panel-sub { font-size: 0.82rem; color: var(--text-secondary); }
.fx-panel-toggle {
  margin-left: auto; font-size: 0.8rem; font-weight: 700; color: var(--primary);
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}
.fx-panel-toggle i { transition: transform 0.2s ease; }
.fx-panel[open] .fx-panel-toggle i { transform: rotate(180deg); }
.fx-panel[open] .fx-when-closed, .fx-panel:not([open]) .fx-when-open { display: none; }
.fx-panel-body { padding: 1.5rem; border-top: 1px solid var(--border-color); }

.fx-builder { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.75rem; align-items: start; }

.fx-section { position: relative; padding: 0 0 1.5rem 3rem; }
.fx-section:not(:last-of-type)::before {
  content: ''; position: absolute; left: 15px; top: 34px; bottom: 6px;
  width: 2px; background: var(--border-color);
}
.fx-step {
  position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
  background: var(--primary-light); color: var(--primary); border: 2px solid #BFDBFE;
}
.fx-section-title { font-weight: 800; font-size: 0.98rem; margin: 0.25rem 0 0.15rem; }
.fx-section-hint { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.9rem; }
.fx-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.fx-row > .form-group, .fx-section .form-group { margin-bottom: 0; }
.fx-stack { display: flex; flex-direction: column; gap: 1rem; }

.fx-input-lg { font-size: 1.05rem !important; font-weight: 700; padding: 0.8rem 1rem !important; }
.fx-help { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.35rem; }
textarea.form-control.fx-textarea { min-height: 84px; resize: vertical; line-height: 1.5; }

/* Chip preset (mis. durasi) */
.fx-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.55rem; }
.fx-chip {
  border: 1px solid var(--border-color); background: #FFF; color: var(--text-main);
  border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s ease;
}
.fx-chip:hover { border-color: var(--primary); color: var(--primary); }
.fx-chip.active { background: var(--primary); border-color: var(--primary); color: #FFF; }

/* Input dengan awalan/akhiran (Rp, menit) */
.fx-affix { display: flex; align-items: stretch; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: #FFF; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.fx-affix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.fx-affix > span { display: inline-flex; align-items: center; padding: 0 0.85rem; background: #F8FAFC; color: var(--text-secondary); font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.fx-affix > .form-control { border: 0 !important; box-shadow: none !important; border-radius: 0; min-width: 0; flex: 1; }

/* Pilihan berbentuk kartu (pengganti dropdown 2 opsi) */
.fx-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.fx-choice { position: relative; cursor: pointer; margin: 0; }
.fx-choice > input { position: absolute; opacity: 0; pointer-events: none; }
.fx-choice-body {
  display: flex; gap: 0.7rem; align-items: flex-start; height: 100%;
  padding: 0.8rem 0.9rem; border: 1.5px solid var(--border-color); border-radius: var(--radius-md);
  background: #FFF; transition: all 0.15s ease;
}
.fx-choice-body > i {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #F1F5F9; color: var(--text-secondary); font-size: 0.9rem; transition: all 0.15s ease;
}
.fx-choice-title { font-weight: 800; font-size: 0.88rem; color: var(--text-main); }
.fx-choice-desc { font-size: 0.74rem; color: var(--text-secondary); line-height: 1.35; }
.fx-choice:hover .fx-choice-body { border-color: #93C5FD; }
.fx-choice > input:checked + .fx-choice-body { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.fx-choice > input:checked + .fx-choice-body > i { background: var(--primary); color: #FFF; }
.fx-choice > input:focus-visible + .fx-choice-body { outline: 2px solid var(--primary); outline-offset: 2px; }
.fx-choice.is-warn > input:checked + .fx-choice-body { border-color: #F59E0B; background: #FFFBEB; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14); }
.fx-choice.is-warn > input:checked + .fx-choice-body > i { background: #F59E0B; }
.fx-choice.is-accent > input:checked + .fx-choice-body { border-color: var(--accent); background: #FFF7ED; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14); }
.fx-choice.is-accent > input:checked + .fx-choice-body > i { background: var(--accent); }

.fx-reveal { margin-top: 0.9rem; padding: 0.9rem; border-radius: var(--radius-md); background: #FFF7ED; border: 1px dashed #FDBA74; }
.fx-reveal[hidden] { display: none; }

.fx-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding-top: 1.1rem; margin-top: 0.25rem; border-top: 1px solid var(--border-color); }
.fx-actions .btn-primary { padding-left: 1.4rem; padding-right: 1.4rem; font-weight: 800; }

/* Preview langsung */
.fx-preview { position: sticky; top: 1rem; }
.fx-preview-label { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 0.55rem; display: flex; align-items: center; gap: 0.4rem; }
.fx-preview-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.fx-preview .test-card { margin: 0; box-shadow: var(--shadow-lg); border: 1px solid #DBEAFE; transition: opacity 0.2s ease; }
.fx-preview.is-draft .test-card { opacity: 0.6; }
.fx-preview-note { margin-top: 0.75rem; font-size: 0.76rem; color: var(--text-secondary); display: flex; gap: 0.45rem; line-height: 1.4; }
.fx-preview-note i { margin-top: 2px; }
.fx-muted-placeholder { color: #94A3B8 !important; font-style: italic; }

@media (max-width: 1100px) {
  .fx-builder { grid-template-columns: minmax(0, 1fr); }
  .fx-preview { position: static; }
}
@media (max-width: 640px) {
  .fx-panel > summary { padding: 0.9rem 1rem; }
  .fx-panel-body { padding: 1rem; }
  .fx-panel-sub, .fx-panel-toggle span { display: none; }
  .fx-section { padding-left: 0; }
  .fx-section::before { display: none; }
  .fx-step { position: static; width: 26px; height: 26px; font-size: 0.75rem; margin-right: 0.4rem; vertical-align: middle; }
  .fx-section-title { display: inline-block; vertical-align: middle; }
  .fx-row, .fx-choices { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   13. ADMIN DASHBOARD — grafik & ringkasan
   ===================================================================== */
.dash-delta { font-size: 0.74rem; color: var(--text-secondary); margin-top: 0.15rem; white-space: nowrap; }
.dash-delta b { color: #006c10; font-weight: 800; }

.dash-filter { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-filter-label { font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 0.4rem; }
.dash-seg { display: inline-flex; background: #FFF; border: 1px solid var(--border-color); border-radius: 10px; padding: 3px; gap: 2px; }
.dash-seg button { border: 0; background: transparent; padding: 0.4rem 0.85rem; border-radius: 7px; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.dash-seg button:hover { background: #F1F5F9; color: var(--text-main); }
.dash-seg button.active { background: var(--primary); color: #FFF; }

.dash-grid { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
.dash-grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dash-grid-half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.dash-card { margin-bottom: 0 !important; min-width: 0; display: flex; flex-direction: column; }
.dash-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.dash-card-head .card-title { margin: 0; }
.dash-card-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.15rem; }
.dash-chart { position: relative; width: 100%; flex: 1; min-height: 200px; }
.dash-kpi { text-align: right; }
.dash-kpi-val { font-size: 1.35rem; font-weight: 800; color: var(--text-main); line-height: 1.1; }
.dash-kpi-label { font-size: 0.74rem; color: var(--text-secondary); display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.15rem; }
.dash-pill { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.7rem; font-weight: 800; padding: 0.1rem 0.45rem; border-radius: 999px; }
.dash-pill.up { background: #E7F6EA; color: #006c10; }
.dash-pill.down { background: #FDECEC; color: #B42318; }
.dash-link { font-size: 0.78rem; font-weight: 700; color: var(--primary); text-decoration: none; white-space: nowrap; }
.dash-link:hover { text-decoration: underline; }

/* Bar tersegmen status sesi */
.dash-segbar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: #F1F5F9; margin-bottom: 1rem; }
.dash-segbar span { display: block; min-width: 4px; }
.dash-segbar .good, .dash-legend .key.good { background: #0aac23; }
.dash-segbar .warning, .dash-legend .key.warning { background: #fbb315; }
.dash-segbar .critical, .dash-legend .key.critical { background: #dc3c3d; }
.dash-legend { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; margin: 0; padding: 0; }
.dash-legend li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; color: var(--text-main); }
.dash-legend li i { color: var(--text-secondary); font-size: 0.8rem; width: 14px; text-align: center; }
.dash-legend .key { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dash-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.dash-legend em { font-style: normal; color: var(--text-secondary); font-size: 0.76rem; width: 48px; text-align: right; font-variant-numeric: tabular-nums; }

.dash-money { font-size: 1.5rem; font-weight: 800; color: var(--text-main); line-height: 1.15; }
.dash-mini { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.84rem; color: var(--text-secondary); padding-top: 0.75rem; border-top: 1px solid var(--border-color); }
.dash-mini b { color: var(--text-main); }

/* Bar horizontal tes terpopuler */
.dash-hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.dash-hbar-label { display: flex; align-items: center; gap: 0.55rem; font-size: 0.84rem; margin-bottom: 0.35rem; min-width: 0; }
.dash-hbar-label .rank { width: 20px; height: 20px; border-radius: 6px; background: #F1F5F9; color: var(--text-secondary); font-size: 0.7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-hbar-label .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--text-main); }
.dash-hbar-label b { font-variant-numeric: tabular-nums; color: var(--text-main); }
.dash-hbar-track { height: 10px; border-radius: 0 4px 4px 0; margin-left: 28px; }
.dash-hbar-track span { display: block; height: 100%; background: #257de0; border-radius: 0 4px 4px 0; transition: background 0.15s; }
.dash-hbars li:hover .dash-hbar-track span { background: #1b64be; }
.dash-empty { padding: 2rem 0; text-align: center; color: var(--text-secondary); font-size: 0.88rem; }

.dash-table > summary { list-style: none; cursor: pointer; font-size: 0.86rem; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 0.5rem; }
.dash-table > summary::-webkit-details-marker { display: none; }
.dash-table > summary .chev { margin-left: auto; transition: transform 0.2s; }
.dash-table[open] > summary .chev { transform: rotate(180deg); }
.dash-table thead th { position: sticky; top: 0; background: #F8FAFC; z-index: 1; }

@media (max-width: 1100px) {
  .dash-grid-main, .dash-grid-half { grid-template-columns: minmax(0, 1fr); }
  .dash-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dash-side { grid-template-columns: minmax(0, 1fr); }
  .dash-seg { width: 100%; }
  .dash-seg button { flex: 1; padding: 0.45rem 0.4rem; }
  .dash-kpi { text-align: left; }
  .dash-kpi-label { justify-content: flex-start; }
  .dash-delta { white-space: normal; }
}
