/* ═══════════════════════════════════════════════════════════
   Vault24 — Modern Tech UI
   Dark mode default · Cyan & Purple accent · Rounded design system
   ═══════════════════════════════════════════════════════════ */

/* ── Dark Theme (default) ── */
:root {
  /* Backgrounds */
  --bg-primary: #000000;
  --bg-panel: #0d0d0d;
  --bg-elevated: #171717;
  --bg-input: #0d0d0d;
  --bg-modal: #0d0d0d;
  --bg-hover: rgba(255, 255, 255, 0.06);

  /* Borders */
  --border-color: #262626;
  --border-subtle: #171717;
  --border-focus: #ffffff;

  /* Text */
  --text-main: #ffffff;
  --text-muted: #a3a3a3;
  --text-white: #ffffff;
  --text-dim: #525252;

  /* White Accent palette */
  --accent: #ffffff;
  --accent-hover: #e5e5e5;
  --accent-dim: rgba(255, 255, 255, 0.12);
  --accent-glow: rgba(255, 255, 255, 0.25);
  --accent-border: rgba(255, 255, 255, 0.35);

  /* Semantic colours */
  --danger: #ff453a;
  --danger-dim: rgba(255, 69, 58, 0.15);
  --warning: #ffd60a;
  --success: #30d158;
  --success-dim: rgba(48, 209, 88, 0.15);

  /* Named accent colours */
  --accent-green: #30d158;
  --accent-blue: #64d2ff;
  --accent-purple: #bf5af2;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.65);
  --shadow-main: 0 8px 32px rgba(0, 0, 0, 0.85);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.95);
  --glow-blue: 0 0 20px rgba(255, 255, 255, 0.1);

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Motion */
  --transition-fast: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Fira Code', Consolas, monospace;
}

/* ── Light Theme ── */
body.light-theme {
  --bg-primary: #ffffff;
  --bg-panel: #f5f5f5;
  --bg-elevated: #eaeaea;
  --bg-input: #ffffff;
  --bg-modal: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.06);

  --border-color: #e5e5e5;
  --border-subtle: #f5f5f5;
  --border-focus: #000000;

  --text-main: #000000;
  --text-muted: #737373;
  --text-white: #000000;
  --text-dim: #d4d4d4;

  --accent: #000000;
  --accent-hover: #171717;
  --accent-dim: rgba(0, 0, 0, 0.08);
  --accent-glow: rgba(0, 0, 0, 0.15);
  --accent-border: rgba(0, 0, 0, 0.25);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-main: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.12);
  --glow-blue: 0 0 20px rgba(0, 0, 0, 0.05);

  /* Named accent colours */
  --accent-green: #24963f;
  --accent-blue: #0a84d6;
  --accent-purple: #8944ab;
}

/* ═══════════════════════════════════════════════════
   RESET & GLOBAL
   ═══════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  transition: background-color 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ═══════════════════════════════════════════════════
   LUCIDE ICONS — SVG defaults
   ═══════════════════════════════════════════════════ */
