
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6);
  transition: background var(--transition-base), border-color var(--transition-base);
}

.app-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: nowrap;
  gap: var(--space-2);
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}

.app-header .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  box-shadow: var(--shadow-glow-accent);
}

.app-header .logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-spring);
}

.app-header .logo:hover .logo-mark {
  transform: scale(1.12) rotate(-3deg);
}

.app-header .logo-v-svg {
  display: block;
  width: 32px;
  height: 32px;
}

.app-header .logo-text {
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--color-text-primary) 30%, var(--color-accent-primary) 70%, var(--color-accent-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.25));
}

.app-header .header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  font-size: 18px;
}

.header-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.header-btn.active {
  background: var(--color-accent-primary);
  color: white;
  box-shadow: var(--shadow-glow-accent);
}

.security-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: var(--space-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.security-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse 2s infinite;
}

.install-pwa-btn {
  width: auto !important;
  padding: 0 12px;
  gap: 6px;
  font-size: 12px !important;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--color-accent-primary) !important;
  border-radius: var(--radius-full) !important;
}

.install-pwa-btn:hover {
  background: rgba(99, 102, 241, 0.25);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.back-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.search-bar {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  padding-left: var(--space-12);
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.search-bar::placeholder {
  color: var(--color-text-tertiary);
}

.search-bar:focus {
  border-color: var(--color-accent-primary);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: var(--color-bg-secondary);
}

.search-icon {
  position: absolute;
  left: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  font-size: 18px;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-icon-svg {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-bar:focus ~ .search-icon,
.search-container:focus-within .search-icon,
.search-bar:focus ~ .search-icon-svg,
.search-container:focus-within .search-icon-svg {
  color: var(--color-accent-primary);
}

.search-clear {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  transition: all var(--transition-fast);
  font-size: 14px;
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.vaults-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.vault-hero-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 18px 22px;
  border-radius: var(--radius-2xl);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--transition-spring), box-shadow var(--transition-fast), border-color var(--transition-fast);
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid var(--color-border);
  min-height: 84px;
}

.vault-hero-card:hover {
  transform: translateY(-2px);
}

.vault-hero-card:active {
  transform: scale(0.985);
}

.vault-hero-card.personal {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

.vault-hero-card.personal:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.vault-hero-card.official {
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.08);
}

.vault-hero-card.official:hover {
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.2);
}

.vault-hero-badge {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-spring);
}

.vault-hero-card.personal .vault-hero-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.25));
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.vault-hero-card.official .vault-hero-badge {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(20, 184, 166, 0.25));
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.35);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25);
}

.vault-hero-card:hover .vault-hero-badge {
  transform: scale(1.08);
}

.vault-hero-body {
  flex: 1;
  min-width: 0;
}

.vault-hero-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 3px;
}

.vault-hero-title {
  font-size: 1.05rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}

.vault-hero-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.vault-hero-tag.official-tag {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.vault-hero-subtitle {
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.vault-hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.vault-count-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-tertiary);
  padding: 4px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
}

.vault-hero-arrow {
  font-size: 20px;
  line-height: 1;
  color: var(--color-text-tertiary);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.vault-hero-card:hover .vault-hero-arrow {
  transform: translateX(3px);
  color: var(--color-text-primary);
}

/* Vault View Modernization */
.vault-back-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.vault-back-circle-btn:hover {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.vault-back-circle-btn:active {
  transform: scale(0.92);
}

.vault-actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.vault-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.vault-action-pill:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--color-text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.vault-action-pill:active {
  transform: scale(0.96);
}

.vault-breadcrumbs .breadcrumb-item {
  cursor: pointer;
  transition: color 0.15s ease;
}

.vault-breadcrumbs .breadcrumb-item:hover {
  color: var(--color-accent-primary);
}

.vault-breadcrumbs .breadcrumb-separator {
  color: var(--color-text-tertiary);
  font-weight: 400;
  margin: 0 2px;
}

/* Quick Actions Bar */
.quick-actions-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: var(--space-6);
}

.quick-action-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--color-text-secondary);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.quick-action-pill:hover {
  background: var(--color-bg-tertiary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  color: var(--color-text-primary);
}

.quick-action-pill:active {
  transform: scale(0.95);
}

.quick-pill-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-spring);
}

.quick-pill-icon.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.quick-pill-icon.icon-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.quick-pill-icon.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.quick-pill-icon.icon-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.quick-action-pill:hover .quick-pill-icon {
  transform: scale(1.1);
}

.quick-pill-label {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.01em;
}

/* Quick Start Onboarding Card */
.quick-start-card {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.08), rgba(14, 165, 233, 0.04));
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-2xl);
  padding: 22px 18px;
  margin: var(--space-4) 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.quick-start-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.quick-start-sparkle {
  font-size: 26px;
  line-height: 1;
}

.quick-start-title {
  font-size: 1.05rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 2px 0;
}

.quick-start-desc {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  margin: 0;
}

.template-chips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.template-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  user-select: none;
}

.template-chip:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-accent-primary);
  color: var(--color-accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.template-chip:active {
  transform: scale(0.97);
}

.template-chip .chip-plus {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-accent-primary);
}

.section-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  vertical-align: middle;
  color: var(--color-accent-primary);
}

