/* ============================================
   components.css — All UI Component Styles
   RULE: Variables bata matra color/spacing.
   ============================================ */

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  font-family: var(--font-main);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    opacity var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.btn-primary {
  background-color: var(--accent-primary);
  color: var(--text-on-accent);
  border-color: var(--accent-primary);
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Secondary */
.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-hover);
  border-color: var(--accent-primary);
}

/* Danger */
.btn-danger {
  background-color: var(--danger-subtle);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger:hover:not(:disabled) {
  background-color: var(--danger);
  color: #fff;
}

/* Ghost */
.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Icon button (square) */
.btn-icon {
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-icon:hover:not(:disabled) {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}
.btn-icon.btn-icon-danger:hover:not(:disabled) {
  background-color: var(--danger-subtle);
  color: var(--danger);
}

/* Size variants */
.btn-sm { padding: 5px 12px; font-size: var(--text-sm); }
.btn-lg { padding: 12px 24px; font-size: var(--text-lg); }
.btn-full { width: 100%; }

/* Loading state */
.btn.loading .btn-text { opacity: 0; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--text-on-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ══════════════════════════════════════════════
   FORM INPUTS
   ══════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-main);
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
  outline: none;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  border-color: var(--accent-primary);
  background-color: var(--bg-secondary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-subtle);
}

.form-input.success {
  border-color: var(--success);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9cb8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

.form-helper {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Password field with action buttons */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap .form-input {
  padding-right: 80px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.password-actions {
  position: absolute;
  right: var(--space-xs);
  display: flex;
  gap: 2px;
}

.password-actions .btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
}

/* Tags input */
.tags-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 40px;
  align-items: center;
  cursor: text;
  transition: border-color var(--transition-fast);
}

.tags-input-wrap:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.tags-input-wrap input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: var(--text-base);
  min-width: 80px;
  flex: 1;
}

/* ══════════════════════════════════════════════
   STRENGTH BAR
   ══════════════════════════════════════════════ */
.strength-wrap {
  margin-top: var(--space-xs);
}

.strength-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.strength-segment {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-full);
  background-color: var(--border-color);
  transition: background-color var(--transition-normal);
}

.strength-segment.active-weak    { background-color: var(--strength-weak); }
.strength-segment.active-fair    { background-color: var(--strength-fair); }
.strength-segment.active-good    { background-color: var(--strength-good); }
.strength-segment.active-strong  { background-color: var(--strength-strong); }

.strength-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
}

.strength-label.weak   { color: var(--strength-weak); }
.strength-label.fair   { color: var(--strength-fair); }
.strength-label.good   { color: var(--strength-good); }
.strength-label.strong { color: var(--strength-strong); }

/* ══════════════════════════════════════════════
   BADGE / TAG
   ══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  line-height: 1.5;
}

.badge-default  { background-color: var(--bg-hover);       color: var(--text-secondary); }
.badge-accent   { background-color: var(--accent-subtle);  color: var(--accent-primary); }
.badge-success  { background-color: var(--success-subtle); color: var(--success); }
.badge-warning  { background-color: var(--warning-subtle); color: var(--warning); }
.badge-danger   { background-color: var(--danger-subtle);  color: var(--danger); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background-color: var(--accent-subtle);
  color: var(--accent-primary);
  border: 1px solid rgba(108, 124, 224, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  transition: background-color var(--transition-fast);
}

.tag .tag-remove {
  display: flex;
  align-items: center;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  padding: 1px;
  border-radius: 50%;
}

.tag .tag-remove:hover { opacity: 1; background-color: var(--danger-subtle); }

/* ══════════════════════════════════════════════
   CARDS (Entry Cards)
   ══════════════════════════════════════════════ */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
  animation: fadeIn 0.3s ease;
}

.entry-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.3s ease backwards;
}

.entry-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-accent);
}

.entry-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.entry-favicon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.entry-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  truncate: true;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-username {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-url {
  font-size: var(--text-xs);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.entry-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.entry-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
  overflow: hidden;
}

.entry-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.entry-card:hover .entry-actions { opacity: 1; }

.entry-favorite {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  color: var(--text-muted);
  font-size: 14px;
  transition: color var(--transition-fast);
}

.entry-favorite.is-favorite { color: var(--warning); }

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-section {
  padding: var(--space-sm) 0;
}

.sidebar-section-label {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  border-radius: 0;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.sidebar-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background-color: var(--accent-subtle);
  color: var(--accent-primary);
}

.sidebar-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.sidebar-item-count {
  margin-left: auto;
  background-color: var(--bg-primary);
  color: var(--text-muted);
  font-size: var(--text-xs);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: var(--font-medium);
}

.sidebar-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: var(--space-sm) 0;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: var(--space-sm) 0;
}

/* ══════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════ */
.search-wrap {
  flex: 1;
  position: relative;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 15px;
}