svg.lucide {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 1.8;
  vertical-align: middle;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

/* ═══════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════ */
.app-container-vault {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════
   TOP HEADER
   ═══════════════════════════════════════════════════ */
.top-bar-vault {
  background-color: var(--bg-panel);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border-color);
  z-index: 101;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo-icon {
  font-size: 1.35rem;
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.retro-brand {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-section:hover .logo-svg,
.header-left:hover .logo-svg {
  transform: scale(1.08) rotate(5deg);
}

.logo-section:hover .logo-svg circle[stroke-dasharray],
.header-left:hover .logo-svg circle[stroke-dasharray] {
  animation: rotate-dial 12s linear infinite;
}

@keyframes rotate-dial {
  0% { transform: rotate(0deg); transform-origin: 50px 46px; }
  100% { transform: rotate(360deg); transform-origin: 50px 46px; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-dropdown-wrapper {
  position: relative;
}

.header-dropdown-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition-fast);
  font-family: var(--font-family);
}

.header-dropdown-btn:hover {
  border-color: var(--accent-border);
  background: var(--bg-hover);
  color: var(--text-white);
}

.header-dropdown-content {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-main);
  border-radius: var(--radius-md);
  width: 200px;
  display: none;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  padding: 0.3rem;
}

.header-dropdown-content.show {
  display: flex;
}

.header-dropdown-item {
  padding: 0.7rem 1rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.83rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: var(--radius-sm);
}

.header-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.header-right .search-wrapper {
  width: 260px;
  position: relative;
}

.header-right .search-wrapper svg.lucide {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header-right .search-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.42rem 0.75rem 0.42rem 2.1rem;
  width: 100%;
  color: var(--text-white);
  font-size: 0.83rem;
  transition: var(--transition-fast);
  font-family: var(--font-family);
}

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

.header-right .search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-elevated);
}

.header-action-btn {
  background: rgba(56, 139, 253, 0.06);
  border: 1px solid rgba(56, 139, 253, 0.12);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.header-action-btn:hover {
  background: rgba(56, 139, 253, 0.12);
  border-color: var(--accent-border);
  color: var(--accent-hover);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}

.header-notification {
  position: relative;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.header-notification:hover {
  color: var(--accent);
}

.header-notification .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.6rem;
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-panel);
}

.user-profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent) 0%, var(--text-muted) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--bg-primary);
  cursor: pointer;
  font-size: 0.85rem;
  box-shadow: var(--glow-blue);
  transition: var(--transition-fast);
}

.user-profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--accent-border), var(--glow-blue);
}


/* User Profile Dropdown */
.user-profile-wrapper {
  position: relative;
  display: inline-block;
}

.user-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  width: 220px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  padding: 0.25rem 0;
  animation: userDropdownFadeIn 0.15s ease-out;
}

.user-dropdown-panel.show {
  display: flex;
}

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

.user-dropdown-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-dropdown-name {
  font-weight: 600;
  color: var(--text-white);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-role {
  font-size: 0.75rem;
  font-weight: 500;
}

.user-dropdown-role.premium {
  color: var(--warning);
}

.user-dropdown-role.free {
  color: var(--text-muted);
}

.user-dropdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-dropdown-item:hover {
  background-color: var(--bg-hover);
  color: var(--accent-hover);
}

.user-dropdown-item.signout {
  color: var(--danger);
  border-top: 1px solid var(--border-color);
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

.user-dropdown-item.signout:hover {
  background-color: var(--danger-dim);
  color: var(--danger);
}

.user-dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */
.sidebar-vault {
  width: 240px;
  background-color: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.nav-links-vault {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item-vault {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  position: relative;
}

.nav-item-vault svg.lucide {
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.15rem;
  flex-shrink: 0;
  stroke-width: 1.6;
  transition: var(--transition-fast);
}

.nav-item-vault:hover svg.lucide {
  stroke-width: 2;
}

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

.nav-item-vault.active {
  background: var(--accent-dim);
  color: var(--accent-hover);
  border-color: var(--accent-border);
  font-weight: 600;
}

.nav-item-vault.active svg.lucide {
  color: var(--accent);
  stroke-width: 2.2;
}

.nav-item-vault.active::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
}

.sidebar-footer-vault {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

.sync-info {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
}

.sync-info #user-display-name {
  font-weight: 600;
  color: var(--text-white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-info #sync-status {
  color: var(--text-muted);
}

.btn-lock-sidebar {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.65rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  transition: var(--transition-fast);
  font-family: var(--font-family);
}

.btn-lock-sidebar:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-dim);
}

/* ═══════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════ */
.main-content-vault {
  padding: 2rem 2.5rem;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
  flex: 1;
}

.panel-view {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}


.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.3px;
  padding-bottom: 12px;
}

/* ═══════════════════════════════════════════════════
   STATS CARDS
   ═══════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.25rem;
}

.stats-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

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

.stats-count {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1;
}

.stats-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.8px;
}

.quick-audit-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.quick-audit-card h3 {
  font-size: 0.95rem;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

/* ═══════════════════════════════════════════════════
   DASHBOARD CARDS
   ═══════════════════════════════════════════════════ */
.dashboard-masonry-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.dashboard-col-left,
.dashboard-col-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-donuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .dashboard-masonry-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-donuts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 200px;
  transition: var(--transition-fast);
}

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

.chart-card h3 {
  font-size: 0.88rem;
  color: var(--text-white);
  font-weight: 600;
}