.section-count-badge {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
  background: var(--color-bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.vault-card {
  position: relative;
  border-radius: var(--radius-2xl);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-base);
}

.vault-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: inherit;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.vault-card.personal {
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border);
}

.vault-card.personal::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 250px;
  height: 250px;
  background: var(--gradient-personal);
  border-radius: 50%;
  opacity: 0.12;
  transition: all var(--transition-slow);
  pointer-events: none;
}

.vault-card.official {
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border);
}

.vault-card.official::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 250px;
  height: 250px;
  background: var(--gradient-official);
  border-radius: 50%;
  opacity: 0.12;
  transition: all var(--transition-slow);
  pointer-events: none;
}

.vault-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border-hover);
}

.vault-card.personal:hover {
  box-shadow: var(--shadow-glow-personal);
}

.vault-card.official:hover {
  box-shadow: var(--shadow-glow-official);
}

.vault-card:hover::after {
  opacity: 0.2;
  transform: scale(1.1);
}

.vault-card .vault-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: var(--space-5);
  color: white;
}

.vault-card.personal .vault-icon {
  background: var(--gradient-personal);
  box-shadow: var(--shadow-glow-personal);
}

.vault-card.official .vault-icon {
  background: var(--gradient-official);
  box-shadow: var(--shadow-glow-official);
}

.vault-card .vault-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-1);
}

.vault-card .vault-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
}

.vault-card .vault-count {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
}

.vault-card .vault-count span {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary);
}

.vault-card .vault-arrow {
  position: absolute;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--color-text-secondary);
  transition: all var(--transition-base);
}

.vault-card:hover .vault-arrow {
  transform: translateX(4px);
}

.vault-card.personal:hover .vault-arrow {
  background: var(--gradient-personal);
  color: white;
}

.vault-card.official:hover .vault-arrow {
  background: var(--gradient-official);
  color: white;
}

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

.section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title .section-icon {
  font-size: 20px;
}

.section-action {
  font-size: var(--font-size-sm);
  color: var(--color-accent-primary);
  font-weight: var(--font-weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.section-action:hover {
  background: rgba(99, 102, 241, 0.1);
}

.category-chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-6);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.category-chip {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
}

.category-chip:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
}

.category-chip.active {
  background: var(--color-accent-primary);
  color: white;
  border-color: var(--color-accent-primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-5);
}

.doc-card {
  position: relative;
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
}

.doc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border-hover);
}

.doc-card .doc-thumbnail {
  width: 100%;
  height: 160px;
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.doc-card .doc-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-card .doc-thumbnail .doc-type-icon {
  font-size: 48px;
  color: var(--color-text-tertiary);
  opacity: 0.6;
}

.doc-card .doc-info {
  padding: var(--space-4);
  max-width: 100%;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}

.doc-card .doc-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-card .doc-category-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-accent-primary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.doc-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--font-weight-regular);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.doc-folder-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  background: rgba(14, 165, 233, 0.12);
  color: var(--color-accent-secondary);
  border: 1px solid rgba(14, 165, 233, 0.2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.vault-breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.vault-breadcrumbs .breadcrumb-item {
  cursor: pointer;
  transition: color var(--transition-fast);
  color: var(--color-text-secondary);
}

.vault-breadcrumbs .breadcrumb-item:hover {
  color: var(--color-accent-primary);
  text-decoration: underline;
}

.vault-breadcrumbs .breadcrumb-item.active {
  color: var(--color-text-primary);
  cursor: default;
  text-decoration: none;
}

.vault-breadcrumbs .breadcrumb-separator {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  user-select: none;
}

.folder-card {
  cursor: pointer;
  border: 1px solid var(--color-border);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium);
}

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

.folder-card .folder-thumbnail {
  transition: background var(--transition-medium);
}

.folder-card:hover .folder-thumbnail {
  background: rgba(99, 102, 241, 0.15) !important;
}

.folder-card.drag-over-folder {
  border-color: var(--color-accent-primary) !important;
  transform: scale(1.05) translateY(-4px) !important;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.45) !important;
  background: rgba(99, 102, 241, 0.18) !important;
}

.doc-card.is-dragging {
  opacity: 0.4;
  transform: scale(0.96);
  border: 2px dashed var(--color-accent-primary) !important;
}

.doc-card .doc-actions {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

@media (max-width: 768px), (hover: none) {
  .doc-card .doc-actions {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .doc-action-btn {
    background: rgba(15, 23, 42, 0.78) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
  }
}

.doc-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
  border: 1px solid var(--color-border);
}

.doc-action-btn:hover {
  background: var(--color-bg-secondary);
  transform: scale(1.1);
}

.doc-action-btn.favorite {
  color: var(--color-text-tertiary);
}

.doc-action-btn.favorite.active {
  color: var(--color-accent-warning);
}

.doc-card .doc-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: var(--space-2);
}

.favorites-row {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-8);
  scrollbar-width: none;
}

.favorites-row::-webkit-scrollbar {
  display: none;
}

.fav-card {
  flex-shrink: 0;
  width: 120px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fav-card:hover {
  transform: translateY(-2px);
}

.fav-card .fav-thumb {
  width: 120px;
  height: 90px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-card .fav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fav-card .fav-name {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--color-border);
}

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

.modal-header .modal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.modal-close {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.modal-close:hover,
.modal-close:active {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
}

.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: var(--space-6);
  background: var(--color-bg-tertiary);
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--color-accent-primary);
  background: rgba(99, 102, 241, 0.04);
}

