/* ExchangeAnalyzer — Sleek & Clean Modern Enterprise Design System */

:root {
  color-scheme: light;
  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --page-plane: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --gridline: #e2e8f0;
  --baseline: #cbd5e1;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;

  --series-1: #2563eb; /* blue */
  --series-2: #ea580c; /* orange */
  --series-3: #0d9488; /* teal */
  --series-4: #d97706; /* amber */
  --series-5: #db2777; /* pink */
  --series-6: #16a34a; /* green */
  --series-7: #7c3aed; /* violet */
  --series-8: #dc2626; /* red */

  --status-good: #16a34a;
  --status-warning: #d97706;
  --status-serious: #ea580c;
  --status-critical: #dc2626;

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-tab: 0 4px 12px rgba(37, 99, 235, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-1: #0f172a;
    --surface-2: #1e293b;
    --surface-3: #334155;
    --page-plane: #020617;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --gridline: #1e293b;
    --baseline: #334155;
    --border: #1e293b;
    --border-subtle: #0f172a;

    --series-1: #3b82f6;
    --series-2: #f97316;
    --series-3: #14b8a6;
    --series-4: #f59e0b;
    --series-5: #ec4899;
    --series-6: #22c55e;
    --series-7: #8b5cf6;
    --series-8: #ef4444;

    --status-good: #22c55e;
    --status-warning: #f59e0b;
    --status-serious: #f97316;
    --status-critical: #ef4444;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 8px 16px -4px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--series-1); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ---- Topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  color: var(--text-primary);
}
.brand .mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--series-1), var(--series-7));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}
.topbar .sub { color: var(--text-muted); font-size: 12.5px; font-weight: 500; }

/* ---- Hero ---- */
.hero {
  padding: 36px 0 16px;
  text-align: left;
}
.hero h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
.hero p {
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

/* ---- Aesthetic Tab Navigation ---- */
.tabs-wrapper {
  margin-top: 20px;
}
.nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--surface-3);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 960px) {
  .nav-tabs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .nav-tabs { grid-template-columns: 1fr; }
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all .2s ease;
  color: var(--text-secondary);
}
.nav-tab .tab-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all .2s ease;
}
.nav-tab .tab-text {
  display: flex;
  flex-direction: column;
}
.nav-tab .tab-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.nav-tab .tab-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.2;
}

.nav-tab:hover {
  background: color-mix(in srgb, var(--surface-1) 60%, transparent);
}
.nav-tab:hover .tab-icon {
  color: var(--series-1);
  border-color: var(--series-1);
  transform: translateY(-1px);
}

.nav-tab.active {
  background: var(--surface-1);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}
.nav-tab.active .tab-icon {
  background: color-mix(in srgb, var(--series-1) 12%, var(--surface-1));
  color: var(--series-1);
  border-color: color-mix(in srgb, var(--series-1) 30%, transparent);
}
.nav-tab.active .tab-title {
  color: var(--series-1);
}

.tab-content {
  display: none;
  margin-top: 14px;
}
.tab-content.active {
  display: block;
}