.search-input {
  width: 100%;
  padding: 7px var(--space-md) 7px 34px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

/* ══════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeInScale 0.25s ease;
  box-shadow: var(--shadow-lg);
}

.modal-content-lg { max-width: 680px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-footer-left {
  margin-right: auto;
}

/* ══════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-base);
  color: var(--text-primary);
  pointer-events: auto;
  min-width: 240px;
  max-width: 380px;
  animation: slideInRight 0.3s ease;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.toast.hiding {
  opacity: 0;
  transform: translateX(20px);
}

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg  { flex: 1; font-size: var(--text-sm); }

.toast-success { border-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error   { border-color: var(--danger);  }
.toast-error   .toast-icon { color: var(--danger);  }
.toast-warning { border-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    { border-color: var(--accent-primary); }
.toast-info    .toast-icon { color: var(--accent-primary); }

/* ══════════════════════════════════════════════
   AUTH CARD (Setup / Unlock pages)
   ══════════════════════════════════════════════ */
.auth-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.auth-logo-name {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.auth-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-footer {
  margin-top: var(--space-lg);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  animation: fadeIn 0.4s ease;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.empty-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 320px;
}

/* ══════════════════════════════════════════════
   SECTION HEADER (inside vault)
   ══════════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.section-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  background-color: var(--bg-hover);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ══════════════════════════════════════════════
   CONFIRMATION DIALOG
   ══════════════════════════════════════════════ */
.confirm-dialog {
  max-width: 380px;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-md);
}

.confirm-icon-danger {
  background-color: var(--danger-subtle);
  color: var(--danger);
}

.confirm-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.confirm-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════
   DETAIL VIEW (Entry detail panel)
   ══════════════════════════════════════════════ */
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-value {
  font-size: var(--text-base);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  overflow: hidden;
}

.detail-value-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-value-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  font-size: var(--text-sm);
}

.detail-value-url {
  color: var(--accent-primary);
  cursor: pointer;
  text-decoration: none;
}

.detail-value-url:hover { text-decoration: underline; }

.detail-value-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   PASSWORD HISTORY
   ══════════════════════════════════════════════ */
.history-section {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-md);
  margin-top: var(--space-sm);
}

.history-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.history-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--bg-input);
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
}

.history-item-pass {
  font-family: var(--font-mono);
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   LOADING / SKELETON
   ══════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-hover) 25%,
    var(--border-color) 50%,
    var(--bg-hover) 75%
  );
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-md);
}

/* ══════════════════════════════════════════════
   COPY FEEDBACK
   ══════════════════════════════════════════════ */
.copy-feedback {
  position: relative;
}

.copy-feedback::after {
  content: 'Copied!';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-primary);
  color: var(--success);
  font-size: var(--text-xs);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--success);
  transition: opacity var(--transition-fast);
}

.copy-feedback.copied::after { opacity: 1; }

/* ══════════════════════════════════════════════
   DIVIDER
   ══════════════════════════════════════════════ */
.divider {
  height: 1px;
  background-color: var(--border-color);
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .app-sidebar {
    display: none;
  }

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

  .auth-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .modal-content {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 95vh;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .toast-container {
    bottom: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
  }

  .toast {
    max-width: 100%;
  }
}

/* ══════════════════════════════════════════════
   PHASE 2 — PASSWORD GENERATOR MODAL
   ══════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────── */
.gen-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100; /* Above entry modal (1000) */
  padding: var(--space-md);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.gen-modal-overlay.visible { opacity: 1; }

/* ── Modal Card ──────────────────────────────── */
.gen-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism (dark mode) */
:root[data-theme="dark"] .gen-modal {
  background: linear-gradient(135deg, rgba(var(--surface-rgb),0.97), rgba(var(--surface-rgb),0.99));
  border-color: rgba(var(--accent-rgb),0.2);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ── Header ──────────────────────────────────── */
.gen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

/* ── Preview Section ─────────────────────────── */
.gen-preview-section {
  padding: var(--space-lg);
  background: var(--bg-input);
  border-bottom: 1px solid var(--border-color);
}

.gen-preview-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.gen-password-display {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  letter-spacing: 0.06em;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
  white-space: nowrap;
  word-break: break-all;
  scrollbar-width: none;
  min-height: 42px;
  display: flex;
  align-items: center;
  cursor: default;
  transition: border-color var(--transition-fast);
  user-select: all;
}

.gen-password-display::-webkit-scrollbar { display: none; }

.gen-preview-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.gen-action-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.gen-action-btn:hover {
  background-color: var(--bg-hover);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.gen-action-btn:active { transform: scale(0.92); }

/* Spinning refresh */
.gen-action-btn.spinning svg {
  animation: spin 0.6s ease-in-out;
}

/* ── Meta row (strength + entropy) ─────────────── */
.gen-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.gen-strength-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.gen-entropy {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

/* ── Options Section ─────────────────────────── */
.gen-options {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.gen-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.gen-option-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gen-option-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--font-normal);
}

/* ── Length Slider ───────────────────────────── */
.gen-slider-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  justify-content: flex-end;
}

.gen-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 4px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    to right,
    var(--accent-primary) 0%,
    var(--accent-primary) var(--slider-pct, 30%),
    var(--border-color) var(--slider-pct, 30%),
    var(--border-color) 100%
  );
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.gen-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 6px var(--accent-glow);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.gen-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px var(--accent-glow);
}

.gen-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-card);
  cursor: pointer;
}

.gen-length-badge {
  min-width: 36px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
  background: var(--accent-subtle);
  border: 1px solid rgba(var(--accent-rgb),0.2);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

/* ── Charset Toggle Buttons ──────────────────── */
.gen-toggles {
  display: flex;
  gap: 6px;
}

.gen-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
  min-width: 48px;
}