.drop-zone.drag-over {
  border-style: solid;
}

.drop-zone .drop-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  color: var(--color-text-tertiary);
}

.drop-zone .drop-text {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.drop-zone .drop-subtext {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.drop-zone .drop-browse {
  color: var(--color-accent-primary);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
}

.upload-preview {
  width: 100%;
  max-height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
  display: none;
  position: relative;
  border: 1px solid var(--color-border);
}

.upload-preview.visible {
  display: block;
}

.upload-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: var(--color-bg-tertiary);
}

.upload-preview .preview-pdf {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg-tertiary);
}

.upload-preview .preview-pdf .pdf-icon {
  font-size: 32px;
  color: var(--color-accent-danger);
}

.upload-preview .preview-remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-bg-overlay);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.upload-preview .preview-remove:hover {
  background: var(--color-accent-danger);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select {
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  padding: 0 var(--space-4);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: var(--color-bg-secondary);
}

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

/* Vaulta Custom Select Component */
.vaulta-custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 var(--space-4);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.custom-select-trigger:hover,
.custom-select-trigger:focus,
.custom-select-trigger.active {
  border-color: var(--color-accent-primary);
  background: var(--color-bg-secondary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

.custom-select-selection {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.custom-select-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custom-select-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 6px;
}

.custom-select-trigger.active .custom-select-chevron {
  transform: rotate(180deg);
  color: var(--color-accent-primary);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  min-width: 180px;
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 20px rgba(99, 102, 241, 0.2);
  padding: 6px;
  z-index: 2500;
  animation: customSelectPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes customSelectPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.custom-select-group-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  padding: 6px 10px 4px;
}

.custom-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.custom-select-item:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
  transform: translateX(2px);
}

.custom-select-item.selected {
  background: rgba(99, 102, 241, 0.28);
  color: #fff;
  font-weight: 700;
}

.custom-select-item-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.custom-select-item-label {
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-check {
  color: var(--color-accent-primary);
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.vaulta-datepicker-wrapper {
  position: relative;
  width: 100%;
}

.vaulta-datepicker-trigger {
  width: 100%;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 var(--space-4);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.vaulta-datepicker-trigger:hover,
.vaulta-datepicker-trigger:focus-within {
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: var(--color-bg-secondary);
}

.vaulta-datepicker-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  z-index: 1200;
  width: 310px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.2);
  padding: 14px;
  animation: datepickerPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 600px) {
  .vaulta-datepicker-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: calc(100vw - 32px);
    max-width: 340px;
    z-index: 2000;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8), 0 0 0 9999px rgba(0, 0, 0, 0.55);
  }
}

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

.vdp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.vdp-month-year {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-text-primary);
}

.vdp-selectors {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.vdp-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.vdp-custom-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(15, 23, 42, 0.9);
  color: #f1f5f9;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  height: 32px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: inherit;
  user-select: none;
}

.vdp-custom-btn:hover,
.vdp-custom-btn.active {
  border-color: rgba(129, 140, 248, 0.8);
  background-color: rgba(30, 41, 59, 0.98);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #fff;
}

.vdp-custom-btn svg {
  color: #818cf8;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.vdp-custom-btn.active svg {
  transform: rotate(180deg);
}

.vdp-custom-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 16px rgba(99, 102, 241, 0.25);
  z-index: 250;
  padding: 6px;
  max-height: 190px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
}

.vdp-custom-menu.month-menu {
  min-width: 135px;
}

.vdp-custom-menu.year-menu {
  min-width: 95px;
}

.vdp-custom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.vdp-custom-item:hover {
  background: rgba(99, 102, 241, 0.18);
  color: #fff;
}

.vdp-custom-item.selected {
  background: rgba(99, 102, 241, 0.32);
  color: #818cf8;
  font-weight: 700;
}

.vdp-select {
  display: none;
}

.vdp-nav-btn {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
  border-radius: var(--radius-full);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.vdp-nav-btn:hover {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  transform: scale(1.08);
}

.vdp-presets {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.vdp-preset-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  cursor: pointer;
  transition: all 0.15s ease;
}

.vdp-preset-btn:hover {
  background: var(--color-accent-primary);
  color: #fff;
}

.vdp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-tertiary);
  margin-bottom: 6px;
}

.vdp-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.vdp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-primary);
  transition: all 0.15s ease;
  user-select: none;
}

.vdp-day:hover:not(.empty) {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

.vdp-day.empty {
  cursor: default;
}

.vdp-day.today {
  border: 1px solid var(--color-accent-primary);
  font-weight: 700;
}

.vdp-day.selected {
  background: var(--color-accent-primary) !important;
  color: #fff !important;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.vdp-weekdays span.vdp-sunday {
  color: #f87171 !important;
  font-weight: 700;
}

.vdp-day.vdp-sunday {
  color: #f87171 !important;
  font-weight: 600;
}

.vdp-day.vdp-sunday:hover:not(.empty) {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fca5a5 !important;
}

.vdp-day.vdp-sunday.selected {
  background: var(--color-accent-primary) !important;
  color: #fff !important;
}

.form-select {
  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='%2394a3b8' 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 var(--space-4) center;
  padding-right: var(--space-10);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--shadow-glow-accent);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.35);
}

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

.btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-hover);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.btn-ghost {
  color: var(--color-text-secondary);
  padding: var(--space-2) var(--space-4);
}

.btn-ghost:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-lg);
}

.btn .btn-spinner {
  display: none;
}

.btn.loading .btn-text {
  visibility: hidden;
}

.btn.loading .btn-spinner {
  display: block;
  position: absolute;
}

.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #ffffff;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5), 0 0 20px rgba(99, 102, 241, 0.3);
  z-index: 999;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease;
}

.fab:hover {
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 14px 40px rgba(99, 102, 241, 0.65), 0 0 30px rgba(129, 140, 248, 0.5);
  background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.fab:active {
  transform: scale(0.95);
}

body.preview-open .bottom-nav {
  display: none !important;
}

.preview-overlay {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg-primary);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.preview-overlay.active {
  display: flex;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-border);
  min-height: 60px;
  gap: var(--space-3);
  flex-shrink: 0;
  z-index: 10;
}

.preview-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.preview-header .preview-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-primary);
  min-width: 0;
}

.preview-header .preview-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.preview-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  position: relative;
  background: var(--color-bg-tertiary);
}

.preview-body img {
  max-width: 96%;
  height: auto;
  object-fit: contain;
  margin: var(--space-4) auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: block;
}

.preview-mobile-footer {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  background: rgba(10, 14, 26, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--color-border);
  z-index: 100;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
}

[data-theme="light"] .preview-mobile-footer {
  background: rgba(255, 255, 255, 0.96);
}

.mobile-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 58px;
}

.mobile-action-btn .btn-icon {
  font-size: 20px;
  line-height: 1;
}

.mobile-action-btn:active {
  transform: scale(0.94);
  color: var(--color-accent-primary);
  background: var(--color-bg-glass-hover);
}

.mobile-action-btn.danger {
  color: var(--color-accent-danger);
}

.mobile-action-btn.danger:active {
  background: rgba(239, 68, 68, 0.15);
}

.pdf-viewer-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  margin: var(--space-3) 0;
  z-index: 5;
  flex-wrap: wrap;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.pdf-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-3);
  height: 32px;
  min-width: 32px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pdf-tb-btn:hover {
  background: var(--color-accent-primary);
  color: white;
  border-color: var(--color-accent-primary);
}

.pdf-page-num, .pdf-zoom-level {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  padding: 0 var(--space-2);
}

.pdf-tb-divider {
  width: 1px;
  height: 18px;
  background: var(--color-border);
  margin: 0 var(--space-1);
}

.pdf-pages-container {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: auto !important;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4) var(--space-8);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.pdf-page-wrapper {
  background: white;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
}

.pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}

.pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8);
  color: var(--color-text-secondary);
}

.pdf-fallback-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
}

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

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

.toast .toast-message {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  flex: 1;
}

.toast .toast-close {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  font-size: 14px;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.toast .toast-close:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: var(--space-6);
  opacity: 0.4;
}

.empty-state .empty-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.empty-state .empty-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  max-width: 320px;
  margin-bottom: var(--space-6);
}

.sort-dropdown {
  position: relative;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
}

.sort-btn:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-hover);
}

.sort-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: auto;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 12px rgba(99, 102, 241, 0.15);
  min-width: 185px;
  max-width: calc(100vw - 32px);
  z-index: var(--z-dropdown);
  display: none;
  overflow: hidden;
  padding: 4px;
}

.sort-menu.active {
  display: block;
  animation: fadeIn 0.18s ease-out;
}

.sort-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 9px 12px;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  text-align: left;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  cursor: pointer;
}

.sort-option svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.sort-option:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.sort-option.active {
  color: var(--color-accent-primary);
  font-weight: var(--font-weight-semibold);
  background: rgba(99, 102, 241, 0.12);
}

.sort-option.active svg {
  color: var(--color-accent-primary);
  opacity: 1;
}

.page-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.page-title .vault-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.page-title .vault-badge.personal {
  background: var(--gradient-personal);
}

.page-title .vault-badge.official {
  background: var(--gradient-official);
}

.confirm-dialog .confirm-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: var(--space-4);
}