/* ---- Cards & Upload Box ---- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.upload-card {
  box-shadow: var(--shadow-card);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 2px dashed var(--baseline);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--surface-2);
  transition: all .2s ease;
  box-sizing: border-box;
}
.dropzone:hover {
  border-color: var(--series-1);
  background: color-mix(in srgb, var(--series-1) 4%, var(--surface-2));
}
.dropzone.dragover {
  border-color: var(--series-1);
  background: color-mix(in srgb, var(--series-1) 10%, var(--surface-2));
}
.dropzone .dropzone-icon {
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, color .2s ease;
}
.dropzone:hover .dropzone-icon {
  color: var(--series-1);
  transform: translateY(-2px);
}
.dropzone .dropzone-title {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.dropzone .dropzone-title strong {
  color: var(--text-primary);
  font-weight: 700;
}
.dropzone .dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.dropzone input[type=file] { display: none; }

#filelistSmtp, #filelistMsgtrk, #filelistHttpproxy, #filelistIis, #filelist {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filerow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}
.filerow .name { color: var(--text-primary); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--series-1);
  color: #fff;
  transition: all .15s ease;
}
.btn:hover:not(:disabled) {
  opacity: .92;
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(0);
}
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.btn.secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn.secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--baseline);
}

.card-actions, .form-row {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.notes {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 12.5px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.notes summary {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 600;
  user-select: none;
}
.notes code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid var(--border);
  font-family: Consolas, monospace;
}
.notes pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  font-size: 12px;
  margin: 10px 0;
  font-family: Consolas, monospace;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.alert-danger { background: color-mix(in srgb, var(--status-critical) 10%, var(--surface-1)); color: var(--status-critical); border-color: color-mix(in srgb, var(--status-critical) 30%, transparent); }
.alert-warning { background: color-mix(in srgb, var(--status-warning) 12%, var(--surface-1)); color: #8a5800; border-color: color-mix(in srgb, var(--status-warning) 30%, transparent); }
.alert-warning-list { max-height: 160px; overflow-y: auto; }

/* ---- Report Page Sections & KPIs ---- */
.report-header {
  padding: 28px 0 12px;
}
.report-header h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; color: var(--text-primary); }
.report-header .meta { color: var(--text-secondary); font-size: 13px; }

/* Distinct Section Cards */
.section-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-top: 24px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-header-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--series-1) 12%, var(--surface-1));
  color: var(--series-1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.section-header-text {
  flex: 1;
}
.section-header h2 {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}
.section-header .desc {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 2px 0 0;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}
.kpi {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.kpi .label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--text-primary); letter-spacing: -0.02em; }
.kpi .sub { color: var(--text-secondary); font-size: 11.5px; margin-top: 2px; }

/* Charts */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
.chart-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) {
  .chart-grid, .chart-grid.two { grid-template-columns: 1fr; }
}
.chart-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  min-height: 260px;
  box-sizing: border-box;
}
.chart-card h3 {
  font-size: 13px;
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-weight: 700;
}
.chart-card canvas {
  width: 100% !important;
  max-height: 240px;
}

