/* =============================================================
   UMS Questionnaire — Modern Admin Theme
   Primary:   #5B2D8B | Secondary: #2F3C8F | BG: #F7F7FB
   ============================================================= */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --ums-primary:        #5B2D8B;
  --ums-primary-light:  #7B4DAB;
  --ums-primary-dark:   #421d6b;
  --ums-secondary:      #2F3C8F;
  --ums-secondary-light:#4a56ab;
  --ums-sidebar-start:  #2B2F77;
  --ums-sidebar-end:    #5B2D8B;
  --ums-sidebar-hover:  rgba(255,255,255,0.14);
  --ums-sidebar-active: rgba(255,255,255,0.22);
  --ums-accent:         #8B5CF6;
  --ums-bg:             #F7F7FB;
  --ums-bg-white:       #FFFFFF;
  --ums-text:           #1e1e2d;
  --ums-text-muted:     #8a94a6;
  --ums-border:         #e8eaf0;
  --ums-shadow:         0 2px 14px rgba(91, 45, 139, 0.10);
  --ums-shadow-sm:      0 1px 6px rgba(0, 0, 0, 0.06);
  --ums-radius:         10px;
  --ums-radius-sm:      6px;
  --ums-sidebar-width:  260px;
  --ums-sidebar-collapsed: 68px;
  --ums-navbar-height:  62px;
  --ums-transition:     0.25s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--ums-bg);
  color: var(--ums-text);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

a { text-decoration: none; }

/* ── Wrapper Layout ─────────────────────────────────────────── */
.ums-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
#ums-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--ums-sidebar-width);
  background:
    radial-gradient(1200px 240px at -10% -10%, rgba(255,255,255,0.14), transparent 50%),
    radial-gradient(900px 180px at 110% 110%, rgba(255,255,255,0.10), transparent 45%),
    linear-gradient(165deg, var(--ums-sidebar-start) 0%, var(--ums-sidebar-end) 100%);
  z-index: 1040;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--ums-transition), transform var(--ums-transition);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

#ums-sidebar::-webkit-scrollbar { width: 4px; }
#ums-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* ── Sidebar Brand ───────────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  min-height: var(--ums-navbar-height);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background: #fff;
  padding: 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.20);
}

.sidebar-brand-text {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--ums-transition);
}

/* ── Sidebar Nav ─────────────────────────────────────────────── */
.sidebar-nav {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  flex: 1;
}

.sidebar-heading {
  padding: 14px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-item {
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.88);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: all var(--ums-transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link:hover {
  color: #fff;
  background: var(--ums-sidebar-hover);
  text-decoration: none;
}

.sidebar-link i.sidebar-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: transform var(--ums-transition);
}

.sidebar-link .sidebar-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform var(--ums-transition);
  flex-shrink: 0;
}

.sidebar-link[aria-expanded="true"] .sidebar-arrow {
  transform: rotate(90deg);
}

.sidebar-link.active,
.sidebar-item.active > .sidebar-link {
  color: #fff;
  background: var(--ums-sidebar-active);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.sidebar-link.active::before,
.sidebar-item.active > .sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255,255,255,0.9);
  border-radius: 0 3px 3px 0;
}

/* ── Sidebar Submenu ─────────────────────────────────────────── */
.sidebar-submenu {
  list-style: none;
  padding: 4px 0;
  margin: 0;
  background: rgba(0,0,0,0.18);
}

.sidebar-submenu .sidebar-link {
  padding: 8px 20px 8px 48px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}

.sidebar-submenu .sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.11);
}

.sidebar-submenu .sidebar-item.active > .sidebar-link,
.sidebar-submenu .sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
  font-weight: 600;
}

.sidebar-submenu .sidebar-link::before { display: none; }

/* ── Collapsed Sidebar ───────────────────────────────────────── */
body.sidebar-collapsed #ums-sidebar {
  width: var(--ums-sidebar-collapsed);
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-heading,
body.sidebar-collapsed .sidebar-link span:not(.sidebar-icon),
body.sidebar-collapsed .sidebar-arrow {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 10px 0;
}

body.sidebar-collapsed .sidebar-link i.sidebar-icon {
  margin: 0;
}