.chart-flex {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.svg-chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100px;
  height: 100px;
}

.usage-bar-chart {
  width: 100%;
  height: 140px;
}

.chart-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chart-main-val {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-white);
  font-family: var(--font-mono);
}

.chart-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.inline-add-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.inline-add-card h3 {
  font-size: 0.88rem;
  color: var(--text-white);
  margin-bottom: 1rem;
}

.inline-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.inline-add-form button {
  font-size: 0.85rem;
  padding: 0.5rem 1.1rem;
}

/* ═══════════════════════════════════════════════════
   ACTION BAR & BUTTONS
   ═══════════════════════════════════════════════════ */
.action-bar-vault {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-panel);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.btn-primary-vault,
.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  border: 1px solid transparent;
  padding: 0.55rem 1.2rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition-fast);
  font-family: var(--font-family);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary-vault:hover,
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
  filter: brightness(1.1);
}

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

.btn-secondary-vault,
.btn-secondary {
  background: rgba(56, 139, 253, 0.06);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(56, 139, 253, 0.15);
  color: var(--text-main);
  padding: 0.55rem 1.2rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition-fast);
  font-family: var(--font-family);
}

.btn-secondary-vault:hover,
.btn-secondary:hover {
  background: rgba(56, 139, 253, 0.12);
  border-color: var(--accent-border);
  color: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--danger);
  padding: 0.55rem 1.2rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition-fast);
  font-family: var(--font-family);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 2px 12px rgba(248, 81, 73, 0.35);
}

