/* =========================================================
   WIRTZ HUB · HERRAMIENTAS · USUARIOS DEL SISTEMA
   CSS completo · Nueva estructura sin ventana
   Lista izquierda + detalle derecho + tabs
   Versión más amplia verticalmente
   ========================================================= */

/* =========================================================
   RESET LOCAL
   ========================================================= */

.users-system-page,
.users-system-page *,
.users-system-toast {
  box-sizing: border-box;
  font-family:
    "ATF Franklin Gothic",
    "Franklin Gothic Medium",
    "Arial Narrow",
    Arial,
    sans-serif !important;
}

.users-system-page {
  --users-bg: rgba(255, 255, 255, 0.97);
  --users-bg-solid: #ffffff;
  --users-bg-soft: #f8fafc;
  --users-bg-soft-2: #f3f4f6;
  --users-hover: rgba(15, 23, 42, 0.045);

  --users-border: rgba(15, 23, 42, 0.095);
  --users-border-strong: rgba(15, 23, 42, 0.16);

  --users-text: #111827;
  --users-muted: #6b7280;
  --users-muted-2: #9ca3af;

  --users-green: #16a34a;
  --users-red: #dc2626;
  --users-blue: #2563eb;
  --users-purple: #7c3aed;
  --users-teal: #0f766e;

  --users-radius-lg: 15px;
  --users-radius-md: 12px;
  --users-radius-sm: 10px;

  --users-shadow:
    0 1px 0 rgba(255, 255, 255, 0.74) inset,
    0 10px 26px rgba(15, 23, 42, 0.045);

  --users-transition: 0.18s ease;

  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;

  width: 100%;
  min-width: 0;
  min-height: calc(100vh - var(--topbar-height) - 42px);

  color: var(--users-text);
  overflow: visible;

  animation: usersSystemPageIn 0.2s ease both;
}

html[data-theme="dark"] .users-system-page {
  --users-bg: rgba(13, 13, 13, 0.97);
  --users-bg-solid: #101010;
  --users-bg-soft: #151515;
  --users-bg-soft-2: #1d1d1d;
  --users-hover: rgba(255, 255, 255, 0.055);

  --users-border: rgba(255, 255, 255, 0.095);
  --users-border-strong: rgba(255, 255, 255, 0.15);

  --users-text: rgba(255, 255, 255, 0.92);
  --users-muted: rgba(255, 255, 255, 0.54);
  --users-muted-2: rgba(255, 255, 255, 0.34);

  --users-green: #4ade80;
  --users-red: #f87171;
  --users-blue: #60a5fa;
  --users-purple: #a78bfa;
  --users-teal: #2dd4bf;

  --users-shadow:
    0 1px 0 rgba(255, 255, 255, 0.045) inset,
    0 14px 34px rgba(0, 0, 0, 0.34);
}

/* =========================================================
   BASE
   ========================================================= */

.users-system-head,
.users-system-metrics,
.users-system-list-panel,
.users-system-detail-panel,
.users-system-detail,
.users-system-denied {
  width: 100%;
  max-width: 100%;
  min-width: 0;

  border: 1px solid var(--users-border);
  border-radius: var(--users-radius-lg);
  background: var(--users-bg);
  box-shadow: var(--users-shadow);

  overflow: hidden;

  transition:
    background var(--users-transition),
    border-color var(--users-transition),
    box-shadow var(--users-transition);
}

.users-system-head:hover,
.users-system-list-panel:hover,
.users-system-detail-panel:hover {
  border-color: var(--users-border-strong);
}

/* =========================================================
   HEADER
   ========================================================= */

.users-system-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;

  min-height: 68px;
  padding: 14px 16px;
}

.users-system-brand {
  display: flex;
  align-items: center;
  gap: 11px;

  min-width: 0;
}

.users-system-brand__icon {
  display: grid;
  width: 40px;
  height: 40px;
  min-width: 40px;
  place-items: center;

  border: 1px solid var(--users-border-strong);
  border-radius: 13px;
  background: var(--users-bg-soft);

  color: var(--users-text);
}

.users-system-brand__icon .icon {
  width: 19px;
  height: 19px;
  stroke-width: 2.15;
}

.users-system-brand h2 {
  margin: 0;

  color: var(--users-text);

  font-size: 17px;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.users-system-brand p {
  margin: 5px 0 0;
  max-width: 820px;

  color: var(--users-muted);

  font-size: 11.5px;
  font-weight: 760;
  line-height: 1.35;
}

.users-system-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;

  min-width: 0;
}

/* =========================================================
   BOTONES
   ========================================================= */

.users-system-btn,
.users-system-row-btn,
.users-system-mini-action,
.users-system-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  min-height: 36px;
  padding: 0 13px;

  border: 1px solid var(--users-border-strong);
  border-radius: 11px;
  background: transparent;

  color: var(--users-text);

  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
  outline: none;

  transition:
    background var(--users-transition),
    border-color var(--users-transition),
    color var(--users-transition),
    transform var(--users-transition),
    opacity var(--users-transition);
}

.users-system-btn:hover,
.users-system-row-btn:hover,
.users-system-mini-action:hover,
.users-system-tab:hover {
  background: var(--users-hover);
  border-color: color-mix(in srgb, var(--users-text) 24%, transparent);
  transform: translateY(-1px);
}

.users-system-btn:active,
.users-system-row-btn:active,
.users-system-mini-action:active,
.users-system-tab:active {
  transform: translateY(0) scale(0.985);
}

.users-system-btn:focus-visible,
.users-system-row-btn:focus-visible,
.users-system-mini-action:focus-visible,
.users-system-tab:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--users-text) 15%, transparent);
}

.users-system-btn .icon,
.users-system-row-btn .icon,
.users-system-mini-action .icon,
.users-system-tab .icon {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  stroke-width: 2.25;
}

