/* ==========================================================================
   MyVaults — Design System & CSS Stylesheet
   Modern, Premium, Tactile & Family-Oriented Password Vault
   ========================================================================== */

:root {
  /* Color Palette - Light Mode Default */
  --bg-app: #f4f6fb;
  --bg-card: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-input: #ffffff;
  --border-subtle: #e2e8f0;
  --border-card: #e2e8f0;
  --border-focus: #3b82f6;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-subtle: #eff6ff;
  --primary-text: #1d4ed8;

  --whatsapp-color: #16a34a;
  --whatsapp-hover: #15803d;
  --whatsapp-subtle: #f0fdf4;

  --accent-rose: #f43f5e;
  --accent-rose-subtle: #fff1f2;
  --accent-purple: #8b5cf6;
  --accent-purple-subtle: #f5f3ff;
  --accent-emerald: #10b981;
  --accent-emerald-subtle: #ecfdf5;
  --accent-amber: #f59e0b;
  --accent-amber-subtle: #fffbeb;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 12px 24px -6px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Conforto Visual & Tamanho do Texto (Padrão) */
  --card-title-size: 1.1rem;
  --card-field-val-size: 0.88rem;
  --card-field-label-size: 0.7rem;
  --card-meta-size: 0.78rem;
  --card-btn-font-size: 0.75rem;
  --card-padding: 1.35rem 1.4rem;
  --card-gap: 0.95rem;
  --card-fields-gap: 0.65rem;
  --card-custom-val-size: 0.85rem;
}

/* Modo Compacto */
html[data-text-size="compact"],
body[data-text-size="compact"] {
  --card-title-size: 0.98rem;
  --card-field-val-size: 0.8rem;
  --card-field-label-size: 0.65rem;
  --card-meta-size: 0.72rem;
  --card-btn-font-size: 0.7rem;
  --card-padding: 1.05rem 1.15rem;
  --card-gap: 0.75rem;
  --card-fields-gap: 0.5rem;
  --card-custom-val-size: 0.78rem;
}

/* Modo Confortável (Leitura Ampliada & Alto Conforto) */
html[data-text-size="comfortable"],
body[data-text-size="comfortable"] {
  --card-title-size: 1.25rem;
  --card-field-val-size: 1.05rem;
  --card-field-label-size: 0.76rem;
  --card-meta-size: 0.86rem;
  --card-btn-font-size: 0.82rem;
  --card-padding: 1.45rem 1.5rem;
  --card-gap: 1.1rem;
  --card-fields-gap: 0.8rem;
  --card-custom-val-size: 0.98rem;
}

/* Dark Mode Styles */
body.theme-dark {
  --bg-app: #090d16;
  --bg-card: #131a29;
  --bg-surface: #101726;
  --bg-subtle: #192236;
  --bg-input: #151d30;
  --border-subtle: #243048;
  --border-card: #1f2b42;
  --border-focus: #60a5fa;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-subtle: #1e293b;
  --primary-text: #93c5fd;

  --whatsapp-color: #22c55e;
  --whatsapp-hover: #16a34a;
  --whatsapp-subtle: #142e20;

  --accent-rose-subtle: #2d141b;
  --accent-purple-subtle: #24163d;
  --accent-emerald-subtle: #112920;
  --accent-amber-subtle: #2e2010;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 16px 32px -4px rgba(0, 0, 0, 0.45);
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

button, input, select, textarea, a {
  touch-action: manipulation;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

/* ==================== LOCK SCREEN OVERLAY ==================== */
.lock-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 250ms ease-out;
}

.lock-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 420px;
  max-width: 100%;
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  animation: modalPop 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.lock-avatar-shield {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.lock-user-info h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.lock-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.pin-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pin-display-dots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  background: transparent;
  transition: all var(--transition-fast);
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.15);
}

.pin-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
}

.pin-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.lock-divider {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.25rem 0;
}

.lock-divider::before,
.lock-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.lock-divider span {
  padding: 0 0.75rem;
}

.sso-login-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-sso {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-sso:hover {
  background: var(--bg-subtle);
  border-color: var(--text-subtle);
  transform: translateY(-1px);
}

.lock-footer-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==================== HEADER ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-normal);
}

body.theme-dark .app-header {
  background-color: rgba(19, 26, 41, 0.88);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-shield {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: transform var(--transition-fast);
}

.logo-shield:hover {
  transform: rotate(-5deg) scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-family {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: var(--radius-full);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Vault Dropdown Switcher (1Password Style) */
.vault-dropdown-wrapper {
  position: relative;
}

.vault-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.vault-select-btn:hover {
  background: var(--border-subtle);
  border-color: var(--primary);
}

.vault-current-icon {
  font-size: 1.1rem;
}

.chevron-icon {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.vault-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 280px;
  overflow: hidden;
  animation: modalPop 150ms ease-out;
}

.dropdown-header {
  padding: 0.65rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.vault-list-container {
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
}

.vault-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.vault-dropdown-item:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

.vault-dropdown-item.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 700;
}

.vault-item-icon {
  font-size: 1.2rem;
}

.vault-item-info {
  flex: 1;
  min-width: 0;
}

.vault-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-item-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dropdown-footer {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.btn-dropdown-action {
  width: 100%;
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  text-align: left;
  cursor: pointer;
}

.btn-dropdown-action:hover {
  text-decoration: underline;
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-name-mobile,
.btn-new-text-mobile {
  display: none !important;
}
.auth-name-desktop,
.btn-new-text-desktop {
  display: inline !important;
}

.btn-header-action.lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-header-action.lock-btn:hover {
  background: var(--accent-rose-subtle);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.18), var(--shadow-sm);
  transform: translateY(-1px);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--border-subtle);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-main);
  background: var(--bg-card);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18), var(--shadow-sm);
  transform: translateY(-1px);
}

/* Bordas evidentes e personalizadas por botão no topo */
#btnReferralModal:hover {
  color: var(--accent-emerald);
  background: var(--accent-emerald-subtle);
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2), var(--shadow-sm);
}