body.sidebar-collapsed .sidebar-submenu {
  display: none !important;
}

/* ── Main Content ────────────────────────────────────────────── */
#ums-main {
  margin-left: var(--ums-sidebar-width);
  width: calc(100% - var(--ums-sidebar-width));
  max-width: calc(100% - var(--ums-sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--ums-transition);
  background: var(--ums-bg);
}

body.sidebar-collapsed #ums-main {
  margin-left: var(--ums-sidebar-collapsed);
  width: calc(100% - var(--ums-sidebar-collapsed));
  max-width: calc(100% - var(--ums-sidebar-collapsed));
}

/* ── Top Navbar ──────────────────────────────────────────────── */
#ums-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--ums-navbar-height);
  background: var(--ums-bg-white);
  border-bottom: 1px solid var(--ums-border);
  box-shadow: var(--ums-shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.navbar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ums-radius-sm);
  border: none;
  background: transparent;
  color: var(--ums-text-muted);
  cursor: pointer;
  transition: all var(--ums-transition);
  flex-shrink: 0;
}

.navbar-toggle:hover {
  background: var(--ums-bg);
  color: var(--ums-primary);
}

.navbar-brand-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--ums-primary);
  flex: 1;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* User Dropdown */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  border-radius: 50px;
  border: 1px solid var(--ums-border);
  background: var(--ums-bg);
  cursor: pointer;
  transition: all var(--ums-transition);
  color: var(--ums-text);
}

.user-menu-btn:hover {
  border-color: var(--ums-primary);
  background: #fff;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ums-text);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Page Content Wrapper ────────────────────────────────────── */
.content-wrapper {
  flex: 1;
  width: 100%;
  max-width: 100%;
  padding: 24px;
}

.page-container {
  width: 100%;
  max-width: 100% !important;
  padding-left: 0;
  padding-right: 0;
}

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ums-text);
  margin: 0;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 13px;
  color: var(--ums-text-muted);
  margin: 2px 0 0;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ums-text-muted);
}

.page-breadcrumb a {
  color: var(--ums-primary);
}

.page-breadcrumb a:hover { opacity: 0.8; }

.page-breadcrumb .separator {
  color: var(--ums-border);
}

/* ── Footer ──────────────────────────────────────────────────── */
.ums-footer {
  padding: 16px 24px;
  margin-top: 28px;
  border-top: 1px solid var(--ums-border);
  background: var(--ums-bg-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ums-text-muted);
}

.ums-footer a { color: var(--ums-primary); }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  border: none !important;
  border-radius: var(--ums-radius) !important;
  box-shadow: var(--ums-shadow) !important;
  background: var(--ums-bg-white);
}

.app-table-card .card-body {
  padding: 0 !important;
}

.app-table-card {
  border: 1px solid #eceef5;
  overflow: hidden;
}

.app-table-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ums-border);
  background: linear-gradient(180deg, #fbfbff 0%, #f7f8fd 100%);
}

.app-table-toolbar .toolbar-start,
.app-table-toolbar .toolbar-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-table-toolbar .toolbar-start {
  flex: 1;
  min-width: 280px;
}

.app-table-toolbar .toolbar-end {
  justify-content: flex-end;
}

.toolbar-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ums-text);
}

.toolbar-subtitle {
  font-size: 12px;
  color: var(--ums-text-muted);
}

.app-search {
  min-width: 280px;
  max-width: 360px;
  border-radius: 999px;
  padding-left: 14px;
  padding-right: 14px;
}

.app-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-meta {
  font-size: 12px;
  color: var(--ums-text-muted);
  background: #f1f4fb;
  border: 1px solid #e2e7f3;
  border-radius: 999px;
  padding: 4px 12px;
}

.app-search-form .btn {
  min-width: 42px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--ums-border) !important;
  padding: 16px 20px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h4,
.card-header h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ums-text);
}

.card-body {
  padding: 20px !important;
}

.card-footer {
  background: transparent !important;
  border-top: 1px solid var(--ums-border) !important;
  padding: 14px 20px !important;
}

