:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #1e293b;
  --success: #059669;
  --success-hover: #047857;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-hover: #b45309;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-light: #fef2f2;
  --info: #0284c7;
  --info-hover: #0369a1;
  --info-light: #f0f9ff;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --border-light: #e2e8f0;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

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

/* =========================================================
   STANDARISASI JARAK ICON DENGAN TEKS: ICON <spasi> TEXT
   ========================================================= */
i.fa-solid:not(:only-child),
i.fa-regular:not(:only-child),
i.fa-brands:not(:only-child),
i.fas:not(:only-child),
i.far:not(:only-child) {
  margin-right: 0.45rem;
}

i.fa-chevron-right,
i.fa-chevron-down,
i.fa-arrow-right,
i.fa-angles-right,
.icon-right {
  margin-right: 0 !important;
  margin-left: 0.45rem !important;
}

.btn-icon i,
.btn-icon-sm i,
.page-header-back-btn i,
.page-header-icon i,
.sidebar-toggle-btn i,
.menubar-toggle-btn i,
.modal-close i,
.btn-close-drawer i,
.survey-topbar-icon-btn i {
  margin-right: 0 !important;
  margin-left: 0 !important;
}

/* =========================================================
   1. APP SHELL & SIDEBAR NAVIGATION
   ========================================================= */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-sidebar {
  width: 250px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #1e293b;
  z-index: 60;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.15rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 64px;
  box-sizing: border-box;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand i {
  color: #38bdf8;
  font-size: 1.35rem;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
  padding: 1.25rem 0.65rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-section-title {
  padding: 0.85rem 0.85rem 0.35rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  user-select: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active);
}

.sidebar-link.active {
  background-color: var(--primary);
  color: #ffffff;
}

/* SIDEBAR COLLAPSED (MINI-MODE) */
.app-shell.sidebar-collapsed .app-sidebar {
  width: 72px;
}

.app-shell.sidebar-collapsed .brand-text {
  display: none !important;
}

.app-shell.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 1rem 0;
}

.app-shell.sidebar-collapsed .sidebar-toggle-btn {
  display: none !important;
}

.app-shell.sidebar-collapsed .sidebar-link-text {
  display: none !important;
}

.app-shell.sidebar-collapsed .sidebar-section-title {
  display: none !important;
}

.app-shell.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 0.85rem 0;
  gap: 0;
}

.app-shell.sidebar-collapsed .sidebar-link i {
  font-size: 1.25rem;
  width: auto;
}

.role-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

.role-admin { background: #fee2e2; color: #991b1b; }
.role-supervisor { background: #fef3c7; color: #92400e; }
.role-operator { background: #e0e7ff; color: #3730a3; }

/* MAIN CONTENT WRAPPER */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* TOP APP HEADER */
.app-header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 0;
  z-index: 40;
}

.menubar-toggle-btn {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: #334155;
  cursor: pointer;
  font-size: 1rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.menubar-toggle-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--primary);
}

.server-status-pill {
  font-size: 0.8rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

/* TOP-RIGHT USER PROFILE DROPDOWN */
.header-user-section {
  position: relative;
}

.user-dropdown-container {
  position: relative;
}

.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.user-dropdown-trigger:hover {
  background: #f8fafc;
  border-color: var(--primary);
}

.user-avatar-circle-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-meta-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-name-header {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 230px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: slideIn 0.15s ease forwards;
}

.user-dropdown-menu.active {
  display: flex;
}

.user-dropdown-info {
  padding: 0.65rem 1rem;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: all 0.1s ease;
}

.user-dropdown-item:hover {
  background: #f1f5f9;
  color: var(--primary);
}

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

.container {
  padding: 1.5rem 2rem;
  flex: 1;
  width: 100%;
  max-width: 100% !important;
  margin: 0;
  box-sizing: border-box;
}

.container.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0 auto;
  max-width: 100% !important;
}

/* FOOTER */
.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 1.25rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.container.container-full-width {
  max-width: 100% !important;
  width: 100% !important;
  padding: 1.25rem 2rem;
  margin: 0;
  box-sizing: border-box;
}

/* STANDARDIZED UNIFIED PAGE HEADER PANEL CARD WITH BREADCRUMB */
.page-header {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.page-header-back-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #475569;
  border: 1.5px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.page-header-back-btn:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: var(--primary);
  transform: translateX(-2px);
}

.page-header-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 1px solid #bfdbfe;
}

.page-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.page-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  margin-left: auto;
}

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

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.breadcrumb-trail strong {
  color: var(--text-main);
}

@media (max-width: 768px) {
  .page-header-right {
    align-items: flex-start;
    width: 100%;
  }
}


