/* ================================
   User Management
   Prefix: .um-
   ================================ */

.um-page {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.um-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.um-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.um-subtitle {
  color: #64748b;
  font-size: 0.875rem;
  margin: 4px 0 0;
}

/* Stats */
.um-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.um-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  flex: 1;
}
.um-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #334155;
}
.um-stat--green { color: #16a34a; }
.um-stat--red   { color: #dc2626; }
.um-stat--purple { color: #7c3aed; }
.um-stat--blue  { color: #2563eb; }
.um-stat--orange { color: #ea580c; }
.um-stat-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Filters */
.um-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.um-search {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 14px;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  transition: border-color .2s;
}
.um-search:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}
.um-search input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 0.875rem;
  color: #334155;
  background: transparent;
}
.um-search input::placeholder { color: #cbd5e1; }

.um-filter-select {
  padding: 9px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.875rem;
  color: #334155;
  background: #fff;
  cursor: pointer;
  min-width: 130px;
}
.um-filter-select:focus {
  outline: none;
  border-color: #6366f1;
}

/* Loading/Empty */
.um-loading, .um-empty {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
  font-size: 0.9375rem;
}

/* Table */
.um-table-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.um-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.um-table thead {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.um-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.um-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.um-table tbody tr:last-child td { border-bottom: none; }
.um-table tbody tr:hover { background: #f8fafc; }
.um-row--inactive td { opacity: 0.55; }

/* User cell */
.um-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.um-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.um-user-name {
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.um-user-username {
  font-size: 0.75rem;
  color: #94a3b8;
}
.um-email { color: #64748b; }
.um-login-count {
  text-align: center;
  color: #64748b;
  font-weight: 500;
}
.um-date {
  color: #94a3b8;
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* Badges */
.um-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.um-badge--admin {
  background: #faf5ff;
  color: #7c3aed;
}
.um-badge--perawat {
  background: #eff6ff;
  color: #2563eb;
}
.um-badge--kepala {
  background: #fff7ed;
  color: #ea580c;
}
.um-badge--aktif {
  background: #f0fdf4;
  color: #16a34a;
}
.um-badge--nonaktif {
  background: #fef2f2;
  color: #dc2626;
}
.um-badge--you {
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.625rem;
  padding: 1px 6px;
  border-radius: 4px;
}

/* Action buttons */
.um-actions {
  display: flex;
  gap: 4px;
}
.um-act-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .1s;
  background: transparent;
}
.um-act-btn:hover { transform: scale(1.08); }
.um-act-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.um-act--edit { color: #2563eb; }
.um-act--edit:hover { background: #eff6ff; }
.um-act--key { color: #f59e0b; }
.um-act--key:hover { background: #fffbeb; }
.um-act--deactivate { color: #94a3b8; }
.um-act--deactivate:hover { background: #f1f5f9; }
.um-act--activate { color: #16a34a; }
.um-act--activate:hover { background: #f0fdf4; }
.um-act--delete { color: #dc2626; }
.um-act--delete:hover { background: #fef2f2; }

/* Buttons */
.um-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.um-btn:active { transform: scale(0.97); }
.um-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.um-btn--primary { background: #6366f1; color: #fff; }
.um-btn--primary:hover:not(:disabled) { background: #4f46e5; }
.um-btn--outline { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.um-btn--outline:hover { background: #f8fafc; }
.um-btn--warning { background: #f59e0b; color: #fff; }
.um-btn--warning:hover:not(:disabled) { background: #d97706; }

/* Modal */
.um-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: umFadeIn .15s ease;
}
@keyframes umFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.um-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: umModalIn .2s ease;
}
.um-modal--sm { max-width: 440px; }
@keyframes umModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.um-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}
.um-modal-header h3 { margin: 0; font-size: 1.125rem; color: #1e293b; }
.um-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.um-modal-close:hover { color: #475569; }
.um-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.um-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
}

/* Form */
.um-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.um-form-group {
  margin-bottom: 14px;
}
.um-form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 5px;
}
.um-req { color: #ef4444; }
.um-hint { font-size: 0.7rem; color: #94a3b8; display: block; margin-top: 3px; }

.um-form-group input,
.um-form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #334155;
  background: #fff;
  transition: border-color .2s;
  box-sizing: border-box;
}
.um-form-group input:focus,
.um-form-group select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}
.um-form-group input:disabled,
.um-form-group select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
}

.um-reset-info {
  font-size: 0.875rem;
  color: #475569;
  margin: 0 0 16px;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 900px) {
  .um-table-wrap { overflow-x: auto; }
  .um-table { min-width: 700px; }
}

@media (max-width: 768px) {
  .um-page { padding: 16px; }
  .um-header { flex-direction: column; }
  .um-stats { gap: 8px; }
  .um-stat { padding: 10px 12px; min-width: 60px; }
  .um-form-row { grid-template-columns: 1fr; }
  .um-filters { flex-direction: column; }
  .um-filter-select { min-width: 100%; }
}