/* Data Tables */
.table-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.table-toolbar input[type=search] {
  flex: 1;
  min-width: 240px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color .15s ease;
}
.table-toolbar input[type=search]:focus {
  border-color: var(--series-1);
}
.table-toolbar .count { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.table-toolbar a.btn { padding: 6px 12px; font-size: 12.5px; }

/* Investigation Filter Preset Bar */
.investigation-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.investigation-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 4px;
}
.btn-filter-preset {
  background: var(--surface-1);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-filter-preset:hover {
  background: var(--surface-3);
  color: var(--text-primary);
  border-color: var(--baseline);
}
.btn-filter-preset.active {
  background: var(--series-1);
  color: #ffffff;
  border-color: var(--series-1);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
table.data td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
table.data tbody tr:last-child td {
  border-bottom: none;
}
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.mono, table.data code {
  font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}
.muted { color: var(--text-muted); }

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-good { background: color-mix(in srgb, var(--status-good) 16%, var(--surface-1)); color: var(--status-good); }
.badge-critical { background: color-mix(in srgb, var(--status-critical) 14%, var(--surface-1)); color: var(--status-critical); }
.badge-mixed { background: color-mix(in srgb, var(--series-4) 20%, var(--surface-1)); color: #8a6400; }
.badge-neutral { background: color-mix(in srgb, var(--series-1) 12%, var(--surface-1)); color: var(--series-1); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}
.pagination button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.pagination button:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--baseline);
}
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination span { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

footer.app-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 40px 0 20px;
}

/* Upload Progress Modal */
.upload-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.upload-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.upload-modal {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  padding: 24px;
  box-sizing: border-box;
}
.upload-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.upload-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--series-1) 12%, var(--surface-1));
  color: var(--series-1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.upload-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.upload-modal-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.upload-progress-track {
  height: 10px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 8px;
  position: relative;
}
.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--series-1), var(--series-7));
  border-radius: 999px;
  transition: width 0.15s ease;
}
.upload-progress-bar.indeterminate {
  width: 100%;
  background: linear-gradient(90deg, var(--series-1), var(--series-7), var(--series-1));
  background-size: 200% 100%;
  animation: progressPulse 1.5s infinite linear;
}
@keyframes progressPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.upload-modal-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}
.upload-modal-detail {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
  min-height: 16px;
  word-break: break-all;
}
.upload-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Diagnostic & Troubleshooting Advisor */
.icon-diag {
  background: color-mix(in srgb, var(--series-7) 12%, var(--surface-1)) !important;
  color: var(--series-7) !important;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.diag-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.diag-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.diag-card.critical { border-left: 4px solid var(--status-critical); }
.diag-card.warning { border-left: 4px solid var(--status-warning); }
.diag-card.good { border-left: 4px solid var(--status-good); }
.diag-card.info { border-left: 4px solid var(--series-1); }

.diag-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.diag-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.diag-badge.critical { background: color-mix(in srgb, var(--status-critical) 14%, var(--surface-1)); color: var(--status-critical); }
.diag-badge.warning { background: color-mix(in srgb, var(--status-warning) 14%, var(--surface-1)); color: #925800; }
.diag-badge.good { background: color-mix(in srgb, var(--status-good) 14%, var(--surface-1)); color: var(--status-good); }
.diag-badge.info { background: color-mix(in srgb, var(--series-1) 14%, var(--surface-1)); color: var(--series-1); }

.diag-category {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.diag-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
  line-height: 1.35;
}
.diag-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0 0 10px;
  line-height: 1.45;
  flex: 1;
}
.diag-impact {
  font-size: 11.5px;
  color: var(--text-primary);
  background: var(--surface-2);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border-left: 3px solid var(--baseline);
}
.diag-command {
  margin-top: auto;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.diag-command code {
  color: #f1f5f9;
  font-family: Consolas, monospace;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-copy {
  background: #334155;
  color: #f8fafc;
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-copy:hover {
  background: var(--series-1);
}

/* SMTP Filter Bar and Error Details */
.filter-controls-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  background: var(--surface-2);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-select {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s ease;
}
.filter-select:focus {
  border-color: var(--series-1);
}
.smtp-err-item {
  line-height: 1.4;
}
.smtp-err-msg {
  display: inline-block;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Floating Hover Tooltip for Table Rows */
.ea-hover-tooltip {
  position: fixed;
  z-index: 99999;
  max-width: 520px;
  min-width: 300px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.22), 0 6px 12px -2px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  backdrop-filter: blur(8px);
  display: none;
}
.ea-hover-tooltip.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.ea-hover-tooltip .ea-tt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  gap: 10px;
}
.ea-hover-tooltip .ea-tt-header-error {
  background: color-mix(in srgb, var(--status-critical) 10%, var(--surface-2));
}
.ea-hover-tooltip .ea-tt-header-info {
  background: color-mix(in srgb, var(--series-1) 10%, var(--surface-2));
}
.ea-hover-tooltip .ea-tt-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: Consolas, monospace;
}
.ea-hover-tooltip .ea-tt-body {
  padding: 10px 12px;
}
.ea-hover-tooltip .ea-tt-err-row {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.ea-hover-tooltip .ea-tt-err-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.ea-hover-tooltip .ea-tt-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.ea-hover-tooltip .ea-tt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 11.5px;
}
.ea-hover-tooltip code {
  font-family: Consolas, monospace;
  font-size: 11px;
}

/* Row error accent indicator */
table.data tbody tr.has-errors {
  border-left: 3px solid var(--status-critical);
}
table.data tbody tr.has-errors:hover {
  background: color-mix(in srgb, var(--status-critical) 5%, var(--surface-2)) !important;
}