#btnCloudSync:hover {
  color: var(--primary);
  background: var(--primary-subtle);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), var(--shadow-sm);
}

#btnInvitePortal:hover {
  color: var(--accent-purple);
  background: var(--accent-purple-subtle);
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2), var(--shadow-sm);
}

#btnExportImport:hover {
  color: var(--primary);
  background: var(--primary-subtle);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), var(--shadow-sm);
}

#btnPasswordGenerator:hover {
  color: var(--accent-amber);
  background: var(--accent-amber-subtle);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2), var(--shadow-sm);
}

#btnOpenManual:hover {
  color: var(--primary);
  background: var(--primary-subtle);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), var(--shadow-sm);
}

#btnThemeToggle:hover {
  color: var(--accent-amber);
  background: var(--accent-amber-subtle);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2), var(--shadow-sm);
}

#btnHeaderLogout:hover {
  color: var(--accent-rose);
  background: var(--accent-rose-subtle);
  border-color: rgba(244, 63, 94, 0.55);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.2), var(--shadow-sm);
}

.header-auth-pill:hover {
  border-color: rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), var(--shadow-sm);
  transform: translateY(-1px);
}

.vault-select-btn:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18), var(--shadow-sm);
}

/* ==================== MAIN CONTAINER ==================== */
.main-container {
  max-width: 1360px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 1.75rem 2rem 4rem 2rem;
}

/* ==================== GUARDIAN BANNER ==================== */
.guardian-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

body.theme-dark .guardian-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(99, 102, 241, 0.16) 100%);
  border-color: rgba(99, 102, 241, 0.25);
}

.banner-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.banner-active-vault {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.vault-banner-icon {
  font-size: 1.8rem;
}

.banner-title-row h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.items-count-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  background: var(--bg-card);
  color: var(--primary-text);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.banner-description {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 850px;
}

/* Family Members Chips Bar */
.family-members-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(37, 99, 235, 0.15);
}

.family-bar-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.members-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.member-chip:hover {
  background: var(--bg-subtle);
  border-color: var(--primary);
  color: var(--text-main);
  transform: translateY(-1px);
}

.member-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-main);
}

.member-chip.active .chip-avatar {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.chip-count {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.member-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.member-chip-add {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.member-chip-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

.member-chip.unassigned {
  border-style: dashed;
}
.member-chip.unassigned .chip-avatar.unassigned {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}
body.theme-dark .member-chip.unassigned .chip-avatar.unassigned {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}
.member-chip.unassigned.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}
.member-chip.unassigned.active .chip-count {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Dynamic Tags Filter Bar */
.tags-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(37, 99, 235, 0.15);
}

.tags-bar-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 0.2rem;
}

.tags-chips-list {
  display: contents;
}

.tag-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-filter-chip .tag-chip-count {
  font-size: 0.68rem;
  opacity: 0.75;
  margin-left: 0.15rem;
  background: var(--bg-subtle);
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-full);
}

.tag-filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

.tag-filter-chip.active {
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}

.tag-filter-chip.active .tag-chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  opacity: 1;
}

.card-member-badge.unassigned {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.member-dot.unassigned {
  background-color: #94a3b8;
}

/* ==================== CONTROLS BAR ==================== */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 320px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.85rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-subtle);
  cursor: pointer;
  line-height: 1;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.select-wrapper select {
  padding: 0.75rem 2.2rem 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  transition: all var(--transition-fast);
}

.select-wrapper select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==================== VAULT CARDS GRID ==================== */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Password Card */
.vault-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  position: relative;
  min-height: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.vault-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(37, 99, 235, 0.3);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.header-badges-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex: 1 1 0;
  min-width: 0;
}

/* ==========================================================================
   Header Badges Unificados (Tipo de Item, Categoria, Cofre e Demo)
   Mesma geometria de pílula, tipografia e bordas suaves, diferenciados por cor
   ========================================================================== */
.card-type-badge,
.category-pill,
.vault-tag-pill,
.demo-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-sizing: border-box;
  border: 1px solid transparent;
}

/* 1. TIPOS DE ITEM (.card-type-badge) */
.card-type-badge.password {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.28);
}
body.theme-dark .card-type-badge.password {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.card-type-badge.credential {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.28);
}
body.theme-dark .card-type-badge.credential {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.card-type-badge.credit_card {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.28);
}
body.theme-dark .card-type-badge.credit_card {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.4);
}

.card-type-badge.secure_note {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.28);
}
body.theme-dark .card-type-badge.secure_note {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* 2. CATEGORIAS (.category-pill) */
.category-pill {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.25);
}
body.theme-dark .category-pill {
  background: rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.35);
}

.category-pill.emails {
  background: rgba(219, 39, 119, 0.1);
  color: #be185d;
  border-color: rgba(219, 39, 119, 0.25);
}
body.theme-dark .category-pill.emails {
  background: rgba(244, 114, 182, 0.18);
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.35);
}

