/* ════════════════════════════════════════════════════════════════════
   TrackMail — Dante Store Official Theme (Matched with dantee.store)
   ════════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #09090b;
  --bg2: #121217;
  --bg3: #181820;
  --surface: #121217;
  --surface-h: #181820;
  --border: #22222a;
  --border-h: rgba(251, 191, 36, 0.4);

  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-300: #fde68a;
  --accent-dim: rgba(251, 191, 36, 0.10);
  --accent-glow: rgba(245, 158, 11, 0.35);

  --gold-gradient: linear-gradient(135deg, #fff2b2 0%, #f5c042 50%, #c68915 100%);
  --card-gradient: linear-gradient(180deg, rgba(20, 27, 43, 0.85) 0%, rgba(12, 17, 27, 0.96) 100%);

  --green: #34d399;
  --red: #f43f5e;
  --yellow: #fbbf24;

  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #71717a;

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 12px;

  --sidebar-w: 280px;
  --topbar-h: 64px;

  --shadow: 0 8px 30px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 24px rgba(245, 158, 11, 0.15);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --trans: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
  height: 100%;
  font-family: var(--font);
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at top, rgba(20, 27, 43, 0.9) 0%, #09090b 65%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: #f59e0b;
  color: #09090b;
}

/* ── GlassCanvas Ambient Glow (Identical to dantee.store) ─────────── */
.ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-top-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 850px;
  height: 360px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06) 0%, transparent 100%);
  filter: blur(64px);
}

.ambient-bottom-vignette {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 240px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

/* ── Crisp Minimal Scrollbar (from dantee.store globals.css) ──────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #09090b;
}

::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* ── Layout ───────────────────────────────────────────────────────── */
body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--card-gradient);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width var(--trans), min-width var(--trans), transform var(--trans);
  position: relative;
  z-index: 20;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
}

/* Sidebar Header & DanteStore BrandLogo */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
}

.brand-logo-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.brand-logo-wrap:hover .brand-logo-icon {
  transform: scale(1.06);
}

.brand-logo-icon svg {
  width: 100%;
  height: 100%;
}

.brand-logo-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 2px;
}

.brand-gold {
  color: #fbbf24;
}

.brand-subtitle {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a1a1aa;
  font-weight: 700;
  margin-top: 3px;
}

/* Sidebar section label */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-2);
  padding: 20px 16px 8px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Account list */
.account-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
}

.account-item-empty {
  color: var(--text-3);
  font-size: 12.5px;
  padding: 16px 8px;
  text-align: center;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--trans);
  position: relative;
  white-space: nowrap;
  margin-bottom: 3px;
  color: #d4d4d8;
}

.account-item:hover {
  background: var(--surface-h);
  border-color: var(--border);
  color: #ffffff;
}

.account-item.active {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.40);
  color: #fde68a;
  font-weight: 600;
}

.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  flex-shrink: 0;
}

.account-item.active .account-avatar {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #09090b;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}

.account-info {
  flex: 1;
  overflow: hidden;
}

.account-email {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.account-del {
  opacity: 0;
  transition: opacity var(--trans);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.account-del:hover {
  color: var(--red);
  background: rgba(244, 63, 94, 0.12);
}

.account-item:hover .account-del {
  opacity: 1;
}

/* Add Account Button */
.btn-add-account {
  margin: 10px 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px dashed rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
  color: #e4e4e7;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--trans);
  flex-shrink: 0;
  font-family: var(--font);
}

.btn-add-account:hover {
  background: rgba(251, 191, 36, 0.10);
  color: #fbbf24;
  border-color: #fbbf24;
}

/* Bottom-left Sponsor Link (Dante Store -> t.me/dantexdbot) */
.sidebar-footer {
  padding: 12px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.45);
}

.sponsor-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--trans);
  overflow: hidden;
}

