/* ============================================================
   Central Uélicon — app.css
   ============================================================
   Hub interno (login + dashboard cards + admin users/systems).
   Herda tokens.css. Sem build step (não usa Tailwind).
   Light mode. Mobile-first onde faz sentido (dashboard cards),
   desktop-first em admin.
   v1.0 — 2026-05-19
   Autor: @dev-frontend
   ============================================================ */

@import url('./tokens.css');

/* [x-cloak] esconde árvores Alpine antes da hidratação (gotcha F4) */
[x-cloak] { display: none !important; }

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; color-scheme: light; }
body {
  margin: 0;
  padding: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100svh;
}
html, body { overflow-x: hidden; }

h1, h2, h3, h4 { margin: 0; }
img, svg { display: block; max-width: 100%; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}
button:disabled { cursor: not-allowed; opacity: 0.55; }

a { color: var(--accent-soft-text); text-decoration: none; }
a:hover { text-decoration: underline; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ============================================================
   FOCUS RING — global (a11y baseline)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   LAYOUT — header autenticado (antracite)
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  background: var(--surface-header);
  border-bottom: 1px solid var(--antracite-800);
}
.app-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-on-header);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--antracite-900);
  color: #fff;
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  letter-spacing: 0;
}
.brand__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand__title {
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
  color: var(--text-on-header);
}
.brand__sub {
  font-weight: var(--weight-regular);
  font-size: var(--text-xs);
  color: var(--text-on-header-mute);
}

.app-header__spacer { flex: 1; }

.app-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.app-nav__link {
  position: relative;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-on-header-mute);
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--motion-fast) var(--ease-out);
}
.app-nav__link:hover { color: var(--text-on-header); text-decoration: none; }
.app-nav__link.is-active {
  color: var(--text-on-header);
  border-bottom-color: var(--accent);
}

@media (max-width: 768px) {
  .app-nav { display: none; }
}

.app-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-on-header);
}
.app-nav-toggle:hover { background: var(--surface-header-hover); }
@media (max-width: 768px) {
  .app-nav-toggle { display: inline-flex; }
}

/* ----- chip de role no header ----- */
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
}
.role-chip--admin { background: var(--chip-role-admin-bg); color: var(--chip-role-admin-fg); }
.role-chip--user  { background: var(--chip-role-user-bg);  color: var(--chip-role-user-fg); }

/* ----- user chip + dropdown ----- */
.user-chip-wrap { position: relative; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-on-header);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  min-height: 40px;
}
.user-chip:hover { background: var(--surface-header-hover); }
.user-chip__avatar {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--antracite-900);
  color: var(--text-on-header);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  border-radius: var(--radius-pill);
}
.user-chip__caret {
  transition: transform var(--motion-fast) var(--ease-out);
  color: var(--text-on-header-mute);
}
.user-chip__caret.is-open { transform: rotate(180deg); }
.user-chip__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  margin: 0;
  padding: var(--space-1);
  z-index: var(--z-dropdown);
}
.user-chip__menuitem {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-body);
  font-size: var(--text-base);
  min-height: 40px;
}
.user-chip__menuitem:hover { background: var(--surface-subtle); color: var(--text-primary); }

@media (max-width: 480px) {
  .brand__wordmark { display: none; }
}

/* ============================================================
   LAYOUT — container
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}
@media (max-width: 640px) {
  .container { padding: var(--space-6) var(--space-4); }
}

.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.page-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}
@media (max-width: 640px) {
  .page-title { font-size: var(--text-2xl); }
}
.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ============================================================
   FORM PRIMITIVES
   ============================================================ */
.field { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-body);
}
.field__hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}
.field__error {
  font-size: var(--text-xs);
  color: var(--red-700);
  margin-top: 2px;
}

.input,
.textarea,
.select {
  width: 100%;
  background: var(--surface-inset);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: var(--text-base);
  color: var(--text-body);
  height: 44px;
  transition: border-color var(--motion-fast) var(--ease-out);
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}
.input:disabled,
.textarea:disabled,
.select:disabled {
  background: var(--neutral-100);
  color: var(--text-disabled);
  cursor: not-allowed;
}
.input--mono { font-family: var(--font-mono); }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  border: 1px solid transparent;
  transition: background var(--motion-fast) var(--ease-out),
              color var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .btn { min-height: var(--touch-target-min); }
}
.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary {
  background: var(--surface-card);
  color: var(--text-body);
  border-color: var(--border-default);
}
.btn--secondary:hover { background: var(--surface-subtle); color: var(--text-primary); }
.btn--danger {
  background: var(--red-500);
  color: #fff;
}
.btn--danger:hover { background: var(--red-600); }
.btn--ghost {
  background: transparent;
  color: var(--text-body);
}
.btn--ghost:hover { background: var(--surface-subtle); color: var(--text-primary); }
.btn--full { width: 100%; }
.btn--icon {
  width: 40px;
  padding: 0;
  color: var(--text-secondary);
}
.btn--icon:hover { color: var(--text-primary); background: var(--surface-subtle); }

