/* ================================================
   BANDANA SIMPLELOGIN — "Terminal Noir"
   A cyberpunk mission-control for email privacy.
   ================================================ */

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

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes glitch-1 {
  0%, 100% { clip-path: inset(0 0 96% 0); transform: translate(0); }
  20% { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 1px); }
  40% { clip-path: inset(60% 0 10% 0); transform: translate(3px, -1px); }
  60% { clip-path: inset(40% 0 30% 0); transform: translate(-2px); }
  80% { clip-path: inset(80% 0 5% 0); transform: translate(1px, 2px); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideIn {
  from { transform: translateX(80px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 20px 4px var(--accent-glow); }
}

@keyframes bar-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* === Theme Tokens === */
:root {
  --bg-void: #06070b;
  --bg-primary: #0a0c12;
  --bg-secondary: #0e1018;
  --bg-card: #12141e;
  --bg-card-hover: #181b28;
  --bg-input: #161926;
  --bg-sidebar: #08090e;
  --border: #1e2235;
  --border-bright: #2a3050;
  --text-primary: #d4dae8;
  --text-secondary: #7e879e;
  --text-muted: #4a5068;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-dim: #1a8a7c;
  --accent-glow: rgba(45, 212, 191, 0.15);
  --accent-glow-strong: rgba(45, 212, 191, 0.3);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.1);
  --red: #fb7185;
  --red-bg: rgba(251, 113, 133, 0.1);
  --orange: #fbbf24;
  --orange-bg: rgba(251, 191, 36, 0.1);
  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, 0.1);
  --purple: #a78bfa;
  --purple-bg: rgba(167, 139, 250, 0.1);
  --cyan: #22d3ee;
  --cyan-bg: rgba(34, 211, 238, 0.1);
  --radius: 4px;
  --radius-sm: 2px;
  --radius-lg: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.7);
  --transition: 0.15s ease;
  --font: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-display: 'IBM Plex Mono', 'Menlo', monospace;
  --font-mono: 'IBM Plex Mono', 'Menlo', monospace;
  --dot-grid: radial-gradient(circle, var(--border) 1px, transparent 1px);
}

[data-theme="light"] {
  --bg-void: #f0f1f6;
  --bg-primary: #f5f6fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fe;
  --bg-input: #eef0f8;
  --bg-sidebar: #f8f9fe;
  --border: #d8dce8;
  --border-bright: #c0c8dc;
  --text-primary: #141828;
  --text-secondary: #5a6178;
  --text-muted: #8e95a8;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-dim: #99f6e4;
  --accent-glow: rgba(13, 148, 136, 0.12);
  --accent-glow-strong: rgba(13, 148, 136, 0.2);
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
  --dot-grid: radial-gradient(circle, var(--border) 0.5px, transparent 0.5px);
}

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dot-grid texture on main content */
.content-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--dot-grid);
  background-size: 24px 24px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.content-body { position: relative; }
.content-body > * { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* === Layout === */
.app-shell { display: flex; min-height: 100vh; }

/* === Sidebar === */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-dim), transparent 40%, transparent 60%, var(--accent-dim));
  opacity: 0.3;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  position: relative;
}

.sidebar-logo:hover .logo-icon { animation: pulse-glow 1.5s ease infinite; }

.sidebar-logo .logo-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--bg-void);
  letter-spacing: 0;
  transition: box-shadow 0.3s;
}

.sidebar-nav { flex: 1; padding: 16px 8px; overflow-y: auto; }

.nav-section { margin-bottom: 16px; }

.nav-section-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  padding: 4px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  border: 1px solid transparent;
}

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

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent-dim);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 18px;
  background: var(--accent);
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  background: var(--bg-input);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid var(--border);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.user-info:hover { background: var(--bg-card-hover); }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--bg-void);
  flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}

/* === Main Content === */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-primary);
}

.content-header {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
}

.content-header h1 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.content-header h1::before {
  content: '//';
  color: var(--accent-dim);
  margin-right: 8px;
  font-weight: 400;
}