/* ── CRUD Modal (Admin) ───────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 22px 64px rgba(17, 24, 39, 0.22);
}

.modal-header {
  border-bottom: 1px solid #eceff6;
  padding: 14px 18px;
  background: linear-gradient(180deg, #fbfbff 0%, #f7f8fd 100%);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ums-text);
}

.modal-body {
  padding: 18px;
}

.modal-footer {
  border-top: 1px solid #eceff6;
  padding: 12px 18px;
  background: #fcfcff;
}

.modal .form-group { margin-bottom: 14px; }
.modal .form-label,
.modal label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ums-text);
  margin-bottom: 6px;
}

.modal .form-control,
.modal .form-select {
  min-height: 39px;
  border-radius: 8px;
}

/* Stat Cards */
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--ums-radius);
  background: #fff;
  box-shadow: var(--ums-shadow);
  border: none;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.stat-icon.bg-primary-soft { background: linear-gradient(135deg, var(--ums-primary), var(--ums-primary-light)); }
.stat-icon.bg-danger-soft  { background: linear-gradient(135deg, #e74c3c, #f1948a); }
.stat-icon.bg-warning-soft { background: linear-gradient(135deg, #f39c12, #f7dc6f); }
.stat-icon.bg-success-soft { background: linear-gradient(135deg, #27ae60, #82e0aa); }
.stat-icon.bg-info-soft    { background: linear-gradient(135deg, #2980b9, #85c1e9); }

.stat-content { flex: 1; }

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ums-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--ums-text);
  line-height: 1;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table {
  margin-bottom: 0;
  color: var(--ums-text);
}

.table thead th {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: #5d6678;
  background: #f4f6fc;
  border-bottom: 1px solid #e8ebf4;
  padding: 13px 14px;
  text-align: left;
}

.table thead th.action-col {
  text-align: center;
}

.table tbody td {
  vertical-align: middle;
  padding: 12px 14px;
  border-color: #edf0f7;
}

.table tbody td.text-center,
.table tbody td.text-end,
.table tbody td.text-start {
  vertical-align: middle;
}

.table-hover tbody tr {
  transition: background-color var(--ums-transition), transform var(--ums-transition);
}

.table-hover tbody tr:hover {
  background: #f8f6fd;
}

.table-responsive {
  border-radius: 0 0 var(--ums-radius) var(--ums-radius);
}

.table-responsive > .table {
  min-width: 720px;
}

.table-bordered th,
.table-bordered td {
  border-color: inherit;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  min-height: 38px;
  padding: .44rem .9rem;
  font-size: .84rem;
  line-height: 1.5;
  border-radius: .56rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  font-weight: 600;
  letter-spacing: .1px;
  transition: all var(--ums-transition);
}

.btn i,
.btn .fa,
.btn .fas,
.btn .far,
.btn .fab {
  margin-right: .375rem !important;
  line-height: 1;
}

.btn i:only-child,
.btn .fa:only-child,
.btn .fas:only-child,
.btn .far:only-child,
.btn .fab:only-child {
  margin-right: 0 !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--ums-primary) 0%, #6f3fa4 100%);
  border-color: var(--ums-primary);
  box-shadow: 0 4px 14px rgba(91, 45, 139, 0.20);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--ums-primary-dark) 0%, #512781 100%);
  border-color: var(--ums-primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background: #5c636a;
  border-color: #565e64;
  color: #fff;
}

.btn-danger {
  background: #dc3545;
  border-color: #dc3545;
}

.btn-danger:hover {
  background: #bb2d3b;
  border-color: #b02a37;
}

.btn-success {
  background: #198754;
  border-color: #198754;
}

.btn-success:hover {
  background: #157347;
  border-color: #146c43;
}

.btn-info {
  background: #0dcaf0;
  border-color: #0dcaf0;
  color: #fff;
}

.btn-info:hover {
  background: #31d2f2;
  border-color: #25cff2;
  color: #fff;
}

.btn-warning {
  background: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background: #ffca2c;
  border-color: #ffc720;
  color: #212529;
}

.btn-outline-primary {
  color: var(--ums-primary);
  border-color: var(--ums-primary);
  background: rgba(91, 45, 139, 0.04);
}

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

.btn-sm {
  min-height: 34px;
  padding: .3rem .72rem;
  font-size: .79rem;
}

/* Action button group in tables */
.action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.action-btns .btn {
  white-space: nowrap;
}

/* Keep icon-only utility buttons compact */
.btn-icon,
.btn[data-icon-only="true"] {
  min-width: 40px !important;
  width: 40px;
  padding: 0 !important;
}

.btn-link {
  min-height: auto;
  padding: 0;
}

@media (max-width: 767.98px) {
  .action-btns {
    flex-wrap: wrap;
  }
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ums-text);
  margin-bottom: 6px;
  display: block;
}

.form-control,
.form-select {
  border: 1px solid var(--ums-border);
  border-radius: var(--ums-radius-sm);
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--ums-text);
  background: #fff;
  transition: all var(--ums-transition);
  width: 100%;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ums-primary);
  box-shadow: 0 0 0 3px rgba(91, 45, 139, 0.12);
  outline: none;
}

.form-control::placeholder { color: #adb5bd; }

.form-control.is-invalid {
  border-color: #e74c3c;
}

.invalid-feedback {
  font-size: 12px;
  color: #e74c3c;
  margin-top: 4px;
}

/* Input group */
.input-group .form-control { border-right: none; }
.input-group .btn { border-radius: 0 var(--ums-radius-sm) var(--ums-radius-sm) 0; }

/* Form section spacing */
.mb-3 { margin-bottom: 18px !important; }

/* ── Bootstrap 4 Compatibility ───────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ums-text);
  margin-bottom: 6px;
}

/* Badge compatibility */
.badge { font-size: 11.5px; font-weight: 600; border-radius: 50px; padding: 4px 10px; }
.badge-primary, .bg-primary { background: var(--ums-primary) !important; color: #fff !important; }
.badge-secondary, .bg-secondary { background: #8a94a6 !important; color: #fff !important; }
.badge-success, .bg-success { background: #27ae60 !important; color: #fff !important; }
.badge-danger, .bg-danger { background: #e74c3c !important; color: #fff !important; }
.badge-warning, .bg-warning { background: #f39c12 !important; color: #fff !important; }
.badge-info, .bg-info { background: #2980b9 !important; color: #fff !important; }

/* Float compat */
.float-left, .float-start { float: left !important; }
.float-right, .float-end { float: right !important; }

/* Text compat */
.text-right { text-align: right !important; }
.text-left  { text-align: left !important; }

/* Spacing compat */
.ml-1 { margin-left: 4px !important; }
.ml-2 { margin-left: 8px !important; }
.ml-3 { margin-left: 12px !important; }
.mr-1 { margin-right: 4px !important; }
.mr-2 { margin-right: 8px !important; }
.mr-3 { margin-right: 12px !important; }
.pl-0 { padding-left: 0 !important; }
.pr-0 { padding-right: 0 !important; }

/* Custom switch / checkbox compat */
.custom-control { display: flex; align-items: center; gap: 8px; }
.custom-control-label { font-size: 13.5px; }
.custom-control-input { width: 16px; height: 16px; }

/* Form switch */
.form-switch .form-check-input { cursor: pointer; }

/* Input group compat */
.input-group-btn { display: flex; }
.input-group-btn .btn { border-radius: 0 var(--ums-radius-sm) var(--ums-radius-sm) 0; }
.input-group-append { display: flex; }

/* thead-light compat */
.table .thead-light th {
  background: inherit;
  color: inherit;
}

/* ── Modals ───────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--ums-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
  background: var(--ums-bg);
  border-bottom: 1px solid var(--ums-border);
  border-radius: var(--ums-radius) var(--ums-radius) 0 0;
  padding: 18px 22px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ums-text);
}

.modal-body { padding: 22px; }
.modal-footer {
  border-top: 1px solid var(--ums-border);
  padding: 14px 22px;
  gap: 8px;
}

.btn-close { opacity: 0.5; }
.btn-close:hover { opacity: 1; }

/* BS4 close button compat */
.modal-header .close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ums-text-muted);
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.modal-header .close:hover { color: var(--ums-text); }

/* ── Alerts & Pagination ─────────────────────────────────────── */
.alert {
  border: none;
  border-radius: var(--ums-radius-sm);
  font-size: 13.5px;
  padding: 14px 18px;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-danger   { background: #f8d7da; color: #721c24; }
.alert-warning  { background: #fff3cd; color: #856404; }
.alert-info     { background: #d1ecf1; color: #0c5460; }

/* Pagination */
.pagination {
  gap: 4px;
  margin-bottom: 0;
}

.page-link {
  border-radius: var(--ums-radius-sm) !important;
  border: 1px solid var(--ums-border) !important;
  color: var(--ums-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
}

.page-link:hover {
  background: var(--ums-primary);
  color: #fff;
  border-color: var(--ums-primary) !important;
}

.page-item.active .page-link {
  background: var(--ums-primary) !important;
  border-color: var(--ums-primary) !important;
  color: #fff;
}

.page-item.disabled .page-link {
  color: var(--ums-text-muted);
  background: transparent;
}

/* ── Auth Layout ─────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ums-primary) 0%, var(--ums-secondary) 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  top: -100px;
  right: -100px;
}

.auth-wrapper::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  bottom: -80px;
  left: -80px;
}

.auth-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.auth-header {
  background: linear-gradient(135deg, var(--ums-primary) 0%, var(--ums-secondary) 100%);
  padding: 36px 36px 28px;
  text-align: center;
}

.auth-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  /* background: rgba(255,255,255,0.15); */
  padding: 10px;
  margin-bottom: 12px;
}

.auth-header h1 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.auth-header p {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin: 6px 0 0;
}

.auth-body {
  padding: 32px 36px 28px;
}

.auth-footer {
  text-align: center;
  padding: 0 36px 28px;
  font-size: 12.5px;
  color: var(--ums-text-muted);
}

/* ── Questionnaire Form ──────────────────────────────────────── */
.questionnaire-container {
  max-width: 800px;
  margin: 0 auto;
}

.question {
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--ums-bg);
  border-radius: var(--ums-radius);
  border: 1px solid transparent;
  transition: all var(--ums-transition);
}

.question:hover {
  border-color: var(--ums-border);
  box-shadow: var(--ums-shadow-sm);
}

.question.is-invalid {
  border-color: #e74c3c;
  background: #fff8f8;
}

.question.is-invalid::after {
  content: "Harap isi pertanyaan ini";
  color: #e74c3c;
  font-size: 12px;
  margin-top: 8px;
  display: block;
}

/* ── Progress Bar ────────────────────────────────────────────── */
.progress {
  height: 6px;
  border-radius: 10px;
  background: var(--ums-border);
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--ums-primary), var(--ums-accent));
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* ── Select2 Overrides ───────────────────────────────────────── */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border: 1px solid var(--ums-border);
  border-radius: var(--ums-radius-sm);
  min-height: 40px;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--multiple:focus {
  border-color: var(--ums-primary);
  box-shadow: 0 0 0 3px rgba(91, 45, 139, 0.12);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--ums-primary) !important;
  border: 1px solid var(--ums-primary-dark) !important;
  color: #fff;
  border-radius: 4px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--ums-primary) !important;
  color: #fff !important;
}

.select2-dropdown {
  border: 1px solid var(--ums-border);
  border-radius: var(--ums-radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* ── Utilities ───────────────────────────────────────────────── */
.section-header-divider {
  height: 1px;
  background: var(--ums-border);
  margin: 0 0 24px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--ums-text-muted);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 14px;
  opacity: 0.4;
  display: block;
}

.empty-state p { font-size: 14px; margin: 0; }

.text-primary { color: var(--ums-primary) !important; }

/* Scrollbar for content */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d5e0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #aab0c0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  #ums-sidebar {
    transform: translateX(-100%);
    z-index: 1050;
  }

  body.sidebar-open #ums-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1045;
  }

  #ums-main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  body.sidebar-collapsed #ums-main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  .content-wrapper {
    padding: 20px 16px 0;
  }

  .app-search {
    min-width: 100%;
    max-width: 100%;
  }

  .page-title { font-size: 18px; }
}

@media (max-width: 575.98px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .auth-header { padding: 28px 24px 20px; }
  .auth-body { padding: 24px 24px 20px; }
  .auth-footer { padding: 0 24px 20px; }
}

/* ── Section legacy classes (Stisla compat) ───────────────────── */
.main-content {
  flex: 1;
}

.section {
  padding: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e9ecf3;
}

.section-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--ums-text);
}

.section-header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.section-header-breadcrumb .breadcrumb-item {
  color: var(--ums-text-muted);
}

.section-header-breadcrumb .breadcrumb-item::after {
  content: '/';
  margin-left: 6px;
  color: var(--ums-border);
}

.section-header-breadcrumb .breadcrumb-item:last-child::after { display: none; }
.section-header-breadcrumb .breadcrumb-item a { color: var(--ums-primary); }

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ums-text);
  margin: 0 0 18px;
}

.section-body { }

/* Card statistic (Stisla compat) */
.card-statistic-1 {
  display: flex !important;
  align-items: center;
  gap: 16px;
  padding: 20px !important;
}

.card-statistic-1 .card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.card-statistic-1 .card-wrap { flex: 1; }
.card-statistic-1 .card-header {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.card-statistic-1 .card-header h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ums-text-muted) !important;
  margin: 0 !important;
}

.card-statistic-1 .card-body {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: var(--ums-text) !important;
  padding: 0 !important;
  line-height: 1.2;
}

/* section shadow override */
.shadow { box-shadow: var(--ums-shadow) !important; }
.shadow-sm { box-shadow: var(--ums-shadow-sm) !important; }

/* card-header-form */
.card-header-form form {
  display: flex;
  align-items: center;
}

/* Summernote overrides */
.note-editor.note-frame {
  border: 1px solid var(--ums-border);
  border-radius: var(--ums-radius-sm);
}

.note-toolbar {
  background: var(--ums-bg) !important;
  border-bottom: 1px solid var(--ums-border) !important;
}

/* ── Auth Split Layout (Login Page) ─────────────────────────── */
.auth-split-wrapper {
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Left brand panel */
.auth-split-brand {
  width: 44%;
  min-width: 340px;
  background: linear-gradient(145deg, #3a1860 0%, var(--ums-primary) 55%, var(--ums-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 44px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Decorative blobs */
.auth-split-deco-1 {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  top: -110px;
  right: -110px;
  pointer-events: none;
}

.auth-split-deco-2 {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  bottom: -80px;
  left: -70px;
  pointer-events: none;
}

.auth-split-brand-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  max-width: 340px;
}

/* Logo — white background container */
.auth-split-logo-wrap {
  width: 96px;
  height: 96px;
  background: #ffffff;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  padding: 14px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.24);
}

.auth-split-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-split-app-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.3;
}

.auth-split-tagline {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 36px;
}

/* Feature highlights */
.auth-split-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.auth-split-feat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 13px 16px;
}

.auth-split-feat-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.95);
  flex-shrink: 0;
}

.auth-split-feat-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.auth-split-feat-desc {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

/* Right form panel */
.auth-split-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 48px;
  background: #fff;
  overflow-y: auto;
}

.auth-split-form-inner {
  width: 100%;
  max-width: 400px;
}

.auth-split-form-header { margin-bottom: 32px; }

.auth-split-form-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--ums-text);
  margin: 0 0 6px;
}

.auth-split-form-subtitle {
  font-size: 13.5px;
  color: var(--ums-text-muted);
  margin: 0;
}

.auth-split-form-footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--ums-border);
  font-size: 12px;
  color: var(--ums-text-muted);
  text-align: center;
}

/* Mobile responsive */
@media (max-width: 767.98px) {
  .auth-split-wrapper { flex-direction: column; }

  .auth-split-brand {
    width: 100%;
    min-width: unset;
    padding: 36px 24px 32px;
  }

  .auth-split-logo-wrap {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 16px;
  }

  .auth-split-app-name { font-size: 18px; }
  .auth-split-tagline  { margin-bottom: 0; }
  .auth-split-features { display: none; }

  .auth-split-form-panel { padding: 36px 24px; }
}