.nav-arrow-btn,
.action-row-btn {
  background: rgba(56, 139, 253, 0.06);
  border: 1px solid rgba(56, 139, 253, 0.12);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.nav-arrow-btn:hover:not(:disabled),
.action-row-btn:hover {
  background: rgba(56, 139, 253, 0.12);
  border-color: var(--accent-border);
  color: var(--accent-hover);
  box-shadow: 0 0 14px var(--accent-glow);
}

.nav-arrow-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.action-row-btn.delete:hover {
  background: rgba(248, 81, 73, 0.12);
  border-color: rgba(248, 81, 73, 0.35);
  color: var(--danger);
  box-shadow: 0 0 14px rgba(248, 81, 73, 0.25);
}

.action-row-btn+.action-row-btn {
  margin-left: 0.35rem;
}

.nav-arrow-btn:hover:not(:disabled) {
  background: rgba(56, 139, 253, 0.12);
  border-color: var(--accent-border);
  color: var(--accent-hover);
  box-shadow: 0 0 14px var(--accent-glow);
}

.nav-arrow-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.search-wrapper-sub {
  position: relative;
  width: 200px;
}

.search-wrapper-sub svg.lucide {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrapper-sub input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.5rem 0.4rem 1.8rem;
  width: 100%;
  color: var(--text-white);
  font-size: 0.8rem;
  font-family: var(--font-family);
  transition: var(--transition-fast);
}

.search-wrapper-sub input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.action-bar-right-vault {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════ */
.table-container-vault {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 20px;
}

.folders-table-vault {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.folders-table-vault th,
.folders-table-vault td {
  padding: 0.9rem 1.25rem;
  font-size: 0.84rem;
}

.folders-table-vault th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border-color);
}

.folders-table-vault td {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.folders-table-vault tbody tr:last-child td {
  border-bottom: none;
}

.folders-table-vault tbody tr {
  transition: var(--transition-fast);
}

.folders-table-vault tbody tr:hover td {
  background: var(--bg-hover);
}

.folder-name-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
}

.folder-name-cell i {
  color: var(--accent);
  font-size: 1.1rem;
}

.tree-connectors {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: pre;
  user-select: none;
  opacity: 0.5;
  line-height: 1;
}

/* Folder tree rows: remove borders, tighter spacing */
.folder-tree-row td {
  border-bottom: none !important;
  padding-top: 0.35rem !important;
  padding-bottom: 0.35rem !important;
}

.folder-tree-row:hover td {
  background: transparent !important;
}

.folder-tree-row:hover .folder-name-cell {
  color: var(--accent-hover);
}

/* ═══════════════════════════════════════════════════
   VAULT CARDS
   ═══════════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.vault-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.vault-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-main), var(--glow-blue);
  transform: translateY(-2px);
}

.folder-card {
  background: rgba(56, 139, 253, 0.04);
  border-left: 3px solid var(--accent);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.card-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-folder {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.card-icon-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.79rem;
  transition: var(--transition-fast);
}

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

.card-field span {
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
  color: var(--text-main);
}

.card-field i {
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.card-field i:hover {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════
   TOTP
   ═══════════════════════════════════════════════════ */
.totp-display {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.totp-code-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
}

.totp-code {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  font-family: var(--font-mono);
}

.totp-timer-bar {
  height: 3px;
  background: var(--border-color);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.totp-progress {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 1s linear;
  border-radius: var(--radius-pill);
}

.totp-live-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  animation: fadeSlideIn 0.2s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

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

.totp-preview-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.totp-preview-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 500;
}

.totp-preview-code {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
}

.totp-preview-right {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.totp-preview-secs {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 2rem;
  text-align: right;
}

/* ═══════════════════════════════════════════════════
   AUTH SCREENS
   ═══════════════════════════════════════════════════ */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem;
  min-height: 100vh;
  background: var(--bg-primary);
  gap: 2rem;
}

.auth-brand-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-brand-side .logo-auth-text {
  font-size: 80px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -3px;
  line-height: 1;
  margin-bottom: 1.5rem;
  user-select: none;
}

.auth-brand-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.auth-form-side {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-card-title {
  color: var(--text-white);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

/* Desktop Split Layout */
@media (min-width: 868px) {
  .auth-container {
    flex-direction: row;
    gap: 6rem;
    padding: 4rem;
  }

  .auth-brand-side {
    align-items: flex-start;
    text-align: left;
    max-width: 440px;
  }

  .auth-brand-side .logo-auth-text {
    font-size: 220px;
    letter-spacing: -8px;
    margin-bottom: 2rem;
  }

  .auth-brand-subtitle {
    font-size: 1.25rem;
  }

}

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.45rem;
}

.logo-section i {
  color: var(--accent);
  font-size: 1.7rem;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-section .logo-svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-auth-static {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-xl);
  flex-shrink: 0;
  transition: none;
}

/* ═══════════════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.input-field-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.input-field-wrapper i {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.05rem;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.2rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 0.84rem;
  transition: var(--transition-fast);
  display: block;
  font-family: var(--font-family);
}

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

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-elevated);
}

.input-field-wrapper .form-input {
  padding-left: 2.1rem;
}

.input-field-wrapper input[type="password"].form-input {
  padding-left: 0.75rem;
}

#register-username {
  padding-left: 0.75rem;
}

input.form-input:not([id*="username"]):not([id*="password"]):not([id*="url"]) {
  padding-left: 0.75rem;
}

.input-action-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.input-action-btn:hover {
  color: var(--accent);
}

.field-icon-group {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  overflow: hidden;
}

.field-icon-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-elevated);
}

.field-icon-group .field-icon {
  flex-shrink: 0;
  width: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  padding-left: 0.5rem;
}

.field-icon-group .field-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-white);
  font-size: 0.84rem;
  outline: none;
  box-shadow: none;
  width: 100%;
  font-family: var(--font-family);
}

.field-icon-group .field-input::placeholder {
  color: var(--text-dim);
}

.field-icon-group .field-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.field-eye-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-left: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.75rem;
  height: 100%;
  min-height: 2.4rem;
  transition: var(--transition-fast);
}

.field-eye-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.field-eye-btn svg.lucide {
  width: 1rem;
  height: 1rem;
}

/* ═══════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

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

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 95%;
  max-width: 520px;
  padding: 2rem;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(56, 139, 253, 0.08);
  transform: scale(0.94) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  opacity: 0;
}

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

.modal-overlay.drawer-overlay {
  justify-content: flex-end;
  align-items: stretch;
}

.modal-overlay.drawer-overlay .modal {
  width: 520px;
  max-width: 100%;
  height: 100%;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border-right: none;
  border-top: none;
  border-bottom: none;
  border-left: 1px solid var(--border-color);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  opacity: 1;
}

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

.modal-overlay.drawer-overlay .modal-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
}

.drawer-footer {
  display: flex;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

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

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
}

.modal-close {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-dim);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* ═══════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════ */
.settings-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 20px;
}

.settings-card h3 {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-white);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

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

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-row-title {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text-white);
}

