#vault .vault-page-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#vault .vault-hero-card,
#vault .vault-panel,
#vault .vault-list-shell,
#vault .vault-details-shell,
#vault .vault-lock-card {
  border: 1px solid var(--border-color, rgba(140, 170, 106, 0.2));
  background: linear-gradient(145deg, rgba(18, 28, 17, 0.92), rgba(28, 42, 24, 0.82));
  border-radius: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

#vault .vault-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px;
  overflow: hidden;
  position: relative;
}

#vault .vault-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(145, 184, 93, 0.18), transparent 42%), radial-gradient(circle at bottom right, rgba(213, 201, 149, 0.1), transparent 36%);
  pointer-events: none;
}

#vault .vault-hero-card > * {
  position: relative;
  z-index: 1;
}

#vault .vault-hero-card h2 {
  margin: 0 0 8px;
}

#vault .vault-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(168, 196, 118, 0.28);
  background: rgba(8, 16, 10, 0.36);
  color: rgba(241, 246, 234, 0.92);
  white-space: nowrap;
}

#vault .vault-hero-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #98bc5d;
  box-shadow: 0 0 0 6px rgba(152, 188, 93, 0.16);
}

#vault .vault-panel {
  padding: 28px;
}

#vault .vault-panel-header {
  margin-bottom: 20px;
}

#vault .vault-lock-card {
  padding: 30px;
  max-width: 760px;
  margin: 0 auto;
}

#vault .vault-empty-icon {
  width: 68px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: rgba(138, 173, 93, 0.12);
  border: 1px solid rgba(168, 196, 118, 0.24);
  font-size: 30px;
  margin-bottom: 16px;
}

#vault .vault-lock-card h4,
#vault .vault-empty-state h3,
#vault .vault-details-empty h3 {
  margin: 0 0 8px;
}

#vault .vault-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

#vault .vault-form-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

#vault .vault-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#vault .vault-field-full {
  grid-column: 1 / -1;
}

#vault .vault-field label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-soft, rgba(235, 241, 227, 0.82));
}

#vault .vault-field input,
#vault .vault-field textarea,
#vault .vault-search-shell input {
  width: 100%;
  min-height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(160, 189, 117, 0.2);
  background: rgba(9, 17, 11, 0.72);
  color: var(--text-color, #f2f6ec);
  padding: 14px 16px;
  outline: none;
}

#vault .vault-field textarea {
  min-height: 140px;
  resize: vertical;
}

#vault .vault-field input:focus,
#vault .vault-field textarea:focus,
#vault .vault-search-shell input:focus {
  border-color: rgba(168, 196, 118, 0.5);
  box-shadow: 0 0 0 4px rgba(148, 183, 93, 0.12);
}

#vault .vault-strength-shell {
  margin-top: 18px;
}

#vault .vault-strength-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#vault .vault-strength-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#vault .vault-strength-bar {
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a85f58, #c7815a);
  transition: width 0.2s ease, background 0.2s ease;
}

#vault .vault-inline-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(12, 20, 13, 0.5);
  border: 1px solid rgba(164, 188, 130, 0.16);
  color: var(--text-soft, rgba(235, 241, 227, 0.82));
}

#vault .vault-action-row {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

#vault .secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color, #f2f6ec);
}

#vault .vault-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#vault .vault-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #8b6b31, #b8944c) !important;
  color: #fff8ea !important;
  border: 1px solid rgba(222, 200, 141, 0.3) !important;
  box-shadow: 0 12px 24px rgba(72, 52, 19, 0.2);
}

#vault #vaultEditItemBtn {
  background: linear-gradient(135deg, #4d698d, #637fa6) !important;
  color: #f5f8ff !important;
  border: 1px solid rgba(171, 194, 224, 0.24) !important;
  box-shadow: 0 12px 24px rgba(32, 48, 72, 0.16);
}

#vault .danger-btn {
  background: linear-gradient(135deg, #954f46, #b36256);
  color: #fff9f7;
}

#vault .vault-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#vault .vault-search-shell {
  flex: 1 1 300px;
}

#vault .vault-toolbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#vault .vault-empty-state,
#vault .vault-details-empty {
  padding: 36px 24px;
  text-align: center;
}

#vault .vault-main-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 22px;
  min-width: 0;
}

#vault .vault-list-shell,
#vault .vault-details-shell {
  padding: 24px;
  min-width: 0;
}

#vault .vault-list-header,
#vault .vault-details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

#vault .vault-list-header h3,
#vault .vault-details-header h3 {
  margin: 0 0 6px;
}

#vault .vault-count-pill {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(159, 190, 109, 0.18);
  border: 1px solid rgba(159, 190, 109, 0.28);
  font-weight: 700;
}

#vault .vault-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 70vh;
  overflow: auto;
  padding-right: 4px;
}

