/* ── Tokens ────────────────────────────────────────────── */
:root {
  /* Palette */
  --brand:          #0c2340;
  --brand-light:    #122d50;
  --accent:         #1a56db;
  --accent-hover:   #1547be;
  --accent-subtle:  rgba(26, 86, 219, 0.08);
  --accent-shadow:  rgba(26, 86, 219, 0.22);
  --bg:             #f0f4f8;
  --card:           #ffffff;
  --border:         #dde4ee;
  --text:           #0d1b2e;
  --text-2:         #3d5268;
  --text-muted:     #8ca0be;
  --danger:         #dc2626;
  --danger-hover:   #b91c1c;
  --secondary:      #64748b;
  --secondary-hover:#475569;
  --green:          #166534;
  --green-bg:       #dcfce7;
  --yellow:         #92400e;
  --yellow-bg:      #fef3c7;
  --red-bg:         #fee2e2;
  --red:            #991b1b;

  /* Spacing — 4px grid */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 3rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(13, 27, 46, 0.05);
  --shadow-md: 0 2px 6px rgba(13, 27, 46, 0.06), 0 8px 24px rgba(13, 27, 46, 0.06);
  --shadow-lg: 0 12px 32px rgba(13, 27, 46, 0.10), 0 24px 64px rgba(13, 27, 46, 0.10);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;

  /* Surfaces */
  --surface-hover: #f7faff;
  --surface-sunken: var(--bg);
}

/* ── Reset & base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  background: var(--brand);
  color: #fff;
  min-height: 60px;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: #fff;
}
.brand-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.topnav { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.topnav span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}
.topnav button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  min-height: 36px;
  transition: background 120ms ease;
  box-shadow: none;
}
.topnav button:hover { background: rgba(255, 255, 255, 0.18); }
.topnav button:focus { outline: 2px solid rgba(255, 255, 255, 0.45); outline-offset: 2px; }

/* Context pill (síndico/morador trocar contexto) */
.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 500;
  line-height: 1;
  min-height: 36px;
  transition: background 120ms ease;
}
.context-pill:hover { background: rgba(255, 255, 255, 0.18); }
.context-pill[aria-disabled="true"] { opacity: 0.85; cursor: default; }
.context-pill__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}
.context-pill__chevron {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-left: 0.1rem;
}

/* ── Layout ────────────────────────────────────────────── */
.container { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(13, 27, 46, 0.06), 0 4px 16px rgba(13, 27, 46, 0.06);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.card.narrow { max-width: 420px; margin: 2rem auto; }

/* ── Typography ────────────────────────────────────────── */
h1 { margin-top: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; color: var(--text); }
h2 { font-size: 1.05rem; font-weight: 600; margin-top: 0; color: var(--text); }

/* ── Forms ─────────────────────────────────────────────── */
form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
}
form input, form select, form textarea {
  display: block;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  margin-top: 0.35rem;
  background: var(--card);
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
form input::placeholder, form textarea::placeholder { color: var(--text-muted); }

/* ── Buttons ───────────────────────────────────────────── */
button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  min-height: 40px;
  touch-action: manipulation;
  transition: background 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 1px 2px var(--accent-shadow);
}
button:hover { background: var(--accent-hover); box-shadow: 0 2px 8px var(--accent-shadow); }
button:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
button.secondary { background: var(--secondary); box-shadow: none; }
button.secondary:hover { background: var(--secondary-hover); box-shadow: none; }
button.danger { background: var(--danger); box-shadow: none; }
button.danger:hover { background: var(--danger-hover); }
button.small { padding: 0.3rem 0.75rem; font-size: 0.8rem; min-height: 30px; border-radius: 6px; }

/* ── Utility ───────────────────────────────────────────── */
.error { color: var(--danger); font-size: 0.875rem; }
.muted { color: var(--text-muted); font-size: 0.875rem; }

