/* Admin page */
.adm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.adm-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.adm-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.adm-stat-num  { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1; }
.adm-stat-label { font-size: 13px; font-weight: 600; color: #334155; margin-top: 4px; }
.adm-stat-sub   { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* Tabs */
.adm-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
  margin-bottom: 20px;
}
.adm-tab-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: .15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.adm-tab-btn.active { background: #fff; color: #0f172a; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.adm-tab-btn:hover:not(.active) { color: #334155; background: rgba(255,255,255,.5); }

/* Panel */
.adm-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
}
.adm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.adm-panel-title { font-size: 16px; font-weight: 700; color: #0f172a; }

/* Table */
.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0 12px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}
.adm-table td { padding: 14px 12px; border-bottom: 1px solid #f8fafc; vertical-align: middle; }
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover td { background: #fafbff; }

.adm-user-cell { display: flex; align-items: center; gap: 10px; }
.adm-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.adm-user-name { font-size: 14px; font-weight: 600; color: #0f172a; }

.adm-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.adm-role-admin    { background: #dbeafe; color: #1d4ed8; }
.adm-role-engineer { background: #dcfce7; color: #15803d; }
.adm-role-viewer   { background: #f1f5f9; color: #475569; }

.adm-role-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fff;
}
.adm-role-card:hover { border-color: #93c5fd; background: #f8faff; }
.adm-role-card.active { border-color: #2f66eb; background: #eff6ff; }

.adm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.adm-status-active  { background: #dcfce7; color: #15803d; }
.adm-status-passive { background: #fef3c7; color: #d97706; }
.adm-status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.adm-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 5px;
  border-radius: 6px;
  transition: .15s;
}
.adm-action-btn:hover { color: #0f172a; background: #f1f5f9; }

/* Add button */
.adm-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
}
.adm-add-btn:hover { background: #4f46e5; }

/* System tab cards */
.adm-sys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.adm-sys-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
}
.adm-sys-card-label { font-size: 12px; color: #94a3b8; font-weight: 500; margin-bottom: 6px; }
.adm-sys-card-value { font-size: 15px; font-weight: 700; color: #0f172a; }

/* Modal */
.adm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}
.adm-modal-overlay.open { display: flex; }
.adm-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 440px;
  max-width: 96vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}
.adm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.adm-modal-title { font-size: 17px; font-weight: 700; color: #0f172a; }
.adm-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  padding: 2px;
}
.adm-modal-close:hover { color: #334155; }
.adm-form-group { margin-bottom: 16px; }
.adm-form-label { font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; display: block; }
.adm-form-input,
.adm-form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #0f172a;
  outline: none;
  transition: .15s;
  box-sizing: border-box;
  background: #fff;
}
.adm-form-input:focus,
.adm-form-select:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .1); }
.adm-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.adm-btn-cancel {
  padding: 10px 20px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
}
.adm-btn-cancel:hover { background: #f8fafc; }
.adm-btn-save {
  padding: 10px 20px;
  border: none;
  background: #6366f1;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}
.adm-btn-save:hover { background: #4f46e5; }
