/* ========================================
   uApps Vault — Design System
   Clean, White, Square, Professional
   Brand: #05047E (primary), #000 (text)
   ======================================== */

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

:root {
  /* Brand Colors */
  --brand: #05047E;
  --brand-light: #1a19a0;
  --brand-dark: #030258;
  --brand-glow: rgba(5, 4, 126, 0.08);
  --brand-glow-strong: rgba(5, 4, 126, 0.15);

  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-tertiary: #f0f2f5;
  --bg-hover: #ebedf1;
  --bg-elevated: #ffffff;

  /* Text */
  --text-primary: #000000;
  --text-secondary: #4a4a5a;
  --text-muted: #8a8a9a;

  /* Borders */
  --border: #e0e2e8;
  --border-light: #d0d2d8;
  --border-active: #05047E;

  /* Status */
  --success: #0a8a50;
  --danger: #d32f2f;
  --warning: #e6a700;
  --info: #05047E;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius — SQUARE */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-full: 0px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);

  /* Layout */
  --sidebar-width: 240px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
}

/* === Base === */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  line-height: 1.5;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

#app {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Prevent iOS zoom on inputs (font-size >=16px) */
input,
textarea,
select {
  font-size: 16px !important;
}

/* PWA standalone mode — remove unwanted browser behaviors */
@media all and (display-mode: standalone) {
  body {
    -webkit-user-select: none;
    user-select: none;
  }

  /* Allow text selection inside content areas */
  input,
  textarea,
  .item-info,
  .share-value {
    -webkit-user-select: text;
    user-select: text;
  }
}

/* === Animations === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* === Loading === */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* === Auth Screens === */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: var(--space-lg);
}

.auth-card {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  width: 100%;
  max-width: 420px;
  padding: var(--space-xl);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo .logo-img {
  height: 36px;
  display: block;
  margin: 0 auto var(--space-md);
}

.auth-logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--brand);
}

.auth-logo p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: var(--space-xs);
}

.auth-logo .vault-label {
  font-size: 0.688rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* === Forms === */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.input-wrapper input {
  width: 100%;
  padding-right: 42px;
}

.input-wrapper .toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  font-size: 1.1rem;
  transition: color var(--transition-fast);
}

.input-wrapper .toggle-password:hover {
  color: var(--text-primary);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.938rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

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

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-light);
  border-color: var(--brand-light);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

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

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

.btn-danger:hover {
  background: #b71c1c;
  border-color: #b71c1c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 0.938rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* === App Layout === */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-width: 0;
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-header .logo-img {
  height: 24px;
}

.sidebar-header h2 {
  font-size: 0.813rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 var(--space-sm);
  margin-bottom: var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

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

.nav-item.active {
  background: var(--brand-glow-strong);
  color: var(--brand);
  font-weight: 600;
}

.nav-item .nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 2px solid var(--border);
}

/* === Main Content === */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-secondary);
  min-width: 0;
}

.content-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 50;
  min-width: 0;
}

.content-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.content-header .header-actions {
  display: flex;
  gap: var(--space-sm);
}

.content-body {
  padding: var(--space-xl);
  min-width: 0;
}

/* === Search Bar === */
.search-bar {
  position: relative;
  margin-bottom: var(--space-lg);
}

.search-bar input {
  padding-left: 42px;
  background: var(--bg-primary);
}

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

/* === Cards / List Items === */
.item-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.item-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.item-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.item-card .item-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: var(--brand-glow);
  border: 1px solid var(--border);
}

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

