/* ============================
   Layout Utilities
=============================== */
.app-topbar,
.search-row,
.card-top,
.meta-row,
.admin-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

/* --- Entrance Animations --- */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: scaleIn 0.4s cubic-bezier(0.2, 0, 0.2, 1) both;
}

.animate-slide-up {
  animation: slideUpFade 0.5s cubic-bezier(0.2, 0, 0.2, 1) both;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }


/* ============================
   Metrics Grid — 2 columns
=============================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
  animation: scaleIn 0.5s cubic-bezier(0.2, 0, 0.2, 1) both;
}

/* --- Shimmer Loading Effect --- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.03) 25%, 
    rgba(255,255,255,0.08) 50%, 
    rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}


/* ============================
   Metric Cards — Premium Style
=============================== */
.metric-card {
  padding: 1.75rem 2rem;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* Stored Secrets card top row */
.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.metric-card-icon {
  width: 40px;
  height: 40px;
  background: rgba(79, 70, 229, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
}

.metric-card-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.metric-card-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.metric-card-label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ============================
   Progress Bar Card
=============================== */
.storage-card {
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.storage-usage-label {
  font-size: 0.88rem;
  color: var(--muted);
}

.storage-usage-counts {
  font-size: 0.88rem;
  color: var(--muted);
}

.storage-usage-counts strong {
  color: var(--text);
  font-weight: 600;
}

.progress-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #818cf8);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.progress-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* ============================
   Search Input — Pill Style
=============================== */
.search-wrap {
  width: min(340px, 100%);
}

.search-wrap input[type="search"] {
  width: 100%;
  padding: 0.65rem 1.25rem 0.65rem 2.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
  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%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.9rem center;
}

.search-wrap input[type="search"]:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.5);
  background-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), inset 0 1px 4px rgba(0, 0, 0, 0.3);
}


/* ============================
   Empty State — Compact Strip
=============================== */
@keyframes emptyFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  margin-top: 1.25rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: transparent;
  animation: emptyFadeIn 0.35s ease both;
}

.empty-state-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0.6;
}

.empty-state-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.empty-state-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  opacity: 0.7;
  white-space: nowrap;
}