.gen-toggle:hover {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
}

.gen-toggle.active {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.gen-toggle:active { transform: scale(0.94); }

.gen-toggle-char {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  line-height: 1;
}

.gen-toggle-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.gen-toggle.active .gen-toggle-label {
  color: var(--accent-primary);
}

/* ── Switch (Exclude Ambiguous) ──────────────── */
.gen-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.gen-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.gen-switch-track {
  width: 40px;
  height: 22px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  transition: background-color var(--transition-normal);
}

.gen-switch-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform var(--transition-normal), box-shadow var(--transition-fast);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.gen-switch input:checked + .gen-switch-track {
  background-color: var(--accent-primary);
}

.gen-switch input:checked + .gen-switch-track::after {
  transform: translateX(18px);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ── Footer ──────────────────────────────────── */
.gen-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* ══════════════════════════════════════════════
   PHASE 2 — STRENGTH FEEDBACK
   ══════════════════════════════════════════════ */

.strength-feedback {
  margin-top: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.strength-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.5;
}

/* Strength badge on entry cards */
.strength-badge {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}

/* Inline strength wrap in form */
.strength-wrap {
  margin-top: 6px;
}

.strength-wrap .strength-bar {
  margin-bottom: 4px;
}

/* Entropy in form (optional display) */
.strength-entropy-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ── Gen Modal responsive ────────────────────── */
@media (max-width: 520px) {
  .gen-modal { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .gen-modal-overlay { align-items: flex-end; padding: 0; }
  .gen-slider { width: 120px; }
  .gen-toggles { gap: 4px; }
  .gen-toggle { min-width: 40px; padding: var(--space-xs) 6px; }
}

/* ══════════════════════════════════════════════
   PHASE 3 — TOTP / 2FA STYLES
   ══════════════════════════════════════════════ */

.totp-ring {
  width: 36px; height: 36px;
  transform: rotate(-90deg);
  flex-shrink: 0;
}
.totp-ring-sm { width: 28px; height: 28px; }

.totp-ring-bg {
  fill: none; stroke: var(--border-color); stroke-width: 3;
}
.totp-ring-fill {
  fill: none; stroke: var(--accent-primary); stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s linear, stroke var(--transition-fast);
}
.totp-ring-urgent { stroke: var(--danger) !important; }

.totp-code-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.totp-remaining {
  position: absolute;
  font-size: 9px; font-weight: var(--font-bold);
  color: var(--text-muted); font-family: var(--font-mono);
  pointer-events: none;
  transition: color var(--transition-fast);
}
.totp-remaining.urgent { color: var(--danger); }

/* Dashboard */
.totp-grid { display: flex; flex-direction: column; gap: var(--space-sm); }

.totp-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); gap: var(--space-md);
  transition: border-color var(--transition-fast);
}
.totp-card:hover { border-color: var(--accent-primary); }

[data-theme="dark"] .totp-card {
  background: linear-gradient(135deg, rgba(var(--surface-rgb),0.8), rgba(var(--surface-rgb),0.9));
  border-color: rgba(var(--accent-rgb),0.15);
}

.totp-card-info { flex: 1; min-width: 0; }
.totp-title {
  font-weight: var(--font-semibold); color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.totp-sub { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }

.totp-right { display: flex; align-items: center; gap: var(--space-md); flex-shrink: 0; }

.totp-code {
  font-size: var(--text-xl); font-weight: var(--font-bold);
  letter-spacing: 0.15em; color: var(--accent-primary);
  min-width: 100px; text-align: center;
}
.totp-copy-btn { color: var(--text-muted); font-size: 16px; }
.totp-copy-btn:hover { color: var(--accent-primary); }

/* TOTP in form */
.totp-form-section {
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  padding: var(--space-md); background: var(--bg-input);
}
.totp-form-enabled { display: flex; flex-direction: column; gap: var(--space-xs); }
.totp-live-preview {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

/* TOTP in detail modal */
.totp-detail-field { background: var(--accent-subtle); border-color: rgba(var(--accent-rgb),0.2); }
.totp-detail-value { display: flex; align-items: center; gap: var(--space-md); }

/* QR Scanner */
.qr-tab {
  padding: var(--space-sm) var(--space-md);
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-secondary); font-size: var(--text-sm);
  font-weight: var(--font-medium); cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  font-family: var(--font-main);
}
.qr-tab:hover { color: var(--text-primary); }
.qr-tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.qr-tab-content { min-height: 200px; }

.qr-camera-wrap {
  position: relative; border-radius: var(--radius-sm);
  overflow: hidden; border: 2px solid var(--border-color);
}

.qr-scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  animation: qrScan 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--accent-glow); z-index: 2;
}
@keyframes qrScan {
  0%   { top: 10%; }
  50%  { top: 90%; }
  100% { top: 10%; }
}

.qr-corner {
  position: absolute; width: 24px; height: 24px;
  border-color: var(--accent-primary); border-style: solid; z-index: 3;
}
.qr-tl { top: 12px; left: 12px;     border-width: 3px 0 0 3px; }
.qr-tr { top: 12px; right: 12px;    border-width: 3px 3px 0 0; }
.qr-bl { bottom: 12px; left: 12px;  border-width: 0 0 3px 3px; }
.qr-br { bottom: 12px; right: 12px; border-width: 0 3px 3px 0; }

