/* ============================================================
  DigiSurat - Global Stylesheet
   ============================================================ */

/* Mengimpor font Poppins dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --sidebar-bg: #1a2332;
  --sidebar-hover: #253044;
  --sidebar-active: #2d3f56;
  --sidebar-width: 230px;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --accent-light: #60a5fa;
  --topbar-bg: #ffffff;
  --topbar-border: #e5e7eb;
  --content-bg: #f3f4f6;
  --card-bg: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-sidebar: #cbd5e1;
  --text-sidebar-active: #ffffff;
  --border: #e5e7eb;
  --border-light: #f1f5f9;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --transition: 0.2s ease;
  
  /* Mengatur variabel font menjadi Poppins */
  --font: 'Poppins', sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--content-bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul, li { list-style: none; }
button { cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
img { max-width: 100%; display: block; }

/* ============================================================
   LAYOUT
   ============================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 64px;
}

.sidebar-logo img.logo-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo .brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.sidebar-logo .brand-name span {
  color: var(--accent-light);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  color: var(--text-sidebar);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  white-space: nowrap;
  /* Vendor prefix ditambahkan di sini */
  -webkit-user-select: none;
  user-select: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left: 3px solid var(--accent);
}

.nav-item .nav-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* ---------- TOP BAR ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 64px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 90;
  gap: 16px;
}

.topbar-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background var(--transition);
  position: relative;
}

.user-menu-btn:hover { background: var(--border-light); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.user-menu-btn .chevron {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 190px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a,
.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-primary);
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  transition: background var(--transition);
}

.dropdown-menu a:hover,
.dropdown-menu button:hover { background: var(--border-light); }

.dropdown-menu .dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.dropdown-menu .logout-btn { color: var(--danger); }

/* ---------- MAIN CONTENT ---------- */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: 64px;
  flex: 1;
  padding: 28px;
  min-height: calc(100vh - 64px);
  background: var(--content-bg);
}

/* ============================================================
   CARDS / STATS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  text-align: center;
  display: block;
}

.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  display: block;
}

/* ============================================================
  PANEL / TABLE
   ============================================================ */
.panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  padding: 20px 24px 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  white-space: normal;
  word-wrap: break-word;
}

.data-table th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.87rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.data-table td:nth-child(5) {
  white-space: normal;
  min-width: 250px;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }

/* Action buttons in table */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background var(--transition), color var(--transition);
}