.empty-state-copy {
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================
   Entry Cards
=============================== */
.card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.entry-card {
  animation: scaleIn 0.4s cubic-bezier(0.2, 0, 0.2, 1) both;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.entry-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}


.trash-card .status-pill {
  margin-left: auto;
}

.status-pill,
.used-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-pill.favorite {
  background: rgba(79, 70, 229, 0.15);
  color: #818cf8;
}

.status-pill.standard,
.used-pill {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.password-text,
.note-text {
  min-height: 1.5rem;
  margin: 1rem 0;
  line-height: 1.6;
}

.password-text {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.note-text {
  margin-top: -0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.meta-row {
  font-size: 0.85rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.reveal-button.visible {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}

.reveal-button.hidden {
  background: rgba(79, 70, 229, 0.15);
  color: #818cf8;
  border-color: rgba(79, 70, 229, 0.25);
}

/* ============================
   Vault Form
=============================== */
.vault-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.vault-form .wide {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.75rem;
}

/* ============================
   Admin List
=============================== */
.admin-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.limit-field {
  min-width: 130px;
}

.limit-input {
  max-width: 110px;
}

/* ============================
   Shell Layout
=============================== */
.admin-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 1.5rem;
  width: min(1360px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 5rem;
}

/* ============================
   Sidebar — Glassmorphism
=============================== */
.admin-sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  min-height: calc(100vh - 4rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.admin-brand {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-brand .eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: #4f46e5;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-brand .section-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-top: 0.4rem;
}

/* ============================
   Navigation
=============================== */
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 2rem;
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-align: left;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  font-weight: 450;
  cursor: pointer;
}

.admin-nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.admin-nav-link.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
  font-weight: 600;
  border-color: rgba(59, 130, 246, 0.3);
}

.admin-nav-link.active svg {
  opacity: 1;
  color: #818cf8;
}

.admin-nav-link:hover,
.admin-nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.admin-nav-link:hover svg {
  opacity: 1;
}

.admin-nav-link.active:hover {
  background: rgba(79, 70, 229, 0.2);
}

.admin-nav-button {
  cursor: pointer;
}

/* ============================
   Main content area
=============================== */
.admin-main {
  width: 100%;
  margin: 0;
  padding: 0;
}

.admin-hero {
  margin-top: 0;
}

.admin-hero .section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 0.4rem;
}

.admin-hero .eyebrow {
  margin: 0 0 0.5rem;
}

.admin-hero .section-copy {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ============================
   Announcements
=============================== */
.announcement-item {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.announcement-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.announcement-item p {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.announcement-item time {
  font-size: 0.8rem;
  color: var(--muted);
}

.announcement-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

/* ============================
   Feedback
=============================== */
.feedback-item {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.feedback-item p {
  margin: 0 0 0.5rem;
}

.feedback-item time {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================
   Mobile UI Components
   (hidden on desktop)
=============================== */
.mobile-topbar {
  display: none;
}

.mobile-menu-overlay {
  display: none;
}

/* ============================
   Settings & Billing Specifics
=============================== */
.settings-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  animation: slideUpFade 0.5s cubic-bezier(0.2, 0, 0.2, 1) both;
}

.settings-grid:last-of-type {
  border-bottom: none;
}

.settings-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.settings-info p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.settings-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.settings-card:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Button Micro-interactions */
.button {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.button:active {
  transform: translateY(0) scale(0.98);
}

.glow-btn {
  position: relative;
  overflow: hidden;
}

.glow-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.glow-btn:hover::after {
  transform: translateX(100%);
}

/* Confirmation Boxes */
#cancelConfirmBox, #removeCardConfirmBox {
  animation: slideDownFade 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

/* ============================
   Responsive — Tablet (900px)
=============================== */
@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
    width: min(100% - 1.5rem, 1360px);
    padding-top: 1rem;
    gap: 0.75rem;
  }

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

  .admin-sidebar {
    position: static;
    min-height: auto;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-topbar,
  .search-row,
  .admin-card {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================
   Responsive — Mobile (640px)
=============================== */
@media (max-width: 640px) {
  .admin-shell {
    display: block;
    width: 100%;
    padding: 0 0 4rem;
  }

  .admin-sidebar {
    display: none;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 0.85rem 1rem;
    background: rgba(11, 15, 25, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.45rem;
    cursor: pointer;
    color: var(--text);
    transition: background 0.2s;
  }

  .mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .mobile-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .mobile-menu-overlay.open {
    opacity: 1;
    pointer-events: all;
  }

  .mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(85vw, 300px);
    background: rgba(13, 15, 25, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    padding: 1.25rem 1rem;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(20px);
  }

  .mobile-menu-overlay.open .mobile-menu-panel {
    transform: translateX(0);
  }

  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .mobile-menu-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
  }

  .mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--text);
    transition: background 0.2s;
  }

  .mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .mobile-menu-nav {
    display: grid;
    gap: 0.35rem;
  }

  .mobile-menu-nav .admin-nav-link {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  .admin-main {
    padding: 0.85rem 0.85rem 0;
  }

  .admin-hero {
    padding: 1rem;
    border-radius: 14px;
  }

  .admin-hero .section-title {
    font-size: 1.35rem;
  }

  .admin-hero .section-copy {
    font-size: 0.85rem;
    margin-top: 0.35rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 0.75rem 0;
  }

  .metric-card,
  .storage-card {
    padding: 1.25rem;
    border-radius: 14px;
  }

  .metric-card-value {
    font-size: 2rem;
  }

  .card-list {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }

  .entry-card {
    padding: 1rem;
    border-radius: 14px;
  }

  .card-top {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .card-actions {
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
  }

  .card-actions .button {
    flex: 1 1 0;
    min-width: 0;
    font-size: 0.78rem;
    padding: 0.5rem 0.5rem;
    border-radius: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .meta-row {
    flex-direction: row;
    align-items: center;
    font-size: 0.78rem;
    padding-top: 0.6rem;
  }

  .panel-heading {
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
  }

  .panel-heading.search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .panel-heading h2 {
    font-size: 1.05rem;
  }

  .panel-heading p {
    font-size: 0.82rem;
  }

  .search-wrap {
    width: 100%;
  }

  .topbar-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-end;
  }

  .topbar-actions .button {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
  }

  .panel {
    padding: 1rem;
    border-radius: 14px;
  }

  .empty-state {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-top: 0.75rem;
    gap: 0.75rem;
  }

  .empty-state-title {
    white-space: normal;
  }

  .empty-state-copy {
    white-space: normal;
  }

  .vault-form {
    grid-template-columns: 1fr;
  }

  #emptyTrashConfirm {
    position: fixed !important;
    inset: auto 0.75rem 0.75rem !important;
    width: auto !important;
    top: auto !important;
    border-radius: 16px;
    padding: 1.25rem !important;
    z-index: 200 !important;
    box-shadow: 0 -6px 40px rgba(0, 0, 0, 0.6) !important;
  }

  .password-text {
    font-size: 0.88rem;
    letter-spacing: 0.02em;
  }

  .note-text {
    font-size: 0.82rem;
  }

  .faq-list {
    gap: 0.6rem !important;
  }

  details.faq-item summary {
    font-size: 0.9rem !important;
    padding: 0.85rem 1rem !important;
  }
}

/* ============================
   Trash Section Polishes
=============================== */
.trash-card {
  padding: 0.75rem 1.25rem !important; /* Compact vertical padding */
}

.inactive-text {
  opacity: 0.5;
}

.expiry-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ff5f56;
  background: rgba(255, 95, 86, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.trash-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.button.ghost-danger {
  background: transparent;
  border: 1px solid rgba(255, 95, 86, 0.3);
  color: #ff5f56;
}

.button.ghost-danger:hover {
  background: rgba(255, 95, 86, 0.1);
  border-color: #ff5f56;
}

.button.link-danger {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: underline;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
}

.button.link-danger:hover {
  color: #ff5f56;
}

.button.small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.button-group {
  display: flex;
  gap: 0.5rem;
}

/* Popover Refinements */
.confirm-popover {
  position: absolute;
  top: 120%;
  right: 0;
  width: 320px;
  padding: 1.5rem;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  background: rgba(20, 20, 25, 0.95);
}

.popover-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #ff5f56;
  font-family: var(--font-serif);
}

.popover-text {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.popover-input {
  margin-bottom: 1.25rem;
  width: 100%;
}

.popover-actions {
  display: flex;
  gap: 0.75rem;
}
/* ============================
   Settings Page Modernization
=============================== */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  max-width: 900px;
}

.settings-grid {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.settings-info {
  flex: 0 0 30%;
}

.settings-info h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.settings-info p {
  font-size: 0.85rem;
  color: #94a3b8; /* Slate 400 */
  line-height: 1.5;
}

.settings-card {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

/* Account Header */
.account-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.avatar-circle {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Danger Zone Refinement */
.danger-card {
  border-left: 3px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.05) !important;
}

.button.transparent-danger {
  background: transparent !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
  transition: all 0.3s ease;
}

.button.transparent-danger:hover {
  background: #ef4444 !important;
  color: white !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3) !important;
}

.button.ghost-danger:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Sidebar Active State Glow */
.admin-nav-link.active[href="#settings"] {
  background: rgba(139, 92, 246, 0.1);
  color: #c084fc;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
  border-right: 2px solid #a855f7;
}

/* Responsive Settings */
@media (max-width: 768px) {
  .settings-grid {
    flex-direction: column;
    gap: 1rem;
  }
  .settings-info {
    flex: none;
    width: 100%;
  }
}

/* Security Section & Toggles */
.security-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.security-row .label-group h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

.security-row .label-group p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

/* Modern Toggle Switch */
.switch-input {
  appearance: none;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.switch-input::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-input:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.switch-input:checked::before {
  transform: translateX(20px);
}

.switch-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
}

/* Security Modal */
.security-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.security-modal {
  background: #0f172a;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(500px, 95vw);
  padding: 2rem;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.security-modal-overlay.open .security-modal {
  transform: scale(1);
}

/* Feedback Page Redesign */
.feedback-grid {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.feedback-guidelines {
  flex: 0 0 30%;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.feedback-guidelines h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.feedback-guidelines ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feedback-guidelines li {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.feedback-guidelines li::before {
  content: "•";
  color: var(--primary);
  font-weight: bold;
}

.feedback-form-container {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.textarea-wrapper {
  position: relative;
}

#feedbackMessage {
  width: 100%;
  min-height: 180px;
  background: #0a0a0a;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 1rem;
  border-radius: 8px;
  resize: vertical;
  transition: all 0.2s ease;
}

#feedbackMessage:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(96, 165, 250, 0.2);
}

.char-counter {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.feedback-success {
  text-align: center;
  padding: 3rem 1rem;
}

.feedback-success h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 1.5rem 0 0.5rem;
}

.feedback-success p {
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .feedback-grid {
    flex-direction: column;
  }
  .feedback-guidelines {
    width: 100%;
  }
}

/* Security & Access Card Redesign */
.security-access-card {
  background: #111827 !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 1.75rem !important;
}

.card-header-compact {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1.75rem;
  opacity: 0.8;
}

/* ============================
   Lockdown / Expired Plan Styles
=============================== */
body.plan-expired-locked .metrics-grid,
body.plan-expired-locked .card-list,
body.plan-expired-locked #add-secret {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
  opacity: 0.6;
  transition: filter 0.5s ease;
}

body.plan-expired-locked .admin-hero {
  border: 2px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

body.plan-expired-locked #billingUpgradeBtn {
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.security-row-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.security-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.button.ghost-white {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: white !important;
  transition: all 0.2s ease;
}

.button.ghost-white:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Premium Toggle for 2FA */
.premium-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.premium-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.premium-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 34px;
  transition: .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.premium-toggle input:checked + .premium-slider {
  background-color: #6366f1; /* Violet 500 */
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.inset-input {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}

/* Plan Badge & Technical Details */
.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.3s ease;
}

.plan-badge.free {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.2);
}

.plan-badge.basic {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

.plan-badge.business {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}

.plan-badge.admin {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
  letter-spacing: 0.1em;
}

/* Premium Upgrade Button */
.upgrade-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(59, 130, 246, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.upgrade-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.upgrade-btn:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 1), rgba(59, 130, 246, 1));
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.upgrade-btn:hover::before {
  left: 100%;
}

.upgrade-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.technical-details {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.technical-details summary {
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  list-style: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.technical-details summary::-webkit-details-marker {
  display: none;
}

.technical-details summary:hover {
  opacity: 1;
}

.technical-content {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.7;
  font-family: monospace;
  border: 1px solid rgba(255, 255, 255, 0.03);
}
/* ============================
   Vault Lock Screen (PIN Entry)
=============================== */
.vault-lock-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background:
    radial-gradient(circle at top, rgba(34, 197, 94, 0.08), transparent 35%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.08), transparent 30%),
    linear-gradient(180deg, #0b1220 0%, #111a2d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  padding: 1.5rem;
  overflow-y: auto;
}

.lock-panel {
  width: min(100%, 420px);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  text-align: center;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(11, 18, 32, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 28px;
  padding: 1.4rem 1.4rem 1.25rem;
  box-shadow:
    0 24px 80px rgba(2, 6, 23, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.lock-pin-row {
  margin-bottom: 1rem;
  flex-wrap: nowrap;
}

.lock-pin-row .pin-box {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.lock-pin-row .pin-box:focus {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  background: rgba(255, 255, 255, 0.05);
}

.lock-pin-row .pin-box.filled {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.18), rgba(34, 197, 94, 0.12));
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.12);
  transform: translateY(-1px);
}

/* --- Security Row Pro Layout --- */
.security-row-pro {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 0;
}

.biometric-icon-wrap {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.security-row-pro:hover .biometric-icon-wrap {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.1), inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}

.status-pill.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-pill.active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.security-row-pro .label-group h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.security-row-pro .label-group p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Minimalist Modal Components --- */
.avatar-circle {
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.pin-step-content {
  display: none;
  animation: modalFadeIn 0.3s ease forwards;
}

.pin-step-content.active {
  display: block;
}

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

.pin-elite-box-grid {
  display: flex;
  justify-content: center;
  position: relative;
}

.pin-digit-display {
  width: 50px;
  height: 60px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(89, 99, 246, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  transition: all 0.2s ease;
  pointer-events: none;
}

.pin-digit-display.focused {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(89, 99, 246, 0.4);
  transform: translateY(-2px);
}

.pin-digit-display.has-value {
  background: #eef2ff;
  border-color: #eef2ff;
  color: #0f172a;
  box-shadow: 0 4px 15px rgba(238, 242, 255, 0.1);
  transform: translateY(-2px);
}

.pin-mask-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: currentColor;
}


/* --- Premium Password Security UI --- */
.security-tier-wrap {
  position: relative;
  margin-top: 0.5rem;
}

.security-input-group {
  position: relative;
  transition: transform 0.2s ease;
}

.security-input-group:focus-within {
  transform: translateY(-2px);
}

.security-input-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  transition: color 0.2s ease;
}

.security-input-group:focus-within label {
  color: var(--primary);
}

.pin-digit {
  width: 3.5rem;
  height: 4.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Only show the 'active' lift and glow when the user is actually interacting or has typed */
.pin-digit:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.5);
}

.pin-digit:not(:placeholder-shown),
.pin-digit.has-value {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2), inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Hide arrow/spinners */
.pin-digit::-webkit-outer-spin-button,
.pin-digit::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.security-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  color: white;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.security-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Multi-segment Strength Meter */
.strength-segments {
  display: flex;
  gap: 4px;
  margin-top: 1rem;
  height: 6px;
}

.strength-segment {
  flex: 1;
  height: 100%;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.strength-segment.active.low { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
.strength-segment.active.med { background: #f59e0b; box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
.strength-segment.active.high { background: #10b981; box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
.strength-segment.active.secure { background: #6366f1; box-shadow: 0 0 15px rgba(99, 102, 241, 0.6); }

.strength-label-pro {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.strength-label-pro::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Shake Animation for mismatch */
@keyframes shake-x {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.input-error {
  border-color: #ef4444 !important;
  animation: shake-x 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ============================
   PIN Setup Modal — Rebuilt
   Clean, class-only, zero inline styles
=============================== */

/* Modal shell */
.pin-setup-modal {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: min(420px, 96vw);
  padding: 2.5rem 2rem;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.security-modal-overlay.open .pin-setup-modal {
  transform: scale(1);
}

/* Icon bubble */
.pin-modal-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.pin-modal-icon--lock {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.1);
}

.pin-modal-icon--check {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.1);
}

/* Text */
.pin-modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.pin-modal-sub {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 2rem;
}

/* --- 4 individual PIN digit inputs --- */
.pin-digit-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.pin-box {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  outline: none;
  caret-color: transparent;
  letter-spacing: 0;
  -webkit-text-security: disc;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  -webkit-appearance: none;
  appearance: none;
}

/* Hide browser spinners */
.pin-box::-webkit-outer-spin-button,
.pin-box::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pin-box[type=number] { -moz-appearance: textfield; }

/* Focus state — subtle glow, lift */
.pin-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.15);
  background: rgba(99, 102, 241, 0.06);
  transform: translateY(-3px);
}

/* Filled state — a digit has been entered */
.pin-box.filled {
  background: rgba(99, 102, 241, 0.1);
  border-color: #6366f1;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

/* Error shake state */
.pin-box.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
  animation: shake-x 0.35s ease-in-out;
}

/* Action buttons inside PIN modal */
.pin-modal-actions {
  display: flex;
  gap: 0.75rem;
}

.pin-modal-btn-primary {
  flex: 2;
  padding: 0.75rem 0;
}

.pin-modal-btn-ghost {
  flex: 1;
  padding: 0.75rem 0;
}

/* ============================
   Vault Lock Screen — Rebuilt
=============================== */

/* Icon */
.lock-panel-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.1), rgba(52, 211, 153, 0.06));
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: #7dd3fc;
  box-shadow: 0 12px 32px rgba(14, 165, 233, 0.08);
}

.lock-panel-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #67e8f9;
  opacity: 0.9;
}

/* Text */
.lock-panel-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.lock-panel-sub {
  color: #94a3b8;
  font-size: 0.96rem;
  margin: 0 0 1.35rem;
  line-height: 1.55;
}

.lock-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.2rem;
}

.lock-help-text {
  margin: 0;
  color: #7c8aa4;
  font-size: 0.86rem;
  text-align: left;
}

.lock-actions-row {
  margin-top: 1rem;
}

.lock-actions-row .button {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  font-size: 1rem;
}

@media (max-width: 820px) {
  .vault-lock-screen {
    padding: 1.25rem;
    align-items: flex-start;
  }

  .lock-panel {
    width: min(100%, 520px);
    margin: auto;
    padding: 1.35rem 1.2rem 1.15rem;
  }

  .lock-panel-title {
    font-size: 1.85rem;
  }

  .lock-panel-sub {
    font-size: 0.92rem;
  }
}

.lock-inline-link {
  background: none;
  border: none;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  opacity: 0.9;
  transition: color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.lock-inline-link:hover {
  color: #67e8f9;
  opacity: 1;
}

/* Biometric button */
.lock-biometric-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 2rem;
}

/* Responsive for PIN modal on small screens */
@media (max-width: 480px) {
  .vault-lock-screen {
    padding: 1rem;
  }

  .lock-panel {
    padding: 1.1rem 1rem 1rem;
    border-radius: 24px;
  }

  .pin-setup-modal {
    padding: 2rem 1.25rem;
  }

  .pin-box {
    width: 48px;
    height: 56px;
    font-size: 1.4rem;
    border-radius: 12px;
  }

  .pin-digit-row {
    gap: 0.6rem;
  }

  .pin-modal-title {
    font-size: 1.35rem;
  }

  .lock-panel-title {
    font-size: 1.6rem;
  }

  .lock-pin-row .pin-box {
    width: 19vw;
    min-width: 48px;
    max-width: 56px;
    height: 56px;
  }

  .lock-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .lock-inline-link {
    padding-left: 0;
  }
}

/* ============================
   Responsive Hardening Pass
   Settings, Security, Admin Mobile
=============================== */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.admin-main,
.panel,
.settings-section,
.settings-grid,
.settings-card,
.security-access-card,
.security-row,
.security-row-pro,
.security-row-compact,
.label-group,
.form-row,
.feedback-grid,
.vault-form,
.card-list,
.admin-list {
  min-width: 0;
}

.settings-section {
  width: 100%;
  max-width: min(100%, 980px);
}

.settings-grid {
  width: 100%;
}

.settings-card {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.security-access-card {
  overflow: hidden;
}

.security-row,
.security-row-pro,
.security-row-compact {
  max-width: 100%;
}

.security-row-pro .label-group,
.security-row-compact .label-group,
.security-row .label-group {
  flex: 1 1 auto;
  min-width: 0;
}

.security-row-pro .label-group p,
.security-row-compact .label-group p,
.security-row .label-group p {
  overflow-wrap: anywhere;
}

.security-row-pro .button,
.security-row-compact .button,
.security-row .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .admin-shell {
    width: min(100% - 1rem, 1360px);
    gap: 1rem;
  }

  .settings-section {
    gap: 2rem;
  }

  .settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .settings-info,
  .settings-card {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .settings-section {
    gap: 1.25rem;
  }

  .settings-grid {
    padding: 1rem 0;
  }

  .settings-card {
    padding: 1rem;
    border-radius: 16px;
  }

  .account-header {
    align-items: flex-start;
    gap: 0.9rem;
  }

  .badge-verified {
    margin-left: 0;
    margin-top: 0.4rem;
  }

  .security-row,
  .security-row-compact {
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
  }

  .security-row-pro {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 0.85rem;
  }

  .security-row-pro > .button,
  .security-row-pro > button,
  .security-row-compact > .button,
  .security-row-compact > button,
  .security-row > .button,
  .security-row > button {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .biometric-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .status-pill {
    max-width: 100%;
    white-space: normal;
  }

  .feedback-grid {
    flex-direction: column;
    gap: 1rem;
  }

  .feedback-guidelines {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 520px) {
  .admin-main {
    padding-inline: 0.75rem;
  }

  .panel {
    padding: 0.9rem;
  }

  .admin-card,
  .admin-card-header,
  .admin-card-actions,
  .admin-stats,
  .announcement-head,
  .popover-actions {
    min-width: 0;
  }

  .admin-card-header,
  .announcement-head,
  .popover-actions,
  .pin-modal-actions,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-card-actions .button,
  .popover-actions .button,
  .pin-modal-actions .button,
  .modal-actions .button {
    width: 100%;
  }

  .pin-setup-modal,
  .security-modal {
    width: min(100% - 1rem, 420px);
    max-height: calc(100dvh - 1rem);
    overflow-y: auto;
    padding: 1.25rem 1rem;
    border-radius: 18px;
  }

  .pin-modal-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 1rem;
  }

  .pin-modal-sub {
    margin-bottom: 1.25rem;
  }

  .pin-digit-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 1.25rem;
  }

  .pin-box,
  .pin-digit {
    width: 100%;
    min-width: 0;
    height: clamp(48px, 14vw, 56px);
    font-size: 1.25rem;
  }

  .lock-meta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .lock-inline-link {
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 360px) {
  .mobile-topbar {
    padding-inline: 0.75rem;
  }

  .mobile-topbar-brand span,
  .mobile-menu-brand span {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .settings-card,
  .panel {
    padding-inline: 0.75rem;
  }
}

/* ============================
   Vault Lock Responsive Rebuild
   Removes inner scroll and keeps the unlock card composed on short screens
=============================== */
.vault-lock-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 1.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100dvh;
}

.lock-panel {
  width: min(100%, 430px);
  max-height: none;
  overflow: visible;
  padding: clamp(1rem, 3.2vh, 1.6rem) clamp(1rem, 4vw, 1.45rem);
  border-radius: clamp(20px, 4vw, 28px);
}

.lock-panel-icon {
  width: clamp(52px, 10dvh, 64px);
  height: clamp(52px, 10dvh, 64px);
  margin-bottom: clamp(0.7rem, 2dvh, 1rem);
}

.lock-panel-icon svg {
  width: clamp(24px, 5dvh, 32px);
  height: clamp(24px, 5dvh, 32px);
}

.lock-panel-eyebrow {
  margin-bottom: 0.28rem;
  font-size: clamp(0.66rem, 1.7vw, 0.76rem);
}

.lock-panel-title {
  font-size: clamp(1.65rem, 6vw, 2.1rem);
  margin-bottom: 0.35rem;
}

.lock-panel-sub {
  max-width: 30ch;
  margin: 0 auto clamp(0.9rem, 2.4dvh, 1.25rem);
  font-size: clamp(0.86rem, 2.2vw, 0.96rem);
}

.lock-pin-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.45rem, 2vw, 0.75rem);
  width: min(100%, 280px);
  margin: 0 auto clamp(0.8rem, 2dvh, 1rem);
}

.lock-pin-row .pin-box {
  width: 100%;
  min-width: 0;
  height: clamp(48px, 10dvh, 58px);
  border-radius: clamp(13px, 3vw, 18px);
  font-size: clamp(1.25rem, 4.5vw, 1.55rem);
}

.lock-meta-row {
  margin-bottom: clamp(0.75rem, 2dvh, 1rem);
}

.lock-help-text,
.lock-inline-link {
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.lock-biometric-btn {
  min-height: clamp(44px, 8dvh, 52px);
  margin-bottom: clamp(0.75rem, 2dvh, 1rem);
}

.lock-actions-row {
  gap: clamp(0.5rem, 1.6dvh, 0.75rem) !important;
  margin-top: 0;
}

.lock-actions-row .button {
  min-height: clamp(46px, 8.5dvh, 54px);
  border-radius: clamp(14px, 3vw, 18px);
}

@media (max-height: 640px) and (min-width: 521px) {
  .vault-lock-screen {
    align-items: flex-start;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .lock-panel {
    width: min(100%, 390px);
    padding: 0.85rem 1.15rem;
  }

  .lock-panel-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 0.45rem;
  }

  .lock-panel-icon svg {
    width: 23px;
    height: 23px;
  }

  .lock-panel-title {
    font-size: 1.55rem;
  }

  .lock-panel-sub {
    margin-bottom: 0.65rem;
    line-height: 1.35;
  }

  .lock-pin-row {
    width: min(100%, 240px);
    margin-bottom: 0.65rem;
  }

  .lock-pin-row .pin-box {
    height: 46px;
  }

  .lock-meta-row {
    margin-bottom: 0.6rem;
  }

  .lock-biometric-btn,
  .lock-actions-row .button {
    min-height: 42px;
  }
}

@media (max-width: 520px) {
  .vault-lock-screen {
    align-items: center;
    padding: 0.75rem;
  }

  .lock-panel {
    width: min(100%, 380px);
  }

  .lock-meta-row {
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
  }

  .lock-help-text {
    text-align: center;
  }
}