/* spinner pequeno */
.btn__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .btn__spinner { animation: none; }
}

/* ============================================================
   BADGES / CHIPS de status
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
}
.badge svg { width: 12px; height: 12px; }
.badge--success { background: var(--status-success-bg); color: var(--status-success-fg); }
.badge--warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.badge--danger  { background: var(--status-danger-bg);  color: var(--status-danger-fg); }
.badge--neutral { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.badge--info    { background: var(--status-info-bg);    color: var(--status-info-fg); }

/* Badge clicável (toggle de visibilidade na lista de sistemas) */
.badge-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.badge-btn:hover .badge { filter: brightness(0.96); }
.badge-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ============================================================
   ALERT (inline, banner top do card)
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-4);
}
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert--danger  { background: var(--status-danger-bg);  color: var(--status-danger-fg); }
.alert--warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.alert--info    { background: var(--status-info-bg);    color: var(--status-info-fg); }
.alert--success { background: var(--status-success-bg); color: var(--status-success-fg); }

/* ============================================================
   LOGIN SHELL — tela cheia centralizada
   ============================================================ */
.login-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  gap: var(--space-6);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
@media (max-width: 480px) {
  .login-card { padding: var(--space-6); border-radius: var(--radius-md); }
}
.login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.login-brand .brand__mark { /* override pra usar antracite no card claro */
  background: var(--antracite-900);
  color: #fff;
}
.login-brand__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.login-brand__title {
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
  color: var(--text-primary);
}
.login-brand__sub {
  font-weight: var(--weight-regular);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.login-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  letter-spacing: var(--tracking-tight);
}
.login-foot {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--space-4);
  margin-bottom: 0;
}
.login-page-foot {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-align: center;
}

/* toggle mostrar/ocultar senha */
.input-wrap--password {
  position: relative;
}
.input-wrap--password .input { padding-right: 44px; }
.input-wrap--password .toggle-eye {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius);
}
.input-wrap--password .toggle-eye:hover { color: var(--text-primary); background: var(--surface-subtle); }

/* ============================================================
   DASHBOARD — grid de cards de sistema
   ============================================================ */
.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-system-min-width), 1fr));
  gap: var(--space-4);
}

.card-system {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: var(--card-system-height);
  padding: var(--space-4);
  background: var(--card-system-bg);
  border: 1px solid var(--card-system-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--text-body);
  text-decoration: none;
  transition: transform var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out),
              border-color var(--motion-base) var(--ease-out);
  overflow: hidden;
}
.card-system:hover {
  border-color: var(--card-system-border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
  text-decoration: none;
}
.card-system:hover .card-system__external { opacity: 0.9; }
.card-system:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.card-system:focus-visible {
  border-color: var(--card-system-border-hover);
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.card-system__icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-system-icon-bg);
  color: var(--card-system-icon-fg);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.card-system__icon svg { width: 20px; height: 20px; }
.card-system__external {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  opacity: 0.4;
  transition: opacity var(--motion-base) var(--ease-out);
}
.card-system__name {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}
.card-system__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: var(--leading-snug);
}

/* skeleton card placeholder */
.skeleton {
  background: linear-gradient(90deg, var(--neutral-100), var(--neutral-200), var(--neutral-100));
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--neutral-100); }
}
.card-system--skeleton {
  pointer-events: none;
  border-color: var(--border-subtle);
  background: var(--surface-card);
}
.card-system--skeleton .card-system__icon {
  background: var(--neutral-200);
  color: transparent;
}

/* empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  background: var(--surface-card);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  gap: var(--space-3);
}
.empty-state__icon {
  width: 48px;
  height: 48px;
  color: var(--text-tertiary);
}
.empty-state__icon svg { width: 100%; height: 100%; }
.empty-state__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

/* ============================================================
   TABELA + LISTA-CARD (admin)
   ============================================================ */
.table-wrap {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  text-align: left;
  padding: 10px var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.table th {
  background: var(--surface-subtle);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-subtle); }
.table .mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary); }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table .url-cell {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .table-wrap { background: transparent; border: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
    padding: var(--space-3);
  }
  .table td {
    border: 0;
    padding: 2px 0;
    font-size: var(--text-base);
  }
  .table td.actions-cell { text-align: left; margin-top: var(--space-2); }
  .table td.url-cell { max-width: 100%; }
  .table tbody tr:hover { background: var(--surface-card); }
}