.category-pill.social {
  background: rgba(225, 29, 72, 0.1);
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.25);
}
body.theme-dark .category-pill.social {
  background: rgba(251, 113, 133, 0.18);
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.35);
}

.category-pill.streaming {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.25);
}
body.theme-dark .category-pill.streaming {
  background: rgba(167, 139, 250, 0.18);
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
}

.category-pill.finance {
  background: rgba(5, 150, 105, 0.1);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.25);
}
body.theme-dark .category-pill.finance {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
}

.category-pill.shopping {
  background: rgba(234, 88, 12, 0.1);
  color: #c2410c;
  border-color: rgba(234, 88, 12, 0.25);
}
body.theme-dark .category-pill.shopping {
  background: rgba(251, 146, 60, 0.18);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.35);
}

.category-pill.work {
  background: rgba(79, 70, 229, 0.1);
  color: #4338ca;
  border-color: rgba(79, 70, 229, 0.25);
}
body.theme-dark .category-pill.work {
  background: rgba(129, 140, 248, 0.18);
  color: #818cf8;
  border-color: rgba(129, 140, 248, 0.35);
}

.category-pill.utilities {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.25);
}
body.theme-dark .category-pill.utilities {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}

.category-pill.other {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.25);
}
body.theme-dark .category-pill.other {
  background: rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.35);
}

/* 3. COFRES (.vault-tag-pill) */
.vault-tag-pill {
  background: rgba(100, 116, 139, 0.08);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.22);
}
body.theme-dark .vault-tag-pill {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.25);
}

.vault-tag-pill.vault-pessoal {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.25);
}
body.theme-dark .vault-tag-pill.vault-pessoal {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
}

.vault-tag-pill.vault-trabalho {
  background: rgba(5, 150, 105, 0.08);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.25);
}
body.theme-dark .vault-tag-pill.vault-trabalho {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}

.vault-tag-pill.vault-voluntariado {
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.25);
}
body.theme-dark .vault-tag-pill.vault-voluntariado {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.35);
}

.vault-tag-pill.vault-escola {
  background: rgba(217, 119, 6, 0.08);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.25);
}
body.theme-dark .vault-tag-pill.vault-escola {
  background: rgba(251, 191, 36, 0.15);
  color: #fde047;
  border-color: rgba(251, 191, 36, 0.35);
}

/* 4. DEMO BADGE (.demo-badge-pill) */
.demo-badge-pill {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: #b45309;
}
body.theme-dark .demo-badge-pill {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-card-action {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-card-action:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18), var(--shadow-sm);
  transform: translateY(-1px);
}

/* 0. Share Link Button */
.btn-card-action.share-link {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.btn-card-action.share-link:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), var(--shadow-sm);
  transform: translateY(-1px);
}

body.theme-dark .btn-card-action.share-link:hover {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.2), var(--shadow-sm);
}

.btn-copy-share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-share-link:hover {
  background: var(--primary-subtle);
  transform: translateY(-1px);
}

/* 1. WhatsApp Button */
.btn-card-action.send-whatsapp {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--whatsapp-color);
}

.btn-card-action.send-whatsapp:hover {
  background: var(--whatsapp-subtle);
  color: var(--whatsapp-color);
  border-color: rgba(22, 163, 74, 0.55);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.2), var(--shadow-sm);
  transform: translateY(-1px);
}

body.theme-dark .btn-card-action.send-whatsapp:hover {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2), var(--shadow-sm);
}

/* 2. Edit Button */
.btn-card-action.edit {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.btn-card-action.edit:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), var(--shadow-sm);
  transform: translateY(-1px);
}

body.theme-dark .btn-card-action.edit:hover {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.2), var(--shadow-sm);
}

/* 3. Delete Button */
.btn-card-action.delete {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.btn-card-action.delete:hover {
  background: var(--accent-rose-subtle);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.55);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.2), var(--shadow-sm);
  transform: translateY(-1px);
}

body.theme-dark .btn-card-action.delete:hover {
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.2), var(--shadow-sm);
}

/* Title & Website Link */
.card-identity {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.service-favicon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.service-favicon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.service-favicon-fallback {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.title-details {
  flex: 1;
  min-width: 0;
}

.service-title {
  font-size: var(--card-title-size);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}

.service-url-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.service-url-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* Card Member & SSO Row */
.card-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-member-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-main);
}

.member-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--primary);
}