.content-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.content-body {
  padding: 24px 28px;
  max-width: 1400px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-transform: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-void);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow-strong);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 5px 8px;
  border: none;
}
.btn-ghost:hover { color: var(--accent); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(251,113,133,0.3);
}
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }

.btn-success { background: var(--green); color: var(--bg-void); }
.btn-success:hover { opacity: 0.9; }

.btn-sm { padding: 4px 8px; font-size: 0.72rem; }
.btn svg { width: 14px; height: 14px; }

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  position: relative;
}

/* Diagonal accent stripe on cards */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  transition: background var(--transition);
}

.card:hover::before { background: var(--accent-dim); }

.card-hover:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 4px 24px var(--accent-glow);
}

/* === Stat Cards === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stats-grid .card { animation: fadeUp 0.5s ease backwards; }
.stats-grid .card:nth-child(1) { animation-delay: 0s; }
.stats-grid .card:nth-child(2) { animation-delay: 0.08s; }
.stats-grid .card:nth-child(3) { animation-delay: 0.16s; }
.stats-grid .card:nth-child(4) { animation-delay: 0.24s; }

.stat-card { padding: 18px 16px; overflow: hidden; }

.stat-card.stat-aliases::before { background: var(--accent); }
.stat-card.stat-forwards::before { background: var(--green); }
.stat-card.stat-replies::before { background: var(--blue); }
.stat-card.stat-blocks::before { background: var(--red); }

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

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

.stat-aliases .stat-icon { background: var(--accent-glow); color: var(--accent); border-color: var(--accent-dim); }
.stat-forwards .stat-icon { background: var(--green-bg); color: var(--green); border-color: rgba(34,197,94,0.2); }
.stat-replies .stat-icon { background: var(--blue-bg); color: var(--blue); border-color: rgba(96,165,250,0.2); }
.stat-blocks .stat-icon { background: var(--red-bg); color: var(--red); border-color: rgba(251,113,133,0.2); }

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-display);
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 5px;
  border-radius: 2px;
  font-family: var(--font-mono);
}

.stat-trend.up { background: var(--green-bg); color: var(--green); }
.stat-trend.down { background: var(--red-bg); color: var(--red); }

/* === Charts === */
.charts-grid {
  display: grid;
  grid-template-columns: 5fr 3fr;
  gap: 12px;
  margin-bottom: 20px;
}

.charts-grid .card { animation: fadeUp 0.5s ease backwards; animation-delay: 0.3s; }
.charts-grid .card:nth-child(2) { animation-delay: 0.38s; }

.chart-card { padding: 18px; }

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.chart-card-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chart-period-select {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  padding: 2px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.chart-period-btn {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  transition: all var(--transition);
}

.chart-period-btn.active {
  background: var(--accent);
  color: var(--bg-void);
}

.chart-container {
  position: relative;
  height: 220px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* === Donut Stats === */
.donut-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.donut-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.donut-stat-item:hover { border-color: var(--border-bright); }

.donut-stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 500;
}

.donut-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
}

.donut-stat-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* === Alias List === */
.alias-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

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

.search-box input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color var(--transition);
}

.search-box input::placeholder { color: var(--text-muted); font-family: var(--font); }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }

.filter-select {
  padding: 7px 28px 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l4 5 4-5' fill='%234a5068'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-select:focus { border-color: var(--accent); }

.alias-list { display: flex; flex-direction: column; gap: 4px; }

.alias-card {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: default;
}

.alias-card:hover { background: var(--bg-card-hover); }
.alias-card:hover::before { background: var(--accent); }

.alias-toggle {
  position: relative;
  width: 36px;
  height: 18px;
  flex-shrink: 0;
}

.alias-toggle input { display: none; }

.alias-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border-radius: 2px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.alias-toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 1px;
  background: var(--text-muted);
  transition: all var(--transition);
}

.alias-toggle input:checked + .alias-toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.alias-toggle input:checked + .alias-toggle-slider::before {
  transform: translateX(18px);
  background: var(--bg-void);
}

.alias-info { flex: 1; min-width: 0; }