.qr-upload-area {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--space-sm);
  padding: var(--space-xl); border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm); cursor: pointer; min-height: 160px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.qr-upload-area:hover { border-color: var(--accent-primary); background-color: var(--accent-subtle); }

/* Recovery key */
.recovery-key-display {
  background: var(--bg-secondary);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-md); padding: var(--space-lg);
  text-align: center; box-shadow: 0 0 20px rgba(var(--accent-rgb),0.15);
}
.recovery-key-label {
  font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted);
  margin-bottom: var(--space-sm); font-weight: var(--font-semibold);
}
.recovery-key-rows { display: flex; flex-direction: column; gap: var(--space-xs); }
.recovery-key-row {
  font-size: var(--text-base); font-weight: var(--font-bold);
  color: var(--text-primary); letter-spacing: 0.08em;
  word-break: break-all; user-select: all;
}

/* Badge additions */
.badge-success {
  background-color: rgba(var(--success-rgb),0.12); color: var(--success);
  border: 1px solid rgba(var(--success-rgb),0.25);
}

/* Form helper text */
.form-helper {
  font-size: var(--text-xs); color: var(--text-muted);
  margin-top: 4px; line-height: 1.5;
}

/* ══════════════════════════════════════════════
   PHASE 4 — BACKUP & BREACH STYLES
   ══════════════════════════════════════════════ */

/* ── Backup Modal ────────────────────────────── */
.backup-section { display: flex; flex-direction: column; gap: var(--space-sm); }

.backup-section-title {
  font-size: var(--text-base); font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.backup-section-desc {
  font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6;
  margin: 0;
}

.backup-section-desc code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-input); padding: 1px 5px; border-radius: 3px;
  color: var(--accent-primary);
}

.backup-divider {
  height: 1px; background: var(--border-color);
  margin: var(--space-xs) 0;
}

/* ── File Drop Zone ──────────────────────────── */
.backup-file-drop {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--space-sm);
  padding: var(--space-lg);
  border: 2px dashed var(--border-color); border-radius: var(--radius-sm);
  cursor: pointer; min-height: 100px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.backup-file-drop:hover,
.backup-file-drop.dragging {
  border-color: var(--accent-primary);
  background-color: var(--accent-subtle);
}

.backup-file-drop.dragging { border-style: solid; }

/* ── Backup Result Messages ──────────────────── */
.backup-result {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-xs);
  font-size: var(--text-sm); line-height: 1.6;
}

.backup-result-success {
  background: rgba(var(--success-rgb),0.1);
  border: 1px solid rgba(var(--success-rgb),0.25);
  color: var(--success);
}

.backup-result-error {
  background: var(--danger-subtle);
  border: 1px solid rgba(var(--danger-rgb),0.25);
  color: var(--danger);
}

/* ── Breach Badges (inline in detail + dashboard) ── */
.breach-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: var(--text-xs); font-weight: var(--font-semibold);
  white-space: nowrap;
}

.breach-safe {
  background: rgba(var(--success-rgb),0.12); color: var(--success);
  border: 1px solid rgba(var(--success-rgb),0.3);
}

.breach-pwned {
  background: rgba(var(--danger-rgb),0.12); color: var(--danger);
  border: 1px solid rgba(var(--danger-rgb),0.3);
  animation: breachPulse 2s ease-in-out infinite;
}

@keyframes breachPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--danger-rgb),0); }
  50%       { box-shadow: 0 0 0 4px rgba(var(--danger-rgb),0.15); }
}

.breach-error {
  background: rgba(var(--warning-rgb),0.12); color: var(--warning);
  border: 1px solid rgba(var(--warning-rgb),0.3);
}

/* ── Breach Check Button ─────────────────────── */
.breach-check-btn {
  font-size: var(--text-xs); padding: 4px 10px;
  height: auto; min-width: 100px;
  border-color: var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.breach-check-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ── Breach Scan Modal ───────────────────────── */
.breach-intro {
  display: flex; align-items: flex-start; gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-input); border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-md);
}

.breach-intro-icon {
  font-size: 28px; flex-shrink: 0; margin-top: 2px;
}

/* ── Breach Stats Row ────────────────────────── */
.breach-stats-row {
  display: flex; gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.breach-stat {
  flex: 1; text-align: center;
  padding: var(--space-sm);
  background: var(--bg-input); border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.breach-stat-val {
  font-size: var(--text-xl); font-weight: var(--font-bold);
  color: var(--text-primary);
}

.breach-stat-label {
  font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px;
}

.breach-stat-safe   .breach-stat-val { color: var(--success); }
.breach-stat-pwned  .breach-stat-val { color: var(--danger);  }

/* ── Breach Progress Bar ─────────────────────── */
.breach-progress-bar {
  height: 6px; background: var(--bg-input);
  border-radius: 3px; overflow: hidden; margin-bottom: var(--space-xs);
}

.breach-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-glow));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ── Breach Result List ──────────────────────── */
.breach-result-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
  gap: var(--space-sm);
}

.breach-result-item:last-child { border-bottom: none; }