.item-card .item-title {
  font-weight: 600;
  font-size: 0.938rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card .item-subtitle {
  font-size: 0.813rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-snippet {
  margin-top: 4px;
  font-size: 0.813rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card .item-actions {
  display: flex;
  gap: var(--space-xs);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

/* === Password specific === */
.password-field {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  padding: var(--space-sm) var(--space-md);
}

.password-field .password-value {
  flex: 1;
  font-family: 'Inter', monospace;
  font-size: 0.938rem;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-field .password-value.masked {
  color: var(--text-muted);
}

/* === Password Generator === */
.password-generator {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  padding: var(--space-md);
  margin-top: var(--space-sm);
}

.generator-output {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  font-family: 'Inter', monospace;
  font-size: 0.938rem;
  letter-spacing: 0.5px;
  word-break: break-all;
}

.generator-output span {
  flex: 1;
}

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

.generator-slider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.generator-slider input[type="range"] {
  flex: 1;
  padding: 0;
  height: 4px;
  appearance: none;
  background: var(--border);
  border: none;
  outline: none;
}

.generator-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--brand);
  cursor: pointer;
  border: none;
}

.generator-slider .length-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand);
  min-width: 28px;
  text-align: center;
}

.generator-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.generator-option {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.813rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.generator-option input[type="checkbox"] {
  width: auto;
  accent-color: var(--brand);
}

/* === Modals === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  padding: var(--space-md);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

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

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* === Confirm Modal === */
.confirm-modal {
  max-width: 400px;
}

.confirm-modal p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === Toast === */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 2000;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 20px;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--transition-base);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

.toast-error {
  border-left: 4px solid var(--danger);
}

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

.toast-icon {
  font-weight: 700;
  font-size: 1rem;
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-info .toast-icon {
  color: var(--info);
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
  max-width: 320px;
}

/* === Settings === */
.settings-section {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.settings-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.settings-section p {
  font-size: 0.813rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.settings-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* === Strength indicator === */
.strength-bar {
  display: flex;
  gap: 3px;
  margin-top: var(--space-xs);
}

.strength-bar .bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  transition: background var(--transition-fast);
}

.strength-bar.strength-1 .bar:nth-child(1) {
  background: var(--danger);
}

.strength-bar.strength-2 .bar:nth-child(-n+2) {
  background: var(--warning);
}

.strength-bar.strength-3 .bar:nth-child(-n+3) {
  background: #4caf50;
}

.strength-bar.strength-4 .bar {
  background: var(--success);
}

/* === Grid for categories/clients === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-md);
}

.grid-card {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.grid-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.grid-card .card-icon {
  font-size: 1.75rem;
}

.grid-card .card-name {
  font-weight: 600;
  font-size: 0.938rem;
}

.grid-card .card-count {
  font-size: 0.813rem;
  color: var(--text-secondary);
}

.grid-card .card-actions {
  display: flex;
  gap: var(--space-xs);
  margin-top: auto;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

/* === Filter Tags === */
.filter-bar {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  align-items: center;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  background: var(--brand-glow);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--brand);
}

.filter-tag .remove-filter {
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  margin-left: var(--space-xs);
  line-height: 1;
}

/* === Mobile === */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-primary);
  border-bottom: 2px solid var(--border);
  align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-sm);
  z-index: 200;
}

.mobile-header .hamburger {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
  padding: var(--space-xs);
}

.mobile-header .logo-img {
  height: 20px;
}

.mobile-header h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brand);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* === Bottom Tab Bar (hidden on desktop) === */
.bottom-tabs {
  display: none;
}

@media (max-width: 768px) {

  /* Hide hamburger and sidebar entirely on mobile */
  .mobile-header {
    display: none !important;
  }

  .sidebar {
    display: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  /* Main content: no sidebar offset, room for bottom tabs */
  .main-content {
    margin-left: 0;
    padding-top: 0;
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
    min-height: 100dvh;
  }

  /* Content header: sticky at top with notch padding */
  .content-header {
    flex-wrap: nowrap;
    padding: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 40;
    padding-top: calc(var(--space-md) + env(safe-area-inset-top));
    align-items: center;
    transform: translateZ(0);
  }

  .content-header h1 {
    font-size: 1.125rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .content-header .header-actions {
    margin-left: auto;
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex-shrink: 0;
  }

  .content-body {
    padding: var(--space-md);
  }

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

  /* === Bottom Tab Bar === */
  .bottom-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(68px + env(safe-area-inset-bottom));
    align-items: stretch;
    padding-inline: 0;
    transform: translateZ(0);
  }

  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 6px;
    border: none;
    border-radius: 0;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    margin: 0;
  }

  .tab-item .tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: all var(--transition-fast);
  }

  .tab-item .tab-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1;
  }

  .tab-item.active {
    color: #ffffff;
    background: var(--brand);
  }

  .tab-item:active {
    transform: none;
  }

  /* Native-style touch targets */
  .item-card {
    padding: 14px var(--space-md);
  }

  .item-card .item-icon {
    width: 38px;
    height: 38px;
  }

  .item-card .item-title {
    font-size: 0.938rem;
  }

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

  .item-card .item-actions .hide-on-mobile {
    display: none !important;
  }

  .item-card .item-actions {
    gap: 0;
    opacity: 1;
  }

  .item-card .item-actions .btn {
    padding: 8px;
  }

  /* Full-screen modals on mobile */
  .modal-overlay {
    align-items: flex-end;
  }

  .modal-overlay .modal {
    width: 100%;
    max-width: 100%;
    max-height: 95vh;
    border-bottom: none;
    animation: slideUp 0.25s ease;
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
    }

    to {
      transform: translateY(0);
    }
  }

  .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }

  /* View password modal: bigger icon buttons for touch targets */
  #view-password-modal .password-field .btn.btn-icon.btn-sm {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  #view-password-modal .password-field .btn.btn-icon.btn-sm svg {
    width: 20px;
    height: 20px;
  }

  /* Auth card spacing */
  .auth-card {
    border: none;
    padding: var(--space-lg);
  }

  .auth-screen {
    padding: var(--space-md);
    padding-top: env(safe-area-inset-top);
  }

  /* Buttons: slightly bigger for touch */
  .btn {
    padding: 11px 18px;
    font-size: 0.875rem;
  }

  .btn-sm {
    padding: 8px 14px;
  }

  .selection-toolbar {
    flex-wrap: wrap;
  }

  .selection-toolbar .selection-actions {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }
}

