/* ==========================================================================
   DESIGN SYSTEM - VARIABLES & TOKENS
   ========================================================================== */
:root {
  /* Color Palette */
  --bg-main: #09090c;
  --bg-card: rgba(18, 18, 24, 0.45);
  --bg-sidebar: #0e0e13;
  --bg-hover: rgba(255, 255, 255, 0.05);
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(99, 102, 241, 0.2);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Accent Curated Gradients */
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #a855f7; /* Purple */
  --accent-glow: linear-gradient(135deg, #6366f1, #a855f7);
  
  --bg-green: rgba(34, 197, 94, 0.1);
  --text-green: #4ade80;
  --border-green: rgba(34, 197, 94, 0.2);
  
  --bg-yellow: rgba(234, 179, 8, 0.1);
  --text-yellow: #facc15;
  --border-yellow: rgba(234, 179, 8, 0.2);
  
  --bg-red: rgba(239, 68, 68, 0.1);
  --text-red: #fca5a5;
  --border-red: rgba(239, 68, 68, 0.25);
  
  /* Structural Tokens */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s ease;
  
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
}

/* ==========================================================================
   RESET & FOUNDATION
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   GLOBAL DESIGN UTILITIES
   ========================================================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.text-secondary {
  color: var(--text-secondary);
}

.small {
  font-size: 0.85rem;
}

.margin-top {
  margin-top: 1rem;
}

.margin-bottom {
  margin-bottom: 1rem;
}

.hidden {
  display: none !important;
}

.flex-center-vertical {
  display: flex;
  align-items: center;
}

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

/* Badge States */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge.active {
  background: var(--bg-green);
  color: var(--text-green);
  border: 1px solid var(--border-green);
}

.badge.inactive {
  background: var(--bg-yellow);
  color: var(--text-yellow);
  border: 1px solid var(--border-yellow);
}

/* ==========================================================================
   ANIMATIONS & TRANSITIONS
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.15); }
  50% { box-shadow: 0 0 25px rgba(99, 102, 241, 0.35); }
}

.container-fade {
  animation: fadeIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

.large-spinner {
  display: block;
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
}

/* ==========================================================================
   INPUTS & FORM LAYOUTS
   ========================================================================== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1.25rem;
  width: 100%;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-group label i {
  width: 15px;
  height: 15px;
}

.input-group input, 
.input-group textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.95rem;
  transition: var(--transition-fast);
  outline: none;
}

.input-group input:focus, 
.input-group textarea:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px var(--border-glow);
}

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

.input-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==========================================================================
   BUTTONS SYSTEM
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  outline: none;
}

.btn-primary {
  background: var(--accent-glow);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-accent {
  background: linear-gradient(135deg, #a855f7, #d946ef);
  color: #fff;
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.btn-secondary-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

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

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--border-red);
  color: var(--text-red);
}

.btn-danger-outline:hover {
  background: var(--bg-red);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

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

/* ==========================================================================
   VIEW 1: AUTH / LOCK SCREEN
   ========================================================================== */
.auth-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 45%),
              radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.08), transparent 40%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  background: rgba(13, 13, 18, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-orb {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  animation: pulse-glow 3s infinite;
}

.orb-icon {
  width: 30px;
  height: 30px;
  color: #fff;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.auth-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-footer p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.auth-footer i {
  width: 14px;
  height: 14px;
}

/* custom 2FA digits */
.mfa-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.mfa-inputs {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.mfa-digit {
  width: 50px;
  height: 55px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  outline: none;
  transition: var(--transition-fast);
}

.mfa-digit:focus {
  border-color: var(--accent-secondary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* ==========================================================================
   VIEW 2: MAIN WORKSPACE LAYOUT
   ========================================================================== */
.main-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  flex-shrink: 0;
}

.sidebar-header {
  margin-bottom: 2.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-orb {
  width: 32px;
  height: 32px;
  background: var(--accent-glow);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon {
  width: 16px;
  height: 16px;
  color: #fff;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

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

.nav-item i {
  width: 18px;
  height: 18px;
}

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

.nav-item.active {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-primary);
  border-left: 3px solid var(--accent-primary);
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
  padding-left: 11px;
}

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

.btn-lock:hover {
  color: var(--text-yellow);
}

.btn-logout:hover {
  color: var(--text-red);
}

/* Content Area */
.content-area {
  flex-grow: 1;
  padding: 2.5rem;
  background: radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.04), transparent 45%);
  overflow-y: auto;
  max-height: 100vh;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.25rem;
}

.content-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.content-header p {
  font-size: 0.9rem;
  margin-top: 2px;
}

.panel {
  animation: fadeIn 0.4s ease forwards;
}

/* ==========================================================================
   PANEL A: DASHBOARD
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon i {
  width: 20px;
  height: 20px;
}

.bg-indigo { background: rgba(99, 102, 241, 0.1); color: #818cf8; }
.bg-green { background: var(--bg-green); color: var(--text-green); }
.bg-yellow { background: var(--bg-yellow); color: var(--text-yellow); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 2px;
}

/* Controls Bar */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.75rem;
}

.search-box {
  position: relative;
  flex-grow: 1;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.9rem;
  padding: 8px 12px 8px 40px;
}

.filters-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filters-group {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.filter-tab {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-icon i {
  width: 60px;
  height: 60px;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Emails Cards Layout */
.emails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.email-card {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.email-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.email-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.email-card-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  word-break: break-all;
  padding-right: 1rem;
}

.email-address {
  font-size: 0.9rem;
  color: var(--accent-primary);
  font-weight: 500;
  margin-bottom: 0.75rem;
  word-break: break-all;
}

.email-card-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ==========================================================================
   PANEL B: API KEYS
   ========================================================================== */
.keys-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 800px;
}

.keys-creation-card {
  padding: 1.75rem 2rem;
}

.keys-creation-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-form {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.key-form .input-group {
  margin-bottom: 0;
}

.keys-list-card {
  padding: 1.75rem 2rem;
}

.keys-list-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.keys-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.01);
}

.key-item-info h4 {
  font-weight: 600;
  font-size: 0.95rem;
}

.key-item-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.key-item-value-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.key-badge {
  font-family: monospace;
  font-size: 0.85rem;
  background: var(--bg-hover);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ==========================================================================
   DRAWER / SLIDE PANEL SYSTEM
   ========================================================================== */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  visibility: hidden;
  transition: visibility 0.3s;
}

.drawer.active {
  visibility: visible;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.drawer.active .drawer-overlay {
  opacity: 1;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 460px;
  height: 100%;
  border-radius: 0;
  border-left: 1px solid var(--border-color);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
}

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

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

.drawer-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 50%;
}

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

.drawer-body {
  padding: 2rem;
  overflow-y: auto;
  flex-grow: 1;
}

.detail-avatar {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-avatar i {
  width: 24px;
  height: 24px;
}

.detail-title-group {
  margin-left: 1rem;
  flex-grow: 1;
  overflow: hidden;
}

.detail-email {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  word-break: break-all;
  margin-bottom: 4px;
}

.detail-form .drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.nuke-section h5 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-red);
  font-weight: 700;
}

/* ==========================================================================
   MODAL DIALOG POPUP SYSTEM
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  padding: 1.5rem;
}

.modal.active {
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s;
}

.modal.active .modal-overlay {
  opacity: 1;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}

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

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.75rem;
}

.generated-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0 1.5rem;
}

#generated-email {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-green);
  word-break: break-all;
  padding-right: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* ==========================================================================
   TOASTS SYSTEM
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: rgba(18, 18, 24, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  animation: fadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
  min-width: 250px;
  max-width: 380px;
}

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

.toast.success i {
  color: var(--text-green);
}

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

.toast.error i {
  color: var(--text-red);
}

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

.toast.info i {
  color: var(--accent-primary);
}

.toast i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast-message {
  flex-grow: 1;
}

/* ==========================================================================
   RESPONSIVE DESIGN ADAPTABILITY
   ========================================================================== */
@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .sidebar-header {
    margin-bottom: 0;
  }
  
  .sidebar-nav {
    flex-direction: row;
    margin-left: 2rem;
    gap: 4px;
  }
  
  .sidebar-footer {
    flex-direction: row;
    border-top: none;
    padding-top: 0;
  }
  
  .content-area {
    padding: 1.5rem;
  }
  
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .key-form {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   BATCH OPERATIONS STYLING
   ========================================================================== */
.email-card-checkbox-container {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
}

.alias-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-primary);
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
  transition: var(--transition-fast);
}

.alias-checkbox:hover {
  transform: scale(1.1);
}

/* Adjust card header spacing to avoid overlaying badge or label with checkbox */
.email-card {
  padding-right: 3rem !important; /* Leave space for the checkbox on the top right */
}

/* Batch Actions Bar style */
.batch-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  margin-bottom: 1.75rem;
  background: rgba(99, 102, 241, 0.08) !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
  animation: fadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.batch-info {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

#batch-selected-count {
  color: var(--text-green);
  font-size: 1.1rem;
  font-weight: 700;
  margin-right: 2px;
}

.batch-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  border-radius: 6px !important;
}

/* Tabs inside Modal */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.modal-tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