.breach-result-title {
  font-size: var(--text-sm); font-weight: var(--font-medium);
  color: var(--text-primary); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.breach-result-badge { flex-shrink: 0; }

.breach-item-pwned  { background: rgba(var(--danger-rgb),0.04); }
.breach-item-safe   { background: transparent; }
.breach-item-error  { background: rgba(var(--warning-rgb),0.04); }

/* ══════════════════════════════════════════════
   PHASE 5 — AUTO-LOCK + CLIPBOARD STYLES
   ══════════════════════════════════════════════ */

/* ── Auto-lock Warning Toast ─────────────────── */
.autolock-warning {
  position: fixed;
  bottom: calc(var(--space-lg) + 60px); /* above any other toasts */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(var(--danger-rgb),0.25), var(--shadow-lg);
  min-width: 300px;
  max-width: 420px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.autolock-warn-icon { font-size: 20px; flex-shrink: 0; }

.autolock-warn-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.4;
}

.autolock-warn-btn {
  flex-shrink: 0;
  font-size: var(--text-xs);
  padding: 4px 12px;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  white-space: nowrap;
}

.autolock-warn-btn:hover {
  background: var(--accent-subtle);
}

/* ── Clipboard Countdown Toast ───────────────── */
.clipboard-toast {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 9998;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 340px;
  overflow: hidden;
  animation: fadeInRight 0.25s ease;
}

@keyframes fadeInRight {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.clipboard-toast-inner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}

.clipboard-toast-icon { font-size: 16px; flex-shrink: 0; }

.clipboard-toast-body { flex: 1; min-width: 0; }

.clipboard-toast-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clipboard-toast-secs {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.clipboard-cancel {
  flex-shrink: 0;
  font-size: 12px;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  padding: 0;
  min-width: unset;
}

.clipboard-cancel:hover { color: var(--danger); }

/* Draining progress bar at bottom of toast */
.clipboard-bar {
  height: 3px;
  background: var(--border-color);
}

.clipboard-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  transition: width 1s linear;
  border-radius: 0 2px 2px 0;
}

/* ── General fade-out ────────────────────────── */
.fade-out {
  animation: fadeOut 0.3s ease forwards !important;
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); }
}

/* ── Settings select ────────────────────────── */
.settings-item select.form-input {
  padding: var(--space-xs) var(--space-sm);
  height: 32px;
  cursor: pointer;
}

/* ══════════════════════════════════════════════
   PHASE 6 — TAGS + SHORTCUTS + MOBILE NAV
   ══════════════════════════════════════════════ */

/* ── Sidebar Tags Section ────────────────────── */
.sidebar-section {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-color);
}

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

/* ── Tag Chips ───────────────────────────────── */
.tags-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: var(--font-medium);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.tag-chip-active {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: var(--font-semibold);
}

.tag-chip-clear {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(var(--danger-rgb),0.07);
}

.tag-chip-clear:hover {
  background: rgba(var(--danger-rgb),0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.tag-chip-count {
  font-size: 10px;
  opacity: 0.7;
  font-weight: var(--font-normal);
}

.tags-empty { padding: var(--space-xs) 0; }

/* ── Keyboard-focused Entry Card ─────────────── */
.entry-card:focus,
.entry-card.keyboard-focused {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-subtle), var(--shadow-md);
}

.entry-card:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ── Keyboard Shortcuts Modal ────────────────── */
.shortcuts-modal { max-width: 460px; }

.shortcuts-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.shortcuts-section { display: flex; flex-direction: column; gap: var(--space-sm); }

.shortcuts-section-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-color);
}

.shortcuts-list { display: flex; flex-direction: column; gap: 2px; }

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px var(--space-sm);
  border-radius: var(--radius-xs);
  gap: var(--space-md);
  transition: background var(--transition-fast);
}

.shortcut-item:hover { background: var(--bg-input); }

.shortcut-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.shortcut-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--border-color);
  flex-shrink: 0;
}

/* ── Mobile Bottom Navigation ────────────────── */
.mobile-bottom-nav {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 450;
  height: 60px;
  background: rgba(var(--bg-secondary-rgb, 22, 23, 35), 0.92);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-top: 1px solid var(--border-color);
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--space-sm);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  height: 52px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--text-xs);
  padding: 0;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-btn:active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.mobile-nav-icon {
  font-size: 20px;
  line-height: 1;
  display: block;
}

.mobile-nav-label {
  font-size: 10px;
  font-weight: var(--font-medium);
}

/* Add button — prominent center pill */
.mobile-nav-add {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--text-on-accent) !important;
  font-size: 22px !important;
  box-shadow: 0 4px 16px rgba(var(--accent-rgb),0.4);
  transform: translateY(-8px);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
              background var(--transition-fast);
}

.mobile-nav-add:active {
  transform: translateY(-6px) scale(0.95);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.3);
  background: var(--accent-hover) !important;
}

/* Show bottom nav on mobile only */
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  .app-main { padding-bottom: 72px; } /* space for nav */
}

/* ══════════════════════════════════════════════
   PHASE 7 — HEALTH DASHBOARD + CSV IMPORTER
   ══════════════════════════════════════════════ */

/* ── Health Modal ────────────────────────────── */
.health-modal { max-width: 540px; }

.health-score-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-lg) 0 var(--space-md);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-md);
}

.health-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

/* Animated donut fill */
.health-donut-fill {
  transition: stroke-dasharray 1s cubic-bezier(.4,0,.2,1);
}

.health-score-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-align: center;
}