.confirm-dialog .confirm-text {
  text-align: center;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.confirm-dialog .confirm-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }

  .search-container {
    max-width: 100%;
    margin-bottom: var(--space-4);
  }

  .search-bar {
    padding: 11px 16px 11px 40px;
    font-size: 0.9rem;
    border-radius: var(--radius-xl);
  }

  .search-icon {
    left: 14px;
    font-size: 16px;
  }

  .vaults-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: var(--space-5);
  }

  .vault-hero-card {
    padding: 14px 16px;
    border-radius: var(--radius-xl);
    min-height: 76px;
    gap: var(--space-3);
  }

  .vault-hero-badge {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
  }

  .vault-hero-badge svg {
    width: 20px;
    height: 20px;
  }

  .vault-hero-title {
    font-size: 0.98rem;
  }

  .vault-hero-subtitle {
    font-size: 0.72rem;
  }

  .vault-count-badge {
    font-size: 10px;
    padding: 3px 7px;
  }

  .documents-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
  }

  .doc-card .doc-thumbnail {
    height: 110px;
  }

  .modal-content {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-top: auto;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0 0 calc(64px + env(safe-area-inset-bottom, 0px)) 0;
  }

  .fab {
    bottom: var(--space-5);
    right: var(--space-5);
    width: 50px;
    height: 50px;
    font-size: 22px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .modal-body {
    padding: 12px 16px !important;
  }

  .modal-body .form-group {
    margin-bottom: 8px !important;
  }

  .modal-body .form-label {
    font-size: 0.74rem !important;
    margin-bottom: 3px !important;
    font-weight: 600 !important;
  }

  .modal-body .form-input,
  .modal-body .form-select,
  .modal-body .custom-select-trigger,
  .modal-body .vaulta-datepicker-trigger {
    height: 38px !important;
    min-height: 38px !important;
    font-size: 0.84rem !important;
    padding: 0 10px !important;
    border-radius: var(--radius-md) !important;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .toast-container {
    top: auto;
    bottom: var(--space-6);
    right: var(--space-4);
    left: var(--space-4);
  }

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

@media (max-width: 640px) {
  .app-header {
    padding: var(--space-2) var(--space-4);
  }

  .app-header .logo-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
    border-radius: var(--radius-md);
  }

  .app-header .logo-text {
    font-size: 20px;
  }

  .header-btn {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .preview-mobile-footer {
    display: flex;
  }

  .preview-actions .desktop-only-btn {
    display: none !important;
  }

  .preview-header {
    padding: var(--space-2) var(--space-4);
  }

  .preview-body {
    padding: var(--space-2);
  }

  .pdf-toolbar {
    padding: var(--space-1) var(--space-2);
    gap: 4px;
  }

  .pdf-tb-btn {
    height: 28px;
    padding: 0 6px;
    font-size: 11px;
  }

  .pdf-page-num, .pdf-zoom-level {
    font-size: 11px;
    padding: 0 4px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-3);
  }

  .search-container {
    margin-bottom: var(--space-3);
  }

  .search-bar {
    padding: 9px 12px 9px 36px;
    font-size: 0.85rem;
    border-radius: var(--radius-lg);
  }

  .search-icon {
    left: 11px;
    font-size: 14px;
  }

  .vaults-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: var(--space-4);
  }

  .vault-hero-card {
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    min-height: 72px;
  }

  .vault-hero-badge {
    width: 38px;
    height: 38px;
  }

  .vault-hero-badge svg {
    width: 18px;
    height: 18px;
  }

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

  .section-header {
    margin-bottom: var(--space-3);
  }

  .section-title {
    font-size: 1.05rem;
  }

  .documents-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .doc-card .doc-info {
    padding: var(--space-2) var(--space-3);
  }

  .doc-card .doc-thumbnail {
    height: 95px;
  }

  .doc-card .doc-title {
    font-size: 0.8rem;
  }

  .doc-card .doc-meta {
    font-size: 0.68rem;
  }

  .app-header {
    padding: 8px var(--space-3);
  }

  .modal-body {
    padding: var(--space-4) !important;
  }
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  margin-top: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.doc-card.select-mode {
  cursor: pointer;
  user-select: none;
}

.doc-card.select-mode.selected {
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3), var(--shadow-md);
}

.doc-select-checkbox {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 5;
}

.doc-select-checkbox input[type="checkbox"] {
  display: none;
}

.doc-select-checkbox label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-text-tertiary);
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 14px;
}

.doc-select-checkbox input[type="checkbox"]:checked + label {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  color: white;
}

.doc-select-checkbox input[type="checkbox"]:checked + label::after {
  content: '✓';
}

.doc-card.select-mode .doc-actions {
  display: none;
}

@media (max-width: 768px) {
  .bulk-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  
  .bulk-action-bar > div {
    justify-content: center;
    flex-wrap: wrap;
  }
}

.share-format-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.share-format-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.share-format-option:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-hover);
}

.share-format-option.selected {
  border-color: var(--color-accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.share-format-option input[type="radio"] {
  accent-color: var(--color-accent-primary);
}

.share-format-icon {
  font-size: 20px;
}

.share-format-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  flex: 1;
}

.share-format-tag {
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  color: white;
  font-weight: var(--font-weight-semibold);
}

#appLockOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(11, 15, 26, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.lock-card {
  width: 100%;
  max-width: 360px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6) var(--space-6);
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: fadeIn var(--transition-base) ease-out;
}

.lock-header {
  margin-bottom: var(--space-5);
}

.lock-app-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.lock-app-icon .lock-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0, 210, 255, 0.4));
}

.lock-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.lock-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: transparent;
  transition: all var(--transition-fast);
}

.pin-dot.filled {
  background: var(--gradient-accent);
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  transform: scale(1.1);
}

.pin-dot.error {
  background: var(--color-danger) !important;
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7) !important;
  transform: scale(1.1);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: var(--space-4);
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.keypad-btn {
  height: 54px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  font-size: 1.2rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  user-select: none;
}

.keypad-btn:hover, .keypad-btn:active {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-hover);
  transform: scale(1.05);
}