.sponsor-link:hover {
  border-color: rgba(251, 191, 36, 0.5);
  background: var(--surface-h);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

.sponsor-logo-svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.sponsor-link:hover .sponsor-logo-svg {
  transform: scale(1.08);
}

.sponsor-logo-svg svg {
  width: 100%;
  height: 100%;
}

.sponsor-text-col {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
  overflow: hidden;
}

.sponsor-powered {
  font-size: 9px;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.sponsor-brand {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-top: 1px;
}

/* Main Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
  z-index: 10;
}

/* Topbar (Matches Navbar of dantee.store) */
.topbar {
  height: var(--topbar-h);
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.topbar-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Connection info badge */
.connection-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.connection-info.success {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(16, 185, 129, 0.10);
  color: #34d399;
}

.connection-info.error {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.10);
  color: #fb7185;
}

.connection-info.loading {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-3);
}

.conn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.connection-info.loading .conn-dot {
  animation: connPulse 1s ease-in-out infinite;
}

@keyframes connPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-h);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}

/* Content Area */
.content-area {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Welcome Screen */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px;
  text-align: center;
  color: var(--text-2);
}

.welcome-icon {
  width: 96px;
  height: 96px;
  background: var(--card-gradient);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.14);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.welcome-screen h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.welcome-screen p {
  font-size: 13.5px;
  color: var(--text-2);
  max-width: 340px;
  line-height: 1.65;
}

/* Email List Panel */
.email-list-panel {
  width: 400px;
  min-width: 320px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(18, 18, 23, 0.75);
}

.email-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.email-item {
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all var(--trans);
  position: relative;
  background: var(--surface);
}

.email-item:hover {
  background: var(--surface-h);
  border-color: #3f3f46;
}

.email-item.active {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.45);
}

.email-item.unread .email-item-subject {
  font-weight: 700;
  color: #ffffff;
}

.email-item-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.email-item-sender {
  font-size: 13px;
  font-weight: 600;
  color: #f4f4f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.email-item-date {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}

.email-item-subject {
  font-size: 12.5px;
  color: #d4d4d8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.email-item-preview {
  font-size: 11.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-dot {
  width: 7px;
  height: 7px;
  background: #fbbf24;
  border-radius: 50%;
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.email-item-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.badge-attach {
  font-size: 10px;
  color: var(--text-3);
}

.otp-inline-badge {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

/* Loading skeleton */
.skeleton-item {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line {
  height: 10px;
  background: var(--surface-h);
  border-radius: 99px;
  margin-bottom: 8px;
}

.skeleton-line:last-child {
  width: 60%;
  margin-bottom: 0;
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Pagination */
.pagination {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-page {
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  transition: all var(--trans);
}

.btn-page:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

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

.page-info {
  font-size: 12px;
  color: var(--text-3);
}

/* Email Detail Panel */
.email-detail-panel {
  flex: 1;
  overflow-y: auto;
  background: transparent;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.detail-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-3);
  padding: 40px;
}

.detail-placeholder svg {
  opacity: 0.4;
  color: #fbbf24;
}

.detail-placeholder p {
  font-size: 13.5px;
}

#detailContent {
  padding: 28px 32px 48px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
}

.back-btn {
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: all var(--trans);
  margin-bottom: 20px;
  display: none;
}

.back-btn:hover {
  background: var(--surface-h);
  color: #fbbf24;
}

.detail-subject {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 18px;
}

.detail-meta {
  background: var(--card-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.meta-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  min-width: 44px;
}

.meta-value {
  font-size: 13px;
  color: #e4e4e7;
  word-break: break-all;
}

.detail-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 200px;
  overflow-x: auto;
  max-width: 100%;
}

.detail-body img {
  max-width: 100%;
  height: auto;
}

.detail-body table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* ── Buttons (Matched with dantee.store bg-amber-400 text-zinc-950) ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #fbbf24;
  color: #09090b;
  border: 1px solid #fbbf24;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--trans);
  box-shadow: 0 2px 10px rgba(251, 191, 36, 0.2);
}

.btn-primary:hover {
  background: #fcd34d;
  border-color: #fcd34d;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #d4d4d8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  transition: all var(--trans);
}

.btn-secondary:hover {
  background: var(--surface-h);
  color: #ffffff;
  border-color: #3f3f46;
}

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

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

.modal {
  background: var(--card-gradient);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-lg);
  width: 500px;
  max-width: 95vw;
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
  position: relative;
  overflow: hidden;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.modal form {
  padding: 18px 22px;
}

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

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #d4d4d8;
  margin-bottom: 6px;
}

.required {
  color: #fbbf24;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: #09090b;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  resize: vertical;
  transition: border-color var(--trans);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #fbbf24;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-3);
}

/* Bulk-import specific */
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.label-row label {
  margin-bottom: 0;
}

.bulk-counter {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 10px;
}

.bulk-counter.has-items {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}

.format-hint {
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #09090b;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-2);
}

.format-hint code {
  font-family: var(--font-mono);
  color: #fbbf24;
  font-size: 11px;
}

#inp_bulk {
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  line-height: 1.6;
}

.bulk-preview {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 120px;
  overflow-y: auto;
}

.preview-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.preview-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
}

.preview-row.ok {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.10);
}