/* Stats grid */
.health-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  flex: 1;
}

.health-stat {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: var(--space-sm);
  text-align: center;
}

.health-stat-val {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.health-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.health-stat-ok   .health-stat-val { color: var(--success); }
.health-stat-warn .health-stat-val { color: var(--warning); }
.health-stat-crit .health-stat-val { color: var(--danger);  }
.health-stat-info .health-stat-val { color: var(--accent-primary); }

/* Issues list */
.health-issues-wrap { display: flex; flex-direction: column; gap: var(--space-sm); }

.health-issues-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.health-issues-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.health-issue-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.health-issue-item:last-child { border-bottom: none; }
.health-issue-item:hover { background: var(--bg-input); }

.health-issue-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-issue-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}

.health-badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: var(--font-semibold);
  white-space: nowrap;
}

.health-badge-critical { background: rgba(var(--danger-rgb),0.12); color: var(--danger);  border: 1px solid rgba(var(--danger-rgb),0.3); }
.health-badge-warning  { background: rgba(var(--warning-rgb),0.12); color: var(--warning); border: 1px solid rgba(var(--warning-rgb),0.3); }
.health-badge-info     { background: rgba(var(--accent-rgb),0.1); color: var(--accent-primary); border: 1px solid rgba(var(--accent-rgb),0.3); }

.health-fix-btn {
  font-size: 11px;
  padding: 3px 8px;
  height: auto;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.health-issue-item:hover .health-fix-btn { opacity: 1; }

.health-perfect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) 0;
  text-align: center;
}

/* ── CSV Importer ────────────────────────────── */
.import-intro { margin-bottom: var(--space-sm); }

.import-format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-sm);
}

.import-preview-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-sm);
}