.member-dot.titular, .member-dot.wagner { background-color: #2563eb; }
.member-dot.familiar, .member-dot.rony { background-color: #059669; }
.member-dot.marlon { background-color: #7c3aed; }
.member-dot.familia, .member-dot.casa { background-color: #d97706; }

/* SSO Card Badge ("Entrar com...") */
.sso-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.24rem 0.62rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  line-height: 1.2;
  transition: all var(--transition-fast);
}

.sso-card-badge svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.sso-card-badge.google {
  background: rgba(66, 133, 244, 0.08);
  border-color: rgba(66, 133, 244, 0.35);
  color: #1e40af;
}
body.theme-dark .sso-card-badge.google {
  background: rgba(66, 133, 244, 0.16);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
}

.sso-card-badge.microsoft {
  background: rgba(0, 164, 239, 0.08);
  border-color: rgba(0, 164, 239, 0.35);
  color: #0369a1;
}
body.theme-dark .sso-card-badge.microsoft {
  background: rgba(0, 164, 239, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.sso-card-badge.apple {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.2);
  color: #0f172a;
}
body.theme-dark .sso-card-badge.apple {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: #f8fafc;
}

/* Card Tags Row */
.card-tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-tag-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.15);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.card-tag-pill:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Credential Fields Box */
.card-fields {
  display: flex;
  flex-direction: column;
  gap: var(--card-fields-gap);
}

.field-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.field-label-and-val {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.field-label {
  font-size: var(--card-field-label-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.field-value {
  font-family: var(--font-mono);
  font-size: var(--card-field-val-size);
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.field-value.password-masked {
  letter-spacing: 2px;
  font-size: 1rem;
}

.field-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-field-action {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--card-btn-font-size);
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-field-action:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-field-action.copied {
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

/* Custom Fields Container in Card */
.card-custom-fields-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
}

.custom-field-row-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  gap: 0.5rem;
}

.custom-field-key {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.custom-field-val {
  font-family: var(--font-mono);
  font-size: var(--card-custom-val-size);
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  flex: 1;
}

.btn-copy-custom-field {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.15rem;
}

.btn-copy-custom-field:hover {
  color: var(--primary);
}

/* Card Attachments Box */
.card-attachments-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.attachment-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.attachment-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-download-att {
  background: var(--primary-subtle);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn-download-att:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Notes & Extra Info Box */
.card-notes-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-main);
}

body.theme-dark .card-notes-box {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}

.notes-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #b45309;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

body.theme-dark .notes-header {
  color: #fcd34d;
}

.notes-content {
  line-height: 1.45;
  color: var(--text-muted);
  white-space: pre-line;
  word-break: break-word;
}

/* Card Footer */
.card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border-card);
  margin-top: 1rem;
}

.empty-illustration {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 480px;
  margin: 0 auto 1.5rem auto;
}

/* Travar rolagem do fundo quando modal estiver aberto (iOS Safari / Mobile) */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
}

/* ==================== MODALS (<dialog>) ==================== */
.app-modal {
  border: none;
  background: transparent;
  padding: 1.5rem;
  max-width: 100vw;
  max-height: 100vh;
  margin: auto;
  overscroll-behavior: contain;
}

.app-modal::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 200ms ease-out;
}

.modal-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 660px;
  max-width: calc(100vw - 3rem);
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-wrapper.modal-sm { width: 460px; }
.modal-wrapper.modal-md { width: 560px; }
.modal-wrapper.modal-lg { width: 720px; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-icon-badge.whatsapp-badge {
  background: var(--whatsapp-subtle);
  color: var(--whatsapp-color);
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-main);
}

/* Modal Form */
.modal-form {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background-color: #f6f8fb;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

body.theme-dark .modal-form {
  background-color: #0c121e;
  border-top-color: #1f2b42;
  border-bottom-color: #1f2b42;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
}

body.theme-dark .form-group label {
  color: #94a3b8;
}

.required {
  color: var(--accent-rose);
}

.input-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  outline: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: all var(--transition-fast);
}

body.theme-dark .form-group input,
body.theme-dark .form-group select,
body.theme-dark .form-group textarea {
  background: #151d30;
  border-color: #2b3b57;
  color: #f1f5f9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #94a3b8;
}

body.theme-dark .form-group input:hover,
body.theme-dark .form-group select:hover,
body.theme-dark .form-group textarea:hover {
  border-color: #475569;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.18), 0 1px 2px rgba(15, 23, 42, 0.06);
}

body.theme-dark .form-group input:focus,
body.theme-dark .form-group select:focus,
body.theme-dark .form-group textarea:focus {
  background: #1b253b;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3.5px rgba(96, 165, 250, 0.22), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Tags Input Container */
.tags-input-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  min-height: 44px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: all var(--transition-fast);
}

body.theme-dark .tags-input-container {
  background: #151d30;
  border-color: #2b3b57;
}

.tags-input-container:hover {
  border-color: #94a3b8;
}

body.theme-dark .tags-input-container:hover {
  border-color: #475569;
}

.tags-input-container:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.18);
}

body.theme-dark .tags-input-container:focus-within {
  background: #1b253b;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3.5px rgba(96, 165, 250, 0.22);
}

.tags-pills-holder {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.btn-remove-tag {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
}

.tags-input-container input {
  border: none !important;
  box-shadow: none !important;
  padding: 0.2rem 0.4rem !important;
  flex: 1;
  min-width: 140px;
}

/* Segmented Control for Login Type */
.login-type-segmented-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.3rem;
}