.alias-email {
  font-weight: 500;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  cursor: pointer;
  transition: color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alias-email:hover { color: var(--accent); }

.alias-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.alias-meta-item {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.alias-meta-item svg { width: 11px; height: 11px; }

.alias-note {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
  opacity: 0.8;
}

.alias-stats {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}

.alias-stat {
  text-align: center;
  min-width: 40px;
}

.alias-stat-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.alias-stat-label {
  font-family: var(--font-display);
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.alias-stat.forwards .alias-stat-value { color: var(--green); }
.alias-stat.blocks .alias-stat-value { color: var(--red); }
.alias-stat.replies .alias-stat-value { color: var(--blue); }

.alias-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.alias-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.alias-action-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border);
}
.alias-action-btn.delete:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(251,113,133,0.3);
}

.alias-action-btn svg { width: 14px; height: 14px; }

.alias-card.disabled { opacity: 0.35; }
.alias-card.disabled .alias-email { color: var(--text-muted); text-decoration: line-through; }

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.page-btn {
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-display);
  transition: all var(--transition);
}

.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.page-info {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 8px;
}

/* === Login === */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-void);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Scan-line effect on login */
.login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(45, 212, 191, 0.015) 2px,
    rgba(45, 212, 191, 0.015) 4px
  );
  pointer-events: none;
  animation: scanline 8s linear infinite;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px;
  animation: fadeUp 0.6s ease;
  position: relative;
  z-index: 1;
}

.login-card::before { background: var(--accent) !important; }

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--bg-void);
  margin-bottom: 14px;
  box-shadow: 0 0 40px var(--accent-glow-strong);
}

.login-logo h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.login-logo p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.login-btn {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-error {
  background: var(--red-bg);
  color: var(--red);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  margin-bottom: 14px;
  display: none;
  border: 1px solid rgba(251,113,133,0.2);
  font-family: var(--font-mono);
}

/* === Resource Cards (Mailbox / Domain) === */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.resource-card { padding: 18px; }

.resource-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.resource-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.resource-badge {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid;
}

.resource-badge.verified { background: var(--green-bg); color: var(--green); border-color: rgba(34,197,94,0.2); }
.resource-badge.unverified { background: var(--orange-bg); color: var(--orange); border-color: rgba(251,191,36,0.2); }
.resource-badge.default { background: var(--accent-glow); color: var(--accent); border-color: var(--accent-dim); }

.resource-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.resource-meta-item {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.resource-meta-item strong { color: var(--text-secondary); }

/* === Theme Toggle === */
.theme-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 15px; height: 15px; }

/* === Toast === */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-display);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,7,11,0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.modal-close:hover { border-color: var(--red); color: var(--red); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* === Loading === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
}

/* === Insights === */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.insight-card { padding: 18px; }

.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.insight-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
}

.top-aliases-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-alias-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-input);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.top-alias-item:hover { border-color: var(--border-bright); }

.top-alias-rank {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.top-alias-email {
  flex: 1;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-alias-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  opacity: 0.3;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.empty-state p { font-size: 0.78rem; }

/* === Responsive === */
.mobile-menu-toggle {
  display: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
}

.mobile-menu-toggle svg { width: 16px; height: 16px; }

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .insights-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .mobile-menu-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-body { padding: 14px; }
  .content-header { padding: 12px 14px; }
  .alias-card { flex-wrap: wrap; }
  .alias-stats { width: 100%; justify-content: flex-start; margin-top: 6px; }
  .alias-actions { margin-top: 6px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* === View transitions === */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === Alias Detail Panel === */
.alias-detail-panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 150;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.2s ease;
}

.alias-detail-panel .panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alias-detail-panel .panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.panel-section { margin-bottom: 18px; }

.panel-section-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.activity-icon {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon svg { width: 12px; height: 12px; }

.activity-icon.forward { background: var(--green-bg); color: var(--green); }
.activity-icon.reply { background: var(--blue-bg); color: var(--blue); }
.activity-icon.block { background: var(--red-bg); color: var(--red); }
.activity-icon.bounced { background: var(--orange-bg); color: var(--orange); }

.activity-details { flex: 1; min-width: 0; }
.activity-email {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