.keypad-clear {
  color: var(--color-danger);
  font-size: 0.95rem;
}

.keypad-backspace {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

.biometric-trigger-wrap {
  margin-top: var(--space-3);
}

.biometric-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 16px;
  border-radius: var(--radius-xl);
  font-size: var(--font-size-sm);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--color-accent-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.biometric-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--color-accent-primary);
}

.biometric-btn.pulse-active {
  animation: bioPulse 1.5s infinite;
  border-color: var(--color-accent-primary);
  background: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

@keyframes bioPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.lock-card.shake {
  animation: lockShake 0.4s ease-in-out;
}

@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

.expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.expiry-badge.valid {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.expiry-badge.expiring-soon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.expiry-badge.expired {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}

.doc-card {
  position: relative;
}

.doc-quick-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-lg);
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}

.doc-card:hover .doc-quick-actions,
.doc-card:focus-within .doc-quick-actions {
  opacity: 1;
  transform: translateY(0);
}

.quick-act-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.quick-act-btn:hover {
  background: var(--color-bg-glass-hover);
  transform: scale(1.1);
}

.storage-progress-track {
  width: 100%;
  height: 12px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  margin: var(--space-3) 0 var(--space-4);
  border: 1px solid var(--color-border);
}

.storage-progress-segment {
  height: 100%;
  transition: width 0.5s ease-in-out;
}

.storage-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  margin-bottom: 8px;
  touch-action: pan-y;
}

.storage-cat-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

/* ============================================
   Bottom Navigation Bar
   ============================================ */

.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10, 14, 26, 0.94);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 3000 !important;
    align-items: stretch;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.55);
  }

  [data-theme="light"] .bottom-nav {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.1);
  }

  .bottom-nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 3px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.02em;
    padding: 6px 0;
    position: relative;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    cursor: pointer;
    border: none;
    background: none;
  }

  [data-theme="light"] .bottom-nav-tab {
    color: #475569;
  }

  .bottom-nav-tab .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 1;
    transition: transform var(--transition-fast);
  }

  .bottom-nav-tab .nav-icon svg {
    stroke: currentColor;
    transition: stroke var(--transition-fast);
  }

  .bottom-nav-tab .nav-label {
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
  }

  .bottom-nav-tab.active {
    color: var(--color-accent-primary);
  }

  .bottom-nav-tab.active .nav-icon {
    transform: scale(1.12);
  }

  .bottom-nav-tab.active .nav-icon svg {
    stroke: var(--color-accent-primary);
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.5));
  }

  .bottom-nav-tab:active .nav-icon {
    transform: scale(0.9);
  }

  /* Center FAB tab */
  .bottom-nav-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
  }

  .bottom-nav-fab .fab-center {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.55), 0 0 14px rgba(139, 92, 246, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.25);
    position: absolute;
    top: -18px;
    transition: transform var(--transition-spring), box-shadow var(--transition-fast);
  }

  .bottom-nav-fab .fab-center svg {
    stroke: #ffffff;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
  }

  .bottom-nav-fab:active .fab-center {
    transform: scale(0.9);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  }

  .bottom-nav-fab:active .fab-center {
    transform: scale(0.9);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  }

  /* Hide the old inline FAB on mobile when bottom nav is present */
  .fab {
    display: none !important;
  }

  /* Add bottom padding to main content so it's not hidden behind nav */
  .container {
    padding-bottom: 80px;
  }

  /* Toast above bottom nav */
  .toast-container {
    bottom: 80px !important;
  }

  /* Header: slim on mobile — hide utility buttons moved to bottom nav */
  .header-btn.mobile-hidden {
    display: none !important;
  }

  body.preview-open .bottom-nav {
    display: none !important;
  }
}

/* ============================================
   Bottom Sheet Modals (Mobile Enhancement)
   ============================================ */

@media (max-width: 768px) {
  body.preview-open .bottom-nav {
    display: none !important;
  }

  .modal-content {
    border-radius: 20px 20px 0 0;
    max-height: calc(85vh - 64px - env(safe-area-inset-bottom, 0px));
    max-height: calc(85dvh - 64px - env(safe-area-inset-bottom, 0px));
    border-bottom: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    flex-shrink: 0;
    padding: var(--space-4) var(--space-5);
  }

  .modal-overlay .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain;
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .modal-footer {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)) 16px !important;
    background: var(--color-bg-secondary) !important;
    border-top: 1px solid var(--color-border) !important;
    position: relative !important;
    z-index: 100 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .modal-content::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--color-text-tertiary);
    border-radius: var(--radius-full);
    margin: 10px auto 0;
    opacity: 0.5;
  }

  .modal-overlay.active {
    animation: sheetOverlayIn 250ms ease-out forwards;
  }

  .modal-overlay.active .modal-content {
    animation: sheetSlideUp 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .modal-overlay.sheet-exit {
    animation: fadeOut 200ms ease-in forwards;
  }

  .modal-overlay.sheet-exit .modal-content {
    animation: sheetSlideDown 250ms ease-in forwards;
  }
}

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

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes sheetSlideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

/* ============================================
   Settings Bottom Sheet
   ============================================ */

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

.settings-sheet-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 14px var(--space-4);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.settings-sheet-item:hover,
.settings-sheet-item:active {
  background: var(--color-bg-tertiary);
}