.segmented-option {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.segmented-option input {
  display: none;
}

.segmented-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  text-align: center;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.segmented-option span svg {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.segmented-option input:checked + span {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* 1Password Style: Type Picker Dialog */
.type-picker-wrapper {
  max-width: 520px;
  width: 95vw;
}

.type-picker-search-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.type-picker-search-wrap svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.type-picker-search-wrap input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.type-picker-search-wrap input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.type-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.type-picker-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  position: relative;
}

.type-picker-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  background: var(--bg-subtle);
}

.type-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.type-picker-card:hover .type-card-icon {
  transform: scale(1.08);
}

.type-card-icon.credential-bg {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.type-card-icon.card-bg {
  background: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
}

.type-card-icon.note-bg {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.type-card-icon.password-bg {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.type-card-info {
  flex: 1;
  min-width: 0;
}

.type-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.type-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.type-card-plus {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.5;
  transition: all var(--transition-fast);
}

.type-picker-card:hover .type-card-plus {
  color: var(--primary);
  opacity: 1;
  transform: scale(1.2);
}

/* Item Type Tabs in Modal */
.item-type-tab-container {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-subtle);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.type-selector-chip {
  flex: 1 1 0;
  background: transparent;
  border: none;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-align: center;
}

.type-selector-chip:hover {
  color: var(--text-main);
}

.type-selector-chip.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.login-type-segmented-control.five-options {
  grid-template-columns: repeat(5, 1fr);
}

/* Credit Card Preview */
.credit-card-preview {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  margin-bottom: 1.1rem;
  position: relative;
  overflow: hidden;
}

.credit-card-preview::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.card-chip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.card-chip {
  width: 38px;
  height: 26px;
  background: linear-gradient(135deg, #d4af37 0%, #fef08a 50%, #b45309 100%);
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  position: relative;
}

.card-chip::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 2px;
}

.card-brand-badge {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.card-number-preview {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.22rem;
  letter-spacing: 0.14em;
  margin-bottom: 1.1rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.card-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-label-micro {
  font-size: 0.6rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.card-name-preview {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-exp-preview {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.credit-card-inputs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

/* Secure Note Content Textarea */
#secureNoteContent {
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 160px;
}

.note-char-counter {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Credit Card inside Vault Card */
.vault-card-credit-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 0.65rem;
}

.vault-card-number-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.vault-card-num-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-main);
}

.vault-card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.45rem;
  margin-top: 0.35rem;
}

/* Secure Note snippet in Vault Card */
.vault-note-snippet-box {
  background: var(--bg-subtle);
  border-left: 3px solid #f59e0b;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow: hidden;
  position: relative;
  margin-top: 0.65rem;
}

/* SSO Alert Banner */
.sso-alert-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--primary-subtle);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.sso-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.sso-banner-text strong {
  display: block;
  font-size: 0.88rem;
  color: var(--primary);
  margin-bottom: 0.15rem;
}

.sso-banner-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Custom Fields Builder in Modal */
.custom-fields-builder {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.custom-field-row-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.65rem;
}

.custom-field-row-edit input[type="text"],
.custom-field-row-edit select {
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
}

.custom-field-row-edit .cf-label-input {
  width: 150px;
}

.custom-field-row-edit .cf-type-select {
  width: 120px;
}

.custom-field-row-edit .cf-val-input {
  flex: 1;
}

.btn-remove-cf {
  background: none;
  border: none;
  color: var(--accent-rose);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.35rem;
}

/* Attachments Builder in Modal */
.attachments-list-builder {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.attachment-row-edit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
}

.btn-remove-att {
  background: none;
  border: none;
  color: var(--accent-rose);
  cursor: pointer;
  font-size: 1.15rem;
}

/* Password Input & Strength Bar */
.input-with-action {
  display: flex;
  gap: 0.5rem;
}

.btn-input-aux {
  padding: 0.65rem 0.9rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: all var(--transition-fast);
}

body.theme-dark .btn-input-aux {
  background: #151d30;
  border-color: #2b3b57;
  color: #f1f5f9;
}

.btn-input-aux:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

.label-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-link-action {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-link-action:hover {
  text-decoration: underline;
}

.password-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-container input {
  padding-right: 2.75rem;
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

.btn-toggle-visibility {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.4rem;
  color: var(--text-muted);
}

.password-strength-bar {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.strength-track {
  flex: 1;
  height: 5px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 200ms ease, background-color 200ms ease;
}

.strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 90px;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==================== SEND MODAL ==================== */
.send-modal-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.member-target-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
}

.member-avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-target-info {
  flex: 1;
}

.target-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
}

.target-phone {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.btn-text-sm {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.message-preview-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-main);
  white-space: pre-wrap;
  max-height: 170px;
  overflow-y: auto;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.send-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--whatsapp-color);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
  transition: all var(--transition-fast);
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-1px);
}

/* ==================== VAULTS MANAGER MODAL ==================== */
.vaults-manager-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.existing-vaults-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 250px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.vault-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.vault-manage-row:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.vault-manage-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.vault-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.vault-manage-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.vault-manage-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-manage-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-manage-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.vault-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.btn-vault-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  font-size: 0.95rem;
  opacity: 0.55;
  transition: opacity 0.15s, background-color 0.15s;
}

.btn-vault-delete:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.1);
}

.emoji-chip {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.emoji-chip:hover {
  transform: scale(1.1);
}

.emoji-chip.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
  transform: scale(1.12);
}

/* ==================== GENERATOR & MEMBERS MODAL ==================== */
.generator-body, .members-config-body, .export-import-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.generated-password-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-subtle);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.15rem;
}

.generated-password-text {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

.btn-copy-gen {
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-copy-gen:hover { background: var(--primary-hover); }

.generator-controls {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.gen-slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.gen-slider-row label {
  font-size: 0.85rem;
  font-weight: 600;
}

.gen-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.gen-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* Members Edit */
.info-note {
  font-size: 0.83rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.info-note code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(37, 99, 235, 0.1);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: var(--primary);
}

.members-edit-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.member-edit-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
}

.member-edit-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.member-edit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  flex: 1;
}

.member-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.member-mini-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.member-name-input,
.member-phone-input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--bg-input);
  color: var(--text-main);
  transition: border-color 0.15s ease;
}

.member-name-input:focus,
.member-phone-input:focus {
  border-color: var(--primary);
  outline: none;
}

.btn-delete-member {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-delete-member:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  transform: scale(1.05);
}

