/* ============================================
   TempMail — Dark Elegant Indigo Design
   Premium glassmorphism UI with SVG icons
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Indigo Palette */
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-300: #a5b4fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --indigo-900: #312e81;

  /* Backgrounds */
  --bg-base: #06070e;
  --bg-surface: #0c0e1a;
  --bg-elevated: #111428;
  --bg-glass: rgba(12, 14, 26, 0.72);
  --bg-glass-hover: rgba(18, 21, 42, 0.82);
  --bg-card: rgba(17, 20, 40, 0.55);
  --bg-card-hover: rgba(22, 26, 52, 0.7);
  --bg-input: rgba(15, 18, 35, 0.6);

  /* Primary (Indigo) */
  --primary: var(--indigo-500);
  --primary-hover: var(--indigo-400);
  --primary-glow: rgba(99, 102, 241, 0.25);
  --primary-subtle: rgba(99, 102, 241, 0.08);
  --primary-muted: rgba(99, 102, 241, 0.15);

  /* Accents */
  --accent-success: #34d399;
  --accent-success-bg: rgba(52, 211, 153, 0.1);
  --accent-danger: #f87171;
  --accent-danger-bg: rgba(248, 113, 113, 0.1);
  --accent-warning: #fbbf24;
  --accent-cyan: #22d3ee;

  /* Text */
  --text-primary: #e8eaf6;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-bright: #f8fafc;
  --text-inverse: #0f172a;

  /* Borders */
  --border: rgba(99, 102, 241, 0.1);
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-hover: rgba(99, 102, 241, 0.25);
  --border-active: rgba(99, 102, 241, 0.4);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px var(--primary-glow);
  --shadow-glow-lg: 0 0 48px var(--primary-glow);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration: 250ms;
  --duration-slow: 400ms;
  --transition: all var(--duration) var(--ease-out);
  --transition-fast: all var(--duration-fast) var(--ease-out);

  /* Layout */
  --sidebar-width: 360px;
  --header-height: 64px;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Animated Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 85% 75%, rgba(99, 102, 241, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 800px 300px at 50% 0%, rgba(67, 56, 202, 0.08) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  animation: ambientShift 12s ease-in-out infinite alternate;
}

@keyframes ambientShift {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 0.9;
  }

  100% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* ── Layout ── */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo .logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--indigo-600), var(--indigo-400));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.header-logo .logo-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.15) 50%, transparent 60%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {

  0%,
  100% {
    transform: translateX(-100%) rotate(25deg);
  }

  50% {
    transform: translateX(100%) rotate(25deg);
  }
}

.header-logo h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-bright) 0%, var(--indigo-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-success);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
  animation: statusPulse 2.5s ease-in-out infinite;
}

@keyframes statusPulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
  }

  50% {
    opacity: 0.5;
    box-shadow: 0 0 4px rgba(52, 211, 153, 0.2);
  }
}

/* ══════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════ */
.main {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  flex: 1;
  overflow: hidden;
}

/* ══════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════ */
.sidebar {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* ── Sidebar Tabs ── */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.2px;
}

.sidebar-tab:hover {
  color: var(--text-secondary);
  background: var(--primary-subtle);
}

.sidebar-tab.active {
  color: var(--indigo-300);
  border-bottom-color: var(--indigo-500);
  background: var(--primary-subtle);
}

.sidebar-tab svg {
  flex-shrink: 0;
}

/* ── Sidebar Content ── */
.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-section-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent);
  opacity: 0;
  transition: var(--transition-fast);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--indigo-600), var(--indigo-500));
  color: var(--text-bright);
  box-shadow: var(--shadow-glow);
  font-weight: 600;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-400));
  box-shadow: var(--shadow-glow-lg);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-danger {
  background: var(--accent-danger-bg);
  color: var(--accent-danger);
  border: 1px solid rgba(248, 113, 113, 0.15);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.3);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px;
}

.btn-ghost:hover {
  background: var(--primary-subtle);
  color: var(--indigo-300);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* ── Generate/Add Section ── */
.generate-section {
  display: flex;
  gap: 8px;
}

.generate-section select,
.domain-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
}

.generate-section select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.domain-input {
  font-family: var(--font-mono);
  cursor: text;
}

.generate-section select:hover,
.domain-input:hover {
  border-color: var(--border-hover);
}

.generate-section select:focus,
.domain-input:focus {
  border-color: var(--border-active);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.generate-section select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.domain-input::placeholder {
  color: var(--text-muted);
}

/* ── Address List ── */
.address-list,
.domain-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.address-list::-webkit-scrollbar,
.domain-list::-webkit-scrollbar {
  width: 3px;
}

.address-list::-webkit-scrollbar-track,
.domain-list::-webkit-scrollbar-track {
  background: transparent;
}

.address-list::-webkit-scrollbar-thumb,
.domain-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.address-item,
.domain-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 3px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
}

