@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* --- CSS Variables & Design System Tokens --- */
:root {
  --bg-primary: #050807;
  --bg-surface: #0b1310;
  --bg-surface-elevated: #101d17;
  --border-subtle: #162720;
  --border-accent: #10b981;
  
  --color-primary: #10b981;
  --color-primary-hover: #34d399;
  --color-text: #e1e7e4;
  --color-muted: #6a8075;
  --color-danger: #f87171;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--color-text);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: #050807;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(5, 150, 105, 0.04) 0%, transparent 40%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #060a08;
}
::-webkit-scrollbar-thumb {
  background: #182c23;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

/* Utility Classes */
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

/* Grid and Flex utilities */
.grid { display: grid; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.hidden { display: none !important; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

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

@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:w-auto { width: auto; }
  .sm\:max-w-md { max-width: 28rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
  .sm\:p-8 { padding: 2rem; }
  .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
  .sm\:inline { display: inline; }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:inline { display: inline; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-16 { height: 4rem; }
.min-h-screen { min-height: 100vh; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.pointer-events-none { pointer-events: none; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.max-h-48 { max-height: 12rem; }

/* Borders & Rounding */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-l { border-left-width: 1px; }
.border-dashed { border-style: dashed; }

.divide-y > * + * { border-top-width: 1px; }
.divide-\[\#14231d\] > * + * { border-color: #14231d; }

/* Backdrop Blur & Shadows */
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(8px); }
.backdrop-blur-xl { backdrop-filter: blur(24px); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6); }

/* Typography */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

.text-\[10px\] { font-size: 10px; line-height: 14px; }
.text-\[11px\] { font-size: 11px; line-height: 15px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

/* Colors */
.bg-\[\#040705\]\/60 { background-color: rgba(4, 7, 5, 0.6); }
.bg-\[\#060a08\] { background-color: #060a08; }
.bg-\[\#060a08\]\/80 { background-color: rgba(6, 10, 8, 0.8); }
.bg-\[\#09100d\]\/70 { background-color: rgba(9, 16, 13, 0.7); }
.bg-\[\#0b1310\] { background-color: #0b1310; }
.bg-\[\#0b1310\]\/50 { background-color: rgba(11, 19, 16, 0.5); }
.bg-\[\#0b1310\]\/80 { background-color: rgba(11, 19, 16, 0.8); }
.bg-\[\#0b1310\]\/90 { background-color: rgba(11, 19, 16, 0.9); }
.bg-\[\#0b1310\]\/95 { background-color: rgba(11, 19, 16, 0.95); }
.bg-\[\#0e1914\] { background-color: #0e1914; }
.bg-\[\#101c17\] { background-color: #101c17; }
.bg-\[\#101d17\] { background-color: #101d17; }
.bg-\[\#12221b\] { background-color: #12221b; }
.bg-\[\#14231d\] { background-color: #14231d; }
.bg-white { background-color: #ffffff; }
.bg-black { background-color: #000000; }
.bg-black\/80 { background-color: rgba(0, 0, 0, 0.8); }

.bg-emerald-400 { background-color: #34d399; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.2); }
.bg-emerald-950\/50 { background-color: rgba(6, 78, 59, 0.5); }
.bg-emerald-950\/60 { background-color: rgba(6, 78, 59, 0.6); }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1); }
.bg-red-950\/50 { background-color: rgba(69, 10, 10, 0.5); }
.bg-red-950\/60 { background-color: rgba(69, 10, 10, 0.6); }
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-purple-500\/10 { background-color: rgba(168, 85, 247, 0.1); }

.border-\[\#13221c\] { border-color: #13221c; }
.border-\[\#14231d\] { border-color: #14231d; }
.border-\[\#162720\] { border-color: #162720; }
.border-\[\#182921\] { border-color: #182921; }
.border-\[\#192b23\] { border-color: #192b23; }
.border-\[\#1a2d24\] { border-color: #1a2d24; }
.border-\[\#1c2e26\] { border-color: #1c2e26; }
.border-\[\#1e342a\] { border-color: #1e342a; }
.border-emerald-500 { border-color: #10b981; }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.2); }
.border-emerald-500\/30 { border-color: rgba(16, 185, 129, 0.3); }
.border-emerald-500\/40 { border-color: rgba(16, 185, 129, 0.4); }
.border-emerald-500\/50 { border-color: rgba(16, 185, 129, 0.5); }
.border-red-500\/20 { border-color: rgba(239, 68, 68, 0.2); }
.border-red-500\/30 { border-color: rgba(239, 68, 68, 0.3); }
.border-amber-500\/20 { border-color: rgba(245, 158, 11, 0.2); }
.border-purple-500\/30 { border-color: rgba(168, 85, 247, 0.3); }

.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-\[\#3b4b44\] { color: #3b4b44; }
.text-\[\#41544a\] { color: #41544a; }
.text-\[\#52665c\] { color: #52665c; }
.text-\[\#6a8075\] { color: #6a8075; }
.text-\[\#7b9186\] { color: #7b9186; }
.text-\[\#8ca197\] { color: #8ca197; }
.text-emerald-300 { color: #6ee7b7; }
.text-emerald-400 { color: #34d399; }
.text-emerald-500 { color: #10b981; }
.text-teal-400 { color: #2dd4bf; }
.text-amber-400 { color: #fbbf24; }
.text-purple-400 { color: #c084fc; }
.text-red-300 { color: #fca5a5; }
.text-red-400 { color: #f87171; }
.text-red-500 { color: #ef4444; }

/* Interactive Hover States */
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-emerald-300:hover { color: #6ee7b7; }
.hover\:text-emerald-400:hover { color: #34d399; }
.hover\:text-red-300:hover { color: #fca5a5; }
.hover\:text-red-400:hover { color: #f87171; }
.hover\:text-amber-300:hover { color: #fcd34d; }

.hover\:bg-\[\#0e1914\]:hover { background-color: #0e1914; }
.hover\:bg-\[\#0f1d17\]:hover { background-color: #0f1d17; }
.hover\:bg-\[\#101d17\]:hover { background-color: #101d17; }
.hover\:bg-\[\#12221b\]:hover { background-color: #12221b; }
.hover\:bg-\[\#14231c\]:hover { background-color: #14231c; }
.hover\:bg-\[\#162720\]:hover { background-color: #162720; }
.hover\:bg-\[\#182c23\]:hover { background-color: #182c23; }
.hover\:bg-emerald-300:hover { background-color: #6ee7b7; }
.hover\:bg-emerald-400:hover { background-color: #34d399; }
.hover\:bg-emerald-500\/20:hover { background-color: rgba(16, 185, 129, 0.2); }
.hover\:bg-purple-500\/20:hover { background-color: rgba(168, 85, 247, 0.2); }
.hover\:bg-red-950\/20:hover { background-color: rgba(69, 10, 10, 0.2); }
.hover\:bg-red-950\/30:hover { background-color: rgba(69, 10, 10, 0.3); }
.hover\:bg-amber-400:hover { background-color: #fbbf24; }

.hover\:border-emerald-500\/40:hover { border-color: rgba(16, 185, 129, 0.4); }
.hover\:border-emerald-500\/50:hover { border-color: rgba(16, 185, 129, 0.5); }

.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:scale-\[1\.01\]:hover { transform: scale(1.01); }
.active\:scale-95:active { transform: scale(0.95); }
.active\:scale-\[0\.98\]:active { transform: scale(0.98); }
.active\:scale-\[0\.99\]:active { transform: scale(0.99); }

/* Transitions */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-1000 { transition-duration: 1000ms; }
.ease-linear { transition-timing-function: linear; }

/* Pulse Animation */
@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}
.animate-pulse {
  animation: pulseGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Form Input Focus Defaults */
input, select, textarea {
  color: #ffffff;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: #10b981 !important;
}

/* Button & interactive states */
button, a {
  cursor: pointer;
  text-decoration: none;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Native Cyber Toast Notification Engine (5s Duration) --- */
@keyframes toastSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
    max-height: 120px;
    margin-bottom: 0.625rem;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

.toast-item {
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.toast-item.toast-hiding {
  animation: toastSlideOut 0.35s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  animation: toastProgress 5s linear forwards;
}

/* Custom Modal Animation */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#confirm-modal:not(.hidden) > div,
#secret-modal:not(.hidden) > div,
#create-user-modal:not(.hidden) > div,
#edit-user-modal:not(.hidden) > div,
#reset-password-modal:not(.hidden) > div,
#import-modal:not(.hidden) > div,
#encrypted-export-modal:not(.hidden) > div,
#encrypted-import-modal:not(.hidden) > div,
#camera-qr-modal:not(.hidden) > div,
#twofa-setup-modal:not(.hidden) > div,
#twofa-disable-modal:not(.hidden) > div,
#command-palette-modal:not(.hidden) > div,
#qr-modal:not(.hidden) > div {
  animation: modalFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scanner HUD & Laser Line Animation */
@keyframes laserSweep {
  0% { top: 10%; opacity: 0.8; }
  50% { top: 90%; opacity: 1; }
  100% { top: 10%; opacity: 0.8; }
}

.scanner-laser {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10b981, #34d399, #10b981, transparent);
  box-shadow: 0 0 12px #10b981, 0 0 24px #10b981;
  animation: laserSweep 2s ease-in-out infinite;
}

/* Keyboard Shortcut Badge */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #9ab3a5;
  background-color: #12221b;
  border: 1px solid #1f382c;
  border-radius: 0.375rem;
  box-shadow: 0 1px 0 1px #09130f;
}

/* Category Filter Chips */
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid #162720;
  background-color: #0b1310;
  color: #7b9186;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.category-chip:hover {
  border-color: #274538;
  color: #e1e7e4;
  background-color: #101d17;
}

.category-chip.active {
  border-color: rgba(16, 185, 129, 0.4);
  background-color: rgba(16, 185, 129, 0.12);
  color: #34d399;
  font-weight: 600;
}

/* Favorite Star Animation */
.btn-star-fav {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease;
}
.btn-star-fav:active {
  transform: scale(1.3);
}
.btn-star-fav.is-favorite {
  color: #fbbf24 !important;
  fill: #fbbf24;
}

/* Command Palette Item Active State */
.palette-item {
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.palette-item.active-item {
  background-color: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

/* --- Native Cyber Toast Notification Engine Styles --- */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: 24rem;
  width: calc(100vw - 2.5rem);
  pointer-events: none;
}

.toast-item {
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
}

.toast-item.toast-hiding {
  animation: toastSlideOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  opacity: 0;
  pointer-events: none;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2.5px;
  width: 100%;
  animation: toastProgress 5s linear forwards;
  transform-origin: left;
}

.toast-item:hover .toast-progress {
  animation-play-state: paused;
}

@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(100%) scale(0.92);
  }
}

@keyframes toastProgress {
  0% {
    width: 100%;
  }
  100% {
    width: 0%;
  }
}