#vault .vault-list::-webkit-scrollbar {
  width: 8px;
}

#vault .vault-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(153, 180, 111, 0.28);
}

#vault .vault-item-card {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(158, 189, 115, 0.16);
  background: rgba(11, 18, 12, 0.5);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#vault .vault-item-card:hover,
#vault .vault-item-card.is-active {
  transform: translateY(-1px);
  border-color: rgba(168, 196, 118, 0.34);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.16);
}

#vault .vault-item-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#vault .vault-item-card h4 {
  margin: 0 0 4px;
  font-size: 1.02rem;
}

#vault .vault-item-card p {
  margin: 0;
}

#vault .vault-item-updated {
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--text-soft, rgba(235, 241, 227, 0.7));
}

#vault .vault-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-soft, rgba(235, 241, 227, 0.72));
  font-size: 0.9rem;
}

#vault .vault-details-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#vault .vault-details-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(158, 189, 115, 0.12);
  border: 1px solid rgba(158, 189, 115, 0.22);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#vault .vault-secret-grid,
#vault .vault-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  min-width: 0;
}

#vault .vault-secret-card,
#vault .vault-info-card,
#vault .vault-notes-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(158, 189, 115, 0.16);
  background: rgba(10, 16, 10, 0.48);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}

#vault .vault-secret-label {
  display: block;
  font-size: 0.86rem;
  color: var(--text-soft, rgba(235, 241, 227, 0.72));
}

#vault .vault-detail-value {
  display: block;
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#vault .vault-password-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

#vault .vault-password-value {
  display: block;
  width: 100%;
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#vault .vault-inline-btn,
#vault .vault-copy-btn {
  border: 1px solid rgba(168, 196, 118, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 14px;
}

#vault .vault-copy-btn {
  margin-top: 0;
  align-self: flex-start;
}

#vault .vault-password-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

#vault .vault-password-input-wrap input {
  flex: 1 1 auto;
}

#vault .vault-notes-card p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#vault .vault-editor-shell {
  margin-top: 12px;
}

#vault .vault-editor-modal[hidden] {
  display: none !important;
}

#vault .vault-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#vault .vault-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 11, 7, 0.72);
  backdrop-filter: blur(10px);
}

#vault .vault-editor-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 26px;
  border-radius: 30px;
  border: 1px solid rgba(158, 189, 115, 0.18);
  background: linear-gradient(145deg, rgba(18, 28, 17, 0.96), rgba(28, 42, 24, 0.9));
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.38);
}

html[data-theme="light"] #vault .vault-hero-card,
html[data-theme="light"] #vault .vault-panel,
html[data-theme="light"] #vault .vault-list-shell,
html[data-theme="light"] #vault .vault-details-shell,
html[data-theme="light"] #vault .vault-lock-card,
body.light-mode #vault .vault-hero-card,
body.light-mode #vault .vault-panel,
body.light-mode #vault .vault-list-shell,
body.light-mode #vault .vault-details-shell,
body.light-mode #vault .vault-lock-card {
  background: linear-gradient(145deg, rgba(255, 253, 246, 0.95), rgba(242, 238, 228, 0.92));
  box-shadow: 0 22px 40px rgba(88, 81, 57, 0.08);
  color: #233022;
}

html[data-theme="light"] #vault h2,
html[data-theme="light"] #vault h3,
html[data-theme="light"] #vault h4,
html[data-theme="light"] #vault strong,
html[data-theme="light"] #vault .vault-detail-value,
html[data-theme="light"] #vault .vault-password-value,
html[data-theme="light"] #vault .vault-count-pill,
html[data-theme="light"] #vault .vault-details-eyebrow,
body.light-mode #vault h2,
body.light-mode #vault h3,
body.light-mode #vault h4,
body.light-mode #vault strong,
body.light-mode #vault .vault-detail-value,
body.light-mode #vault .vault-password-value,
body.light-mode #vault .vault-count-pill,
body.light-mode #vault .vault-details-eyebrow {
  color: #243022;
}

html[data-theme="light"] #vault p,
html[data-theme="light"] #vault span,
html[data-theme="light"] #vault label,
html[data-theme="light"] #vault .muted,
html[data-theme="light"] #vault .vault-secret-label,
html[data-theme="light"] #vault .vault-item-updated,
html[data-theme="light"] #vault .vault-item-meta,
html[data-theme="light"] #vault .vault-inline-note,
body.light-mode #vault p,
body.light-mode #vault span,
body.light-mode #vault label,
body.light-mode #vault .muted,
body.light-mode #vault .vault-secret-label,
body.light-mode #vault .vault-item-updated,
body.light-mode #vault .vault-item-meta,
body.light-mode #vault .vault-inline-note {
  color: rgba(37, 47, 35, 0.92);
}