/* =========================================================
   2. STANDARISASI UKURAN BUTTON (BOOTSTRAP-LIKE DESIGN SYSTEM)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
  box-sizing: border-box;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Ukuran Tombol Standard - SELURUH TOMBOL DI-STANDARKAN KE UKURAN SMALL */
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.25;
  border-radius: var(--radius-xs);
  gap: 0.3rem;
  min-height: 26px;
}

.btn,
.btn-sm,
.btn-md {
  padding: 0.35rem 0.75rem;
  font-size: 0.84rem;
  line-height: 1.35;
  border-radius: var(--radius-sm);
  gap: 0.4rem;
  min-height: 32px;
}

.btn-lg {
  padding: 0.55rem 1.15rem;
  font-size: 0.95rem;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  gap: 0.5rem;
}

/* Tombol Icon Persegi / Bulat - Standar Small 32px */
.btn-icon,
.btn-icon-sm {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-icon-xs {
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
  border-radius: var(--radius-xs);
}

.btn-icon-lg {
  width: 38px;
  height: 38px;
  font-size: 1rem;
  border-radius: var(--radius-sm);
}

.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Varian Warna Tombol */
.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #ffffff;
  color: #334155;
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
  border-color: var(--success);
}
.btn-success:hover {
  background-color: var(--success-hover);
  border-color: var(--success-hover);
}

.btn-warning {
  background-color: var(--warning);
  color: #ffffff;
  border-color: var(--warning);
}
.btn-warning:hover {
  background-color: var(--warning-hover);
  border-color: var(--warning-hover);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background-color: var(--danger-hover);
  border-color: var(--danger-hover);
}

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

.btn-outline-secondary {
  background-color: transparent;
  color: #475569;
  border-color: var(--border-color);
}
.btn-outline-secondary:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.btn-outline-danger {
  background-color: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover {
  background-color: var(--danger);
  color: #ffffff;
}

.action-buttons-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}


/* =========================================================
   3. STANDARISASI FORM CONTROL (INPUT, TEXTAREA, SELECT)
   ========================================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

/* Standarisasi Form Label */
.form-label {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.15rem;
}

.form-label-xs { font-size: 0.75rem; font-weight: 700; }
.form-label-sm { font-size: 0.82rem; font-weight: 700; }
.form-label-lg { font-size: 1.05rem; font-weight: 700; }

.required-star {
  color: var(--danger);
  font-weight: bold;
  margin-left: 2px;
}

/* Form Helper Text */
.form-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.2rem;
}

.form-text-xs { font-size: 0.72rem; }
.form-text-sm { font-size: 0.78rem; }
.form-text-lg { font-size: 0.92rem; }