/* toolbar acima das tabelas */
.toolbar {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.toolbar .input { max-width: 360px; }
@media (max-width: 640px) {
  .toolbar .input { max-width: 100%; }
}

/* ============================================================
   DROPDOWN de ações (menu “⋯”)
   ============================================================ */
.actions-dropdown { position: relative; display: inline-block; }
.actions-dropdown__trigger {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.actions-dropdown__trigger:hover { background: var(--surface-subtle); color: var(--text-primary); }
.actions-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-1);
  list-style: none;
  margin: 0;
  z-index: var(--z-dropdown);
}
.actions-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: var(--text-sm);
  color: var(--text-body);
  min-height: 36px;
}
.actions-dropdown__item:hover { background: var(--surface-subtle); color: var(--text-primary); }
.actions-dropdown__item--danger { color: var(--red-700); }
.actions-dropdown__item--danger:hover { background: var(--red-50); color: var(--red-700); }
.actions-dropdown__sep {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-1) 0;
}

/* ============================================================
   DRAWER — slide-from-right (desktop) / bottom-sheet (mobile)
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 0.35);
  z-index: var(--z-overlay);
  animation: fade-in var(--motion-base) var(--ease-out);
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--surface-card);
  box-shadow: var(--shadow-drawer);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  animation: slide-in-right var(--motion-slow) var(--ease-out);
}
@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@media (max-width: 768px) {
  .drawer {
    top: auto;
    width: 100%;
    height: 92vh;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: slide-up var(--motion-slow) var(--ease-out);
  }
  @keyframes slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .overlay { animation: none; }
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.drawer__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.drawer__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-secondary);
}
.drawer__close:hover { background: var(--surface-subtle); color: var(--text-primary); }
.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
}
.drawer__foot {
  flex-shrink: 0;
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-card);
}
@media (max-width: 480px) {
  .drawer__foot { flex-direction: column-reverse; }
  .drawer__foot .btn { width: 100%; }
}

/* bloco senha temp dentro do drawer */
.temp-password {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--text-primary);
  user-select: text;
  word-break: break-all;
}
.temp-password__copy {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}
.temp-password__copy:hover { color: var(--text-primary); background: var(--surface-subtle); }
.temp-password__feedback {
  font-size: var(--text-xs);
  color: var(--green-700);
  font-weight: var(--weight-medium);
  margin-left: var(--space-2);
}

/* ============================================================
   TOAST stack (bottom-right desktop, top em mobile)
   ============================================================ */
.toast-stack {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-toast);
  pointer-events: none;
}
@media (max-width: 640px) {
  .toast-stack {
    top: var(--space-3);
    bottom: auto;
    left: var(--space-3);
    right: var(--space-3);
  }
}
.toast {
  background: var(--surface-card);
  border-left: 4px solid var(--neutral-400);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-body);
  min-width: 240px;
  max-width: 380px;
  pointer-events: auto;
  animation: toast-in var(--motion-slow) var(--ease-out);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast--success { border-left-color: var(--green-500); }
.toast--danger  { border-left-color: var(--red-500); }
.toast--warning { border-left-color: var(--amber-500); }
.toast--info    { border-left-color: var(--blue-500); }
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

/* ============================================================
   CHECKLIST de permissões (sub-drawer)
   ============================================================ */
.permission-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.permission-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface-card);
  cursor: pointer;
  min-height: 56px;
  transition: background var(--motion-fast) var(--ease-out);
}
.permission-item:hover { background: var(--surface-subtle); }
.permission-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.permission-item__body { flex: 1; min-width: 0; }
.permission-item__name {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}
.permission-item__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ============================================================
   COMBOBOX de ícones Lucide (em admin/systems)
   ============================================================ */
.icon-combobox { position: relative; }
.icon-combobox__current {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.icon-combobox__current-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-system-icon-bg);
  color: var(--card-system-icon-fg);
  border-radius: var(--radius);
}
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
  max-height: 240px;
  overflow-y: auto;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface-page);
}
.icon-grid__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  background: var(--surface-card);
}
.icon-grid__btn:hover {
  color: var(--text-primary);
  border-color: var(--border-default);
}
.icon-grid__btn.is-selected {
  border-color: var(--accent);
  color: var(--card-system-icon-fg);
  background: var(--accent-soft);
}

/* ============================================================
   SKIP LINK (a11y)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  z-index: 200;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 8px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition: top var(--motion-fast) var(--ease-out);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  text-decoration: none;
}
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

/* ============================================================
   Helpers
   ============================================================ */
.muted { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.flex-row { display: flex; flex-direction: row; gap: var(--space-3); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--space-3); }
.spacer-sm { height: var(--space-3); }
.spacer-md { height: var(--space-5); }
.text-right { text-align: right; }

/* visualmente escondido mas acessível (sr-only) */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