.settings-sheet-item .settings-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.settings-sheet-item .settings-label {
  flex: 1;
}

.settings-sheet-item .settings-chevron {
  color: var(--color-text-tertiary);
  font-size: 14px;
}

/* ============================================
   Swipe Actions on Doc Cards (Mobile)
   ============================================ */

.doc-card-swipe-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}

.doc-swipe-actions {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  z-index: 1;
}

.doc-swipe-actions-left {
  right: 0;
  flex-direction: row;
}

.doc-swipe-actions-right {
  left: 0;
  flex-direction: row;
}

.swipe-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 70px;
  gap: 4px;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #ffffff;
  font-weight: var(--font-weight-semibold);
}

.swipe-action-btn .swipe-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-bold);
}

.swipe-action-btn.swipe-delete {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.swipe-action-btn.swipe-share {
  background: linear-gradient(135deg, #6366f1, #818cf8);
}

.swipe-action-btn.swipe-fav {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.doc-card-inner {
  position: relative;
  z-index: 2;
  background: var(--color-bg-secondary);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: inherit;
}

.doc-card-inner.swiping {
  transition: none;
}

/* On mobile, hide hover-only quick actions since we use swipe */
@media (max-width: 768px) {
  .doc-quick-actions {
    display: none !important;
  }
}

/* ============================================
   Biometric Lock Screen Styles
   ============================================ */

.bio-prompt-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) 0;
  gap: var(--space-4);
  animation: fadeIn 0.3s ease;
}

.bio-pulse-button {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(14, 165, 233, 0.2));
  border: 1.5px solid rgba(0, 210, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #38bdf8;
  box-shadow: 0 0 24px rgba(0, 210, 255, 0.3);
  transition: transform var(--transition-spring), box-shadow var(--transition-fast);
  outline: none;
}

.bio-pulse-button:hover,
.bio-pulse-button:active {
  transform: scale(1.06);
  box-shadow: 0 0 35px rgba(0, 210, 255, 0.6);
  color: #00f5ff;
}

.bio-pulse-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(0, 210, 255, 0.4);
  animation: bioPulseRing 2.2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  pointer-events: none;
}

.bio-pulse-ring-2 {
  animation-delay: 0.8s;
}

@keyframes bioPulseRing {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

.bio-touch-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin: 0;
  text-align: center;
}

.btn-switch-lock-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-switch-lock-mode:hover,
.btn-switch-lock-mode:active {
  color: var(--color-text-primary);
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--color-bg-glass-hover);
}

/* ============================================
   Redesigned Settings & Security Grouped Cards
   ============================================ */

.settings-card-group {
  background: var(--color-bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-4);
  touch-action: pan-y;
}

.settings-row-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 13px 16px;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast);
  width: 100%;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.settings-row-item:last-child {
  border-bottom: none;
}

.settings-row-item:hover,
.settings-row-item:active {
  background: var(--color-bg-tertiary);
}