.import-preview-count {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.import-table-wrap {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
}

.import-table th {
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.import-table td {
  padding: 6px 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-table tr:last-child td { border-bottom: none; }
.import-table tr:hover td { background: var(--bg-input); }

/* ======================================================
   PHASE 8 — NOTES + CUSTOM FIELDS + EXPIRY + SEARCH
   ====================================================== */

/* Search highlight */
mark.search-highlight{background:rgba(var(--accent-rgb),.28);color:inherit;border-radius:2px;padding:0 1px}

/* Note rendered content */
.note-render{font-size:var(--text-sm);color:var(--text-secondary);line-height:1.7;padding:var(--space-sm) 0;word-break:break-word}
.note-h2{font-size:var(--text-xl);font-weight:var(--font-bold);color:var(--text-primary);margin:var(--space-sm) 0 var(--space-xs)}
.note-h3{font-size:var(--text-lg);font-weight:var(--font-semibold);color:var(--text-primary);margin:var(--space-sm) 0 var(--space-xs)}
.note-h4{font-size:var(--text-base);font-weight:var(--font-semibold);color:var(--text-primary);margin:var(--space-sm) 0 var(--space-xs)}
.note-ul{padding-left:var(--space-lg);margin:var(--space-xs) 0}.note-li{margin-bottom:3px}
.note-code-block{background:var(--bg-input);border:1px solid var(--border-color);border-radius:var(--radius-xs);padding:var(--space-sm) var(--space-md);font-family:var(--font-mono);font-size:12px;overflow-x:auto;margin:var(--space-xs) 0;line-height:1.5}
.note-inline-code{background:var(--bg-input);border:1px solid var(--border-color);border-radius:3px;padding:1px 5px;font-family:var(--font-mono);font-size:12px}
.note-link{color:var(--accent-primary);text-decoration:underline;text-underline-offset:2px}
.note-link:hover{color:var(--accent-hover)}
.note-textarea{font-family:var(--font-mono);font-size:13px;resize:vertical;min-height:200px;line-height:1.6}

/* Custom field rows */
.custom-field-row{display:grid;grid-template-columns:80px 1fr 1fr auto;gap:var(--space-xs);align-items:center;margin-bottom:var(--space-xs);animation:fadeIn .2s ease}
.custom-field-type{padding:var(--space-xs) var(--space-sm);font-size:var(--text-xs);height:36px}
.cf-remove-btn{width:32px;height:32px;flex-shrink:0;font-size:13px}

/* Custom fields detail */
.detail-custom-field{display:flex;align-items:center;gap:var(--space-sm);padding:var(--space-xs) var(--space-sm);background:var(--bg-input);border:1px solid var(--border-color);border-radius:var(--radius-xs)}
.detail-cf-label{font-size:var(--text-xs);font-weight:var(--font-semibold);color:var(--text-muted);min-width:80px;text-transform:uppercase;letter-spacing:.05em;flex-shrink:0}
.detail-cf-value{flex:1;font-size:var(--text-sm);color:var(--text-primary);font-family:var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.detail-cf-masked{letter-spacing:.1em}

/* Badge note */
.badge-note{background:rgba(var(--accent-rgb),.12);color:var(--accent-primary);border:1px solid rgba(var(--accent-rgb),.3);font-size:10px;padding:2px 7px;border-radius:20px;font-weight:var(--font-semibold)}

/* Expiry */
.badge-danger{background:rgba(var(--danger-rgb),.12);color:var(--danger);border:1px solid rgba(var(--danger-rgb),.3);font-size:10px;padding:2px 7px;border-radius:20px;font-weight:var(--font-semibold)}
.expiry-badge{display:inline-flex;align-items:center;gap:3px}
.expiry-pulse{animation:expiryPulse 1.5s ease-in-out infinite}
@keyframes expiryPulse{0%,100%{opacity:1}50%{opacity:.5}}
.expiry-icon{font-size:14px}.expiry-icon-danger{color:var(--danger)}.expiry-icon-warn{color:var(--warning)}

/* Expiry banner */
.expiry-banner{display:flex;align-items:center;gap:var(--space-sm);padding:var(--space-sm) var(--space-md);border-radius:var(--radius-sm);margin-bottom:var(--space-md);font-size:var(--text-sm);animation:slideDown .3s ease}
@keyframes slideDown{from{transform:translateY(-10px);opacity:0}to{transform:translateY(0);opacity:1}}
.expiry-banner-danger{background:rgba(var(--danger-rgb),.08);border:1px solid rgba(var(--danger-rgb),.3);color:var(--text-primary)}
.expiry-banner-warn{background:rgba(var(--warning-rgb),.08);border:1px solid rgba(var(--warning-rgb),.3);color:var(--text-primary)}
.expiry-banner-icon{font-size:18px;flex-shrink:0}
.expiry-banner-text{flex:1;line-height:1.5}.expiry-banner-text em{font-style:normal;font-weight:var(--font-semibold)}
.expiry-banner-close{opacity:.6}.expiry-banner-close:hover{opacity:1;color:var(--danger)}
.expiry-highlight{outline:2px solid var(--danger)!important;outline-offset:2px;animation:expiryFlash .5s ease-in-out 3}
@keyframes expiryFlash{0%,100%{box-shadow:var(--shadow-md)}50%{box-shadow:0 0 0 6px rgba(var(--danger-rgb),.2),var(--shadow-md)}}

/* Utility */
.text-danger{color:var(--danger)!important}.text-warning{color:var(--warning)!important}.text-success{color:var(--success)!important}

/* ======================================================
   PHASE 9 — PASSPHRASE + BULK ACTIONS + EXPORTER
   ====================================================== */

/* -- Passphrase Modal -------------------------- */
.pp-modal { max-width: 500px; }

.pp-preview-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xs);
}

.pp-preview {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: 0.03em;
  word-break: break-all;
  line-height: 1.5;
}

.pp-refresh-btn { flex-shrink: 0; font-size: 18px; }

.pp-entropy {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-align: right;
  margin-bottom: var(--space-md);
}

.pp-controls { display: flex; flex-direction: column; gap: var(--space-md); }

.pp-control-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.pp-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.pp-val {
  font-family: var(--font-mono);
  font-weight: var(--font-bold);
  color: var(--accent-primary);
  min-width: 18px;
  text-align: center;
}

.pp-range {
  -webkit-appearance: none;
  height: 4px;
  border-radius: 4px;
  background: var(--border-color);
  outline: none;
  cursor: pointer;
}

.pp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(var(--accent-rgb),0.4);
}

.pp-select { height: 36px; font-size: var(--text-sm); }

.pp-toggles {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pp-toggle-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  user-select: none;
}

.pp-toggle-input { display: none; }

.pp-toggle-pill {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--border-color);
  border-radius: 20px;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.pp-toggle-pill::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.pp-toggle-input:checked + .pp-toggle-pill { background: var(--accent-primary); }
.pp-toggle-input:checked + .pp-toggle-pill::after { transform: translateX(16px); }

/* -- Bulk Action Bar --------------------------- */
.bulk-action-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: bottom 0.35s cubic-bezier(.4,0,.2,1);
  min-width: min(700px, 90vw);
}

.bulk-action-bar.visible { bottom: calc(var(--space-lg) + 4px); }

@media (max-width: 768px) {
  .bulk-action-bar.visible { bottom: calc(68px + var(--space-sm)); }
}

.bulk-action-left, .bulk-action-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.bulk-action-left { flex: 1; }

.bulk-count-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  min-width: 80px;
}

.bulk-folder-sel {
  height: 32px;
  font-size: var(--text-xs);
  padding: 0 var(--space-sm);
  width: 120px;
}

.bulk-tag-input {
  height: 32px;
  font-size: var(--text-xs);
  padding: 0 var(--space-sm);
}

/* Card select-mode styles */
.entry-card.bulk-mode { cursor: pointer; position: relative; }

.bulk-check {
  position: absolute;
  top: 10px; right: 10px;
  width: 18px; height: 18px;
  cursor: pointer;
  accent-color: var(--accent-primary);
  z-index: 2;
}

.entry-card.bulk-selected {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  background: var(--accent-subtle);
}

/* -- Export Cards ------------------------------ */
.export-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.export-card:hover { border-color: var(--accent-primary); }

.export-card-icon {
  font-size: 28px;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-weight: var(--font-bold);
}

.export-card-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.export-card-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

/* ======================================================
   PHASE 10 — ACTIVITY LOG + FAVORITES DASHBOARD
   ====================================================== */

/* -- Activity Log Modal ------------------------ */
.act-list {
  max-height: 420px;
  overflow-y: auto;
}

.act-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.act-row:last-child { border-bottom: none; }
.act-row:hover { background: var(--bg-input); }

.act-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.act-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.act-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.act-detail {
  font-size: var(--text-xs);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.act-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.act-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
}