.add-member-inline {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.add-member-inline input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: var(--bg-input);
  color: var(--text-main);
  flex: 1;
  min-width: 130px;
}

@media (max-width: 640px) {
  .member-edit-row {
    flex-wrap: wrap;
    padding-right: 3.25rem;
  }
  .member-edit-fields {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .btn-delete-member {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
  }
  .type-picker-grid {
    grid-template-columns: 1fr !important;
    gap: 0.6rem !important;
  }
  .item-type-tab-container {
    display: flex !important;
    flex-wrap: wrap !important;
  }
  .type-selector-chip {
    flex: 1 1 calc(33.333% - 0.4rem) !important;
  }
  .credit-card-inputs-grid {
    grid-template-columns: 1fr !important;
  }
  .login-type-segmented-control.five-options {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* IO Cards */
.io-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.io-icon { font-size: 1.8rem; line-height: 1; }
.io-details { flex: 1; }
.io-details h4 { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.25rem; }
.io-details p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.4; }

.btn-primary-sm, .btn-secondary-sm, .btn-outline-sm {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary-sm { background: var(--primary); color: #ffffff; border: none; }
.btn-primary-sm:hover { background: var(--primary-hover); }

.btn-secondary-sm { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-subtle); }
.btn-secondary-sm:hover { background: var(--border-subtle); }

.btn-outline-sm { background: transparent; color: var(--primary); border: 1px dashed var(--primary); }
.btn-outline-sm:hover { background: var(--primary-subtle); }

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  font-weight: 600;
  animation: toastSlideIn 250ms cubic-bezier(0.16, 1, 0.3, 1), toastFadeOut 250ms ease-in 2.75s forwards;
}

.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.info { border-left: 4px solid var(--primary); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ==================== RESPONSIVE (MOBILE & TABLET) ==================== */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  /* ==================== HEADER MOBILE FLUIDO & SAFE AREA (DYNAMIC ISLAND / NOTCH) ==================== */
  .app-header {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: 0.55rem;
    padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
    display: grid;
    grid-template-areas:
      "logo action"
      "vault vault";
    grid-template-columns: 1fr auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
  }

  .header-left {
    display: contents; /* Permite posicionar logo e cofre diretamente no grid */
  }

  .brand-logo {
    grid-area: logo;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .logo-shield {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .logo-shield svg {
    width: 18px;
    height: 18px;
  }

  .brand-title {
    font-size: 1rem;
    font-weight: 800;
  }

  .brand-subtitle {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.1;
  }

  .badge-family {
    font-size: 0.62rem;
    padding: 0.1rem 0.4rem;
  }

  .header-right {
    grid-area: action;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: nowrap;
  }

  .vault-dropdown-wrapper {
    grid-area: vault;
    width: 100%;
  }

  .vault-select-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.52rem 0.85rem;
    font-size: 0.88rem;
    max-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
  }

  .vault-dropdown-menu {
    width: 100%;
    left: 0;
    right: 0;
    touch-action: manipulation;
  }

  /* Oculta botões excessivos no topo do mobile — centralizados em Ajustes & Bottom Tab Bar! */
  .btn-header-action.lock-btn,
  #btnHeaderAppSettings,
  #btnChangePin,
  #btnCloudSync,
  #btnExportImport,
  #btnPasswordGenerator,
  #btnOpenManual,
  #btnThemeToggle,
  #btnReferralModal {
    display: none !important;
  }

  /* Exibir apenas o ícone/avatar do usuário no celular para economizar espaço */
  .header-auth-pill {
    padding: 0 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    border-radius: var(--radius-full) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    flex-shrink: 0 !important;
  }

  .header-auth-pill #headerAuthText,
  .header-auth-pill .auth-name-desktop,
  .header-auth-pill .auth-name-mobile {
    display: none !important;
  }

  .header-auth-pill #headerAuthDot {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.05rem !important;
    line-height: 1 !important;
    margin: 0 !important;
  }

  .header-auth-pill #headerAuthDot img {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }

  /* Botão de Logout compacto no mobile */
  .header-right .btn-icon#btnHeaderLogout {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    padding: 0 !important;
    border-radius: var(--radius-full) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .header-right .btn-icon#btnHeaderLogout svg {
    width: 17px !important;
    height: 17px !important;
  }

  /* Botão do Painel de Distribuição compacto no mobile (entre Sair e +) */
  .header-right .btn-icon#btnInvitePortal {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    padding: 0 !important;
    border-radius: var(--radius-full) !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 1.05rem !important;
    line-height: 1 !important;
  }
  .header-right .btn-icon#btnInvitePortal:not([style*="display: none"]) {
    display: inline-flex !important;
  }

  /* Botão de Nova Senha no celular: apenas o sinal de '+' circular */
  .btn-new-text-desktop,
  .btn-new-text-mobile {
    display: none !important;
  }

  .btn-primary#btnNewVaultItem {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    padding: 0 !important;
    border-radius: var(--radius-full) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
  }

  .btn-primary#btnNewVaultItem svg {
    width: 20px !important;
    height: 20px !important;
  }

  /* Main Container com espaçamento para barra inferior */
  .main-container {
    padding: 0.65rem 0.85rem calc(75px + env(safe-area-inset-bottom)) 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* ==================== ELIMINAÇÃO DO ESPAÇO GIGANTE (CIRCULO VERMELHO) ==================== */
  .guardian-banner {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 0.45rem !important;
    gap: 0.35rem !important;
  }

  .banner-description {
    display: none !important; /* Remove o parágrafo longo redundante */
  }

  .banner-title-row {
    margin-bottom: 0.15rem;
  }

  .banner-title-row h1 {
    font-size: 1.15rem !important;
    font-weight: 700;
  }

  .banner-active-vault {
    gap: 0.4rem;
  }

  .vault-banner-icon {
    font-size: 1.25rem;
  }

  .items-count-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.55rem;
  }

  .family-bar-label,
  .tags-bar-label {
    display: none !important; /* Remove o texto redundante 'PESSOA:' e 'Etiquetas:' */
  }

  /* Barra de Pessoas (Carrossel Horizontal Deslizável com o Dedo) */
  .family-members-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding-top: 0.4rem;
  }

  .members-chips {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .members-chips::-webkit-scrollbar {
    display: none;
  }

  .member-chip {
    flex-shrink: 0;
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
  }

  .member-chip-add {
    flex-shrink: 0;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
  }

  /* Barra de Etiquetas (Envolve e aproveita 100% da largura das linhas) */
  .tags-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    padding-top: 0.4rem;
  }

  .tags-chips-list {
    display: contents;
  }

  .tag-filter-chip {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
  }

  /* Controles de Busca e Filtros */
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 1.15rem;
  }

  .search-input-wrapper {
    min-width: 100%;
  }

  .search-input-wrapper input {
    padding: 0.65rem 2.2rem 0.65rem 2.5rem;
    font-size: 16px !important;
    touch-action: manipulation;
  }

  .filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .select-wrapper {
    width: 100%;
  }

  .select-wrapper select {
    width: 100%;
    padding: 0.6rem 1.8rem 0.6rem 0.75rem;
    font-size: 16px !important;
    touch-action: manipulation;
  }

  /* Mobile Density Tuning */
  :root {
    --card-padding: 1.1rem 1.15rem;
    --card-title-size: 1.05rem;
    --card-field-val-size: 0.86rem;
    --card-btn-font-size: 0.72rem;
  }
  html[data-text-size="compact"],
  body[data-text-size="compact"] {
    --card-padding: 0.85rem 0.95rem;
    --card-title-size: 0.95rem;
    --card-field-val-size: 0.78rem;
    --card-btn-font-size: 0.68rem;
  }
  html[data-text-size="comfortable"],
  body[data-text-size="comfortable"] {
    --card-padding: 1.25rem 1.25rem;
    --card-title-size: 1.22rem;
    --card-field-val-size: 1.02rem;
    --card-btn-font-size: 0.8rem;
  }

  /* Cards Grid */
  .vault-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    gap: 1rem;
  }

  .vault-card {
    padding: var(--card-padding);
    border-radius: var(--radius-lg);
    min-height: auto;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }

  .card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .header-badges-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    flex: 1 1 0;
    min-width: 0;
  }

  .card-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .card-identity {
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .service-favicon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .title-details {
    min-width: 0;
    flex: 1 1 auto;
  }

  .service-title {
    font-size: var(--card-title-size);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .field-box {
    padding: 0.6rem 0.8rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .field-label-and-val {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .field-value {
    font-size: var(--card-field-val-size);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .field-actions {
    flex-shrink: 0;
  }

  .btn-field-action {
    padding: 0.35rem 0.55rem;
    font-size: var(--card-btn-font-size);
  }

  /* Proteção para telas estreitas (<= 480px) ou modo confortável */
  @media (max-width: 480px) {
    html[data-text-size="comfortable"] .field-box,
    body[data-text-size="comfortable"] .field-box {
      flex-wrap: wrap;
      gap: 0.45rem;
      padding: 0.65rem 0.75rem;
    }
    html[data-text-size="comfortable"] .field-box .field-actions,
    body[data-text-size="comfortable"] .field-box .field-actions {
      width: 100%;
      justify-content: flex-end;
      padding-top: 0.25rem;
      border-top: 1px dashed rgba(226, 232, 240, 0.45);
    }
    body.theme-dark[data-text-size="comfortable"] .field-box .field-actions {
      border-top-color: rgba(36, 48, 72, 0.5);
    }
    html[data-text-size="comfortable"] .field-value,
    body[data-text-size="comfortable"] .field-value {
      white-space: normal;
      word-break: break-all;
    }
  }

  /* ==================== PREVENÇÃO DE ZOOM DO IOS SAFARI ==================== */
  /* No iOS, inputs com font-size menor que 16px acionam zoom involuntário de tela inteira */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  input[type="search"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Modais em Celular (Rolagem Fluida, Proporções Compactas e Sem Distorção) */
  .app-modal {
    padding: 0.5rem 0.65rem;
    box-sizing: border-box;
    width: 100vw;
    max-height: 100dvh;
    margin: auto;
    overscroll-behavior: contain;
  }

  .modal-wrapper,
  .modal-wrapper.modal-sm,
  .modal-wrapper.modal-md,
  .modal-wrapper.modal-lg {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 86dvh;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
  }

  /* Manual do Usuário aproveita altura máxima para leitura confortável */
  #modalUserManual .modal-wrapper {
    height: 90dvh;
    max-height: 90dvh;
  }

  .modal-header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .modal-header h2 {
    font-size: 1.05rem;
  }

  .modal-icon-badge {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }

  .modal-subtitle {
    font-size: 0.75rem;
  }

  #modalUserManual .modal-subtitle {
    display: none;
  }

  .manual-nav-bar {
    flex-shrink: 0;
    padding: 0.45rem 0.85rem;
    gap: 0.35rem;
    overscroll-behavior: contain;
    touch-action: pan-x;
  }

  .cloud-sync-body,
  .modal-form,
  .send-modal-body,
  .vaults-manager-body,
  .generator-body,
  .members-config-body,
  .export-import-body,
  .manual-modal-body,
  .settings-modal-body {
    padding: 0.85rem 1rem !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .modal-form {
    gap: 0.85rem !important;
  }

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

  .form-group {
    gap: 0.3rem;
  }

  .form-group label {
    font-size: 0.78rem;
    font-weight: 600;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.52rem 0.75rem;
    border-radius: var(--radius-md);
  }

  .login-type-segmented-control {
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
  }

  .segmented-option span {
    padding: 0.45rem 0.4rem;
    font-size: 0.76rem;
  }

  .modal-footer,
  .manual-modal-footer {
    flex-shrink: 0;
    padding: 0.65rem 1rem !important;
  }

  .manual-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }

  .manual-modal-footer .btn-secondary-sm {
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
  }

  .custom-field-row-edit {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .custom-field-row-edit .cf-label-input {
    width: 100%;
  }

  .custom-field-row-edit .cf-type-select {
    width: 45%;
  }

  .custom-field-row-edit .cf-val-input {
    width: calc(55% - 2.5rem);
  }

  .send-actions-grid {
    grid-template-columns: 1fr;
  }

  /* Lock Card em Celular */
  .lock-card {
    width: 100%;
    padding: 1.75rem 1.25rem;
  }
}

/* ==================== IN-APP MANUAL MODAL ==================== */
.manual-nav-bar {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 1.4rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.manual-nav-bar::-webkit-scrollbar {
  display: none;
}

.manual-nav-pill {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.manual-nav-pill:hover {
  color: var(--text-main);
  border-color: var(--border-card);
}

.manual-nav-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.manual-modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  flex: 1 1 0%;
  min-height: 0;
}

.manual-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.manual-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--text-main);
}

.manual-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}

.manual-card ul {
  margin: 0.5rem 0 0.5rem 1.25rem;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.manual-card li {
  margin-bottom: 0.35rem;
}

/* ==================== BOTTOM TAB BAR (1PASSWORD STYLE) ==================== */
.bottom-tab-bar {
  display: none;
}

@media (max-width: 768px) {
  .bottom-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.05);
  }

  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    padding: 0;
  }

  .tab-item:active {
    transform: scale(0.94);
  }

  .tab-item.active {
    color: var(--primary);
  }

  .tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    font-size: 1.2rem;
  }

  .tab-label {
    font-size: 0.7rem;
    font-weight: 600;
  }
}