.settings-icon-tile {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.tile-violet { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.tile-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.tile-cyan { background: linear-gradient(135deg, #06b6d4, #0284c7); }
.tile-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tile-blue { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.tile-rose { background: linear-gradient(135deg, #f43f5e, #e11d48); }

.settings-item-body {
  flex: 1;
  min-width: 0;
}

.settings-item-title {
  font-size: 0.95rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.settings-item-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.settings-pill-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.pill-active { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.pill-inactive { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Anti-Screenshot & Screen Security Shield */
@media print {
  body {
    display: none !important;
  }
}

.screen-privacy-shield {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.98);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: white;
  text-align: center;
  padding: 24px;
  pointer-events: none;
}

/* Sensitive Content Anti-Copy / Anti-Capture */
.document-card,
.preview-modal-body,
.doc-thumbnail,
.file-preview {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Settings Sheet & Security Modal Mobile Scrolling Guarantees */
#settingsSheetOverlay,
#securityModalOverlay,
#vaultsSheetOverlay {
  z-index: 2500 !important;
}

#settingsSheetOverlay .modal-content,
#securityModalOverlay .modal-content,
#vaultsSheetOverlay .modal-content {
  max-height: calc(88vh - 64px - env(safe-area-inset-bottom, 0px)) !important;
  max-height: calc(88dvh - 64px - env(safe-area-inset-bottom, 0px)) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#settingsSheetOverlay .modal-body,
#securityModalOverlay .modal-body,
#vaultsSheetOverlay .modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior: contain !important;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ==========================================================================
   Live Camera ID Scanner Component
   ========================================================================== */
.camera-scanner-overlay {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  color: #ffffff;
  overflow: hidden;
  user-select: none;
}

.camera-scanner-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.camera-scanner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.camera-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.camera-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.camera-icon-btn:hover,
.camera-icon-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.camera-viewfinder-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
}

.camera-viewfinder-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-id-guide-box {
  position: absolute;
  width: 86%;
  max-width: 440px;
  aspect-ratio: 1.586; /* Standard ID-1 card ratio (85.6mm x 53.98mm) */
  border-radius: 16px;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.58);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Corner Reticle Brackets */
.camera-id-guide-box::before,
.camera-id-guide-box::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  border: 3px solid transparent;
  pointer-events: none;
}

.camera-reticle-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #38bdf8;
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}

.reticle-tl { top: -2px; left: -2px; border-top-width: 3.5px; border-left-width: 3.5px; border-top-left-radius: 16px; }
.reticle-tr { top: -2px; right: -2px; border-top-width: 3.5px; border-right-width: 3.5px; border-top-right-radius: 16px; }
.reticle-bl { bottom: -2px; left: -2px; border-bottom-width: 3.5px; border-left-width: 3.5px; border-bottom-left-radius: 16px; }
.reticle-br { bottom: -2px; right: -2px; border-bottom-width: 3.5px; border-right-width: 3.5px; border-bottom-right-radius: 16px; }

/* Subtle Laser Scan Line Animation */
.camera-scan-laser {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, transparent);
  box-shadow: 0 0 14px #38bdf8;
  animation: laserScan 2.4s ease-in-out infinite alternate;
}

@keyframes laserScan {
  0% { top: 12px; opacity: 0.2; }
  20% { opacity: 0.9; }
  80% { opacity: 0.9; }
  100% { top: calc(100% - 14px); opacity: 0.2; }
}

.camera-guide-text {
  position: absolute;
  bottom: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.camera-scanner-bottom-bar {
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.camera-shutter-outer {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  outline: none;
}

.camera-shutter-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  transition: all 0.15s ease;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
}

.camera-shutter-outer:active .camera-shutter-inner {
  transform: scale(0.86);
  background: #38bdf8;
}

.camera-bottom-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.72rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.camera-bottom-btn:hover,
.camera-bottom-btn:active {
  color: #ffffff;
  transform: scale(1.05);
}

/* ── PWA Update Banner (Clean floating notification above bottom nav) ── */
.update-banner {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 14px));
  left: 12px;
  right: 12px;
  max-width: 460px;
  margin: 0 auto;
  z-index: 1005;
  transform: translateY(160%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  pointer-events: none;
}

.update-banner.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Hide update banner completely when modals, sheets, or previews are active */
body.modal-open .update-banner,
body.preview-open .update-banner {
  display: none !important;
}

.update-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(18, 22, 38, 0.96);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 16px;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(99, 102, 241, 0.15) inset,
    0 0 24px rgba(99, 102, 241, 0.2);
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .update-banner-inner {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(99, 102, 241, 0.1) inset;
}

/* Shimmer overlay effect */
.update-banner-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(99, 102, 241, 0.08) 40%,
    rgba(99, 102, 241, 0.16) 50%,
    rgba(99, 102, 241, 0.08) 60%,
    transparent 100%
  );
  animation: updateShimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes updateShimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

.update-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: updateIconPulse 2.5s ease-in-out infinite;
}

@keyframes updateIconPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

.update-banner-icon svg {
  width: 19px;
  height: 19px;
  color: #fff;
  stroke: currentColor;
}

.update-banner-text {
  flex: 1;
  min-width: 0;
}

.update-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.update-banner-subtitle {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.update-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.update-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.update-btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.update-btn-primary:hover,
.update-btn-primary:active {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.55);
}

.update-btn-dismiss {
  background: transparent;
  color: var(--color-text-tertiary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.update-btn-dismiss:hover,
.update-btn-dismiss:active {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

/* Reloading state */
.update-banner.reloading .update-btn-primary {
  pointer-events: none;
  opacity: 0.8;
}

.update-banner.reloading .update-btn-primary::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  margin-left: 8px;
  animation: updateSpin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes updateSpin {
  to { transform: rotate(360deg); }
}

/* ── What's New & Updates Dialog / Popup Styles ── */
.update-current-status {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.update-status-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.update-icon-highlight-card {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-xl);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 14px;
}

.update-icon-highlight-card:hover,
.update-icon-highlight-card:active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(99, 102, 241, 0.18));
  border-color: rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.update-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.update-card-item {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.update-card-item:hover,
.update-card-item:active {
  background: var(--color-bg-tertiary);
  border-color: var(--color-accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.update-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.update-version-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.update-version-tag.latest {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-accent-primary);
  border-color: rgba(99, 102, 241, 0.35);
}

.update-date-label {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  font-weight: 500;
}

.update-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.update-badge.new {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.update-badge.feature {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.update-badge.redesign {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.update-badge.core {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.update-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.update-card-summary {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.update-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.update-view-details {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--color-accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Update Detail Popup Sections */
.update-detail-section {
  margin-bottom: 16px;
}

.update-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.update-bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.update-bullet-list li {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
  padding-left: 18px;
  position: relative;
}

.update-bullet-list li::before {
  content: '•';
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--color-accent-primary);
  font-size: 1.1rem;
  line-height: 1.2;
}

/* App Icon Guide box inside popup or standalone */
.update-icon-guide-box {
  background: rgba(6, 182, 212, 0.07);
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.update-icon-guide-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 10px;
}

.update-step-list {
  padding-left: 20px;
  margin: 0 0 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.update-step-list li strong {
  color: var(--color-text-primary);
}

.update-safety-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  color: var(--color-text-primary);
}

.update-safety-alert strong {
  color: #10b981;
  font-size: 0.84rem;
  display: block;
}

.update-safety-guarantee {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  padding: 8px 12px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  margin-top: 8px;
}


