/* Historical Data Onboarding — Zackgo Reports */

.hist-ob-page {
  min-height: 100vh;
  background: var(--bg, #04140F);
  color: var(--text, #E6ECF7);
}

.hist-ob-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.hist-ob-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  animation: histFadeUp .4s ease both;
}

.hist-ob-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hist-ob-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(245, 181, 68, .14);
  border: 1px solid rgba(245, 181, 68, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #E0B44C;
  font-size: 14px;
}

.hist-ob-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text-strong, #fff);
}

.hist-ob-sub {
  font-size: 13px;
  color: var(--text-dim, rgba(230,236,247,.68));
  margin-top: 4px;
  line-height: 1.5;
  max-width: 520px;
}

.hist-ob-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  background: rgba(245, 181, 68, .12);
  border: 1px solid rgba(245, 181, 68, .24);
  color: #E0B44C;
  white-space: nowrap;
}

.hist-ob-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  animation: histFadeUp .45s ease both;
}

.hist-ob-step {
  flex: 1;
  height: 4px;
  border-radius: 100px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.hist-ob-step-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #E0B44C, #E89A1C);
  border-radius: 100px;
  transition: width .35s cubic-bezier(.2,.7,.2,1);
}

.hist-ob-step.active .hist-ob-step-fill { width: 100%; }
.hist-ob-step.done .hist-ob-step-fill { width: 100%; opacity: .7; }

.hist-ob-card {
  background: var(--surface-elev, linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.018)));
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-md, 0 12px 32px -14px rgba(0,0,0,.55));
  animation: histFadeUp .5s ease both;
}

.hist-ob-card + .hist-ob-card { margin-top: 20px; }

.hist-ob-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #E0B44C;
  margin-bottom: 8px;
}

.hist-ob-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong, #fff);
  letter-spacing: -.2px;
}

.hist-ob-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.6;
}

.hist-ob-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.hist-ob-choice {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all .2s ease;
  background: rgba(255,255,255,.02);
  text-align: left;
}

.hist-ob-choice:hover {
  border-color: rgba(224,180,76,.35);
  background: rgba(224,180,76,.05);
  transform: translateY(-2px);
}

.hist-ob-choice-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
  background: rgba(255,255,255,.05);
}

.hist-ob-choice-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
}

.hist-ob-choice-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.5;
}

.hist-ob-mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  margin-top: 20px;
}

.hist-ob-mode-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-dim);
  transition: all .18s ease;
  font-family: inherit;
}

.hist-ob-mode-btn.active {
  background: rgba(224,180,76,.16);
  color: #E0B44C;
}

.hist-ob-dropzone {
  margin-top: 20px;
  border: 2px dashed rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: rgba(255,255,255,.02);
}

.hist-ob-dropzone:hover,
.hist-ob-dropzone.dragover {
  border-color: rgba(224,180,76,.45);
  background: rgba(224,180,76,.04);
}

.hist-ob-dropzone-icon { font-size: 32px; margin-bottom: 12px; }
.hist-ob-dropzone-title { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.hist-ob-dropzone-sub { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

.hist-ob-timeline {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 16px 4px 8px;
  margin-top: 20px;
  scrollbar-width: thin;
}

.hist-ob-timeline::-webkit-scrollbar { height: 4px; }
.hist-ob-timeline::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.hist-ob-tl-item {
  flex: 0 0 auto;
  min-width: 72px;
  text-align: center;
  position: relative;
}

.hist-ob-tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 auto 8px;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.2);
  transition: all .25s ease;
}

.hist-ob-tl-item.completed .hist-ob-tl-dot {
  background: #10B981;
  border-color: #10B981;
  box-shadow: 0 0 12px rgba(16,185,129,.4);
}

.hist-ob-tl-item.queued .hist-ob-tl-dot,
.hist-ob-tl-item.processing .hist-ob-tl-dot {
  background: #E0B44C;
  border-color: #E0B44C;
}

.hist-ob-tl-item.failed .hist-ob-tl-dot {
  background: #F87171;
  border-color: #F87171;
}

.hist-ob-tl-item.missing .hist-ob-tl-dot {
  background: transparent;
  border-style: dashed;
  border-color: rgba(248,113,113,.5);
}

.hist-ob-tl-item.processing .hist-ob-tl-dot {
  animation: histPulse 1.2s ease infinite;
}

.hist-ob-tl-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.hist-ob-file-list { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }

.hist-ob-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  animation: histFadeUp .3s ease both;
}

.hist-ob-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(96,165,250,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.hist-ob-file-info { flex: 1; min-width: 0; }
.hist-ob-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-ob-file-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

.hist-ob-file-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 4px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}