/* Standarisasi Input & Textarea */
.form-control {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.4;
  color: #1e293b;
  background-color: #ffffff;
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.form-control:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.form-control:disabled,
.form-control[readonly] {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

/* Ukuran Form Control - STANDARISASI SELURUH FORM KE SMALL */
.form-control-xs {
  min-height: 26px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-xs);
}

.form-control,
.form-control-sm,
.form-control-md {
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

.form-control-lg {
  min-height: 40px;
  padding: 0.55rem 0.95rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
}

textarea.form-control {
  min-height: auto;
  line-height: 1.5;
  resize: vertical;
}

/* =========================================================
   4. STANDARISASI SELECT OPTION (CUSTOM SVG CHEVRON, BUKAN DEFAULT)
   ========================================================= */
.form-select,
select.form-control,
.form-select-sm,
.form-select-md {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.4;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 11px 8px;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0.25rem 2rem 0.25rem 0.65rem !important;
  font-size: 0.82rem !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select:focus,
select.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.form-select:disabled,
select.form-control:disabled {
  background-color: #f1f5f9;
  cursor: not-allowed;
  opacity: 0.65;
}

/* Ukuran Form Select */
.form-select-xs {
  height: 26px !important;
  min-height: 26px !important;
  padding: 0.15rem 1.75rem 0.15rem 0.5rem !important;
  font-size: 0.75rem !important;
  background-position: right 0.45rem center !important;
  background-size: 10px 8px !important;
  border-radius: var(--radius-xs);
}

.form-select-sm {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0.25rem 2rem 0.25rem 0.65rem !important;
  font-size: 0.82rem !important;
  background-position: right 0.65rem center !important;
  background-size: 11px 8px !important;
  border-radius: var(--radius-sm);
}

.form-select-lg {
  height: 42px !important;
  min-height: 42px !important;
  padding: 0.55rem 2.85rem 0.55rem 0.95rem !important;
  font-size: 0.95rem !important;
  background-position: right 1rem center !important;
  background-size: 14px 10px !important;
  border-radius: var(--radius-sm);
}

/* Action Icons in Tables (No Gray Box, Pure Icon) */
.btn-action-icon,
button.btn-action-icon {
  background: transparent !important;
  background-color: transparent !important;
  border: 1px solid transparent !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  color: #64748b !important;
  cursor: pointer !important;
  padding: 0.35rem 0.5rem !important;
  border-radius: 6px !important;
  font-size: 0.95rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease-in-out !important;
  line-height: 1 !important;
}

.btn-action-icon:hover,
button.btn-action-icon:hover {
  background: #eff6ff !important;
  background-color: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: var(--primary) !important;
  transform: scale(1.15);
}

.btn-action-icon.btn-action-danger:hover,
button.btn-action-icon.btn-action-danger:hover {
  background: #fef2f2 !important;
  background-color: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
  transform: scale(1.15);
}

/* Segmented Filter Pills (Seperti Gambar 2) */
.filter-pills-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  white-space: nowrap;
}

.filter-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

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

.filter-pill-btn.active {
  background: #059669 !important; /* Emerald Green */
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.filter-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.filter-pill-btn.active .filter-pill-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

/* Multiple select */
select.form-control[multiple],
select.form-select[multiple] {
  padding-right: 0.95rem;
  background-image: none;
  min-height: 120px;
}

select.form-control[multiple] option {
  padding: 0.4rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 2px;
}

select.form-control[multiple] option:checked {
  background-color: var(--primary);
  color: #ffffff;
}


/* =========================================================
   5. STANDARISASI RADIO & CHECKBOX (CUSTOM DESIGNED, BUKAN DEFAULT BROWSER)
   ========================================================= */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 1.5rem;
  padding-left: 0;
  margin-bottom: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.form-check:last-child {
  margin-bottom: 0;
}

.form-check-inline {
  display: inline-flex;
  margin-right: 1.25rem;
  margin-bottom: 0;
}

.form-check-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  line-height: 1.4;
}

/* Custom Checkbox & Radio Input */
.form-check-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  border: 1.5px solid #94a3b8;
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  transition: all 0.15s ease-in-out;
  position: relative;
}

.form-check-input:hover {
  border-color: var(--primary);
}

.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

/* Checkbox Style */
.form-check-input[type="checkbox"] {
  border-radius: 4px;
}

.form-check-input[type="checkbox"]:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2.5-2.5a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

/* Radio Style */
.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input[type="radio"]:checked {
  background-color: #ffffff;
  border-color: var(--primary);
  border-width: 5px;
}

/* Ukuran Checkbox & Radio */
.form-check-sm .form-check-input,
.form-check-input-sm {
  width: 0.95rem;
  height: 0.95rem;
}
.form-check-sm .form-check-input[type="radio"]:checked {
  border-width: 4px;
}
.form-check-sm .form-check-label {
  font-size: 0.82rem;
}

.form-check-lg .form-check-input,
.form-check-input-lg {
  width: 1.4rem;
  height: 1.4rem;
}
.form-check-lg .form-check-input[type="radio"]:checked {
  border-width: 6px;
}
.form-check-lg .form-check-label {
  font-size: 1.05rem;
}


/* =========================================================
   6. TYPOGRAPHY SCALE & UTILITIES
   ========================================================= */
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.84rem !important; }
.text-base, .text-md { font-size: 0.92rem !important; }
.text-lg { font-size: 1.1rem !important; }
.text-xl { font-size: 1.35rem !important; }
.text-2xl { font-size: 1.65rem !important; }

.fw-normal { font-weight: 400 !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.fw-extrabold { font-weight: 800 !important; }

.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }


/* =========================================================
   7. BADGES, CARDS & TABLES
   ========================================================= */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.badge-sm { padding: 0.15rem 0.45rem; font-size: 0.7rem; }