.settings-row-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.settings-select {
  padding: 0.55rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 0.84rem;
  font-family: var(--font-family);
  transition: var(--transition-fast);
}

.settings-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.import-export-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.import-box {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-elevated);
}

.import-box:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.import-box i {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.import-box:hover i {
  color: var(--accent);
}

.import-box span {
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-white);
  box-shadow: var(--shadow-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(12px);
  opacity: 0;
  transition: var(--transition-fast);
  font-size: 0.84rem;
  min-width: 240px;
}

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

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

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

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

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

.toast.warning {
  border-left-color: var(--warning);
}

.toast.warning svg.lucide {
  color: var(--warning);
}

/* ═══════════════════════════════════════════════════
   NOTIFICATION PANEL
   ═══════════════════════════════════════════════════ */

/* Wrapper keeps the panel anchored below the bell */
.header-notification-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Badge pulse animation when there are alerts */
@keyframes badge-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.7); }
  70%  { box-shadow: 0 0 0 6px rgba(248, 81, 73, 0); }
  100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0); }
}

.header-notification .badge.pulse {
  animation: badge-pulse 1.8s ease-out infinite;
}

/* Override the old static badge background to danger red */
.header-notification .badge {
  background: #f85149;
  min-width: 14px;
  padding: 0 2px;
}

/* The floating dropdown panel */
.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: 480px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  z-index: 9000;
  overflow: hidden;
  /* Slide-in animation */
  transform-origin: top right;
  animation: notif-panel-in 0.18s ease-out;
}

@keyframes notif-panel-in {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}

.notif-panel-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-white);
}

.notif-panel-title svg.lucide {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.notif-panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.notif-panel-close:hover {
  color: var(--text-white);
  background: rgba(255,255,255,0.07);
}

.notif-panel-body {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0;
}

/* Empty state */
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.notif-empty svg.lucide {
  width: 36px;
  height: 36px;
  color: #3fb950;
  opacity: 0.75;
}

/* Individual notification alert items */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.notif-item:hover {
  background: rgba(255,255,255,0.05);
}

.notif-item-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.notif-item-icon svg.lucide {
  width: 15px;
  height: 15px;
}

/* Compromised = danger red */
.notif-item.compromised .notif-item-icon {
  background: rgba(248, 81, 73, 0.18);
  color: #f85149;
}

/* Weak = orange */
.notif-item.weak .notif-item-icon {
  background: rgba(255, 153, 0, 0.15);
  color: #ff9900;
}

/* Reused = amber/yellow */
.notif-item.reused .notif-item-icon {
  background: rgba(227, 179, 65, 0.15);
  color: #e3b341;
}

.notif-item-text {
  flex: 1;
  min-width: 0;
}

.notif-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Panel footer with action button */
.notif-panel-footer {
  border-top: 1px solid var(--border-glass);
  padding: 0.6rem 1rem;
  flex-shrink: 0;
}

.notif-run-btn {
  width: 100%;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.15s, color 0.15s;
}

.notif-run-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.notif-run-btn svg.lucide {
  width: 13px;
  height: 13px;
}

/* HIBP scanning spinner state */
.notif-run-btn.scanning {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════
   TOGGLE SWITCH (Settings)
   ═══════════════════════════════════════════════════ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-glass, rgba(255,255,255,0.12));
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent, #388bfd);
  border-color: var(--accent, #388bfd);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateY(-50%) translateX(20px);
}

/* ═══════════════════════════════════════════════════
   AUDIT LOG PANEL
   ═══════════════════════════════════════════════════ */

.audit-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.audit-controls {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.audit-filter-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.audit-chip {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
}

.audit-chip:hover {
  border-color: var(--accent-border);
  color: var(--text-white);
}

.audit-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

.audit-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.audit-log-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.audit-date-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.audit-date-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-color);
}

.audit-entry {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.audit-entry:hover {
  border-color: var(--border-color);
}

.audit-entry-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.audit-entry-icon svg {
  width: 16px;
  height: 16px;
}

.audit-entry-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.audit-entry-action {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-white);
}