.hist-ob-file-status.queued { background: rgba(224,180,76,.14); color: #E0B44C; }
.hist-ob-file-status.processing { background: rgba(96,165,250,.14); color: #60A5FA; }
.hist-ob-file-status.completed { background: rgba(16,185,129,.14); color: #10B981; }
.hist-ob-file-status.failed { background: rgba(248,113,113,.14); color: #F87171; }
.hist-ob-file-status.needs_confirmation { background: rgba(167,139,250,.14); color: #A78BFA; }

.hist-ob-warn {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  background: rgba(224,180,76,.08);
  border: 1px solid rgba(224,180,76,.18);
  color: #E0B44C;
}

.hist-ob-progress {
  margin-top: 24px;
  padding: 20px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
}

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

.hist-ob-progress-title { font-size: 13px; font-weight: 700; color: var(--text-strong); }
.hist-ob-progress-eta { font-size: 11px; color: var(--text-dim); }

.hist-ob-progress-track {
  height: 6px;
  border-radius: 100px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.hist-ob-progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #10B981, #E0B44C);
  transition: width .4s ease;
  width: 0;
}

.hist-ob-progress-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.hist-ob-stat {
  font-size: 11px;
  color: var(--text-dim);
}

.hist-ob-stat strong { color: var(--text-strong); }

.hist-ob-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.hist-ob-summary-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}

.hist-ob-summary-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -.3px;
}

.hist-ob-summary-lbl {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.hist-ob-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hist-ob-btn {
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all .18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hist-ob-btn-primary {
  background: linear-gradient(135deg, #E0B44C, #E89A1C);
  color: #071A14;
  box-shadow: 0 8px 24px -8px rgba(224,180,76,.5);
}

.hist-ob-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.hist-ob-btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.hist-ob-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.hist-ob-btn-ghost:hover { border-color: rgba(255,255,255,.2); color: var(--text-strong); }

.hist-ob-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: histFadeIn .2s ease;
}

.hist-ob-modal {
  width: 100%;
  max-width: 440px;
  background: #0A2A20;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 32px 80px -20px rgba(0,0,0,.7);
}

.hist-ob-modal-title { font-size: 16px; font-weight: 700; color: #fff; }
.hist-ob-modal-sub { font-size: 12px; color: rgba(230,236,247,.65); margin-top: 6px; line-height: 1.5; }

.hist-ob-field { margin-top: 16px; }
.hist-ob-field label { display: block; font-size: 11px; font-weight: 600; color: rgba(230,236,247,.55); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .6px; }
.hist-ob-field input, .hist-ob-field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}

.hist-ob-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color .15s;
}

.hist-ob-back-link:hover { color: #E0B44C; }

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

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

@keyframes histPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224,180,76,.5); }
  50% { box-shadow: 0 0 0 8px rgba(224,180,76,0); }
}

@media (max-width: 768px) {
  .hist-ob-choice-grid { grid-template-columns: 1fr; }
  .hist-ob-summary-grid { grid-template-columns: 1fr 1fr; }
  .hist-ob-header { flex-direction: column; }
}

/* Light theme support */
:root[data-theme="light"] .hist-ob-page,
html[data-theme="light"] .hist-ob-page {
  --bg: #F7F8FB;
  --text: #071A14;
  --text-strong: #04140F;
  --text-dim: rgba(11,18,32,.66);
  --border: rgba(15,23,42,.08);
  --surface-elev: linear-gradient(180deg,#FFFFFF,#FBFCFE);
}

:root[data-theme="light"] .hist-ob-modal,
html[data-theme="light"] .hist-ob-modal {
  background: #fff;
  border-color: rgba(15,23,42,.1);
}

:root[data-theme="light"] .hist-ob-modal-title { color: #071A14; }
:root[data-theme="light"] .hist-ob-field input,
:root[data-theme="light"] .hist-ob-field select {
  background: #F7F8FB;
  color: #071A14;
  border-color: rgba(15,23,42,.12);
}

/* Executive business history card (read-only) */
.business-history-card{
  margin-bottom:20px;padding:20px 22px;border-radius:16px;
  border:1px solid rgba(16,185,129,.22);
  background:linear-gradient(135deg,rgba(16,185,129,.08),rgba(96,165,250,.04));
  animation:histFadeUp .4s ease both;
}
.business-history-header{display:flex;gap:14px;align-items:flex-start;margin-bottom:16px}
.business-history-icon{font-size:24px;line-height:1}
.business-history-title{font-size:14px;font-weight:700;color:var(--text-strong,#fff)}
.business-history-sub{font-size:12px;color:var(--text-dim);margin-top:4px;line-height:1.55;max-width:640px}
.business-history-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.business-history-stat{padding:12px 14px;border-radius:12px;border:1px solid var(--border,rgba(255,255,255,.08));background:rgba(255,255,255,.03)}
.business-history-stat-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.7px;color:var(--text-dim)}
.business-history-stat-val{font-size:13px;font-weight:700;color:var(--text-strong,#fff);margin-top:4px}
.business-history-periods{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}
.business-history-chip{display:inline-block;padding:4px 10px;border-radius:100px;font-size:11px;font-weight:600;background:rgba(255,255,255,.06);border:1px solid var(--border,rgba(255,255,255,.1));color:var(--text-strong,#fff)}
.business-history-chip.muted{opacity:.7;font-weight:500}
.business-history-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
@media(max-width:768px){.business-history-grid{grid-template-columns:1fr 1fr}}