html[data-theme="light"] #vault .vault-hero-badge,
html[data-theme="light"] #vault .vault-inline-note,
html[data-theme="light"] #vault .vault-item-card,
html[data-theme="light"] #vault .vault-secret-card,
html[data-theme="light"] #vault .vault-info-card,
html[data-theme="light"] #vault .vault-notes-card,
body.light-mode #vault .vault-hero-badge,
body.light-mode #vault .vault-inline-note,
body.light-mode #vault .vault-item-card,
body.light-mode #vault .vault-secret-card,
body.light-mode #vault .vault-info-card,
body.light-mode #vault .vault-notes-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(103, 121, 82, 0.14);
}

html[data-theme="light"] #vault .vault-field input,
html[data-theme="light"] #vault .vault-field textarea,
html[data-theme="light"] #vault .vault-search-shell input,
body.light-mode #vault .vault-field input,
body.light-mode #vault .vault-field textarea,
body.light-mode #vault .vault-search-shell input {
  background: rgba(255, 255, 255, 0.88);
  color: #263028;
  border-color: rgba(105, 124, 84, 0.18);
}

html[data-theme="light"] #vault .vault-inline-btn,
html[data-theme="light"] #vault .vault-copy-btn,
html[data-theme="light"] #vault .secondary-btn,
body.light-mode #vault .vault-inline-btn,
body.light-mode #vault .vault-copy-btn,
body.light-mode #vault .secondary-btn {
  background: rgba(130, 148, 108, 0.12);
  color: #2b3728;
  border-color: rgba(116, 138, 92, 0.22);
}

html[data-theme="light"] #vault .vault-empty-icon,
body.light-mode #vault .vault-empty-icon {
  background: rgba(138, 173, 93, 0.16);
  color: #385126;
}

html[data-theme="light"] #vault .vault-editor-dialog,
body.light-mode #vault .vault-editor-dialog {
  background: linear-gradient(145deg, rgba(255, 253, 246, 0.98), rgba(242, 238, 228, 0.96));
  box-shadow: 0 28px 56px rgba(88, 81, 57, 0.16);
  color: #233022;
}

html[data-theme="light"] #vault .vault-lock-btn,
body.light-mode #vault .vault-lock-btn {
  background: linear-gradient(135deg, #b88d43, #d3aa63) !important;
  color: #fffaf0 !important;
  border-color: rgba(146, 116, 54, 0.16) !important;
}

html[data-theme="light"] #vault #vaultEditItemBtn,
body.light-mode #vault #vaultEditItemBtn {
  background: linear-gradient(135deg, #6e88ae, #89a2c1) !important;
  color: #f8fbff !important;
  border-color: rgba(116, 138, 168, 0.18) !important;
}

html[dir="rtl"] #vault .vault-list-header,
html[dir="rtl"] #vault .vault-details-header,
html[dir="rtl"] #vault .vault-item-card-top,
html[dir="rtl"] #vault .vault-password-row,
html[dir="rtl"] #vault .vault-strength-top,
html[dir="rtl"] #vault .vault-toolbar,
html[dir="rtl"] #vault .vault-toolbar-actions,
html[dir="rtl"] #vault .vault-action-row {
  direction: rtl;
}

@media (max-width: 1024px) {
  #vault .vault-main-grid {
    grid-template-columns: 1fr;
  }

  #vault .vault-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  #vault .vault-hero-card,
  #vault .vault-panel,
  #vault .vault-list-shell,
  #vault .vault-details-shell,
  #vault .vault-lock-card {
    border-radius: 24px;
  }

  #vault .vault-hero-card {
    padding: 22px;
    flex-direction: column;
    align-items: flex-start;
  }

  #vault .vault-form-grid,
  #vault .vault-secret-grid,
  #vault .vault-info-grid {
    grid-template-columns: 1fr;
  }

  #vault .vault-list-header,
  #vault .vault-details-header,
  #vault .vault-toolbar,
  #vault .vault-password-input-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  #vault .vault-toolbar {
    justify-content: flex-start;
    gap: 14px;
  }

  #vault .vault-search-shell {
    flex: none;
    width: 100%;
  }

  #vault .vault-toolbar-actions,
  #vault .vault-details-actions,
  #vault .vault-action-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #vault .vault-toolbar-actions > *,
  #vault .vault-details-actions > *,
  #vault .vault-action-row > * {
    width: 100%;
  }

  #vault .vault-editor-dialog {
    width: min(100%, 560px);
    max-height: calc(100vh - 24px);
    padding: 22px;
    border-radius: 24px;
  }
}

@media (max-width: 520px) {
  #vault .vault-toolbar-actions,
  #vault .vault-details-actions,
  #vault .vault-action-row {
    grid-template-columns: 1fr;
  }

  #vault .vault-editor-modal {
    padding: 12px;
  }
}