/* === Strength text === */
.strength-text {
  font-size: 0.75rem;
  margin-top: var(--space-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.strength-text.weak {
  color: var(--danger);
}

.strength-text.fair {
  color: var(--warning);
}

.strength-text.good {
  color: #4caf50;
}

.strength-text.strong {
  color: var(--success);
}

/* === Combobox (auto-create select) === */
.combobox {
  position: relative;
}

.combobox-input {
  width: 100%;
  cursor: text;
}

.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  margin-top: -2px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 500;
  box-shadow: var(--shadow-md);
  display: none;
}

.combobox-dropdown.open {
  display: block;
}

.combobox-option {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.combobox-option:hover,
.combobox-option.highlighted {
  background: var(--bg-hover);
}

.combobox-option.selected {
  color: var(--brand);
  font-weight: 600;
}

.combobox-option.create-option {
  color: var(--brand);
  border-top: 2px solid var(--border);
  font-weight: 600;
}

.combobox-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  z-index: 1;
}

.combobox-clear:hover {
  color: var(--text-primary);
}

/* === Multi-select === */
.item-card .select-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  font-size: 0.75rem;
  color: transparent;
  background: transparent;
}

.item-card .select-checkbox:hover {
  border-color: var(--brand);
}

.item-card .select-checkbox.checked {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.item-card.selected {
  border-color: var(--brand);
  background: var(--brand-glow);
}

/* === Selection Toolbar === */
.selection-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px var(--space-lg);
  background: var(--brand-glow);
  border: 2px solid var(--brand);
  margin-bottom: var(--space-md);
  min-width: 0;
}

.selection-toolbar .selection-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
}

.selection-toolbar .selection-actions {
  margin-left: auto;
  display: flex;
  gap: var(--space-sm);
  min-width: 0;
}

/* === Share Result Popup === */
.share-result {
  text-align: center;
}

.share-result .share-field {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  padding: 12px 14px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.share-result .share-field .share-value {
  flex: 1;
  text-align: left;
  font-size: 0.875rem;
  word-break: break-all;
  font-family: 'Inter', monospace;
  color: var(--text-primary);
}

.share-result .share-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-align: left;
  font-weight: 600;
}

.share-whatsapp-btn {
  background: #25D366;
  color: white;
  border-color: #25D366;
}

.share-whatsapp-btn:hover {
  background: #1da851;
  border-color: #1da851;
}

.note-markdown-preview {
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  padding: var(--space-md);
  min-height: 120px;
  max-height: 280px;
  overflow-y: auto;
}

.note-markdown-preview h1,
.note-markdown-preview h2,
.note-markdown-preview h3,
.note-markdown-preview h4 {
  margin: 0 0 var(--space-sm);
}

.note-markdown-preview p,
.note-markdown-preview ul,
.note-markdown-preview ol,
.note-markdown-preview blockquote,
.note-markdown-preview pre {
  margin: 0 0 var(--space-sm);
}

.note-markdown-preview code {
  background: var(--bg-tertiary);
  padding: 2px 5px;
  border: 1px solid var(--border);
  font-family: 'Inter', monospace;
  font-size: 0.813rem;
}

.note-markdown-preview pre {
  padding: var(--space-sm);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  overflow-x: auto;
}

.note-markdown-preview pre code {
  background: transparent;
  border: none;
  padding: 0;
}

.note-markdown-preview blockquote {
  border-left: 3px solid var(--border-active);
  padding-left: var(--space-sm);
  color: var(--text-secondary);
}

.markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.markdown-toolbar .btn {
  min-width: 44px;
  padding: 7px 10px;
  text-transform: none;
  letter-spacing: 0;
}