.btn-edit { background: #eff6ff; color: var(--accent); }
.btn-edit:hover { background: var(--accent); color: #fff; }
.btn-delete { background: #fef2f2; color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: #fff; }
.btn-download { background: #f0fdf4; color: var(--success); }
.btn-download:hover { background: var(--success); color: #fff; }

/* "Lihat Semua" link */
.see-all-link {
  display: block;
  text-align: center;
  padding: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition);
  border-top: 1px solid var(--border-light);
}
.see-all-link:hover { color: var(--accent); }

/* ============================================================
  TOOLBAR (search + buttons)
  ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  gap: 8px;
  height: 40px;
  min-width: 240px;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.88rem;
  flex: 1;
  color: var(--text-primary);
}

.search-box input::placeholder { color: var(--text-muted); }
.search-box .search-icon { color: var(--text-muted); font-size: 0.85rem; }

.select-box {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.spacer { flex: 1; }

/* ============================================================
  BUTTONS
  ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 2px 8px rgba(59,130,246,0.35); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--border-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-download-all { background: var(--card-bg); color: var(--text-primary); border: 1.5px solid var(--border); }
.btn-download-all:hover { background: var(--border-light); }
.btn-upload { background: var(--card-bg); color: var(--text-primary); border: 1.5px solid var(--border); }
.btn-upload:hover { background: var(--border-light); }
.btn-add { border: 2px solid var(--text-primary); background: transparent; color: var(--text-primary); }
.btn-add:hover { background: var(--text-primary); color: #fff; }

/* ============================================================
  MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 48px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 500px;
  padding: 28px;
  transform: translateY(-12px) scale(0.97);
  transition: transform 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: none;
  background: var(--border-light);
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--border); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: #fff;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* File upload style */
.file-upload-area {
  display: block; /* PERBAIKAN BUG: Mencegah area upload hancur/kolaps ke kiri */
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.file-upload-area:hover { border-color: var(--accent); background: #eff6ff; }
.file-upload-area .upload-icon { font-size: 1.6rem; color: var(--text-muted); margin-bottom: 6px; }
.file-upload-area .upload-text { font-size: 0.83rem; color: var(--text-secondary); }
.file-upload-area input[type="file"] { display: none; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2332 0%, #253044 50%, #1e3a5f 100%);
  padding: 20px;
}
.login-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 48px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
}
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; }
.login-logo img { width: 44px; height: 44px; border-radius: 10px; }
.login-logo .brand { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); }
.login-logo .brand span { color: var(--accent); }
.login-subtitle { text-align: center; font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 28px; }
.login-footer { text-align: center; margin-top: 18px; font-size: 0.82rem; color: var(--text-muted); }

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}
.profile-avatar-wrap {
  position: relative;
  width: 90px; height: 90px;
  margin-bottom: 12px;
}
.profile-avatar-wrap img {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}
.avatar-edit-btn {
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}
.avatar-edit-btn:hover { background: var(--accent-dark); }
.profile-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 2px; }
.profile-role { font-size: 0.82rem; color: var(--text-secondary); }
.hak-akses-badge {
  position: absolute;
  top: 0; right: 0;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 22px;
}
.profile-tab {
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: flex; align-items: center; gap: 6px;
  transition: color var(--transition), border-color var(--transition);
  background: none; border-top: none; border-left: none; border-right: none;
}
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.profile-tab:hover:not(.active) { color: var(--text-primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.profile-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.info-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.info-field .field-value {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.info-field .field-icon { color: var(--text-muted); font-size: 0.82rem; }
.profile-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mini-stat {
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.mini-stat .mini-stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 8px; }
.mini-stat .mini-stat-value { font-size: 1.25rem; font-weight: 700; }
.activity-table { width: 100%; }
.activity-table th, .activity-table td { padding: 10px 12px; font-size: 0.85rem; text-align: left; }
.activity-table th { color: var(--text-secondary); font-weight: 600; font-size: 0.78rem; border-bottom: 1px solid var(--border); }
.activity-table td { border-bottom: 1px solid var(--border-light); }
.badge-success { background: #dcfce7; color: #166534; padding: 2px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-info { background: #dbeafe; color: #1e40af; padding: 2px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }

/* ============================================================
   ALGORITMA PAGE
   ============================================================ */
.algo-legend {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 0.85rem; }
.legend-dot { width: 14px; height: 14px; border-radius: 50%; }
.algo-chart-wrap { padding: 0 24px 24px; }
.algo-bars { display: flex; flex-direction: column; gap: 10px; }
.algo-bar-row { display: flex; align-items: center; gap: 12px; }
.algo-bar-label { width: 100px; font-size: 0.82rem; color: var(--text-secondary); text-align: right; flex-shrink: 0; }
.algo-bar-track {
  flex: 1;
  height: 20px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.algo-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s ease;
}
.algo-bar-fill.nb { background: #3b82f6; }
.algo-bar-fill.knn { background: #8b5cf6; }
.algo-bar-val { width: 42px; font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: #1a2332;
  color: #fff;
  border-radius: 8px;
  padding: 13px 18px;
  font-size: 0.87rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  animation: slideInRight 0.25s ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent); }
@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(20px); }
}
.toast.fade-out { animation: fadeOut 0.3s ease forwards; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  :root { --sidebar-width: 64px; }
  .sidebar-logo .brand-name,
  .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item .nav-icon { width: auto; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .profile-info-grid { grid-template-columns: 1fr; }
  .profile-mini-stats { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
}

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fef2f2;
  color: var(--danger);
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.confirm-text { text-align: center; margin-bottom: 22px; }
.confirm-text h3 { font-size: 1rem; margin-bottom: 6px; }
.confirm-text p { font-size: 0.85rem; color: var(--text-secondary); }

/* ============================================================
   LAPORAN PAGE
   ============================================================ */
.laporan-filter { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.chart-placeholder {
  height: 180px;
  background: linear-gradient(120deg, #eff6ff, #f0fdf4);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 16px 0;
  border: 1px dashed var(--border);
  position: relative;
  overflow: hidden;
}

/* ============================================================
   PENGATURAN AI
   ============================================================ */
.ai-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.ai-setting-row:last-child { border-bottom: none; }
.ai-setting-info .setting-name { font-size: 0.9rem; font-weight: 600; }
.ai-setting-info .setting-desc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================================
   MANAJEMEN USER
   ============================================================ */
.user-role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.role-admin { background: #dbeafe; color: #1d4ed8; }
.role-karyawan { background: #dcfce7; color: #15803d; }
.status-active { background: #dcfce7; color: #15803d; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status-inactive { background: #fee2e2; color: #b91c1c; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.88rem; }

/* password strength */
.password-strength { height: 4px; border-radius: 4px; margin-top: 6px; transition: background 0.3s, width 0.3s; background: #e5e7eb; }
.strength-weak { background: var(--danger); width: 33%; }
.strength-medium { background: var(--warning); width: 66%; }
.strength-strong { background: var(--success); width: 100%; }

/* ============================================================
  GANTI SANDI MODAL Extras
  ============================================================ */
.pass-input-wrap { position: relative; }
.pass-input-wrap .form-control { padding-right: 40px; }
.pass-eye-btn {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0;
}