.users-system-btn--dark,
.users-system-row-btn--dark {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.users-system-btn--dark:hover,
.users-system-row-btn--dark:hover {
  border-color: #030712;
  background: #030712;
  color: #ffffff;
}

.users-system-btn--danger,
.users-system-row-btn--danger {
  border-color: color-mix(in srgb, var(--users-red) 44%, transparent);
  color: var(--users-red);
}

.users-system-btn--danger:hover,
.users-system-row-btn--danger:hover {
  background: color-mix(in srgb, var(--users-red) 9%, transparent);
}

html[data-theme="dark"] .users-system-btn--dark,
html[data-theme="dark"] .users-system-row-btn--dark {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: #090909;
}

html[data-theme="dark"] .users-system-btn--dark:hover,
html[data-theme="dark"] .users-system-row-btn--dark:hover {
  border-color: rgba(255, 255, 255, 0.98);
  background: rgba(255, 255, 255, 0.82);
  color: #090909;
}

/* =========================================================
   MÉTRICAS
   ========================================================= */

.users-system-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.users-system-metric {
  display: grid;
  align-content: center;
  gap: 6px;

  min-height: 64px;
  padding: 13px 14px;

  border-right: 1px solid var(--users-border);
  background: transparent;
}

.users-system-metric:last-child {
  border-right: 0;
}

.users-system-metric:hover {
  background: var(--users-hover);
}

.users-system-metric span {
  min-width: 0;

  color: var(--users-muted);

  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-system-metric strong {
  color: var(--users-text);

  font-size: 20px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.045em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-system-metric small {
  color: var(--users-muted-2);

  font-size: 9px;
  font-weight: 820;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-system-metric:nth-child(2) strong {
  color: var(--users-green);
}

.users-system-metric:nth-child(3) strong {
  color: var(--users-red);
}

.users-system-metric:nth-child(4) strong {
  color: var(--users-blue);
}

.users-system-metric:nth-child(5) strong {
  color: var(--users-purple);
}

.users-system-metric:nth-child(6) strong {
  color: var(--users-teal);
}

/* =========================================================
   WORKSPACE
   ========================================================= */

.users-system-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 12px;

  width: 100%;
  min-width: 0;
  min-height: 0;

  overflow: visible;
}

.users-system-list-panel,
.users-system-detail-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.users-system-list-panel {
  grid-template-rows: auto minmax(0, 1fr);
  align-self: start;
}

.users-system-detail-panel {
  min-height: 720px;
  background: var(--users-bg);
  overflow: visible;
}

/* =========================================================
   TOOLBAR / FILTROS
   ========================================================= */

.users-system-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;

  padding: 13px 14px;

  border-bottom: 1px solid var(--users-border);
  background: color-mix(in srgb, var(--users-bg-soft) 62%, transparent);
}

.users-system-toolbar--stack {
  grid-template-columns: 1fr;
  gap: 11px;
}

.users-system-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.users-system-title span,
.users-system-panel-title span {
  color: var(--users-muted);

  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.users-system-title strong,
.users-system-panel-title strong {
  color: var(--users-text);

  font-size: 14.5px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.users-system-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.users-system-filters--stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.users-system-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.users-system-search {
  display: flex;
  align-items: center;
  gap: 8px;

  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 13px;

  border: 1px solid var(--users-border-strong);
  border-radius: 12px;
  background: var(--users-bg);

  color: var(--users-muted);
}

.users-system-search:focus-within {
  border-color: color-mix(in srgb, var(--users-text) 30%, transparent);
  background: color-mix(in srgb, var(--users-bg) 92%, var(--users-hover));
}

.users-system-search .icon {
  width: 14px;
  height: 14px;
  min-width: 14px;
  stroke-width: 2.15;
  color: var(--users-muted);
}

.users-system-search input {
  width: 100%;
  min-width: 0;

  border: 0;
  background: transparent;

  color: var(--users-text);
  outline: none;

  font-size: 11px;
  font-weight: 780;
}

.users-system-search input::placeholder {
  color: var(--users-muted-2);
}

.users-system-filters select {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 13px;

  border: 1px solid var(--users-border-strong);
  border-radius: 12px;
  background: var(--users-bg);

  color: var(--users-text);
  outline: none;

  font-size: 11px;
  font-weight: 850;
}

/* =========================================================
   LISTA DE USUARIOS
   ========================================================= */

.users-system-users-list {
  display: grid;
  align-content: start;
  gap: 10px;

  min-width: 0;
  min-height: 0;
  max-height: none;
  padding: 12px;

  overflow-y: visible;
  overflow-x: hidden;
}

.users-system-user-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;

  width: 100%;
  min-width: 0;
  min-height: 82px;
  padding: 12px;

  border: 1px solid var(--users-border);
  border-radius: 15px;
  background: var(--users-bg-solid);

  color: var(--users-text);
  text-align: left;

  cursor: pointer;
  outline: none;

  transition:
    background var(--users-transition),
    border-color var(--users-transition),
    transform var(--users-transition),
    box-shadow var(--users-transition);
}

.users-system-user-card:hover {
  border-color: var(--users-border-strong);
  background: color-mix(in srgb, var(--users-bg-soft) 65%, var(--users-bg-solid));
  transform: translateY(-1px);
}

.users-system-user-card.is-selected {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

html[data-theme="dark"] .users-system-user-card {
  background: #101010;
}

html[data-theme="dark"] .users-system-user-card:hover {
  background: #171717;
}

html[data-theme="dark"] .users-system-user-card.is-selected {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: #090909;
}

.users-system-user-card__avatar {
  display: grid;
  width: 40px;
  height: 40px;
  min-width: 40px;
  place-items: center;

  border: 1px solid var(--users-border-strong);
  border-radius: 13px;
  background: var(--users-bg-soft);

  color: var(--users-text);

  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.users-system-user-card.is-selected .users-system-user-card__avatar {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

html[data-theme="dark"] .users-system-user-card.is-selected .users-system-user-card__avatar {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.08);
  color: #090909;
}

.users-system-user-card__body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.users-system-user-card__body strong {
  color: currentColor;

  font-size: 12.5px;
  font-weight: 950;
  line-height: 1.1;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-system-user-card__body small {
  color: var(--users-muted);

  font-size: 10px;
  font-weight: 820;
  line-height: 1.1;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-system-user-card__meta {
  color: var(--users-muted-2);

  font-size: 9.5px;
  font-weight: 820;
  line-height: 1.15;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-system-user-card.is-selected .users-system-user-card__body small,
.users-system-user-card.is-selected .users-system-user-card__meta {
  color: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .users-system-user-card.is-selected .users-system-user-card__body small,
html[data-theme="dark"] .users-system-user-card.is-selected .users-system-user-card__meta {
  color: rgba(0, 0, 0, 0.62);
}

.users-system-user-card__state {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 25px;
  padding: 0 10px;

  border: 1px solid currentColor;
  border-radius: 999px;

  font-size: 9.5px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.users-system-user-card__state.is-active {
  color: var(--users-green);
}

.users-system-user-card__state.is-inactive {
  color: var(--users-red);
}

.users-system-user-card.is-selected .users-system-user-card__state {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

html[data-theme="dark"] .users-system-user-card.is-selected .users-system-user-card__state {
  color: #090909;
  border-color: rgba(0, 0, 0, 0.32);
}

/* =========================================================
   EMPTY
   ========================================================= */

.users-system-empty-card,
.users-system-detail-empty {
  display: grid;
  place-items: center;
  gap: 8px;

  min-height: 220px;
  padding: 24px;

  border: 1px solid var(--users-border);
  border-radius: 15px;
  background: var(--users-bg-solid);

  text-align: center;
}

.users-system-empty-card strong,
.users-system-detail-empty strong {
  color: var(--users-text);

  font-size: 14px;
  font-weight: 950;
  line-height: 1.15;
}

.users-system-empty-card span,
.users-system-detail-empty p {
  margin: 0;

  color: var(--users-muted);

  font-size: 11px;
  font-weight: 820;
  line-height: 1.35;
}

.users-system-empty-card.is-error strong {
  color: var(--users-red);
}

.users-system-detail-empty .icon {
  width: 38px;
  height: 38px;
  stroke-width: 2.1;
  color: var(--users-muted);
}

/* =========================================================
   PANEL DETALLE
   ========================================================= */

.users-system-detail {
  display: grid;
  grid-auto-rows: max-content;

  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;

  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

.users-system-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;

  min-height: 90px;
  padding: 16px;

  border-bottom: 1px solid var(--users-border);
  background: color-mix(in srgb, var(--users-bg-soft) 52%, transparent);
}

.users-system-detail-user {
  display: flex;
  align-items: center;
  gap: 12px;

  min-width: 0;
}

.users-system-detail-user__avatar {
  display: grid;
  width: 48px;
  height: 48px;
  min-width: 48px;
  place-items: center;

  border: 1px solid var(--users-border-strong);
  border-radius: 15px;
  background: var(--users-bg-solid);

  color: var(--users-text);

  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.users-system-detail-user > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.users-system-detail-user span:not(.users-system-detail-user__avatar) {
  color: var(--users-muted);

  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.users-system-detail-user h3 {
  margin: 0;

  color: var(--users-text);

  font-size: 18px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.04em;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-system-detail-user p {
  margin: 0;

  color: var(--users-muted);

  font-size: 11px;
  font-weight: 820;
  line-height: 1.2;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-system-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   BADGES
   ========================================================= */

.users-system-status,
.users-system-role,
.users-system-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 28px;
  padding: 0 11px;

  border: 1px solid var(--users-border);
  border-radius: 999px;
  background: var(--users-bg-soft);

  color: var(--users-text);

  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.users-system-status.is-active {
  color: var(--users-green);
}

.users-system-status.is-inactive {
  color: var(--users-red);
}

.users-system-role.is-admin {
  color: var(--users-blue);
}

.users-system-role.is-supervisor {
  color: var(--users-purple);
}

.users-system-pill {
  color: var(--users-teal);
}

/* =========================================================
   TABS
   ========================================================= */

.users-system-tabs {
  display: flex;
  align-items: center;
  gap: 8px;

  min-width: 0;
  padding: 12px 14px;

  border-bottom: 1px solid var(--users-border);
  background: var(--users-bg);
  overflow-x: auto;
}

.users-system-tab {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;

  font-size: 10.5px;
}

.users-system-tab.is-active {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

html[data-theme="dark"] .users-system-tab.is-active {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: #090909;
}

.users-system-tab-panel {
  display: grid;
  align-content: start;
  gap: 16px;

  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 16px;

  overflow: visible;
}

/* =========================================================
   PANEL TITLE
   ========================================================= */

.users-system-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  min-width: 0;
  min-height: 60px;
  padding: 14px 15px;

  border: 1px solid var(--users-border);
  border-radius: 15px;
  background: var(--users-bg-solid);
}

.users-system-panel-title > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

/* =========================================================
   FORM
   ========================================================= */

.users-system-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  border: 1px solid var(--users-border);
  border-radius: 15px;
  background: var(--users-bg-solid);

  overflow: hidden;
}

.users-system-form-grid--detail,
.users-system-form-grid--security {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.users-system-field,
.users-system-switch {
  display: grid;
  gap: 7px;

  min-height: 74px;
  padding: 15px;

  border-right: 1px solid var(--users-border);
  border-bottom: 1px solid var(--users-border);
  background: var(--users-bg-solid);

  transition: background var(--users-transition);
}

.users-system-field:hover,
.users-system-field:focus-within,
.users-system-switch:hover {
  background: var(--users-bg-soft);
}

.users-system-field:nth-child(3n),
.users-system-switch:nth-child(3n) {
  border-right: 1px solid var(--users-border);
}

.users-system-field:last-child,
.users-system-switch:last-child {
  border-bottom: 0;
}

.users-system-field label {
  color: var(--users-muted);

  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.users-system-field input,
.users-system-field select {
  width: 100%;
  min-width: 0;

  border: 0;
  background: transparent;

  color: var(--users-text);
  outline: none;

  font-size: 12px;
  font-weight: 850;
}

.users-system-field input::placeholder {
  color: var(--users-muted-2);
}

.users-system-field input:disabled {
  color: var(--users-muted);
  cursor: not-allowed;
}

.users-system-switch {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.users-system-switch span {
  display: grid;
  gap: 5px;
}

.users-system-switch strong {
  color: var(--users-text);

  font-size: 12px;
  font-weight: 950;
  line-height: 1.15;
}

.users-system-switch small {
  color: var(--users-muted);

  font-size: 9.5px;
  font-weight: 780;
  line-height: 1.2;
}

.users-system-switch input {
  display: none;
}

/* =========================================================
   SWITCHES
   ========================================================= */

.users-system-switch b,
.users-system-permissions-row label b,
.users-system-page-permissions-row label b {
  position: relative;

  width: 38px;
  height: 21px;

  border: 1px solid color-mix(in srgb, var(--users-muted) 42%, transparent);
  border-radius: 999px;
  background: var(--users-bg-soft-2);

  transition:
    background var(--users-transition),
    border-color var(--users-transition);
}

.users-system-switch b::before,
.users-system-permissions-row label b::before,
.users-system-page-permissions-row label b::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;

  width: 15px;
  height: 15px;

  border-radius: 999px;
  background: var(--users-muted-2);

  transition:
    transform var(--users-transition),
    background var(--users-transition);
}

.users-system-switch input:checked + b,
.users-system-permissions-row label input:checked + b,
.users-system-page-permissions-row label input:checked + b {
  border-color: color-mix(in srgb, var(--users-green) 46%, transparent);
  background: color-mix(in srgb, var(--users-green) 13%, transparent);
}

.users-system-switch input:checked + b::before,
.users-system-permissions-row label input:checked + b::before,
.users-system-page-permissions-row label input:checked + b::before {
  transform: translateX(17px);
  background: var(--users-green);
}

/* =========================================================
   PERMISOS
   ========================================================= */

.users-system-permissions-layout {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.users-system-permissions,
.users-system-page-permissions,
.users-system-security-card,
.users-system-password-box {
  display: grid;
  min-width: 0;

  border: 1px solid var(--users-border);
  border-radius: 16px;
  background: var(--users-bg-solid);

  overflow: hidden;
}

.users-system-permissions__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  min-height: 56px;
  padding: 15px 16px;

  border-bottom: 1px solid var(--users-border);
  background: var(--users-bg-soft);
}

.users-system-permissions__head strong {
  color: var(--users-text);

  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
}

.users-system-permissions__head span {
  color: var(--users-muted);

  font-size: 9.5px;
  font-weight: 780;
  line-height: 1.2;
}

.users-system-permissions-table {
  display: grid;
  width: 100%;
  min-width: 0;
  max-height: none;

  overflow: visible;
}

.users-system-permissions-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(5, 96px);
  align-items: center;

  min-height: 52px;

  border-bottom: 1px solid var(--users-border);
  background: var(--users-bg-solid);
}

.users-system-permissions-row:last-child {
  border-bottom: 0;
}

.users-system-permissions-row:hover {
  background: var(--users-bg-soft);
}

.users-system-permissions-row--head {
  position: sticky;
  top: 0;
  z-index: 5;

  min-height: 40px;
  background: var(--users-bg-soft);
}

.users-system-permissions-row span,
.users-system-permissions-row strong {
  padding: 0 14px;

  color: var(--users-muted);

  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-system-permissions-row strong {
  color: var(--users-text);

  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.users-system-permissions-row label {
  display: grid;
  place-items: center;

  height: 100%;

  border-left: 1px solid var(--users-border);
}

.users-system-permissions-row label input {
  display: none;
}

/* =========================================================
   SUBPÁGINAS
   ========================================================= */

.users-system-page-accordion {
  display: grid;
  gap: 12px;

  max-height: none;
  padding: 14px;

  background: var(--users-bg-solid);

  overflow: visible;
}

.users-system-page-accordion__item {
  display: block;

  border: 1px solid var(--users-border);
  border-radius: 15px;
  background: var(--users-bg-solid);

  overflow: hidden;
}

.users-system-page-accordion__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;

  min-height: 64px;
  padding: 14px 16px;

  background: var(--users-bg-soft);

  cursor: pointer;
  list-style: none;
}

.users-system-page-accordion__summary::-webkit-details-marker {
  display: none;
}

.users-system-page-accordion__summary:hover {
  background: color-mix(in srgb, var(--users-bg-soft) 72%, var(--users-hover));
}

.users-system-page-accordion__title {
  display: flex;
  align-items: center;
  gap: 12px;

  min-width: 0;
}

.users-system-page-accordion__title > .icon {
  width: 19px;
  height: 19px;
  min-width: 19px;
  stroke-width: 2.25;
  color: var(--users-text);
}

.users-system-page-accordion__title > span {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.users-system-page-accordion__title strong {
  color: var(--users-text);

  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-system-page-accordion__title small {
  color: var(--users-muted);

  font-size: 10px;
  font-weight: 820;
  line-height: 1.15;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-system-page-accordion__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex: 0 0 auto;
}

.users-system-page-accordion__actions .users-system-mini-action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 9.5px;
}

.users-system-page-accordion__actions .users-system-mini-action .icon {
  width: 13px;
  height: 13px;
}

.users-system-page-accordion__chevron {
  width: 17px;
  height: 17px;
  min-width: 17px;
  color: var(--users-muted);
  transition: transform var(--users-transition);
}

.users-system-page-accordion__item[open] .users-system-page-accordion__chevron {
  transform: rotate(180deg);
}

.users-system-page-accordion__body {
  display: block;

  border-top: 1px solid var(--users-border);
  background: var(--users-bg-solid);
}

.users-system-page-permissions-table {
  display: grid;
  width: 100%;
}

.users-system-page-permissions-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(5, 90px);
  align-items: center;

  min-height: 52px;

  border-bottom: 1px solid var(--users-border);
  background: var(--users-bg-solid);
}

.users-system-page-permissions-row:last-child {
  border-bottom: 0;
}

.users-system-page-permissions-row:hover {
  background: var(--users-bg-soft);
}

.users-system-page-permissions-row--head {
  min-height: 42px;
  background: var(--users-bg-soft);
}

.users-system-page-permissions-row > span,
.users-system-page-permissions-row > strong {
  min-width: 0;
  padding: 0 14px;

  color: var(--users-muted);

  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-system-page-permissions-row > strong {
  display: grid;
  gap: 5px;

  color: var(--users-text);

  font-size: 11px;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: none;
}

.users-system-page-permissions-row > strong span {
  min-width: 0;

  color: var(--users-text);

  font-size: 12px;
  font-weight: 950;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-system-page-permissions-row > strong small {
  min-width: 0;

  color: var(--users-muted);

  font-size: 9.5px;
  font-weight: 780;
  line-height: 1.15;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-system-page-permissions-row label {
  display: grid;
  place-items: center;

  height: 100%;

  border-left: 1px solid var(--users-border);
}

.users-system-page-permissions-row label input {
  display: none;
}

/* =========================================================
   SEGURIDAD
   ========================================================= */

.users-system-security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.users-system-security-card {
  align-content: center;
  gap: 8px;

  min-height: 92px;
  padding: 16px;
}

.users-system-security-card span {
  color: var(--users-muted);

  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.users-system-security-card strong {
  color: var(--users-text);

  font-size: 13px;
  font-weight: 950;
  line-height: 1.15;
}

.users-system-password-box {
  gap: 0;
}

/* =========================================================
   DENIED
   ========================================================= */

.users-system-denied {
  display: grid;
  place-items: center;
  gap: 10px;

  min-height: 260px;
  padding: 28px;

  text-align: center;
}

.users-system-denied .icon {
  width: 38px;
  height: 38px;
  stroke-width: 2.15;
  color: var(--users-red);
}

.users-system-denied strong {
  color: var(--users-text);

  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.users-system-denied p {
  margin: 0;

  color: var(--users-muted);

  font-size: 12px;
  font-weight: 780;
  line-height: 1.35;
}

/* =========================================================
   TOAST
   ========================================================= */

.users-system-toast {
  position: fixed;
  right: 16px;
  bottom: 40px;
  z-index: 10000;

  max-width: min(400px, calc(100vw - 32px));
  padding: 13px 15px;

  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  color: #111827;

  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;

  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;

  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);

  transition:
    opacity var(--users-transition),
    transform var(--users-transition),
    background var(--users-transition),
    border-color var(--users-transition),
    color var(--users-transition);
}

html[data-theme="dark"] .users-system-toast {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(18, 18, 18, 0.94);
  color: rgba(255, 255, 255, 0.92);
}

.users-system-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1380px) {
  .users-system-head {
    grid-template-columns: 1fr;
  }

  .users-system-actions {
    justify-content: flex-start;
  }

  .users-system-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .users-system-metric:nth-child(3n) {
    border-right: 0;
  }

  .users-system-metric:nth-child(n + 4) {
    border-top: 1px solid var(--users-border);
  }

  .users-system-workspace {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }

  .users-system-permissions-row {
    grid-template-columns: minmax(200px, 1fr) repeat(5, 86px);
  }

  .users-system-page-permissions-row {
    grid-template-columns: minmax(230px, 1fr) repeat(5, 78px);
  }
}

@media (max-width: 1040px) {
  .users-system-workspace {
    grid-template-columns: 1fr;
  }

  .users-system-list-panel,
  .users-system-detail-panel {
    height: auto;
    min-height: 360px;
  }

  .users-system-detail {
    min-height: auto;
  }

  .users-system-detail-head {
    grid-template-columns: 1fr;
  }

  .users-system-detail-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .users-system-page {
    gap: 10px;
    overflow: visible;
  }

  .users-system-head,
  .users-system-metrics,
  .users-system-list-panel,
  .users-system-detail-panel {
    border-radius: 14px;
  }

  .users-system-head {
    padding: 12px;
  }

  .users-system-brand p {
    display: none;
  }

  .users-system-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .users-system-actions .users-system-btn {
    width: 100%;
  }

  .users-system-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .users-system-metric {
    border-right: 1px solid var(--users-border);
    border-top: 1px solid var(--users-border);
  }

  .users-system-metric:nth-child(1),
  .users-system-metric:nth-child(2) {
    border-top: 0;
  }

  .users-system-metric:nth-child(2n) {
    border-right: 0;
  }

  .users-system-filter-row {
    grid-template-columns: 1fr;
  }

  .users-system-user-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .users-system-user-card__state {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .users-system-detail-head {
    padding: 14px;
  }

  .users-system-detail-user__avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .users-system-detail-user h3 {
    font-size: 15px;
  }

  .users-system-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .users-system-detail-actions .users-system-btn,
  .users-system-detail-actions .users-system-status,
  .users-system-detail-actions .users-system-role {
    width: 100%;
  }

  .users-system-tabs {
    padding: 10px;
  }

  .users-system-tab {
    flex: 1 1 auto;
  }

  .users-system-tab-panel {
    padding: 12px;
    gap: 14px;
  }

  .users-system-panel-title {
    display: grid;
    grid-template-columns: 1fr;
  }

  .users-system-panel-title .users-system-btn {
    width: 100%;
  }

  .users-system-form-grid,
  .users-system-form-grid--detail,
  .users-system-form-grid--security,
  .users-system-security-grid {
    grid-template-columns: 1fr;
  }

  .users-system-field,
  .users-system-switch {
    border-right: 0;
  }

  .users-system-permissions__head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .users-system-permissions-row--head,
  .users-system-page-permissions-row--head {
    display: none;
  }

  .users-system-permissions-row,
  .users-system-page-permissions-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;

    min-height: auto;
    padding: 14px;
  }

  .users-system-permissions-row strong,
  .users-system-page-permissions-row > strong {
    padding: 0;
  }

  .users-system-permissions-row label,
  .users-system-page-permissions-row label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;

    min-height: 34px;
    border-left: 0;
  }

  .users-system-permissions-row label::before,
  .users-system-page-permissions-row label::before {
    color: var(--users-muted);

    font-size: 8.5px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .users-system-permissions-row label:nth-of-type(1)::before,
  .users-system-page-permissions-row label:nth-of-type(1)::before {
    content: "Ver";
  }

  .users-system-permissions-row label:nth-of-type(2)::before,
  .users-system-page-permissions-row label:nth-of-type(2)::before {
    content: "Crear";
  }

  .users-system-permissions-row label:nth-of-type(3)::before,
  .users-system-page-permissions-row label:nth-of-type(3)::before {
    content: "Editar";
  }

  .users-system-permissions-row label:nth-of-type(4)::before,
  .users-system-page-permissions-row label:nth-of-type(4)::before {
    content: "Eliminar";
  }

  .users-system-permissions-row label:nth-of-type(5)::before,
  .users-system-page-permissions-row label:nth-of-type(5)::before {
    content: "Acceso total";
  }

  .users-system-page-accordion {
    padding: 0;
  }

  .users-system-page-accordion__item {
    border-radius: 0;
    border-right: 0;
    border-left: 0;
  }

  .users-system-page-accordion__summary {
    grid-template-columns: 1fr;
  }

  .users-system-page-accordion__actions {
    display: grid;
    grid-template-columns: 1fr 1fr 34px;
    width: 100%;
  }

  .users-system-page-accordion__actions .users-system-mini-action {
    width: 100%;
  }

  .users-system-page-accordion__chevron {
    align-self: center;
    justify-self: center;
  }
}

@media (max-width: 420px) {
  .users-system-brand h2 {
    font-size: 15px;
  }

  .users-system-metric strong {
    font-size: 17px;
  }

  .users-system-detail-actions {
    grid-template-columns: 1fr;
  }

  .users-system-tab span {
    display: none;
  }

  .users-system-tab {
    min-width: 46px;
  }
}

/* =========================================================
   ANIMACIONES
   ========================================================= */

@keyframes usersSystemPageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .users-system-page,
  .users-system-page *,
  .users-system-page *::before,
  .users-system-page *::after,
  .users-system-toast {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}/* Botón guardar permisos · texto blanco */
.users-system-btn.users-system-btn--dark,
.users-system-btn.users-system-btn--dark span,
.users-system-btn.users-system-btn--dark .icon,
.users-system-btn.users-system-btn--dark svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.users-system-btn.users-system-btn--dark {
  background: #111827 !important;
  border-color: #111827 !important;
}

.users-system-btn.users-system-btn--dark:hover {
  background: #030712 !important;
  border-color: #030712 !important;
  color: #ffffff !important;
}/* =========================================================
   USUARIOS SISTEMA · ACHICAR TODO UN POCO
   ========================================================= */

.users-system-page {
  gap: 10px;
}

.users-system-head {
  min-height: 62px;
  padding: 12px 14px;
}

.users-system-brand__icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
}

.users-system-brand__icon .icon {
  width: 17px;
  height: 17px;
}

.users-system-brand h2 {
  font-size: 15.5px;
}

.users-system-brand p {
  font-size: 10.5px;
}

.users-system-btn,
.users-system-row-btn,
.users-system-mini-action,
.users-system-tab {
  min-height: 33px;
  padding: 0 11px;
  font-size: 10px;
}

.users-system-btn .icon,
.users-system-row-btn .icon,
.users-system-mini-action .icon,
.users-system-tab .icon {
  width: 13px;
  height: 13px;
  min-width: 13px;
  min-height: 13px;
}

/* Métricas */
.users-system-metric {
  min-height: 58px;
  padding: 11px 12px;
  gap: 5px;
}

.users-system-metric span {
  font-size: 8px;
}

.users-system-metric strong {
  font-size: 18px;
}

.users-system-metric small {
  font-size: 8.5px;
}

/* Workspace */
.users-system-workspace {
  gap: 10px;
  grid-template-columns: minmax(290px, 345px) minmax(0, 1fr);
}

/* Lista izquierda */
.users-system-toolbar {
  padding: 11px 12px;
}

.users-system-users-list {
  gap: 8px;
  padding: 10px;
}

.users-system-user-card {
  min-height: 74px;
  padding: 10px;
  gap: 10px;
}

.users-system-user-card__avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  font-size: 9px;
}

.users-system-user-card__body strong {
  font-size: 11.5px;
}

.users-system-user-card__body small {
  font-size: 9.2px;
}

.users-system-user-card__meta {
  font-size: 8.8px;
}

.users-system-user-card__state {
  min-height: 23px;
  padding: 0 9px;
  font-size: 8.8px;
}

/* Panel derecho */
.users-system-detail-head {
  min-height: 78px;
  padding: 13px 14px;
}

.users-system-detail-user__avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  font-size: 10px;
}

.users-system-detail-user h3 {
  font-size: 16px;
}

.users-system-detail-user p {
  font-size: 10px;
}

.users-system-tabs {
  padding: 10px 12px;
}

.users-system-tab-panel {
  gap: 13px;
  padding: 13px;
}

.users-system-panel-title {
  min-height: 52px;
  padding: 12px 13px;
}

.users-system-title strong,
.users-system-panel-title strong {
  font-size: 13.5px;
}

/* Formularios */
.users-system-field,
.users-system-switch {
  min-height: 66px;
  padding: 13px;
}

.users-system-field input,
.users-system-field select {
  font-size: 11px;
}

.users-system-switch strong {
  font-size: 11px;
}

.users-system-switch small {
  font-size: 9px;
}

/* Permisos */
.users-system-permissions-layout {
  gap: 14px;
}

.users-system-permissions__head {
  min-height: 50px;
  padding: 13px 14px;
}

.users-system-permissions__head strong {
  font-size: 12px;
}

.users-system-permissions__head span {
  font-size: 9px;
}

.users-system-permissions-row {
  min-height: 46px;
  grid-template-columns: minmax(210px, 1fr) repeat(5, 88px);
}

.users-system-permissions-row strong {
  font-size: 11px;
}

.users-system-page-accordion {
  gap: 10px;
  padding: 12px;
}

.users-system-page-accordion__summary {
  min-height: 56px;
  padding: 12px 14px;
}

.users-system-page-accordion__title strong {
  font-size: 12px;
}

.users-system-page-accordion__title small {
  font-size: 9px;
}

.users-system-page-accordion__actions .users-system-mini-action {
  min-height: 31px;
  padding: 0 10px;
  font-size: 9px;
}

.users-system-page-permissions-row {
  min-height: 46px;
  grid-template-columns: minmax(250px, 1fr) repeat(5, 82px);
}

.users-system-page-permissions-row > strong span {
  font-size: 11px;
}

.users-system-page-permissions-row > strong small {
  font-size: 8.8px;
}

/* Switches un poco más chicos */
.users-system-switch b,
.users-system-permissions-row label b,
.users-system-page-permissions-row label b {
  width: 36px;
  height: 20px;
}

.users-system-switch b::before,
.users-system-permissions-row label b::before,
.users-system-page-permissions-row label b::before {
  width: 14px;
  height: 14px;
}

.users-system-switch input:checked + b::before,
.users-system-permissions-row label input:checked + b::before,
.users-system-page-permissions-row label input:checked + b::before {
  transform: translateX(16px);
}/* =========================================================
   USUARIOS DEL SISTEMA
   MISMO TAMAÑO + BORDES MÁS VISIBLES + SCROLL DE PÁGINA
   Agregar al FINAL de usuarios-sistema.css
   ========================================================= */

/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */

.app-content:has(.users-system-page) {
  display: block !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  padding: 10px !important;

  overflow: visible !important;
}

.users-system-page {
  display: grid !important;

  grid-template-rows:
    auto
    auto
    auto !important;

  align-content: start !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  gap: 12px !important;

  overflow: visible !important;
}

/* =========================================================
   CABECERA
   ========================================================= */

.users-system-head {
  display: grid !important;

  grid-template-columns:
    minmax(320px, 1fr)
    auto !important;

  align-items: center !important;

  width: 100% !important;

  min-height: 92px !important;

  padding:
    15px
    17px !important;

  gap: 16px !important;

  border-radius: 13px !important;
}

.users-system-brand {
  gap: 13px !important;
}

.users-system-brand__icon {
  width: 46px !important;
  height: 46px !important;

  min-width: 46px !important;
  min-height: 46px !important;

  border-radius: 11px !important;
}

.users-system-brand__icon .icon,
.users-system-brand__icon svg {
  width: 21px !important;
  height: 21px !important;

  min-width: 21px !important;
  min-height: 21px !important;
}

.users-system-brand h2 {
  font-size:
    clamp(
      24px,
      2.1vw,
      30px
    ) !important;

  font-weight: 950 !important;
  line-height: 1 !important;
}

.users-system-brand p {
  max-width: 850px !important;

  margin-top: 6px !important;

  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.45 !important;
}

/* =========================================================
   BOTONES
   ========================================================= */

.users-system-btn,
.users-system-row-btn,
.users-system-mini-action,
.users-system-tab {
  min-height: 36px !important;
  height: 36px !important;

  padding:
    0
    12px !important;

  gap: 7px !important;

  border-radius: 9px !important;

  font-size: 11px !important;
  font-weight: 900 !important;
}

.users-system-btn .icon,
.users-system-btn svg,
.users-system-row-btn .icon,
.users-system-row-btn svg,
.users-system-mini-action .icon,
.users-system-mini-action svg,
.users-system-tab .icon,
.users-system-tab svg {
  width: 15px !important;
  height: 15px !important;

  min-width: 15px !important;
  min-height: 15px !important;
}

/* =========================================================
   MÉTRICAS
   ========================================================= */

.users-system-metrics {
  grid-template-columns:
    repeat(
      6,
      minmax(0, 1fr)
    ) !important;

  width: 100% !important;

  border-radius: 13px !important;
}

.users-system-metric {
  min-height: 72px !important;

  padding:
    11px
    12px !important;

  gap: 5px !important;
}

.users-system-metric span {
  font-size: 9px !important;
}

.users-system-metric strong {
  font-size: 19px !important;
}

.users-system-metric small {
  font-size: 9.5px !important;
}

/* =========================================================
   WORKSPACE
   ========================================================= */

.users-system-workspace {
  display: grid !important;

  grid-template-columns:
    minmax(320px, 380px)
    minmax(0, 1fr) !important;

  align-items: start !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;

  gap: 12px !important;

  overflow: visible !important;
}

.users-system-list-panel,
.users-system-detail-panel {
  width: 100% !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  border-radius: 13px !important;

  overflow: visible !important;
}

.users-system-detail-panel {
  min-height: 0 !important;
}

/* =========================================================
   TOOLBAR
   ========================================================= */

.users-system-toolbar {
  padding:
    12px !important;

  gap: 10px !important;
}

.users-system-title {
  gap: 4px !important;
}

.users-system-title span,
.users-system-panel-title span {
  font-size: 9px !important;
}

.users-system-title strong,
.users-system-panel-title strong {
  font-size: 15px !important;
}

.users-system-search,
.users-system-filters select {
  height: 38px !important;
  min-height: 38px !important;

  border-radius: 9px !important;
}

.users-system-search input,
.users-system-filters select {
  font-size: 10.5px !important;
}

/* =========================================================
   LISTADO DE USUARIOS
   ========================================================= */

.users-system-users-list {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  padding: 12px !important;

  gap: 8px !important;

  overflow-x: hidden !important;
  overflow-y: visible !important;
}

.users-system-user-card {
  grid-template-columns:
    42px
    minmax(0, 1fr)
    auto !important;

  min-height: 78px !important;

  padding:
    11px
    12px !important;

  gap: 11px !important;

  border-radius: 11px !important;
}

.users-system-user-card__avatar {
  width: 42px !important;
  height: 42px !important;

  min-width: 42px !important;
  min-height: 42px !important;

  border-radius: 10px !important;

  font-size: 10px !important;
}

.users-system-user-card__body {
  gap: 4px !important;
}

.users-system-user-card__body strong {
  font-size: 12px !important;
}

.users-system-user-card__body small {
  font-size: 9.5px !important;
}

.users-system-user-card__meta {
  font-size: 9px !important;
}

.users-system-user-card__state {
  min-height: 24px !important;
  height: 24px !important;

  padding:
    0
    9px !important;

  font-size: 8.8px !important;
}

/* =========================================================
   PANEL DETALLE
   ========================================================= */

.users-system-detail {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  overflow: visible !important;
}

.users-system-detail-head {
  min-height: 92px !important;

  padding:
    15px
    16px !important;
}

.users-system-detail-user {
  gap: 13px !important;
}

.users-system-detail-user__avatar {
  width: 48px !important;
  height: 48px !important;

  min-width: 48px !important;
  min-height: 48px !important;

  border-radius: 11px !important;
}

.users-system-detail-user span:not(.users-system-detail-user__avatar) {
  font-size: 9px !important;
}

.users-system-detail-user h3 {
  font-size: 19px !important;
}

.users-system-detail-user p {
  font-size: 10.5px !important;
}

/* =========================================================
   TABS
   ========================================================= */

.users-system-tabs {
  min-height: 56px !important;

  padding:
    10px
    12px !important;

  gap: 7px !important;
}

.users-system-tab {
  min-height: 36px !important;
  height: 36px !important;

  padding:
    0
    13px !important;
}

/* =========================================================
   PANEL INTERNO
   ========================================================= */

.users-system-tab-panel {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  padding: 14px !important;

  gap: 12px !important;

  overflow: visible !important;
}

.users-system-panel-title {
  min-height: 60px !important;

  padding:
    12px
    14px !important;

  border-radius: 11px !important;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */

.users-system-form-grid {
  border-radius: 11px !important;
}

.users-system-field,
.users-system-switch {
  min-height: 74px !important;

  padding:
    12px
    13px !important;

  gap: 7px !important;
}

.users-system-field label {
  font-size: 9px !important;
}

.users-system-field input,
.users-system-field select {
  font-size: 11.5px !important;
}

.users-system-switch strong {
  font-size: 12px !important;
}

.users-system-switch small {
  font-size: 9.5px !important;
}

/* =========================================================
   PERMISOS
   ========================================================= */

.users-system-permissions-layout {
  gap: 12px !important;
}

.users-system-permissions,
.users-system-page-permissions,
.users-system-security-card,
.users-system-password-box {
  border-radius: 11px !important;
}

.users-system-permissions__head {
  min-height: 58px !important;

  padding:
    12px
    14px !important;
}

.users-system-permissions__head strong {
  font-size: 13px !important;
}

.users-system-permissions__head span {
  font-size: 9.5px !important;
}

.users-system-permissions-table,
.users-system-page-permissions-table {
  overflow: visible !important;
}

.users-system-permissions-row,
.users-system-page-permissions-row {
  min-height: 52px !important;
}

.users-system-permissions-row strong,
.users-system-page-permissions-row > strong span {
  font-size: 11.5px !important;
}

.users-system-page-permissions-row > strong small {
  font-size: 9px !important;
}

/* =========================================================
   ACORDEÓN
   ========================================================= */

.users-system-page-accordion {
  height: auto !important;
  max-height: none !important;

  padding: 12px !important;

  gap: 9px !important;

  overflow: visible !important;
}

.users-system-page-accordion__item {
  border-radius: 11px !important;
}

.users-system-page-accordion__summary {
  min-height: 60px !important;

  padding:
    12px
    14px !important;
}

.users-system-page-accordion__title strong {
  font-size: 12.5px !important;
}

.users-system-page-accordion__title small {
  font-size: 9.5px !important;
}

/* =========================================================
   SEGURIDAD DEL USUARIO
   ========================================================= */

.users-system-security-grid {
  gap: 10px !important;
}

.users-system-security-card {
  min-height: 96px !important;

  padding:
    14px !important;

  border-radius: 11px !important;
}

.users-system-security-card span {
  font-size: 9px !important;
}

.users-system-security-card strong {
  font-size: 12.5px !important;
}

/* =========================================================
   BORDES PRINCIPALES MÁS VISIBLES
   ========================================================= */

.users-system-head,
.users-system-metrics,
.users-system-list-panel,
.users-system-detail-panel,
.users-system-denied {
  border-color:
    rgba(
      15,
      23,
      42,
      0.18
    ) !important;

  box-shadow:
    0 1px 0
    rgba(
      255,
      255,
      255,
      0.86
    ) inset,
    0 5px 16px
    rgba(
      15,
      23,
      42,
      0.055
    ) !important;
}

/* =========================================================
   BORDES INTERNOS
   ========================================================= */

.users-system-user-card,
.users-system-panel-title,
.users-system-form-grid,
.users-system-permissions,
.users-system-page-permissions,
.users-system-page-accordion__item,
.users-system-security-card,
.users-system-password-box,
.users-system-empty-card,
.users-system-detail-empty {
  border-color:
    rgba(
      15,
      23,
      42,
      0.17
    ) !important;
}

.users-system-metric,
.users-system-field,
.users-system-switch,
.users-system-permissions-row,
.users-system-page-permissions-row,
.users-system-summary__row {
  border-right-color:
    rgba(
      15,
      23,
      42,
      0.14
    ) !important;

  border-bottom-color:
    rgba(
      15,
      23,
      42,
      0.14
    ) !important;
}

.users-system-toolbar,
.users-system-detail-head,
.users-system-tabs,
.users-system-permissions__head,
.users-system-page-accordion__body {
  border-color:
    rgba(
      15,
      23,
      42,
      0.16
    ) !important;
}

/* =========================================================
   HOVER
   ========================================================= */

.users-system-head:hover,
.users-system-list-panel:hover,
.users-system-detail-panel:hover,
.users-system-user-card:hover,
.users-system-panel-title:hover,
.users-system-page-accordion__item:hover {
  border-color:
    rgba(
      15,
      23,
      42,
      0.28
    ) !important;
}

/* =========================================================
   SCROLL DE PÁGINA Y FOOTER
   ========================================================= */

body:has(.users-system-page) .app-main {
  min-height: 100vh !important;
  height: auto !important;

  overflow: visible !important;
}

body:has(.users-system-page) .app-shell {
  min-height: 100vh !important;
  height: auto !important;

  overflow: visible !important;
}

body:has(.users-system-page) .app-footer,
body:has(.users-system-page) #footerMount,
body:has(.users-system-page) footer.app-footer {
  position: static !important;

  inset: auto !important;

  width: 100% !important;

  margin-top: 12px !important;

  transform: none !important;
}

/* =========================================================
   MODO OSCURO
   ========================================================= */

html[data-theme="dark"] .users-system-head,
html[data-theme="dark"] .users-system-metrics,
html[data-theme="dark"] .users-system-list-panel,
html[data-theme="dark"] .users-system-detail-panel,
html[data-theme="dark"] .users-system-denied {
  border-color:
    rgba(
      255,
      255,
      255,
      0.19
    ) !important;

  box-shadow:
    0 1px 0
    rgba(
      255,
      255,
      255,
      0.055
    ) inset,
    0 8px 20px
    rgba(
      0,
      0,
      0,
      0.32
    ) !important;
}

html[data-theme="dark"] .users-system-user-card,
html[data-theme="dark"] .users-system-panel-title,
html[data-theme="dark"] .users-system-form-grid,
html[data-theme="dark"] .users-system-permissions,
html[data-theme="dark"] .users-system-page-permissions,
html[data-theme="dark"] .users-system-page-accordion__item,
html[data-theme="dark"] .users-system-security-card,
html[data-theme="dark"] .users-system-password-box,
html[data-theme="dark"] .users-system-empty-card,
html[data-theme="dark"] .users-system-detail-empty {
  border-color:
    rgba(
      255,
      255,
      255,
      0.17
    ) !important;
}

html[data-theme="dark"] .users-system-metric,
html[data-theme="dark"] .users-system-field,
html[data-theme="dark"] .users-system-switch,
html[data-theme="dark"] .users-system-permissions-row,
html[data-theme="dark"] .users-system-page-permissions-row {
  border-right-color:
    rgba(
      255,
      255,
      255,
      0.13
    ) !important;

  border-bottom-color:
    rgba(
      255,
      255,
      255,
      0.13
    ) !important;
}

html[data-theme="dark"] .users-system-toolbar,
html[data-theme="dark"] .users-system-detail-head,
html[data-theme="dark"] .users-system-tabs,
html[data-theme="dark"] .users-system-permissions__head,
html[data-theme="dark"] .users-system-page-accordion__body {
  border-color:
    rgba(
      255,
      255,
      255,
      0.15
    ) !important;
}

html[data-theme="dark"] .users-system-head:hover,
html[data-theme="dark"] .users-system-list-panel:hover,
html[data-theme="dark"] .users-system-detail-panel:hover,
html[data-theme="dark"] .users-system-user-card:hover,
html[data-theme="dark"] .users-system-panel-title:hover,
html[data-theme="dark"] .users-system-page-accordion__item:hover {
  border-color:
    rgba(
      255,
      255,
      255,
      0.27
    ) !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1380px) {
  .users-system-metrics {
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      ) !important;
  }

  .users-system-workspace {
    grid-template-columns:
      minmax(300px, 350px)
      minmax(0, 1fr) !important;
  }
}

@media (max-width: 1040px) {
  .users-system-head,
  .users-system-workspace {
    grid-template-columns:
      1fr !important;
  }

  .users-system-actions,
  .users-system-detail-actions {
    justify-content:
      flex-start !important;
  }
}

@media (max-width: 720px) {
  .users-system-head {
    min-height: 0 !important;

    padding: 12px !important;
  }

  .users-system-brand h2 {
    font-size: 22px !important;
  }

  .users-system-brand p {
    display: block !important;

    font-size: 11px !important;
  }

  .users-system-metrics {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      ) !important;
  }

  .users-system-actions,
  .users-system-detail-actions {
    display: grid !important;

    grid-template-columns:
      1fr
      1fr !important;

    width: 100% !important;
  }

  .users-system-user-card {
    grid-template-columns:
      42px
      minmax(0, 1fr) !important;
  }

  .users-system-user-card__state {
    grid-column:
      1 /
      -1 !important;

    justify-self: start !important;
  }
}

@media (max-width: 520px) {
  .users-system-metrics {
    grid-template-columns:
      1fr !important;
  }

  .users-system-actions,
  .users-system-detail-actions {
    grid-template-columns:
      1fr !important;
  }
}