.preview-row.ok svg {
  stroke: #10b981;
  flex-shrink: 0;
}

.preview-row.err {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.10);
}

.preview-row.err svg {
  stroke: #f43f5e;
  flex-shrink: 0;
}

.preview-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.modal-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(244, 63, 94, 0.10);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-sm);
  color: #fda4af;
  font-size: 12.5px;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(9, 9, 11, 0.25);
  border-top-color: #09090b;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

.toast.error {
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

/* ── Loader ───────────────────────────────────────────────────────── */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
}

.loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--card-gradient);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  box-shadow: var(--shadow);
}

.loader-ring {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(251, 191, 36, 0.2);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-box span {
  font-size: 13px;
  color: var(--text-2);
}

/* ── Error / Empty state ──────────────────────────────────────────── */
.error-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-3);
  text-align: center;
  flex: 1;
}

.error-state {
  color: #fda4af;
}

.error-state svg {
  opacity: 0.5;
}

.error-state p,
.empty-state p {
  font-size: 13px;
  max-width: 280px;
  line-height: 1.6;
}

/* ── Sidebar toggle button ────────────────────────────────────────── */
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  transition: all var(--trans);
}

.sidebar-toggle:hover {
  color: #ffffff;
  background: var(--surface-h);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .email-list-panel {
    width: 100%;
    border-right: none;
  }

  .email-detail-panel {
    position: fixed;
    inset: 0;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 50;
  }

  .email-detail-panel.mobile-open {
    transform: translateX(0);
  }

  .back-btn {
    display: flex !important;
  }

  .sidebar-toggle {
    display: none;
  }
}

@media (min-width: 901px) {
  .sidebar:not(.collapsed)+.main-wrapper #mobileSidebarToggle {
    display: none;
  }

  .back-btn {
    display: none !important;
  }
}

.spin-once {
  animation: spin 0.6s ease;
}

.source-badge {
  display: none !important;
}

/* ── Folder Dropdown ──────────────────────────────────────────────── */
.cyber-dropdown {
  position: relative;
}

.cyber-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #fde68a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
}

.cyber-dropdown-btn:hover,
.cyber-dropdown-btn.open {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.10);
}

.cyber-dropdown-btn i {
  font-size: 15px;
  color: #fbbf24;
}

.cyber-caret {
  font-size: 11px !important;
  opacity: 0.7;
  transition: transform var(--trans);
}

.cyber-dropdown-btn.open .cyber-caret {
  transform: rotate(180deg);
}

.cyber-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
  padding: 4px;
  animation: slideUp 0.15s ease;
}

.cyber-dropdown-menu.show {
  display: block;
}

.cyber-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #d4d4d8;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--trans);
}

.cyber-dropdown-item i {
  font-size: 15px;
  color: #fbbf24;
}

.cyber-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.cyber-dropdown-item.active {
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  font-weight: 600;
}