.audit-entry-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-entry-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.audit-entry-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.audit-entry-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.audit-log-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 3rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.audit-log-empty svg {
  width: 2.5rem;
  height: 2.5rem;
  opacity: 0.4;
}

.audit-log-empty p {
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════
   FOLDER MORE DROPDOWN
   ═══════════════════════════════════════════════════ */
.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 500;
  display: none;
  flex-direction: column;
  padding: 0.35rem;
}

.dropdown-menu.open {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-white);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.dropdown-item:hover {
  background: rgba(255,255,255,0.06);
}

.dropdown-item svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dropdown-item-danger {
  color: var(--danger);
}

.dropdown-item-danger:hover {
  background: rgba(248,81,73,0.1);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0;
}

/* ═══════════════════════════════════════════════════
   MOVE FOLDER MODAL
   ═══════════════════════════════════════════════════ */
.move-folder-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-white);
  background: var(--bg-panel);
}

.move-folder-item:hover,
.move-folder-item.highlighted {
  border-color: var(--accent-border);
  background: rgba(56, 139, 253, 0.06);
}

.move-folder-item.selected {
  border-color: var(--accent);
  background: rgba(56, 139, 253, 0.1);
}

.move-folder-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   CONTEXT MENU
   ═══════════════════════════════════════════════════ */
.context-menu {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  width: 180px;
  padding: 0.4rem;
  list-style: none;
}

.context-menu-list {
  list-style: none;
}

.context-menu-item {
  padding: 0.65rem 0.9rem;
  font-size: 0.83rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm);
}

.context-menu-item:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.context-menu-item:hover i {
  color: var(--accent);
}