/* -- Favorites Dashboard Panel ----------------- */
.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-input);
  transition: background var(--transition-fast);
}

.dash-header:hover { background: var(--bg-hover); }

.dash-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.dash-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--font-normal);
}

.dash-chevron { opacity: 0.6; font-size: 12px; }

.dash-body {
  padding: var(--space-md);
  transition: all 0.3s ease;
}

.dash-panel.dash-collapsed .dash-body {
  display: none;
}

.dash-section-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-sm);
}

.dash-grid-recent {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.dash-tile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  position: relative;
}

.dash-tile:hover {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.dash-tile:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.dash-tile-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--font-bold);
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.dash-tile-info {
  flex: 1;
  min-width: 0;
}

.dash-tile-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-tile-sub {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-tile-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.dash-tile:hover .dash-tile-actions { opacity: 1; }

.dash-copy-btn {
  width: 26px;
  height: 26px;
  font-size: 13px;
  padding: 0;
}

/* -- Empty state for no entries ---------------- */
.entry-grid-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl) 0;
  text-align: center;
}

.entry-grid-empty-icon { font-size: 48px; opacity: 0.4; }

.entry-grid-empty-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.entry-grid-empty-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 280px;
}

/* ======================================================
   PHASE 11 — UI POLISH: ANIMATIONS + ONBOARDING
   ====================================================== */

/* -- Page load progress bar -------------------- */
.page-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.3s;
}
.page-progress.active { opacity: 1; }

/* -- Card entrance stagger --------------------- */
@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
.card-entrance { animation: cardEntrance 0.3s ease both; }

/* -- Scroll to top button ---------------------- */
.scroll-top-btn {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border: none;
  cursor: pointer;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.scroll-top-btn.visible { opacity: 1; transform: translateY(0); }
.scroll-top-btn:hover { background: var(--accent-hover); transform: translateY(-2px); }

@media (max-width: 768px) {
  .scroll-top-btn { bottom: calc(72px + var(--space-sm)); right: var(--space-md); }
}

/* -- Search clear button ----------------------- */
.search-clear-btn {
  position: absolute;
  right: var(--space-sm);
  top: 50%; transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px;
  line-height: 1;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.search-clear-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

/* -- Onboarding Tour --------------------------- */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: all;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.tour-spotlight {
  position: absolute;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  outline: 3px solid var(--accent-primary);
  outline-offset: 3px;
  animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
  0%, 100% { outline-color: var(--accent-primary); }
  50%       { outline-color: var(--accent-secondary); }
}

.tour-tooltip {
  position: absolute;
  z-index: 1001;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-xl);
  pointer-events: all;
}

.tour-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.tour-step-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--font-semibold);
}

.tour-skip-btn {
  background: none;
  border: none;
  font-size: var(--text-xs);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.tour-skip-btn:hover { color: var(--text-secondary); }

.tour-title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.tour-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.tour-desc code {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.tour-progress {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.tour-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all 0.25s;
}
.tour-dot.active { background: var(--accent-primary); transform: scale(1.4); }
.tour-dot.done   { background: var(--success); }

.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

/* ======================================================
   PHASE 12 — SECURITY HARDENING
   ====================================================== */

/* -- Re-auth Modal ----------------------------- */
.reauth-lock-icon {
  font-size: 40px;
  text-align: center;
  margin-bottom: var(--space-sm);
}

.reauth-reason {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.reauth-error {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: var(--space-xs);
  font-weight: var(--font-medium);
}

/* Shake animation on wrong password */
@keyframes shake {
  0%, 100% { transform: translateX(0);  }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px);  }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px);  }
}
.shake { animation: shake 0.4s ease; }

/* -- Session Countdown Ring -------------------- */
.session-ring-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  cursor: default;
  title: 'Session timeout';
}

.session-ring-svg {
  width: 34px; height: 34px;
  transform: rotate(-90deg);
}

.session-ring-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 3;
}

.session-ring-fill {
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear, stroke 0.5s ease;
}

.session-ring-label {
  position: absolute;
  font-size: 9px;
  font-weight: var(--font-bold);
  color: var(--text-muted);
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
}

/* -- Security badge on action buttons ---------- */
.btn-requires-auth::after {
  content: '??';
  font-size: 10px;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.7;
}

/* -- Strength gate on setup screen ------------ */
.strength-gate-bar {
  display: flex;
  gap: 3px;
  margin-top: var(--space-xs);
}

.strength-gate-seg {
  height: 4px;
  flex: 1;
  border-radius: 4px;
  background: var(--border-color);
  transition: background 0.3s ease;
}

.strength-gate-seg.filled-0 { background: var(--danger);  }
.strength-gate-seg.filled-1 { background: var(--danger);  }
.strength-gate-seg.filled-2 { background: var(--warning); }
.strength-gate-seg.filled-3 { background: var(--warning); }
.strength-gate-seg.filled-4 { background: var(--success); }

.strength-gate-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  margin-top: 4px;
}

.strength-gate-label.weak   { color: var(--danger);  }
.strength-gate-label.fair   { color: var(--warning); }
.strength-gate-label.strong { color: var(--success); }

/* -- Security status indicator in header ------- */
.security-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  margin-right: 4px;
  animation: statusPulse 3s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}