/* ── Modals ────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(13, 27, 46, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 1rem;
}
.modal {
  background: var(--card);
  border-radius: 16px;
  padding: 1.75rem;
  max-width: 480px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(13, 27, 46, 0.20), 0 8px 24px rgba(13, 27, 46, 0.12);
}

/* ── Header select (seletor de unidade no morador) ─────── */
.header-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.header-select__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.header-select select {
  margin-top: 0;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  min-width: 240px;
}
.header-select select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* ── Login page ────────────────────────────────────────── */
.login-wrap {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-wrap .card.narrow { margin: 0; width: 100%; }
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  text-align: center;
}
.login-icon {
  width: 52px;
  height: 52px;
  background: var(--accent);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 6px 20px var(--accent-shadow);
}
.login-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}
.login-sub {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.login-wrap #login-form button[type="submit"] { width: 100%; margin-top: 0.5rem; }

/* ════════════════════════════════════════════════════════
   COMPONENTES DO REDESIGN
   ════════════════════════════════════════════════════════ */

/* ── Page header ───────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) 0 var(--space-5);
}
.page-header__text { min-width: 0; }
.page-header__text h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}
.page-header__sub {
  margin: var(--space-1) 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.page-header__action { display: flex; gap: var(--space-2); flex-shrink: 0; }

/* ── Tabbar (pill tabs) ────────────────────────────────── */
.tabbar {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tabbar .tab {
  background: transparent;
  color: var(--text-2);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-weight: 500;
  font-size: 0.875rem;
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  min-height: 34px;
  box-shadow: none;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.tabbar .tab:hover { background: var(--accent-subtle); color: var(--text); }
.tabbar .tab.is-active {
  background: var(--accent-subtle);
  color: var(--accent);
}
.tabbar .tab .icon { color: currentColor; flex-shrink: 0; }
.tabbar .tab__count {
  background: rgba(13, 27, 46, 0.08);
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  min-width: 20px;
  text-align: center;
}
.tabbar .tab.is-active .tab__count {
  background: var(--accent);
  color: #fff;
}
.tabbar .tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Searchbar ─────────────────────────────────────────── */
.record-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-4);
}
.searchbar {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  align-items: center;
  background: var(--card);
}
.searchbar__input-wrap {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  background: var(--surface-sunken);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  min-width: 0;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.searchbar__input-wrap .icon { color: var(--text-muted); flex-shrink: 0; }
.searchbar__input-wrap:focus-within {
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.searchbar__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  padding: 0.55rem 0;
  min-width: 0;
}
.searchbar__input::placeholder { color: var(--text-muted); }

/* ── Generic buttons (.button helper class) ────────────── */
button.button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 38px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  box-shadow: none;
}
.button--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px var(--accent-shadow);
}
.button--primary:hover { background: var(--accent-hover); }
.button--ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.button--ghost:hover { background: var(--surface-hover); color: var(--text); border-color: var(--text-muted); }
.button--danger {
  background: var(--danger);
  color: #fff;
}
.button--danger:hover { background: var(--danger-hover); }
.button--with-icon .icon { flex-shrink: 0; }
.button__count {
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  display: none;
}

/* ── Filter chips ──────────────────────────────────────── */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-sunken);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.2rem 0.2rem 0.65rem;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
}
.filter-chip__remove {
  background: transparent;
  color: var(--accent);
  border: none;
  padding: 3px;
  margin: 0;
  min-height: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  box-shadow: none;
}
.filter-chip__remove:hover { background: rgba(26, 86, 219, 0.18); }