.context-menu-item i {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.context-menu-item.ctx-delete {
  color: var(--danger);
}

.context-menu-item.ctx-delete:hover {
  background: var(--danger-dim);
  color: var(--danger);
}

.context-menu-item.ctx-delete i {
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════
   REPORT PANEL
   ═══════════════════════════════════════════════════ */
.report-print-content {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.report-header-print {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.report-header-print h1 {
  font-size: 1.3rem;
  color: var(--text-white);
}

.report-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.report-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.report-card {
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.report-card h3 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.report-metric-val {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.report-metric-sub {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.report-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
}

.report-table td {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.report-section-print {
  margin-top: 1rem;
}

.report-section-print h3 {
  font-size: 0.88rem;
  color: var(--text-white);
  margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════════════ */
.breadcrumb-vault-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.breadcrumb-link {
  color: var(--accent);
  cursor: pointer;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-divider {
  color: var(--text-dim);
}

.breadcrumb-active {
  color: var(--text-white);
}

/* ═══════════════════════════════════════════════════
   PASSWORDS SPLIT LAYOUT
   ═══════════════════════════════════════════════════ */
.passwords-list-scroll {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
  margin-top: -0.5rem;
}

.passwords-list-scroll:empty {
  min-height: 80px;
}

.compact-passwords-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.passwords-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.passwords-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--accent-purple);
}

.passwords-empty-add-btn {
  margin-top: 1.25rem;
  padding: 0.6rem 1.5rem;
}

.compact-item-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.compact-item-row:hover {
  background: var(--bg-hover);
}

.compact-item-row.active {
  background: var(--accent-dim);
}

@keyframes alert-flash {
  0%   { background: rgba(248, 81, 73, 0.25); box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.5); }
  60%  { background: rgba(248, 81, 73, 0.12); box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.2); }
  100% { background: transparent; box-shadow: none; }
}

.compact-item-row.highlight-alert {
  animation: alert-flash 2s ease-out forwards;
  border-radius: var(--radius-sm, 8px);
}

.compact-item-row .card-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

.compact-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.compact-item-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-item-subtitle {
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Details in modal - kept for reuse in item-detail-modal */

.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
}

.details-header-left {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.details-avatar {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.details-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.details-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
}

.details-folder {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.details-grid {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.details-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 1rem;
}

.details-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.details-value-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 42px;
  transition: var(--transition-fast);
}

.details-value-box:hover {
  border-color: var(--accent-border);
}

.details-value-text {
  font-size: 0.88rem;
  color: var(--text-white);
  word-break: break-all;
}

.details-notes-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  font-size: 0.88rem;
  color: var(--text-white);
  white-space: pre-wrap;
  min-height: 70px;
}

.details-totp-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.details-actions-bar {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

#detail-modal-body {
  overflow-y: visible;
  padding-right: 0.25rem;
}

/* History modal styles */
.history-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
}

.history-entry-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.history-entry-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-entry-preview {
  font-size: 0.82rem;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-history-revert {
  flex-shrink: 0;
}

.history-empty {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════
   RANGE SLIDER
   ═══════════════════════════════════════════════════ */
.generator-inline-section input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  height: 20px;
}

.generator-inline-section input[type="range"]:focus {
  outline: none;
}

.generator-inline-section input[type="range"]::-webkit-slider-runnable-track {
  background: var(--border-color);
  border-radius: var(--radius-pill);
  height: 5px;
}

.generator-inline-section input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: var(--accent);
  border-radius: 50%;
  height: 16px;
  width: 16px;
  margin-top: -5.5px;
  box-shadow: 0 0 0 3px var(--accent-glow), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease;
}

.generator-inline-section input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.generator-inline-section input[type="range"]::-moz-range-track {
  background: var(--border-color);
  border-radius: var(--radius-pill);
  height: 5px;
}

.generator-inline-section input[type="range"]::-moz-range-thumb {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  height: 16px;
  width: 16px;
  box-shadow: 0 0 0 3px var(--accent-glow);
  transition: transform 0.12s ease;
}

.generator-inline-section input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.generator-inline-section label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.generator-inline-section label input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .app-container-vault {
    height: auto;
    overflow: auto;
  }

  .workspace-wrapper {
    flex-direction: column;
  }

  .sidebar-vault {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1rem;
  }

  .main-content-vault {
    padding: 1.25rem 1rem;
    gap: 1.25rem;
  }

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

  .import-export-block {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════ */
@media print {

  body,
  .app-container-vault,
  .main-content-vault,
  .workspace-wrapper {
    background: #fff !important;
    color: #000 !important;
    display: block !important;
    height: auto !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .top-bar-vault,
  .sidebar-vault,
  #btn-print-reports,
  .inline-add-card,
  .action-bar-vault,
  .toast-container,
  .modal-overlay,
  .panel-view:not(#reports-panel) {
    display: none !important;
  }

  #reports-panel {
    display: block !important;
  }

  .report-print-content,
  .report-card {
    background: #fff !important;
    border: 1px solid #d0d7de !important;
    box-shadow: none !important;
    color: #000 !important;
    padding: 1.5rem !important;
  }

  .report-header-print h1 {
    color: #000 !important;
  }

  .report-metric-val {
    color: #1a6eff !important;
  }

  .folders-table-vault th,
  .folders-table-vault td,
  .report-table td {
    border-bottom: 1px solid #d0d7de !important;
    color: #000 !important;
  }
}

/* ==========================================
   UPDATE ALERTS & NOTIFICATIONS
   ========================================== */
.update-banner {
  background: var(--accent-dim);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--accent-border);
  padding: 0.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-white, #ffffff);
  z-index: 102;
  flex-shrink: 0;
  animation: slideDown 0.3s ease-out;
}

.update-banner-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.update-banner-icon {
  color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.update-link {
  color: var(--accent-green, #00e676);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.5rem;
  transition: opacity 0.2s ease;
}

.update-link:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.update-banner-actions {
  display: flex;
  align-items: center;
}

.btn-dismiss {
  background: none;
  border: none;
  color: var(--text-muted, #8b949e);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.btn-dismiss:hover {
  color: var(--text-white, #ffffff);
}

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

/* Billing & Account Settings Upgrade UI */
.plan-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.plan-badge.free {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.plan-badge.premium {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: #000000;
  border: 1px solid #eab308;
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
}

.settings-card.premium-status {
  border: 1px solid rgba(234, 179, 8, 0.3);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.plan-benefit-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-white);
  margin-bottom: 0.5rem;
}

.plan-benefit-item i {
  color: #eab308;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.plan-box-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 576px) {
  .plan-box-container {
    grid-template-columns: 1fr;
  }
}