.badge-lg { padding: 0.35rem 0.85rem; font-size: 0.85rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-draft { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.status-published { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.status-closed { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: #f8fafc;
  padding: 0.85rem 1.15rem;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-light);
  color: #1e293b;
  vertical-align: middle;
}

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

/* Pagination */
.table-pagination-footer {
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-page {
  min-width: 32px;
  height: 32px;
  padding: 0 0.45rem;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: #334155;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-page.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* =========================================================
   8. MODALS & TOASTS (UNIVERSAL & RESPONSIVE)
   ========================================================= */
.modal-backdrop,
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
  padding: 1rem;
  box-sizing: border-box;
}

.modal-backdrop.active,
.modal.active {
  display: flex !important;
}

.modal-dialog,
.modal-card {
  background: #ffffff !important;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100000;
  box-sizing: border-box;
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

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

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  background: #f8fafc;
}

/* Toast notifications (Posisi Kanan Atas Sesuai Standar) */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  background: #0f172a;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  animation: slideInTop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 5px solid var(--primary, #0284c7);
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast .toast-icon {
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast .toast-message {
  flex: 1;
}

.toast-info {
  background: #0f172a;
  border-left-color: #38bdf8;
  color: #ffffff;
}

.toast-success {
  background: #065f46;
  border-left-color: #34d399;
  color: #ffffff;
}

.toast-warning {
  background: #92400e;
  border-left-color: #fbbf24;
  color: #ffffff;
}

.toast-error, .toast-danger {
  background: #991b1b;
  border-left-color: #f87171;
  color: #ffffff;
}

@keyframes slideInTop {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

/* =========================================================
   9. RESPONSIVE DESIGN (DESKTOP, TABLET & MOBILE)
   ========================================================= */

/* Tablet & Smaller Screens (<= 1024px) */
@media (max-width: 1024px) {
  .designer-layout {
    grid-template-columns: 1fr !important;
  }
  .sidebar-panel {
    position: static !important;
    max-height: none !important;
    margin-bottom: 1.25rem !important;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .app-shell {
    position: relative;
    overflow-x: hidden;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    height: 100vh;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
  }
  .app-shell.sidebar-mobile-open .app-sidebar {
    transform: translateX(0);
  }
  .app-shell.sidebar-collapsed .app-sidebar {
    width: 260px;
    transform: translateX(-100%);
  }
  .app-shell.sidebar-collapsed.sidebar-mobile-open .app-sidebar {
    transform: translateX(0);
  }
  .app-shell.sidebar-collapsed.sidebar-mobile-open .sidebar-link-text,
  .app-shell.sidebar-collapsed.sidebar-mobile-open .brand-text,
  .app-shell.sidebar-collapsed.sidebar-mobile-open .sidebar-section-title {
    display: block !important;
  }
  .app-shell.sidebar-collapsed.sidebar-mobile-open .sidebar-header {
    justify-content: space-between;
    padding: 1.15rem;
  }
  .app-shell.sidebar-collapsed.sidebar-mobile-open .sidebar-toggle-btn {
    display: inline-flex !important;
  }

  /* Overlay backdrop for mobile drawer */
  .sidebar-mobile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 9998;
    display: none;
    backdrop-filter: blur(2px);
  }
  .app-shell.sidebar-mobile-open .sidebar-mobile-backdrop {
    display: block;
  }

  .app-header {
    padding: 0 1rem;
    height: 58px;
  }
  .server-status-pill span,
  .server-status-pill {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
  }
  .user-dropdown-trigger {
    padding: 0.25rem 0.5rem;
    gap: 0.4rem;
  }
  .user-name-header {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
  }
  .role-pill {
    font-size: 0.62rem;
    padding: 0.1rem 0.35rem;
  }

  .container {
    padding: 1rem 0.85rem;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }
  .page-header-left,
  .page-header-right {
    width: 100%;
    justify-content: space-between;
  }
  .page-title {
    font-size: 1.15rem;
  }
  .breadcrumb-trail {
    font-size: 0.75rem;
    flex-wrap: wrap;
  }

  /* Tables & Toolbars on Mobile */
  .card-header-actions,
  .table-toolbar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.5rem !important;
    width: 100%;
  }
  .table-toolbar input,
  .table-toolbar select,
  .table-toolbar button,
  .table-toolbar a {
    width: 100% !important;
  }

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

  /* Modals on Mobile */
  .modal-dialog,
  .modal-card {
    width: 96% !important;
    max-height: 94vh !important;
    margin: 0.5rem !important;
  }
  .modal-header,
  .modal-footer {
    padding: 0.85rem 1rem !important;
  }
  .modal-body {
    padding: 1rem !important;
    gap: 0.85rem !important;
  }

  /* Designer Cards on Mobile */
  .bab-card {
    padding: 1.15rem 1rem !important;
  }
  .subbab-card {
    padding: 1rem 0.75rem !important;
  }
  .question-box {
    padding: 1rem 0.85rem !important;
  }
  .question-box > div {
    flex-direction: column;
    gap: 0.65rem !important;
  }
  .question-box > div > div:last-child {
    align-self: flex-end;
  }
}

/* Small Smartphone (< 480px) */
@media (max-width: 480px) {
  .server-status-pill {
    display: none;
  }
  .user-name-header {
    display: none;
  }
}
