/* ========================================
   USERS VIEW
======================================== */

.users-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.users-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.users-header .btn {
  flex-shrink: 0;
  min-width: 160px;
  height: 44px;
}

.users-title h1 {
  margin: 0;
  font-size: 32px;
}

.users-title p {
  margin-top: 6px;
  opacity: 0.7;
}

/* KPI */

.users-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.user-kpi-card {
  background: #141414;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 18px 20px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.2s ease;
}

.user-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.18);
}

.user-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}

.user-kpi-value {
  margin-top: 8px;
  font-size: 32px;
  font-weight: 700;
}

/* CREATE USER DRAWER */

.users-create-card {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 95vw;
  height: 100vh;
  z-index: 1000;
  background: #111111;
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}

.users-create-card.is-hidden {
  display: none;
}

.users-create-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

/* TABLE CARD */

.users-table-card {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 18px;
  background: #141414;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0;
}

/* TOOLBAR */

.users-toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.users-toolbar input,
.users-toolbar select {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  font-size: 14px;
  color: #ffffff;
}

/* TABLE */

.users-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: fixed;
}

.users-table thead {
  background: rgba(255,255,255,0.02);
}

.users-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.65;
  padding: 12px 12px;
}

.users-table td {
  padding: 10px 12px;
  vertical-align: middle;
  font-size: 13px;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 15%;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 16%;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 8%;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  width: 10%;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  width: 10%;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
  width: 16%;
}

.users-table th:nth-child(7),
.users-table td:nth-child(7) {
  width: 28%;
}

.users-table tbody tr {
  border-top: 1px solid rgba(255,255,255,0.05);
  transition: all 0.2s ease;
}

.users-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

/* STATUS */

.user-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.user-status-active {
  background: rgba(0,255,120,0.12);
  border: 1px solid rgba(0,255,120,0.25);
}

.user-status-inactive {
  background: rgba(255,120,120,0.12);
  border: 1px solid rgba(255,120,120,0.25);
}

/* PASSWORD */

.user-password input {
  width: 100%;
  font-family: monospace;
}

.users-table input[readonly] {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 9px 10px;
  color: #ffffff;
}

/* ACTIONS */

.user-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-width: 220px;
}

.user-actions button {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}

.copy-password-btn {
  min-width: 100px;
}

/* RESPONSIVE */

@media (max-width: 1200px) {

  .users-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 768px) {

  .users-kpis {
    grid-template-columns: 1fr;
  }

  .users-toolbar {
    grid-template-columns: 1fr;
  }

  .users-create-card {
    width: 100%;
  }

}