/* ==================== SETTINGS MODAL BODY ==================== */
.settings-modal-body {
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(85vh - 90px);
  overscroll-behavior: contain;
}

/* ==================== SETTINGS MENU ITEMS ==================== */
.settings-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-menu-item:hover {
  background: var(--bg-subtle);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-item-icon {
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.settings-item-text {
  display: flex;
  flex-direction: column;
}

.settings-item-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.settings-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.settings-item-arrow {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==================== CONFIGURAÇÃO DE CONFORTO VISUAL / TAMANHO DE TEXTO ==================== */
.settings-density-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.settings-density-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-density-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.density-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.6rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.density-chip:hover {
  color: var(--text-main);
  background: rgba(37, 99, 235, 0.06);
}

.density-chip.active {
  background: var(--bg-card);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

body.theme-dark .density-chip.active {
  background: var(--bg-surface);
  border-color: rgba(96, 165, 250, 0.45);
  color: #60a5fa;
}

.density-chip-preview {
  line-height: 1;
  color: var(--text-main);
}

.density-chip.active .density-chip-preview {
  color: var(--primary);
}

body.theme-dark .density-chip.active .density-chip-preview {
  color: #60a5fa;
}

.density-chip-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ==================== BANNER MODO LOCAL / DEMO ==================== */
.local-mode-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.09), rgba(217, 119, 6, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: 0 4px 20px -2px rgba(245, 158, 11, 0.08);
}

.local-banner-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 260px;
}

.local-banner-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  line-height: 1;
}

.local-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.local-banner-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: #d97706;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

body.theme-dark .local-banner-title {
  color: #fbbf24;
}

.local-banner-badge {
  font-size: 0.72rem;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: inherit;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.local-banner-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.local-banner-desc strong {
  color: var(--text-main);
}

.local-banner-actions {
  flex-shrink: 0;
}

.btn-local-banner-cta {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #1c1917;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn-local-banner-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.45);
  filter: brightness(1.05);
}

.header-auth-pill {
  transition: all var(--transition-fast);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-auth-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

@media (max-width: 768px) {
  .local-mode-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-local-banner-cta {
    width: 100%;
    justify-content: center;
  }
}

/* ==================== IMPORTED ITEM HIGHLIGHT PULSE ==================== */
@keyframes itemHighlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px 8px rgba(16, 185, 129, 0.55);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    transform: scale(1);
  }
}

.item-imported-highlight {
  animation: itemHighlightPulse 2.5s ease-in-out;
  border-color: #10b981 !important;
  z-index: 5;
}

/* ==================== BACKGROUND SYNC SPINNER ==================== */
@keyframes spinSync {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-sync {
  display: inline-block;
  animation: spinSync 0.9s linear infinite;
  transform-origin: center center;
}