.address-item:hover,
.domain-item:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

.address-item.active {
  background: var(--primary-subtle);
  border-color: var(--border-hover);
}

.address-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.address-item .address-icon,
.domain-item .domain-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--indigo-700), var(--indigo-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.address-item .address-info,
.domain-item .domain-info {
  flex: 1;
  min-width: 0;
}

.address-item .address-email {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  letter-spacing: -0.3px;
}

.address-item .address-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.address-item .badge {
  font-size: 0.65rem;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-unread {
  background: linear-gradient(135deg, var(--indigo-600), var(--indigo-500));
  color: var(--text-bright);
  box-shadow: 0 0 8px var(--primary-glow);
}

.badge-count {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.address-item .address-actions,
.domain-item .domain-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: var(--transition-fast);
}

.address-item:hover .address-actions,
.domain-item:hover .domain-actions {
  opacity: 1;
}

.address-actions .btn-icon,
.domain-actions .btn-icon {
  width: 28px;
  height: 28px;
  font-size: 12px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.address-actions .btn-icon:hover {
  background: var(--accent-danger-bg);
  color: var(--accent-danger);
}

.domain-actions .btn-icon.btn-toggle:hover {
  background: var(--primary-subtle);
  color: var(--indigo-300);
}

.domain-actions .btn-icon.btn-delete:hover {
  background: var(--accent-danger-bg);
  color: var(--accent-danger);
}

/* ── Domain Item Specifics ── */
.domain-item .domain-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.3px;
}

.domain-item .domain-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 3px;
}

.domain-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.domain-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.domain-nameservers {
  font-size: 0.65rem;
  color: var(--indigo-300);
  padding: 4px 8px;
  background: var(--primary-subtle);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  line-height: 1.5;
  font-family: var(--font-mono);
  letter-spacing: -0.2px;
}

/* ══════════════════════════════════════
   CONTENT AREA
   ══════════════════════════════════════ */
.content {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
  background: var(--bg-base);
}

/* ── Inbox Header ── */
.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.inbox-header h2 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.inbox-header .inbox-count {
  font-size: 0.7rem;
  padding: 2px 10px;
  background: var(--primary-muted);
  border-radius: var(--radius-full);
  color: var(--indigo-300);
  font-weight: 600;
}

.inbox-actions {
  display: flex;
  gap: 6px;
}

.inbox-header .back-btn {
  display: none;
}

/* ── Email List ── */
.email-list {
  flex: 1;
  overflow-y: auto;
}

.email-list::-webkit-scrollbar {
  width: 3px;
}

.email-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.email-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.email-item:hover {
  background: var(--bg-card);
}

.email-item.unread {
  background: var(--primary-subtle);
}

.email-item.unread::after {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.email-item.unread .email-subject {
  color: var(--text-bright);
  font-weight: 600;
}

.email-item.unread .email-sender {
  font-weight: 600;
  color: var(--text-bright);
}

.email-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--indigo-700), var(--indigo-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.email-body {
  flex: 1;
  min-width: 0;
}

.email-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
}

.email-sender {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

.email-subject {
  font-size: 0.84rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.email-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-item .attachment-badge {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   EMAIL DETAIL
   ══════════════════════════════════════ */
.email-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeSlideUp var(--duration) var(--ease-out);
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.email-detail-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.email-detail-subject {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.4;
}

.email-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.email-detail-from {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.email-detail-from .avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--indigo-700), var(--indigo-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  text-transform: uppercase;
}

.from-info .from-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.from-info .from-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.email-detail-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.email-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.email-detail-body::-webkit-scrollbar {
  width: 3px;
}

.email-detail-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.email-detail-body iframe {
  width: 100%;
  border: none;
  min-height: 400px;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.email-text-body {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-primary);
}

/* ── Attachments ── */
.email-attachments {
  padding: 16px 28px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  flex-shrink: 0;
}

.email-attachments h4 {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}

.attachment-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.attachment-item .att-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.attachment-item .att-name {
  font-size: 0.8rem;
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-item .att-size {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  flex: 1;
}

.empty-state .empty-icon {
  margin-bottom: 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.7;
}

/* ══════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--duration-slow) var(--ease-spring);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.3);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.3);
}

.toast.info {
  border-color: rgba(99, 102, 241, 0.3);
}

.toast-exit {
  animation: toastOut var(--duration) var(--ease-out) forwards;
}

.toast .toast-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: var(--accent-success);
}

.toast.error .toast-icon {
  color: var(--accent-danger);
}

.toast.info .toast-icon {
  color: var(--indigo-400);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
}

/* ── Spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* ── Refresh rotating ── */
@keyframes rotating {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.rotating svg {
  animation: rotating 0.6s linear infinite;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
.mobile-toggle {
  display: none;
}

@media (max-width: 768px) {
  .main {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 360px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease-out);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-toggle {
    display: flex;
  }

  .header-status {
    display: none;
  }

  .inbox-header .back-btn {
    display: flex;
  }

  .email-item {
    padding: 14px 16px;
  }

  .inbox-header {
    padding: 0 16px;
  }

  .email-detail-header {
    padding: 16px;
  }

  .email-detail-body {
    padding: 16px;
  }

  .email-attachments {
    padding: 14px 16px;
  }
}

/* ── Focus Styles ── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus:not(:focus-visible) {
  outline: none;
}

/* ── Selection ── */
::selection {
  background: var(--primary-muted);
  color: var(--text-bright);
}

/* ── Scrollbar (global) ── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ── Domain Detail Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 200ms var(--ease-out);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 250ms var(--ease-spring);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px) scale(0.97);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  font-family: var(--font-mono);
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--accent-danger-bg);
  color: var(--accent-danger);
}

.modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.detail-label {
  color: var(--text-secondary);
}

.detail-value {
  color: var(--text-primary);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.detail-value.ok {
  color: var(--accent-success);
}

.detail-value.warn {
  color: var(--accent-warning);
}

.detail-value.fail {
  color: var(--accent-danger);
}

.detail-value.info {
  color: var(--accent-cyan);
}

.detail-dns-records {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dns-record {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.dns-record-type {
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 28px;
}

.dns-record-valid {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
}

.dns-record-valid.valid {
  color: var(--accent-success);
}

.dns-record-valid.invalid {
  color: var(--accent-danger);
}

.modal-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
}

.modal-actions .btn {
  flex: 1;
}

.btn-copy {
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: var(--transition-fast);
}

.btn-copy svg {
  width: 12px;
  height: 12px;
}

.btn-copy:hover {
  background: var(--primary-subtle);
  color: var(--indigo-300);
  border-color: var(--border-hover);
}

.detail-value-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-section-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2px;
}

.dns-record-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Domain Status Badges ── */
.domain-badge-active,
.domain-badge-inactive,
.domain-badge-dns-ok,
.domain-badge-dns-fail,
.domain-badge-dns-pending,
.domain-badge-mg-ok,
.domain-badge-mg-pending,
.domain-badge-mg-fail {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  height: 18px;
}

.domain-badge-active {
  background: var(--accent-success-bg);
  color: var(--accent-success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.domain-badge-inactive {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.domain-badge-dns-ok {
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.domain-badge-dns-pending {
  background: rgba(251, 191, 36, 0.1);
  color: var(--accent-warning);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.domain-badge-dns-fail {
  background: var(--accent-danger-bg);
  color: var(--accent-danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.domain-badge-mg-ok {
  background: var(--accent-success-bg);
  color: var(--accent-success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.domain-badge-mg-pending {
  background: rgba(251, 191, 36, 0.1);
  color: var(--accent-warning);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.domain-badge-mg-fail {
  background: var(--accent-danger-bg);
  color: var(--accent-danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.domain-error {
  font-size: 0.7rem;
  color: var(--accent-danger);
  margin-top: 4px;
  padding: 4px 8px;
  background: var(--accent-danger-bg);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(248, 113, 113, 0.15);
  line-height: 1.4;
}

.btn-status {
  color: var(--accent-cyan);
}

.btn-status:hover {
  background: rgba(34, 211, 238, 0.1);
}

.btn-status.rotating svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ── Provider Settings Card ── */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.provider-current {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--indigo-400);
  background: var(--primary-subtle);
  padding: 3px 10px;
  border-radius: 20px;
}

.provider-toggle {
  display: flex;
  gap: 8px;
}

.provider-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.provider-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.provider-btn.active {
  background: var(--primary-muted);
  color: var(--indigo-300);
  border-color: var(--indigo-500);
  box-shadow: 0 0 12px var(--primary-glow);
}

.settings-hint {
  margin-top: 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Domain Loading State ── */
.domain-loading {
  opacity: 0.8;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

.domain-loading-text {
  font-size: 0.72rem;
  color: var(--indigo-400);
  font-weight: 500;
}

.spinner-small {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--indigo-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ── CF Routing Badge ── */
.domain-badge-cf {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

/* ──────────────────────────────────────
   AUTH SCREEN
   ────────────────────────────────────── */

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow:
    0 0 40px rgba(99, 102, 241, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.4);
  animation: authFadeIn 0.5s ease-out;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.auth-logo .logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--indigo-600), var(--indigo-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.auth-field {
  margin-bottom: 1.25rem;
}

.auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.auth-field input:focus {
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.auth-field input::placeholder {
  color: var(--text-muted);
}

.auth-error {
  color: var(--accent-danger);
  font-size: 0.82rem;
  min-height: 1.2em;
  margin-bottom: 0.75rem;
  text-align: center;
}

.auth-submit {
  width: 100%;
  padding: 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo-600), var(--indigo-500));
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.auth-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-400));
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}