/* ── Record list & rows ────────────────────────────────── */
.record-list {
  display: flex;
  flex-direction: column;
}
.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  transition: background var(--dur-fast) var(--ease-out);
}
.record:first-child { border-top: none; }
.record:hover { background: var(--surface-hover); }
.record-id { min-width: 0; }
.record-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-subtitle {
  font-size: 0.8125rem;
  color: var(--text-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
.record-actions {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

/* ── Painel de acessos (links) ─────────────────────────── */
.record--expandable {
  grid-template-columns: minmax(0, 1fr) auto auto;
  flex-wrap: wrap;
}
.link-acessos {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-2) var(--space-2);
}
.link-acessos--hidden { display: none; }
.link-acessos__empty {
  font-size: 0.8125rem;
  color: var(--text-2);
  margin: 0;
  padding: var(--space-2) 0;
}
.link-acessos__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.link-acesso-row {
  display: grid;
  grid-template-columns: 6rem minmax(0, 11rem) minmax(0, 1fr);
  gap: var(--space-3);
  font-size: 0.8125rem;
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
}
.link-acesso-row:hover { background: var(--surface-hover); }
.link-acesso-row__when { color: var(--text-2); white-space: nowrap; overflow: hidden; }
.link-acesso-row__ip   {
  color: var(--text-2);
  font-family: monospace;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-acesso-row__ua   {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Status chips ──────────────────────────────────────── */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.status-chip .icon { flex-shrink: 0; }
.status-chip__label { line-height: 1; }
.status-chip--green   { background: var(--green-bg);     color: var(--green);  }
.status-chip--accent  { background: var(--accent-subtle); color: var(--accent); }
.status-chip--red     { background: var(--red-bg);       color: var(--red);    }
.status-chip--yellow  { background: var(--yellow-bg);    color: var(--yellow); }
.status-chip--neutral { background: var(--surface-sunken); color: var(--text-2); }

/* ── Icon buttons ──────────────────────────────────────── */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 6px;
  min-height: 34px;
  min-width: 34px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: none;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}
.icon-btn.is-copied {
  background: var(--green-bg);
  color: var(--green);
}
.icon-btn .icon { flex-shrink: 0; }
.icon-btn__label {
  /* visually hidden by default; mostrado em .icon-btn--with-label */
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.icon-btn--with-label {
  padding: 6px 12px 6px 10px;
}
.icon-btn--with-label .icon-btn__label {
  position: static;
  width: auto; height: auto;
  margin: 0;
  clip: auto;
  overflow: visible;
}
.icon-btn--with-label.is-copied .icon-btn__label { color: var(--green); }
.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Dropdown menu ─────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: dropdown-in var(--dur-base) var(--ease-out);
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  text-align: left;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: none;
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item.is-destructive { color: var(--danger); }
.dropdown-item.is-destructive:hover { background: var(--red-bg); }

/* ── Popover (filtros) ─────────────────────────────────── */
.dropdown--popover { position: relative; }
.popover {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: var(--space-4);
  animation: dropdown-in var(--dur-base) var(--ease-out);
}
.popover__form { display: flex; flex-direction: column; gap: var(--space-3); }
.popover__field { display: flex; flex-direction: column; gap: 4px; }
.popover__field > span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.popover__field select,
.popover__field input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  margin-top: 0;
}
.popover__field select:focus,
.popover__field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.popover__actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-2);
}

/* ── Empty state ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-5);
  gap: var(--space-3);
}
.empty-state__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-lg);
}
.empty-state__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}
.empty-state__message {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 360px;
}
.empty-state__cta { margin-top: var(--space-2); }

/* ── Skeleton ──────────────────────────────────────────── */
.record--skeleton:hover { background: transparent; }
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-sunken) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    var(--surface-sunken) 100%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s linear infinite;
}
.skeleton--line { height: 12px; }
.skeleton--w-40 { width: 40%; }
.skeleton--w-25 { width: 25%; margin-top: 8px; }
.skeleton--pill { width: 80px; height: 22px; border-radius: var(--radius-pill); }
.skeleton--square { width: 80px; height: 28px; border-radius: var(--radius-md); }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Modal (extension: header + body + footer) ─────────── */
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
}
.modal-header h2 { margin: 0; font-size: 1.125rem; }
.modal-header .icon-btn { margin: -6px; }
.modal-section { margin-bottom: var(--space-4); }
.modal-footer {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-4);
}

/* ── Definition list (modal credenciais, link gerado) ──── */
.kv-list { display: flex; flex-direction: column; gap: var(--space-2); }
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}
.kv__label { color: var(--text-muted); font-weight: 500; }
.kv__value {
  font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace;
  color: var(--text);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* ── Form grid (modais) ────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3) var(--space-4);
}
.form-grid label,
.form-grid > label { margin-bottom: 0; }

/* ── Responsive: mobile (≤ 640px) ─────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0.75rem; }
  .topbar { padding: 0.75rem 1rem; }
  .topnav { width: 100%; justify-content: space-between; }
  .topnav span { max-width: calc(100vw - 6rem); }

  .card { padding: 1rem; }
  .card.narrow { margin: 1rem auto; }

  h1 { font-size: 1.2rem; }
  h2 { font-size: 1rem; }

  .modal { padding: 1.25rem; border-radius: 12px; }

  .login-wrap { padding: 1rem; }

  .header-select select { min-width: 0; width: 100%; }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-5) 0 var(--space-4);
  }
  .page-header__text h1 { font-size: 1.25rem; }
  .page-header__action { width: 100%; }
  .page-header__action .button { flex: 1; }

  .record {
    grid-template-columns: 1fr;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
  }
  .record-actions { justify-content: flex-end; }
  .record-chips { order: 2; }
  .record-actions { order: 3; }

  .searchbar { flex-wrap: wrap; }
  .searchbar .button { flex: 0 0 auto; }

  .popover { width: calc(100vw - 32px); }

  .form-grid { grid-template-columns: 1fr; }
}

/* ── Responsive: small mobile (≤ 380px) ───────────────── */
@media (max-width: 380px) {
  .topbar .brand { font-size: 0.9rem; }
}
