/* ============================================================
   EnrichWork — app.css
   Theme: matches log_app dark glassmorphism design
   ============================================================ */

:root {
  /* ── Log-app colour tokens ── */
  --bg-color:        #0b0f19;
  --panel-bg:        rgba(22, 28, 45, 0.72);
  --panel-border:    rgba(255, 255, 255, 0.08);
  --text-main:       #e2e8f0;
  --text-muted:      #94a3b8;
  --accent-primary:  #E75E26;   /* orange — log_app primary */
  --accent-light:    #3987ED;   /* blue  — log_app secondary */
  --accent-glow:     rgba(57, 135, 237, 0.25);

  /* ── Structural ── */
  --radius:    8px;
  --radius-lg: 14px;
  --shadow:    0 4px 30px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 40px rgba(0, 0, 0, 0.35);

  /* ── Confidence levels (kept functional) ── */
  --conf-1: #22c55e;
  --conf-2: #84cc16;
  --conf-3: #f59e0b;
  --conf-4: #f97316;
  --conf-5: #ef4444;

  /* ── Semantic aliases (used throughout below) ── */
  --slate-900: #0b0f19;
  --slate-800: rgba(22, 28, 45, 0.72);
  --slate-700: rgba(255, 255, 255, 0.10);
  --slate-600: rgba(255, 255, 255, 0.07);
  --slate-400: #94a3b8;
  --slate-200: rgba(255, 255, 255, 0.08);
  --slate-100: rgba(255, 255, 255, 0.05);
  --slate-50:  rgba(255, 255, 255, 0.03);
  --green-500: #22c55e;
  --green-600: #16a34a;
  --amber-500: #f59e0b;
  --red-500:   #ef4444;
  --teal-500:  #14b8a6;
  --indigo-600: #3987ED;   /* remapped to log_app blue */
  --indigo-500: #5aa3f0;
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  background-color: var(--bg-color);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.12), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.12), transparent 25%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-light); text-decoration: none; }
a:hover { color: #5aa3f0; text-decoration: underline; }
code { font-family: 'Courier New', monospace; font-size: .85em;
       background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 4px;
       color: var(--accent-primary); }

/* ── Glass panel mixin ────────────────────────────────────── */
.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ── Legacy .app-header (orphan — no longer in DOM) ───────────────────────
   The platform navigation is now provided by _nav.html (.main-header,
   position: static, ~90px tall). The old .app-header fixed/sticky header
   was removed when the unified platform nav was integrated.
   These rules are kept as a zero-impact no-op for safety.
   ─────────────────────────────────────────────────────────────────────── */
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  color: white; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-icon { font-size: 1.4rem; }
.brand-name  { font-weight: 700; font-size: 1.1rem; color: white;
               background: linear-gradient(135deg, #E75E26, #f0874e);
               -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand-tag   { font-size: .75rem; color: var(--text-muted); margin-left: .25rem; }
.header-nav  { display: flex; gap: 1.5rem; align-items: center; }
.nav-link    { color: var(--text-muted); font-size: .9rem; transition: color .15s; }
.nav-link:hover { color: var(--text-main); text-decoration: none; }
.nav-link-muted { color: rgba(148, 163, 184, 0.6); }


/* ── Flash messages ───────────────────────────────────────── */
.flash-container { max-width: 1200px; margin: 1rem auto; padding: 0 1.5rem; }
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: .5rem;
         font-size: .9rem; backdrop-filter: blur(8px); }
.flash-error   { background: rgba(239, 68, 68, 0.15); color: #fca5a5;
                 border: 1px solid rgba(239, 68, 68, 0.3); }
.flash-warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d;
                 border: 1px solid rgba(245, 158, 11, 0.3); }
.flash-success { background: rgba(34, 197, 94, 0.15); color: #86efac;
                 border: 1px solid rgba(34, 197, 94, 0.3); }

/* ── Main content ─────────────────────────────────────────── */
.main-content { flex: 1; max-width: 1200px; margin: 0 auto;
                padding: 2rem 1.5rem; width: 100%; }

/* ── Footer ───────────────────────────────────────────────── */
.app-footer {
  text-align: center; padding: 1.25rem;
  font-size: .8rem; color: var(--text-muted);
  border-top: 1px solid var(--panel-border);
  background: rgba(11, 15, 25, 0.6);
}
.footer-sep { margin: 0 .5rem; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--panel-border);
}
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem;
              color: var(--text-main); }
.card-header-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: var(--radius);
  font-family: inherit; font-size: .9rem; font-weight: 500;
  cursor: pointer; border: 1px solid var(--panel-border);
  transition: all .18s; text-decoration: none; white-space: nowrap;
  background: rgba(255,255,255,0.06); color: var(--text-main);
}
.btn:hover { background: rgba(255,255,255,0.10); text-decoration: none; }
.btn-primary { background: var(--accent-primary); color: white; border-color: transparent; }
.btn-primary:hover { background: #f06d36; box-shadow: 0 0 16px rgba(231,94,38,0.4); }
.btn-ghost   { background: transparent; border: 1px solid var(--panel-border); color: var(--text-muted); }
.btn-ghost:hover { background: rgba(255,255,255,0.06); color: var(--text-main); }
.btn-warning { background: rgba(245, 158, 11, 0.85); color: white; border-color: transparent; }
.btn-green   { background: rgba(22, 163, 74, 0.85); color: white; border-color: transparent; }
.btn-green:hover { background: rgba(34, 197, 94, 0.85); }
.btn-muted   { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.btn-sm      { font-size: .8rem; padding: .35rem .8rem; }
.btn-lg      { font-size: 1rem; padding: .7rem 1.6rem; }
.btn-full    { width: 100%; justify-content: center; }
.btn-clear   { background: none; border: none; cursor: pointer;
               color: var(--text-muted); font-size: 1.1rem; padding: 0 .25rem; }

/* ── Hero ──────────────────────────────────────────────────── */
.page-hero { text-align: center; padding: 2rem 1rem 1.5rem; }
.hero-title { font-size: 2rem; font-weight: 700; color: var(--text-main);
              margin-bottom: .5rem; }
.hero-sub   { color: var(--text-muted); font-size: 1.05rem; }

/* ── Upload card ───────────────────────────────────────────── */
.upload-card { padding: 2rem; }
.drop-zone {
  border: 2px dashed rgba(255,255,255,0.15); border-radius: var(--radius-lg);
  padding: 3rem 2rem; text-align: center; cursor: pointer;
  transition: all .2s; background: rgba(255,255,255,0.03);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-primary); background: rgba(231,94,38,0.06);
}
.drop-icon   { font-size: 3rem; margin-bottom: .75rem; }
.drop-label  { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }
.drop-sub    { color: var(--text-muted); margin-top: .25rem; }
.drop-formats { font-size: .8rem; color: rgba(148,163,184,0.6); margin-top: .5rem; }
.browse-link { color: var(--accent-primary); cursor: pointer; font-weight: 500; }
.browse-link:hover { color: #f06d36; text-decoration: underline; }
.file-input-hidden { display: none; }
.file-selected { display: flex; align-items: center; gap: .75rem; margin-top: 1rem;
                 padding: .75rem 1rem; background: rgba(255,255,255,0.05);
                 border-radius: var(--radius); border: 1px solid var(--panel-border); }
.file-icon { font-size: 1.2rem; }
.btn-upload { margin-top: 1.5rem; width: 100%; justify-content: center;
              font-size: 1rem; padding: .8rem; }

/* Hints */
.upload-hints { margin-top: 2rem; border-top: 1px solid var(--panel-border); padding-top: 1.5rem; }
.hints-title  { font-size: .85rem; font-weight: 600; color: var(--text-muted);
                text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.hints-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.hint-item    { display: flex; align-items: center; gap: .5rem; font-size: .9rem;
                color: var(--text-muted); }
.hint-icon    { font-size: 1.1rem; }

/* ── Auth ─────────────────────────────────────────────────── */
.auth-wrap  { display: flex; justify-content: center; align-items: center; min-height: 60vh; }
.auth-card  { background: var(--panel-bg);
              backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
              border-radius: var(--radius-lg);
              box-shadow: var(--shadow-md); padding: 2.5rem; width: 100%; max-width: 380px;
              border: 1px solid var(--panel-border); text-align: center; }
.auth-icon  { font-size: 2.5rem; margin-bottom: 1rem; }
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem;
              color: var(--text-main); }
.auth-sub   { color: var(--text-muted); font-size: .9rem; margin-bottom: 2rem; }
.auth-form  { text-align: left; }
.form-label { display: block; font-size: .85rem; font-weight: 500;
              color: var(--text-muted); margin-bottom: .35rem; }
.form-input { display: block; width: 100%; padding: .6rem .85rem;
              border: 1px solid rgba(255,255,255,0.12);
              border-radius: var(--radius); background: rgba(255,255,255,0.06);
              color: var(--text-main);
              font-family: inherit; font-size: .95rem; outline: none;
              transition: border-color .15s; margin-bottom: 1rem; }
.form-input:focus { border-color: var(--accent-primary);
                    box-shadow: 0 0 0 3px rgba(231,94,38,0.2); }
.form-input::placeholder { color: rgba(148,163,184,0.5); }

/* ── Jobs table ───────────────────────────────────────────── */
.jobs-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.jobs-table th { background: rgba(255,255,255,0.06); color: var(--text-muted);
                 padding: .6rem .85rem; text-align: left; font-weight: 500;
                 border-bottom: 1px solid var(--panel-border); }
.jobs-table td { padding: .65rem .85rem; border-bottom: 1px solid rgba(255,255,255,0.05);
                 color: var(--text-main); }
.jobs-table tr:hover td { background: rgba(255,255,255,0.04); }
.td-filename { font-weight: 500; max-width: 300px;
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-date { color: var(--text-muted); font-size: .85rem; white-space: nowrap; }

/* ── Status badges ────────────────────────────────────────── */
.status-badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px;
                font-size: .78rem; font-weight: 600; text-transform: uppercase; }
.status-done    { background: rgba(34,197,94,0.18);  color: #86efac; }
.status-running { background: rgba(245,158,11,0.18); color: #fcd34d; }
.status-pending { background: rgba(57,135,237,0.18); color: #93c5fd; }
.status-failed  { background: rgba(239,68,68,0.18);  color: #fca5a5; }

/* ── Badges ───────────────────────────────────────────────── */
.badge        { display: inline-block; padding: .2rem .5rem; border-radius: 20px;
                font-size: .78rem; font-weight: 600; background: rgba(255,255,255,0.08);
                color: var(--text-muted); }
.badge-auto   { background: rgba(34,197,94,0.18); color: #86efac; }
.badge-manual { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ── Mapping table ────────────────────────────────────────── */
.mapping-table-wrap { overflow-x: auto; }
.mapping-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.mapping-table th { background: rgba(255,255,255,0.06); color: var(--text-muted);
                    padding: .6rem .85rem; text-align: left;
                    border-bottom: 1px solid var(--panel-border); }
.mapping-table td { padding: .6rem .85rem; border-bottom: 1px solid rgba(255,255,255,0.05);
                    vertical-align: middle; color: var(--text-main); }
.mapping-row.auto-matched { background: rgba(34,197,94,0.08); }
.col-name code { font-size: .85rem; }
.field-select { padding: .35rem .65rem; border: 1px solid rgba(255,255,255,0.12);
                border-radius: var(--radius); font-family: inherit; font-size: .88rem;
                min-width: 180px; background: rgba(255,255,255,0.06);
                color: var(--text-main); }
.field-select option { background: #1e293b; color: var(--text-main); }
.select-auto  { border-color: var(--green-500); }
.preview-val  { display: block; color: var(--text-muted); font-size: .82rem;
                max-width: 200px; overflow: hidden; text-overflow: ellipsis;
                white-space: nowrap; }

/* ── Status page ──────────────────────────────────────────── */
.status-card    { text-align: center; padding: 2.5rem; }
.status-indicator { display: flex; align-items: center; justify-content: center;
                    gap: 1rem; margin-bottom: 1.5rem; }
.status-text    { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }
.spinner        { width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.1);
                  border-top-color: var(--accent-primary); border-radius: 50%;
                  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-wrap  { margin-bottom: 1rem; }
.progress-bar-track { height: 10px; background: rgba(255,255,255,0.08);
                      border-radius: 99px; overflow: hidden; margin-bottom: .5rem; }
.progress-bar-fill  { height: 100%;
                      background: linear-gradient(90deg, var(--accent-primary), var(--accent-light));
                      border-radius: 99px; transition: width .4s ease; min-width: 0; }
.progress-labels { display: flex; justify-content: space-between; font-size: .85rem;
                   color: var(--text-muted); }
.status-notes   { color: var(--text-muted); font-size: .85rem; }
.done-buttons   { margin-top: 1rem; }
.error-card     { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); }
.error-message  { color: #fca5a5; font-size: .9rem; margin-bottom: 1rem; }

/* ── Results page ─────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between;
               margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-title  { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.page-sub    { color: var(--text-muted); font-size: .9rem; }
.dl-panel    { display: flex; flex-direction: column; gap: 0;
               background: rgba(255,255,255,0.04);
               border: 1px solid rgba(255,255,255,0.09);
               border-radius: var(--radius-lg);
               padding: .6rem .75rem; min-width: 210px; }

.dl-row      { display: flex; align-items: center; gap: .5rem; }
.dl-row-top  { justify-content: space-between; }
.dl-row-actions { gap: .4rem; padding-top: .05rem; }

.dl-label    { font-size: .72rem; font-weight: 600; color: var(--text-muted);
               text-transform: uppercase; letter-spacing: .06em; }

.dl-btn-group { display: flex; align-items: center; }
.dl-btn-group .dl-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.dl-btn-group .dl-btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }

.dl-btn      { display: inline-flex; align-items: center; gap: .35rem;
               padding: .28rem .65rem; font-size: .78rem; font-weight: 500;
               color: var(--text-main); border: 1px solid rgba(255,255,255,0.12);
               background: rgba(255,255,255,0.06); cursor: pointer;
               text-decoration: none; transition: all .15s; white-space: nowrap; }
.dl-btn:hover { background: rgba(255,255,255,0.12); color: white; text-decoration: none; }
.dl-btn svg  { opacity: .7; flex-shrink: 0; }

.dl-divider  { height: 1px; background: rgba(255,255,255,0.07); margin: .5rem 0; }

.dl-action-btn { display: inline-flex; align-items: center; justify-content: center;
                 gap: .35rem; flex: 1; padding: .32rem .6rem;
                 font-size: .78rem; font-weight: 600; border-radius: var(--radius);
                 text-decoration: none; transition: all .18s; white-space: nowrap; cursor: pointer; }

.dl-action-green { background: rgba(22,163,74,0.22); color: #4ade80;
                   border: 1px solid rgba(34,197,94,0.3); }
.dl-action-green:hover { background: rgba(22,163,74,0.38);
                          box-shadow: 0 0 12px rgba(34,197,94,0.25);
                          color: #86efac; text-decoration: none; }

.dl-action-blue { background: rgba(59,130,246,0.22); color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.35); font-weight: 500; }
.dl-action-blue:hover { background: rgba(59,130,246,0.38);
  box-shadow: 0 0 12px rgba(96,165,250,0.25); border-color: rgba(96,165,250,0.5); }

.dl-action-ghost { background: transparent; color: var(--text-muted);
                   border: 1px solid rgba(255,255,255,0.1); }
.dl-action-ghost:hover { background: rgba(255,255,255,0.06);
                          color: var(--text-main); text-decoration: none; }


.filter-bar  { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
               margin-bottom: 1rem; }
.filter-select { padding: .4rem .75rem; border: 1px solid rgba(255,255,255,0.12);
                 border-radius: var(--radius); font-family: inherit; font-size: .85rem;
                 background: rgba(255,255,255,0.06); color: var(--text-main); }
.filter-select option { background: #1e293b; }
.filter-check { font-size: .88rem; color: var(--text-main); cursor: pointer;
                display: flex; align-items: center; gap: .35rem; }

.conf-legend  { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
                margin-bottom: 1rem; font-size: .82rem; }
.legend-label { color: var(--text-muted); font-weight: 500; }
.conf-dot     { padding: .2rem .6rem; border-radius: 20px; font-weight: 600; }

/* Confidence color system */
.conf-direct    { color: #86efac; background: rgba(34,197,94,0.18); }
.conf-high      { color: #bef264; background: rgba(132,204,22,0.18); }
.conf-inferred  { color: #fcd34d; background: rgba(245,158,11,0.18); }
.conf-weak      { color: #fdba74; background: rgba(249,115,22,0.18); }
.conf-uncertain { color: #fca5a5; background: rgba(239,68,68,0.18); }
.conf-direct-row    { border-left: 3px solid var(--conf-1); }
.conf-high-row      { border-left: 3px solid var(--conf-2); }
.conf-inferred-row  { border-left: 3px solid var(--conf-3); }
.conf-weak-row      { border-left: 3px solid var(--conf-4); }
.conf-uncertain-row { border-left: 3px solid var(--conf-5); }
.conf-badge { display: inline-block; width: 22px; height: 22px; border-radius: 50%;
              text-align: center; line-height: 22px; font-size: .8rem; font-weight: 700; }

.results-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.results-table th { background: rgba(255,255,255,0.06); color: var(--text-muted);
                    padding: .6rem .75rem; text-align: left; font-weight: 500;
                    border-bottom: 1px solid var(--panel-border); }
.results-table td { padding: .55rem .75rem; border-bottom: 1px solid rgba(255,255,255,0.05);
                    max-width: 200px; overflow: hidden; text-overflow: ellipsis;
                    white-space: nowrap; color: var(--text-main); }
.results-table tr:hover td { background: rgba(255,255,255,0.04); }
.td-conf { text-align: center; }
.th-conf, .th-row, .th-expand { width: 60px; }
.email-link  { color: var(--accent-light); }
.unresolved  { color: rgba(148,163,184,0.5); }
.source-badge { font-size: .75rem; background: rgba(255,255,255,0.08); padding: .15rem .45rem;
                border-radius: 4px; color: var(--text-muted); }
.btn-expand  { background: none; border: 1px solid rgba(255,255,255,0.1);
               border-radius: 4px; padding: .15rem .5rem; cursor: pointer;
               font-size: .9rem; color: var(--text-muted); }
.btn-expand:hover { background: rgba(255,255,255,0.06); color: var(--text-main); }
.enriched-val { color: #86efac; font-weight: 500; }

/* Pagination */
.pagination  { margin-top: 1rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.pg-btn      { padding: .3rem .65rem; border: 1px solid rgba(255,255,255,0.1);
               border-radius: var(--radius);
               background: rgba(255,255,255,0.04); color: var(--text-muted);
               cursor: pointer; font-size: .85rem; }
.pg-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-main); }
.pg-active   { background: var(--accent-primary); color: white; border-color: transparent; }

/* Loading / empty states */
.loading-state { text-align: center; padding: 3rem; color: var(--text-muted);
                 display: flex; align-items: center; justify-content: center; gap: .75rem; }
.empty-state   { text-align: center; padding: 3rem; color: var(--text-muted); }

/* ── Modal ────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 200; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); }
.modal-box { position: relative;
             background: rgba(22, 28, 45, 0.95);
             backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
             border: 1px solid var(--panel-border);
             border-radius: var(--radius-lg);
             max-width: 640px; margin: 5vh auto; max-height: 90vh;
             overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal-header { display: flex; justify-content: space-between; align-items: center;
                padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--panel-border);
                position: sticky; top: 0;
                background: rgba(22, 28, 45, 0.95); }
.modal-title  { font-size: 1rem; font-weight: 600; color: var(--text-main); }
.modal-close  { background: none; border: none; font-size: 1.4rem; cursor: pointer;
                color: var(--text-muted); }
.modal-close:hover { color: var(--text-main); }
.modal-body   { padding: 1.5rem; }
.detail-sections { display: grid; gap: 1.5rem; }
.detail-section h4 { font-size: .85rem; font-weight: 600; color: var(--text-muted);
                     text-transform: uppercase; letter-spacing: .05em; margin-bottom: .75rem; }
.detail-dl    { display: grid; grid-template-columns: 140px 1fr; gap: .35rem .75rem; }
.detail-dl dt { color: var(--text-muted); font-size: .85rem; font-weight: 500;
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-dl dd { color: var(--text-main); font-size: .85rem;
                overflow-wrap: break-word; word-break: break-all; }

/* ── Error page ───────────────────────────────────────────── */
.error-page  { text-align: center; padding: 5rem 1rem; }
.error-code  { font-size: 6rem; font-weight: 700; color: rgba(255,255,255,0.1); line-height: 1; }
.error-msg   { color: var(--text-muted); margin: 1rem 0 2rem; }

/* ── Action bar ───────────────────────────────────────────── */
.action-bar  { display: flex; justify-content: space-between; align-items: center;
               margin-top: 1rem; }

/* ── Page header (sub-pages) ──────────────────────────────── */
.page-header-left { flex: 1; }
.page-header-right { flex: 0; }

/* ── Utilities ────────────────────────────────────────────── */
.hidden  { display: none !important; }
.dimmed  { opacity: .5; }
.text-muted { color: var(--text-muted); font-size: .85rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .hints-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
  .modal-box  { margin: 2vh 1rem; }
  .detail-dl  { grid-template-columns: 110px 1fr; }
}

/* ── Live Console Panel ────────────────────────────────────── */
.console-panel {
  margin-top: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 35, 55, 0.95);
  padding: .55rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  gap: 1rem;
}

.console-title {
  display: flex;
  align-items: center;
  gap: .45rem;
}

/* macOS-style traffic lights */
.console-dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #ff5f57;
  flex-shrink: 0;
}
.console-dot.is-yellow { background: #febc2e; }
.console-dot.is-green  { background: #28c840; }

.console-label {
  font-size: .8rem;
  font-weight: 600;
  color: rgba(148,163,184,.7);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-left: .25rem;
}

.console-autoscroll-label {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  color: rgba(148,163,184,.5);
  cursor: pointer;
  user-select: none;
}
.console-autoscroll-label input { accent-color: var(--accent-primary); }

.console-body {
  background: #0d1117;
  color: #c9d1d9;
  font-family: 'Courier New', 'Cascadia Code', 'Fira Mono', monospace;
  font-size: .8rem;
  line-height: 1.6;
  max-height: 340px;
  overflow-y: auto;
  padding: .5rem 0;
  scroll-behavior: smooth;
}

/* Scrollbar styling */
.console-body::-webkit-scrollbar { width: 6px; }
.console-body::-webkit-scrollbar-track { background: transparent; }
.console-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.console-line {
  display: flex;
  gap: 0;
  padding: .06rem 1rem;
  border-left: 2px solid transparent;
  transition: background .1s;
}
.console-line:hover { background: rgba(255,255,255,0.03); }

/* Level colours */
.console-info    { color: #8b949e; border-left-color: transparent; }
.console-success { color: #7ee787; border-left-color: #238636; }
.console-warn    { color: #e3b341; border-left-color: #9e6a03; }
.console-error   { color: #f85149; border-left-color: #da3633; }

.console-ts {
  color: rgba(139,148,158,0.45);
  font-size: .75em;
  flex-shrink: 0;
  width: 6em;
  padding-top: .05em;
}
.console-msg {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 768px) {
  .console-body { max-height: 220px; font-size: .75rem; }
}

/* ── Completion summary inline stats ───────────────────── */
.done-summary {
  margin: .75rem 0 1.25rem;
  padding: .75rem 1rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
}
.summary-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem .75rem;
  margin: 0;
  font-size: .88rem;
}
.summary-dl dt {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.summary-dl dd {
  color: var(--text-main);
  margin: 0;
  font-weight: 600;
}

/* ── Cancel / Abort styles ─────────────────────────────────── */
.cancel-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.btn-cancel {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: .4rem .9rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-cancel:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  color: #fee2e2;
}
.btn-cancel:disabled {
  opacity: .55;
  cursor: default;
}

.cancel-hint {
  font-size: .8rem;
  color: var(--text-muted);
  flex: 1;
}

/* Cancelled state card */
.cancelled-card {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.05);
}
.cancelled-card .card-title { color: #fbbf24; }
.cancelled-message { color: var(--text-muted); font-size: .9rem; margin: .5rem 0 1.25rem; }

/* done-buttons flex row */
.done-buttons {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Amber spinner during cancelling/stalled state */
.spinner-warn {
  border-top-color: #fbbf24 !important;
}

/* Red pulsing spinner for stuck jobs */
.spinner-error {
  border-top-color: #f87171 !important;
  animation: spin 0.8s linear infinite, pulse-error 1.5s ease-in-out infinite;
}

@keyframes pulse-error {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Telemetry / Performance Panel
   ───────────────────────────────────────────────────────────────────────── */
.telemetry-panel {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 16px;
  backdrop-filter: blur(6px);
  transition: opacity 0.3s;
}

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

.telemetry-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
}

.telemetry-bottleneck {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted, #94a3b8);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.4s, color 0.4s;
  text-transform: capitalize;
}
.telemetry-bottleneck.telem-ok   { background: rgba(16,185,129,0.18); color: #34d399; border-color: #34d39950; }
.telemetry-bottleneck.telem-warn { background: rgba(245,158,11,0.18); color: #fbbf24; border-color: #fbbf2450; }
.telemetry-bottleneck.telem-err  { background: rgba(239, 68, 68,0.18); color: #f87171; border-color: #f8717150; }

/* 5-cell stat grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.telem-cell {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.telem-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text, #f1f5f9);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.telem-label {
  font-size: 0.62rem;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Animated bar charts */
.telem-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.telem-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.telem-bar-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  width: 28px;
  flex-shrink: 0;
}

.telem-bar-track {
  flex: 1;
  height: 7px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}

.telem-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent, #6366f1);
  transition: width 0.6s ease, background 0.4s;
}

.telem-bar-val {
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted, #94a3b8);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* Provider stats table */
.telem-prov-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.71rem;
  color: var(--text-muted, #94a3b8);
}

.telem-prov-table th {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: var(--text-muted, #94a3b8);
}

.telem-prov-table td {
  padding: 3px 8px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}



/* ── KB Search Workbench ──────────────────────────────────────────────────── */

.kb-header { display: flex; align-items: flex-start; justify-content: space-between;
             flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }

.kb-stats-row { display: flex; align-items: center; gap: 0;
                background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
                border-radius: var(--radius-lg); padding: .5rem 1rem; }
.kb-stat { display: flex; flex-direction: column; align-items: center; padding: 0 1rem; }
.kb-stat-val { font-size: 1.4rem; font-weight: 700; color: var(--text-main);
               line-height: 1.2; font-variant-numeric: tabular-nums; }
.kb-stat-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase;
                 letter-spacing: .06em; }
.kb-stat-sep { width: 1px; background: rgba(255,255,255,0.08); align-self: stretch; margin: .15rem 0; }

.kb-search-card { padding: 1rem 1.25rem; margin-bottom: 1rem; }

.kb-search-bar { display: flex; align-items: center; gap: .5rem; }
.kb-search-icon { color: var(--text-muted); flex-shrink: 0; }
.kb-search-input {
  flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius); padding: .6rem 1rem; color: var(--text-main);
  font-family: inherit; font-size: .95rem; outline: none; transition: border-color .15s;
}
.kb-search-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(231,94,38,0.15); }
.kb-search-input::placeholder { color: rgba(148,163,184,0.5); }
.kb-adv-btn.active { background: rgba(231,94,38,0.15); border-color: var(--accent-primary); color: var(--text-main); }

.kb-adv-panel { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.07); }
.kb-adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .65rem .75rem;
               margin-bottom: .75rem; }
.kb-field-group { display: flex; flex-direction: column; gap: .25rem; }
.kb-field-label { font-size: .72rem; font-weight: 600; color: var(--text-muted);
                  text-transform: uppercase; letter-spacing: .06em; }
.kb-field-input { padding: .38rem .65rem; border: 1px solid rgba(255,255,255,0.12);
                  border-radius: var(--radius); background: rgba(255,255,255,0.06);
                  color: var(--text-main); font-family: inherit; font-size: .88rem; outline: none;
                  transition: border-color .15s; }
.kb-field-input:focus { border-color: var(--accent-primary); }
.kb-select option { background: #1e293b; }
.kb-field-check { justify-content: flex-end; padding-top: 1rem; }
.kb-adv-actions { display: flex; gap: .5rem; }

/* ── Results ─────────────────────────────────────────────────────────────── */
.kb-results-header { display: flex; align-items: center; justify-content: space-between;
                     margin-bottom: .75rem; }
.kb-result-count { font-size: .875rem; color: var(--text-muted); font-weight: 500; }

.kb-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.kb-table th { background: rgba(255,255,255,0.05); color: var(--text-muted); padding: .55rem .85rem;
               text-align: left; border-bottom: 1px solid var(--panel-border); font-weight: 500; }
.kb-table td { padding: .6rem .85rem; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.kb-table tr:hover td { background: rgba(255,255,255,0.03); }
.kb-name { font-weight: 500; }
.kb-email-link { color: var(--accent-primary); text-decoration: none; }
.kb-email-link:hover { text-decoration: underline; }
.kb-null { color: var(--text-muted); opacity: .4; }
.kb-td-hits { color: var(--text-muted); font-size: .82rem; text-align: center; }
.kb-row-btn { font-size: .78rem; padding: .2rem .65rem; }

/* Freshness badges */
.fresh-badge { display: inline-block; padding: .18rem .55rem; border-radius: 20px;
               font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fresh-fresh      { background: rgba(34,197,94,0.18); color: #86efac; }
.fresh-acceptable { background: rgba(234,179,8,0.18);  color: #fde047; }
.fresh-stale      { background: rgba(249,115,22,0.18); color: #fdba74; }
.fresh-expired    { background: rgba(239,68,68,0.18);  color: #fca5a5; }

/* Empty states */
.kb-empty-state { text-align: center; padding: 4rem 2rem; }
.kb-empty-icon  { font-size: 3rem; margin-bottom: .75rem; opacity: .5; }
.kb-empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text-muted); margin-bottom: .35rem; }
.kb-empty-sub   { color: var(--text-muted); opacity: .6; font-size: .9rem; }

/* ── Detail Drawer ────────────────────────────────────────────────────────── */
.kb-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45);
                     z-index: 200; backdrop-filter: blur(2px); }
.kb-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(480px, 95vw);
             background: var(--panel-bg); backdrop-filter: blur(20px);
             border-left: 1px solid rgba(255,255,255,0.1);
             box-shadow: -8px 0 32px rgba(0,0,0,.5); z-index: 210;
             display: flex; flex-direction: column; overflow: hidden;
             transform: translateX(0); transition: transform .25s cubic-bezier(.4,0,.2,1); }
.kb-drawer.hidden { transform: translateX(100%); }
.kb-drawer-header { display: flex; align-items: center; justify-content: space-between;
                    padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.08);
                    flex-shrink: 0; }
.kb-drawer-title { font-size: 1rem; font-weight: 600; color: var(--text-main); }
.kb-drawer-actions { display: flex; align-items: center; gap: .5rem; }
.kb-drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.kb-drawer-loading { display: flex; align-items: center; gap: .75rem; color: var(--text-muted); font-size: .9rem; }
.kb-drawer-error { color: #fca5a5; font-size: .9rem; }

.drawer-timestamps { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-bottom: .75rem;
                     font-size: .8rem; color: var(--text-muted); }
.drawer-stats { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.kb-hits-badge { font-size: .78rem; color: var(--text-muted); background: rgba(255,255,255,0.06);
                 padding: .15rem .5rem; border-radius: 20px; }

.kb-detail-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.kb-detail-table td { padding: .5rem .4rem; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }
.drawer-field-label { color: var(--text-muted); font-size: .78rem; font-weight: 600;
                      text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
                      width: 110px; padding-right: .75rem; }
.drawer-field-val { color: var(--text-main); word-break: break-all; }
.drawer-field-val a { color: var(--accent-primary); text-decoration: none; }
.drawer-field-val a:hover { text-decoration: underline; }
.kb-src-tag { display: inline-block; font-size: .68rem; padding: .1rem .4rem;
              background: rgba(255,255,255,0.07); border-radius: 4px;
              color: var(--text-muted); margin-left: .35rem; }

/* ── Verify Modal ─────────────────────────────────────────────────────────── */
.kb-verify-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
                   width: min(720px, 95vw); max-height: 85vh;
                   background: var(--panel-bg); backdrop-filter: blur(24px);
                   border: 1px solid rgba(255,255,255,0.12);
                   border-radius: var(--radius-lg); box-shadow: 0 24px 64px rgba(0,0,0,.7);
                   z-index: 300; display: flex; flex-direction: column; overflow: hidden; }
.kb-verify-modal.hidden { display: none; }
.kb-verify-header { display: flex; align-items: center; justify-content: space-between;
                    padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.kb-verify-title { font-size: 1rem; font-weight: 600; color: var(--text-main); }
.kb-verify-section { padding: 1.25rem; }
.kb-verify-running-row { display: flex; align-items: center; gap: .75rem;
                          color: var(--text-muted); font-size: .9rem; }
.kb-verify-events { margin-top: .75rem; font-size: .8rem; color: var(--text-muted);
                    max-height: 120px; overflow-y: auto; }
#kb-verify-result { flex: 1; overflow-y: auto; padding: 1.25rem; }
.kb-verify-provider-row { font-size: .82rem; color: var(--text-muted); margin-bottom: .75rem; }
.kb-verify-footer { display: flex; align-items: center; justify-content: space-between;
                    margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.07); }
.kb-verify-save-note { font-size: .82rem; color: #86efac; }
.kb-verify-no-change { text-align: center; padding: 1.5rem; color: #86efac; font-size: .9rem; }

/* Diff table */
.kb-diff-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.kb-diff-table th { background: rgba(255,255,255,0.05); color: var(--text-muted); padding: .5rem .75rem;
                    text-align: left; border-bottom: 1px solid var(--panel-border);
                    font-weight: 500; font-size: .78rem; }
.kb-diff-table td { padding: .55rem .75rem; border-bottom: 1px solid rgba(255,255,255,0.04);
                    vertical-align: middle; word-break: break-all; }
.diff-field { color: var(--text-muted); font-weight: 500; text-transform: capitalize;
              white-space: nowrap; font-size: .82rem; }
.diff-old   { color: var(--text-muted); }
.diff-new   { color: var(--text-main); font-weight: 500; }

.diff-row.diff-match   td { background: rgba(34,197,94,0.04); }
.diff-row.diff-new     td { background: rgba(59,130,246,0.08); }
.diff-row.diff-changed td { background: rgba(245,158,11,0.08); }
.diff-row.diff-lost    td { background: rgba(255,255,255,0.02); }
.diff-row.diff-conflict td { background: rgba(239,68,68,0.08); }

.diff-badge { display: inline-flex; align-items: center; gap: .3rem;
              padding: .15rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.diff-badge-diff-match   { background: rgba(34,197,94,0.18); color: #86efac; }
.diff-badge-diff-new     { background: rgba(59,130,246,0.18); color: #93c5fd; }
.diff-badge-diff-changed { background: rgba(245,158,11,0.18); color: #fcd34d; }
.diff-badge-diff-lost    { background: rgba(255,255,255,0.07); color: var(--text-muted); }
.diff-badge-diff-conflict { background: rgba(239,68,68,0.18); color: #fca5a5; }

/* ── Intel Sections (News + Confluence in Drawer) ─────────────────────────── */
.intel-section { margin-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 1rem; }
.intel-section-hdr { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; font-size: .875rem; }
.intel-section-icon { font-size: 1.1rem; }
.intel-count { margin-left: auto; font-size: .72rem; color: var(--text-muted); background: rgba(255,255,255,0.07);
               padding: .1rem .5rem; border-radius: 20px; }

/* News items */
.news-list { display: flex; flex-direction: column; gap: .75rem; }
.news-item { padding: .6rem .8rem; background: rgba(255,255,255,0.04); border-radius: var(--radius);
             border-left: 3px solid rgba(99,102,241,0.4); }
.news-title { color: var(--text-main); font-size: .875rem; font-weight: 500;
              text-decoration: none; display: block; margin-bottom: .2rem; line-height: 1.35; }
.news-title:hover { color: var(--accent-primary); text-decoration: underline; }
.news-meta { display: flex; gap: .75rem; font-size: .75rem; color: var(--text-muted); margin-bottom: .2rem; }
.news-source { font-weight: 500; }
.news-date { opacity: .7; }
.news-snippet { font-size: .78rem; color: var(--text-muted); line-height: 1.4; }

/* Confluence items */
.ce-list { display: flex; flex-direction: column; gap: .6rem; }
.ce-item { padding: .6rem .8rem; background: rgba(255,255,255,0.04); border-radius: var(--radius); }
.ce-item-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.ce-link { color: var(--text-main); font-size: .875rem; font-weight: 500; text-decoration: none;
           flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce-link:hover { color: var(--accent-primary); text-decoration: underline; }
.ce-space { font-size: .72rem; color: var(--text-muted); margin-bottom: .15rem; }
.ce-excerpt { font-size: .77rem; color: var(--text-muted); line-height: 1.35; margin-bottom: .2rem; }
.ce-strength { font-size: .72rem; font-style: italic; color: var(--text-muted); opacity: .7; }
.ce-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .45rem;
            border-radius: 4px; font-size: .7rem; font-weight: 600; text-transform: capitalize;
            white-space: nowrap; flex-shrink: 0; }
.ce-badge-customer { background: rgba(34,197,94,0.2); color: #86efac; }
.ce-badge-prospect  { background: rgba(245,158,11,0.2); color: #fcd34d; }
.ce-badge-partner   { background: rgba(59,130,246,0.2); color: #93c5fd; }
.ce-badge-research  { background: rgba(168,85,247,0.2); color: #d8b4fe; }
.ce-badge-mention   { background: rgba(255,255,255,0.08); color: var(--text-muted); }

/* Gmail intelligence section */
.gmail-intel-section { border-left: 3px solid rgba(66,133,244,0.5); padding-left: .75rem; }
.gmail-badge {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 600;
  background: rgba(66,133,244,0.15);
  color: #93c5fd;
  padding: .1rem .55rem;
  border-radius: 20px;
}

/* ── Upload progress bar (shown during AJAX upload) ───────────────────────── */
.upload-progress-bar {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-top: 1rem;
  padding: .75rem 1rem;
  background: rgba(57, 135, 237, 0.08);
  border: 1px solid rgba(57, 135, 237, 0.25);
  border-radius: var(--radius);
  animation: uploading-pulse 1.8s ease-in-out infinite;
}

@keyframes uploading-pulse {
  0%, 100% { border-color: rgba(57, 135, 237, 0.25); }
  50%       { border-color: rgba(57, 135, 237, 0.55); }
}

.upload-progress-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(57, 135, 237, 0.25);
  border-top-color: #3987ED;
  border-radius: 50%;
  flex-shrink: 0;
  animation: spin .8s linear infinite;
}

.upload-progress-text {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  font-size: .88rem;
  color: var(--text-main);
}

.upload-progress-name {
  font-weight: 600;
  color: #5aa3f0;
}

.upload-progress-sub {
  font-size: .78rem;
  color: var(--text-muted);
}

/* ── Inline upload error display ─────────────────────────────────────────── */
.upload-error-inline {
  margin-top: 1rem;
  padding: .75rem 1rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius);
  color: #fca5a5;
  font-size: .9rem;
  line-height: 1.5;
}

/* ── Upload success banner on mapping page ───────────────────────────────── */
.upload-success-banner {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .7rem 1rem;
  margin-bottom: 1.25rem;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius);
  font-size: .875rem;
  color: #86efac;
  line-height: 1.45;
}

.upload-success-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: .05rem;
}

.upload-success-banner strong {
  color: #a7f3d0;
}

.upload-success-banner em {
  font-style: normal;
  font-weight: 600;
  color: var(--text-main);
}

/* Cancelled job status badge */
.status-cancelling { background: rgba(251,191,36,0.18); color: #fcd34d; }
.status-cancelled   { background: rgba(255,255,255,0.08); color: var(--text-muted); }

/* Table Sorting Styles */
/* NOTE: position:relative was removed — it conflicted with position:sticky on
   .results-table th when both classes appear on the same table element.
   The sort-indicator span is inline and does not require a relative parent. */
.kb-table th.sortable { cursor: pointer; user-select: none; transition: background 0.2s, color 0.2s; }
.kb-table th.sortable:hover { background: rgba(255,255,255,0.1); color: var(--text-base); }
.kb-table th.sort-asc, .kb-table th.sort-desc { font-weight: 600; color: var(--text-main); background: rgba(255,255,255,0.07); }
.sort-indicator { margin-left: 4px; font-size: 0.8em; color: var(--accent); }

/* ── Global Layout & Overflow Fixes ── */
.table-responsive, .table-wrap, .mapping-table-wrap, .sdp-findings { 
    width: 100%; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
}
.card, .glass-panel, .glass, .panel, .schema-discovery-panel, .main-content, .page-header, .table-card { 
    min-width: 0; 
    overflow-wrap: break-word; 
}
.truncate-cell, .sdp-reason-txt { 
    max-width: 250px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    display: inline-block;
    vertical-align: middle;
}
.truncate-cell-sm { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.truncate-cell-lg { max-width: 350px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.fixed-table, table.results-table, table.mapping-table, table.sdp-table { 
    table-layout: auto; /* Allow natural column widths */
}
/* Ensure table data does not stretch the container excessively */
table.results-table td, table.mapping-table td, table.sdp-table td {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
