/* ============================================================
   Mottu Data Turbo — Dataform IDP Stylesheet
   Design language: Angular Material dark theme + Mottu green
   Primary: #00b131  |  Background: #0e150d  |  Surface: #1a2218
   ============================================================ */

:root {
  /* ── Mottu brand colours ───────────────────────────────────── */
  --primary:        #00b131;
  --primary-dim:    #009929;
  --primary-light:  rgba(0,177,49,.15);
  --primary-subtle: rgba(0,177,49,.08);

  /* ── Dark theme surfaces — exact match to turbo.mottu.cloud ── */
  --bg:             #0a0a0a;
  --bg2:            #1a1a1a;
  --bg3:            #242424;
  --bg4:            #2e2e2e;
  --surface:        #1a1a1a;
  --surface-raised: #242424;

  /* ── Borders (matches --border-dark: rgba(255,255,255,0.08)) ─ */
  --border:         rgba(255,255,255,0.08);
  --border-light:   rgba(255,255,255,0.12);

  /* ── Text ──────────────────────────────────────────────────── */
  --text:           rgba(255,255,255,0.87);
  --text2:          rgba(255,255,255,0.6);
  --text-on-primary: #ffffff;

  /* ── Hover / selected states ───────────────────────────────── */
  --hover:    rgba(255,255,255,0.04);
  --selected: rgba(255,255,255,0.08);

  /* ── Status ────────────────────────────────────────────────── */
  --success:  #3fb950;
  --error:    #f85149;
  --warning:  #d29922;
  --info:     #2c93f7;

  /* ── Terminal ──────────────────────────────────────────────── */
  --term-bg:   #0d0d0d;
  --term-text: rgba(255,255,255,0.75);

  /* ── Misc ──────────────────────────────────────────────────── */
  --radius:    4px;
  --radius-lg: 8px;
  --font:      'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Roboto Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --sidenav-w: 260px;
  --toolbar-h: 64px;
  --transition: .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; cursor: pointer; }

/* ── Login screen ────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}

.login-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 48px 40px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 380px;
  text-align: center;
}

.login-logo  { height: 40px; }
.login-title { font-size: 24px; font-weight: 500; color: var(--text); }
.login-subtitle { font-size: 13px; color: var(--text2); max-width: 280px; }
.login-btn   { width: 100%; justify-content: center; padding: 12px 24px; font-size: 15px; }
.login-hint  { font-size: 12px; color: var(--text2); min-height: 18px; }

/* ── App shell ───────────────────────────────────────────────── */
.sidenav-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidenav ─────────────────────────────────────────────────── */
.sidenav {
  width: var(--sidenav-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width var(--transition);
}
.sidenav.collapsed { width: 0; }

.sidenav-header {
  height: 55px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidenav-logo { height: 32px; width: 32px; object-fit: contain; }

/* Nav list */
.nav-list {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section { margin-bottom: 8px; }

.nav-subheader {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text2);
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  height: 40px;
  border-radius: var(--radius);
  margin: 2px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
}
.nav-item:hover  { background: var(--hover); color: var(--text); }
.nav-item.active {
  background: var(--selected);
  color: var(--primary);
}
.nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  color: inherit;
}

/* Collapsible category in sidenav */
.nav-category {
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px; height: 36px;
  border-radius: var(--radius);
  margin: 2px 0;
  font-size: 13px; font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap; overflow: hidden;
}
.nav-category:hover { background: var(--hover); color: var(--text); }
.nav-category .caret { margin-left: auto; font-size: 12px; transition: transform var(--transition); }
.nav-category.open .caret { transform: rotate(90deg); }

.nav-children { display: none; }
.nav-children.open { display: block; }

.nav-fn {
  padding: 0 8px 0 40px;
  height: 36px;
  display: flex; align-items: center;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  border-radius: var(--radius);
  margin: 1px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background var(--transition), color var(--transition);
}
.nav-fn:hover  { background: var(--hover); color: var(--text); }
.nav-fn.active { background: var(--selected); color: var(--primary); }

/* Sidenav footer */
.sidenav-footer { flex-shrink: 0; padding: 8px; }
.nav-divider { height: 1px; background: var(--border); margin-bottom: 8px; }

.user-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.user-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
  overflow: hidden;
}
.user-name  { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Sidenav content column ──────────────────────────────────── */
.sidenav-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.toolbar {
  height: var(--toolbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 5;
}

.toolbar-titles {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.toolbar-page {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toolbar-subtitle {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
}
.toolbar-badges { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Status badges (GCP / GitHub) ───────────────────────────── */
.status-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text2);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg3);
  transition: border-color var(--transition);
  white-space: nowrap;
}
.status-badge:hover { border-color: var(--primary); }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text2);
  flex-shrink: 0;
}
.status-dot.ok  { background: var(--success); }
.status-dot.err { background: var(--error);   }

/* ── Page content area ───────────────────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* ── Material-style cards ────────────────────────────────────── */
.mat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.mat-card-accent { border-top: 4px solid var(--primary); }

.mat-card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.mat-card-title {
  font-size: 16px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.mat-card-subtitle { font-size: 13px; color: var(--text2); margin-top: 2px; }
.mat-card-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

/* Keep old .card alias for existing JS */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px; font-weight: 500;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

/* ── Form elements ───────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 12px; font-weight: 500; color: var(--text2);
  letter-spacing: .1px;
}
.field label .required { color: var(--error); margin-left: 2px; }

.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  padding: 9px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.field input:hover, .field select:hover { border-color: var(--text2); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,177,49,.15);
}
.field input.mono { font-family: var(--font-mono); font-size: 12px; }
.field select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a9386' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
.field select option { background: var(--bg2); color: var(--text); }
.field .hint { font-size: 11px; color: var(--text2); }

.field-checkbox { flex-direction: row; align-items: center; gap: 10px; }
.field-checkbox input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.field-checkbox label { font-size: 14px; color: var(--text); margin: 0; cursor: pointer; }

/* Token / password field */
.token-wrap { position: relative; }
.token-wrap input { padding-right: 40px; width: 100%; }
.token-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text2); cursor: pointer; padding: 0; font-size: 14px;
}
.token-toggle:hover { color: var(--primary); }

/* Repo retry link */
.repo-retry { cursor: pointer; color: var(--primary); margin-right: 8px; font-size: 11px; }
.repo-retry:hover { text-decoration: underline; }

/* ── Material-style buttons ──────────────────────────────────── */
.mat-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 14px; font-weight: 500;
  cursor: pointer; border: none;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  letter-spacing: .4px;
  text-transform: uppercase;
}
.mat-btn:disabled { opacity: .38; cursor: not-allowed; }

.mat-btn-primary {
  background: var(--primary); color: var(--text-on-primary);
}
.mat-btn-primary:hover:not(:disabled) {
  background: var(--primary-dim);
  box-shadow: 0 2px 8px rgba(0,177,49,.3);
}

.mat-btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-light);
  text-transform: none;
}
.mat-btn-outline:hover:not(:disabled) { background: var(--bg3); border-color: var(--text2); }

.mat-btn-danger {
  background: transparent; color: var(--error);
  border: 1px solid var(--error);
  text-transform: none;
}
.mat-btn-danger:hover:not(:disabled) { background: rgba(248,81,73,.1); }

.mat-btn-sm { padding: 5px 12px; font-size: 12px; }

/* Keep old .btn aliases for existing JS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 20px; border-radius: 4px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: background var(--transition), opacity var(--transition); font-family: var(--font); letter-spacing: .3px; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn-primary  { background: var(--primary); color: var(--text-on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dim); }
.btn-outline  { background: transparent; color: var(--text); border: 1px solid var(--border-light); }
.btn-outline:hover:not(:disabled) { background: var(--bg3); }
.btn-danger   { background: transparent; color: var(--error); border: 1px solid var(--error); }
.btn-danger:hover:not(:disabled) { background: rgba(248,81,73,.1); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* Icon-only button */
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  border-radius: 50%; cursor: pointer;
  color: var(--text2); font-size: 16px;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg3); color: var(--text); }

/* ── Step progress bar ───────────────────────────────────────── */
.steps-bar {
  display: flex; gap: 0;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.step-pill {
  flex: 1; padding: 9px 12px;
  font-size: 11px; font-weight: 600; text-align: center;
  border-right: 1px solid var(--border);
  color: var(--text2); background: var(--bg3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background var(--transition), color var(--transition);
}
.step-pill:last-child { border-right: none; }
.step-pill.running { color: var(--primary); background: var(--primary-subtle); }
.step-pill.ok      { color: var(--success); background: rgba(63,185,80,.1);    }
.step-pill.error   { color: var(--error);   background: rgba(248,81,73,.1);    }

/* ── Terminal panel ──────────────────────────────────────────── */
.terminal-panel {
  height: 260px;
  background: var(--term-bg);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.terminal-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 6px 14px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.terminal-title { font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: .5px; }
.terminal-actions { display: flex; gap: 6px; }
.terminal-output {
  flex: 1; overflow-y: auto;
  padding: 10px 16px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  color: var(--term-text);
}
.log-line       { color: var(--term-text); }
.log-line.step  { color: var(--primary); font-weight: 600; margin-top: 6px; }
.log-line.ok    { color: var(--success); }
.log-line.err   { color: var(--error);   }
.log-line.warn  { color: var(--warning); }
.log-line.done  { color: var(--success); font-weight: 600; margin-top: 4px; }

/* ── Resize handle ───────────────────────────────────────────── */
.resize-handle {
  height: 4px; background: var(--border);
  cursor: row-resize; flex-shrink: 0;
  transition: background var(--transition);
}
.resize-handle:hover { background: var(--primary); }

/* ── Welcome / home screen ───────────────────────────────────── */
.home-container { max-width: 860px; }
.home-welcome { margin-bottom: 32px; }
.home-welcome h1 { font-size: 24px; font-weight: 500; margin-bottom: 8px; }
.home-welcome p  { font-size: 14px; color: var(--text2); line-height: 1.7; max-width: 600px; }

.home-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }

.home-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.home-card:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(0,177,49,.1); }

.home-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.home-card-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.home-card-title { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.home-card-desc  { font-size: 13px; color: var(--text2); line-height: 1.6; flex: 1; }

/* ── Summary box ─────────────────────────────────────────────── */
.summary-box {
  background: rgba(0,177,49,.06);
  border: 1px solid rgba(0,177,49,.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: var(--font-mono); font-size: 12px; line-height: 2;
  color: var(--term-text);
  margin-top: 12px;
}
.summary-box .label { color: var(--text2); }

/* ── Badge pills ─────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 20px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
}
.badge-repo       { background: rgba(0,177,49,.15);  color: var(--primary); }
.badge-iam        { background: rgba(210,153,34,.15); color: var(--warning); }
.badge-github     { background: rgba(63,185,80,.15);  color: var(--success); }
.badge-migration  { background: rgba(248,81,73,.15);  color: var(--error);   }
.badge-sandbox    { background: rgba(138,147,134,.15);color: var(--text2);   }
.badge-validation { background: rgba(44,147,247,.15); color: var(--info);    }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utilities ───────────────────────────────────────────────── */
.text-muted   { color: var(--text2); }
.text-primary { color: var(--primary); }
.text-ok      { color: var(--success); }
.text-err     { color: var(--error);   }
.text-mono    { font-family: var(--font-mono); }
.mt-8   { margin-top: 8px;  }
.mt-16  { margin-top: 16px; }
.flex   { display: flex; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-end { justify-content: flex-end; }
.gap-8  { gap: 8px;  }
.gap-12 { gap: 12px; }
.separator { height: 1px; background: var(--border); margin: 12px 0; }

/* ── Scrollbars ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text2); }

/* ── Mobile / responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidenav {
    position: fixed; top: 0; left: 0; height: 100vh;
    z-index: 200; transform: translateX(-100%);
    transition: transform var(--transition);
    width: var(--sidenav-w) !important;
  }
  .sidenav.mobile-open { transform: translateX(0); }

  .sidenav-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 199;
  }
  .sidenav-overlay.visible { display: block; }

  .toolbar-subtitle { display: none; }
  .page-content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .agent-container { height: calc(100vh - 160px); }
}

/* ── Spreadsheet Automation ──────────────────────────────────────────────── */

.ss-container { max-width: 800px; margin: 0 auto; padding: 24px 16px; }
.ss-header { margin-bottom: 24px; }
.ss-header h2 { margin: 0; color: var(--text); font-weight: 600; }
.ss-header p { margin: 4px 0 0; color: var(--text2); font-size: 14px; }

.ss-steps {
  display: flex; gap: 4px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border); padding-bottom: 12px;
}
.ss-step {
  padding: 6px 14px; border-radius: 6px; font-size: 13px;
  color: var(--text2); background: transparent;
}
.ss-step.active { color: var(--primary); background: var(--primary-light); font-weight: 500; }

.ss-body { min-height: 300px; }

/* Source cards */
.ss-card-row { display: flex; gap: 16px; }
.ss-source-card {
  flex: 1; padding: 24px; border-radius: 12px;
  border: 2px solid var(--border-light); background: var(--bg3);
  cursor: pointer; text-align: center; transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ss-source-card i { font-size: 32px; color: var(--text2); }
.ss-source-card strong { color: var(--text); }
.ss-source-card span { color: var(--text2); font-size: 13px; }
.ss-source-card:hover { border-color: var(--primary); }
.ss-source-card.selected { border-color: var(--primary); background: var(--primary-subtle); }
.ss-source-card.selected i { color: var(--primary); }

/* Upload zone */
.ss-upload-zone {
  border: 2px dashed var(--border-light); border-radius: 12px;
  padding: 48px 24px; text-align: center; color: var(--text2);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.ss-upload-zone.dragover { border-color: var(--primary); background: var(--primary-subtle); }
.ss-upload-zone i { font-size: 40px; margin-bottom: 12px; color: var(--text2); }
.ss-browse { color: var(--primary); cursor: pointer; text-decoration: underline; }

/* Fields */
.ss-field-group { margin-bottom: 16px; }
.ss-field-group label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.ss-input {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border-light); background: var(--bg3);
  color: var(--text); font-size: 14px; outline: none;
}
.ss-input:focus { border-color: var(--primary); }
select.ss-input { appearance: auto; }

/* Radio group */
.ss-radio-group { display: flex; gap: 8px; }
.ss-radio {
  flex: 1; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border-light); background: var(--bg3);
  color: var(--text); font-size: 13px; cursor: pointer;
  text-align: center; transition: border-color .15s;
}
.ss-radio.selected { border-color: var(--primary); background: var(--primary-subtle); }
.ss-radio input { display: none; }

/* Validation result */
.ss-validation-result { padding: 16px; border-radius: 12px; background: var(--bg3); border: 1px solid var(--border); }
.ss-val-header { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin-bottom: 8px; }
.ss-val-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text2); margin-bottom: 12px; flex-wrap: wrap; }
.ss-badge-warn { background: rgba(210,153,34,.15); color: var(--warning); padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* Column tags */
.ss-col-list { display: flex; flex-wrap: wrap; gap: 4px; }
.ss-col-tag {
  padding: 3px 8px; border-radius: 4px; font-size: 12px;
  background: var(--bg4); color: var(--text2); font-family: 'Roboto Mono', monospace;
}
.ss-col-tag.ok { background: rgba(63,185,80,.12); color: var(--success); }
.ss-col-tag.warn { background: rgba(210,153,34,.12); color: var(--warning); }

/* Comparison */
.ss-comparison { padding: 12px; border-radius: 8px; background: var(--bg3); border: 1px solid var(--border); margin-bottom: 16px; }
.ss-comp-header { margin-bottom: 8px; color: var(--text); font-size: 14px; }
.ss-comp-cols { display: flex; flex-direction: column; gap: 8px; }
.ss-comp-label { font-size: 12px; font-weight: 500; display: block; margin-bottom: 4px; }

/* Actions */
.ss-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }

/* Loading */
.ss-loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px; }
.ss-load-log { width: 100%; max-height: 300px; overflow-y: auto; font-size: 13px; color: var(--text2); display: flex; flex-direction: column; gap: 6px; }

.ss-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.ss-spinner-sm { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.ss-uploading { display: flex; align-items: center; gap: 8px; color: var(--text2); font-size: 13px; margin-top: 12px; }

/* Done */
.ss-done { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ss-done h3 { color: var(--text); margin: 0; }
.ss-done p { color: var(--text2); font-size: 14px; }

/* Error */
.ss-error { color: var(--danger); font-size: 13px; margin-top: 8px; }

/* ── Power BI License ────────────────────────────────────────────────────── */

.pbi-container { max-width: 600px; margin: 0 auto; padding: 24px 16px; }
.pbi-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px; text-align: center;
}
.pbi-icon { font-size: 48px; color: #f59e0b; margin-bottom: 12px; }
.pbi-card h2 { margin: 0 0 8px; color: var(--text); }
.pbi-card p { color: var(--text2); font-size: 14px; max-width: 420px; margin: 0 auto 16px; line-height: 1.6; }
.pbi-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

.pbi-status { padding: 12px 16px; border-radius: 8px; font-size: 14px; text-align: left; }
.pbi-status i { margin-right: 6px; }
.pbi-ok { background: rgba(63,185,80,.1); color: var(--success); border: 1px solid rgba(63,185,80,.2); }
.pbi-none { background: rgba(44,147,247,.1); color: var(--info); border: 1px solid rgba(44,147,247,.2); }

.pbi-info {
  margin-top: 24px; padding: 20px; border-radius: 12px;
  background: var(--bg3); border: 1px solid var(--border);
}
.pbi-info h3 { margin: 0 0 12px; color: var(--text); font-size: 15px; }
.pbi-info ul { margin: 0; padding-left: 20px; }
.pbi-info li { color: var(--text2); font-size: 13px; margin-bottom: 8px; line-height: 1.5; }
.pbi-info a { color: var(--primary); }

.pbi-license-selector {
  display: flex;
  gap: 10px;
}

.pbi-license-opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: var(--text2);
  font-family: inherit;
}

.pbi-license-opt:hover {
  border-color: var(--primary);
  background: rgba(0,196,107,.05);
}

.pbi-license-opt.active {
  border-color: var(--primary);
  background: rgba(0,196,107,.1);
  color: var(--text1);
}

.pbi-license-opt i {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 2px;
}

.pbi-license-opt-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
}

.pbi-license-opt-desc {
  font-size: 11px;
  color: var(--text2);
  text-align: center;
  line-height: 1.4;
}

/* ── Data Engineer Agent Chat ────────────────────────────────────────────── */

.agent-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  max-width: 900px;
  margin: 0 auto;
}

.agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.agent-msg {
  display: flex;
  gap: 12px;
  max-width: 100%;
}

.agent-msg-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.agent-msg-user .agent-msg-avatar {
  background: var(--bg3);
  color: var(--text2);
}

.agent-msg-assistant .agent-msg-avatar {
  background: var(--primary-light);
  color: var(--primary);
}

.agent-msg-body {
  flex: 1;
  min-width: 0;
  line-height: 1.6;
  color: var(--text);
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.agent-msg-user .agent-msg-body {
  background: var(--bg3);
  padding: 10px 14px;
  border-radius: 12px 12px 2px 12px;
}

/* Welcome screen */
.agent-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text2);
}

.agent-welcome-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.agent-welcome h2 {
  color: var(--text);
  font-weight: 600;
  margin: 0;
}

.agent-welcome p {
  max-width: 480px;
  line-height: 1.6;
}

.agent-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.agent-suggestion {
  background: var(--bg3);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.agent-suggestion:hover {
  background: var(--bg4);
  border-color: var(--primary);
}
.agent-suggestion i { margin-right: 6px; color: var(--primary); }

/* Input area */
.agent-input-area {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}

.agent-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--bg3);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 8px 12px;
  transition: border-color .15s;
}
.agent-input-row:focus-within {
  border-color: var(--primary);
}

.agent-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  max-height: 120px;
  line-height: 1.5;
}
.agent-input::placeholder { color: var(--text2); }

.agent-send-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: opacity .15s;
}
.agent-send-btn:hover { opacity: .85; }
.agent-send-btn:disabled { opacity: .4; cursor: not-allowed; }

.agent-input-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text2);
  margin-top: 6px;
  opacity: .7;
}

/* Tool call indicators */
.agent-tool-call {
  background: var(--primary-subtle);
  border: 1px solid var(--primary-light);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 6px 0;
  font-size: 12px;
  color: var(--text2);
}
.agent-tool-call i:first-child { color: var(--primary); margin-right: 4px; }
.agent-tool-params { color: var(--text2); opacity: .7; }

/* Typing indicator */
.agent-typing {
  display: inline-block;
  color: var(--text2);
  animation: agentPulse 1.2s ease-in-out infinite;
}
@keyframes agentPulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}

/* Code blocks */
.agent-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  overflow-x: auto;
  font-family: 'Roboto Mono', monospace;
  font-size: 12.5px;
  line-height: 1.5;
}
.agent-inline-code {
  background: var(--bg3);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: 'Roboto Mono', monospace;
  font-size: 12.5px;
}

/* Error display */
.agent-error {
  background: rgba(248,81,73,.1);
  border: 1px solid rgba(248,81,73,.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 6px 0;
  color: var(--danger);
  font-size: 13px;
}

/* ── Docs / Guides view ─────────────────────────────────────────────────────── */

.docs-layout {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface);
}

.docs-sidebar-inner {
  padding: 16px 0 24px;
}

.docs-cat-label {
  padding: 12px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text2);
}

.docs-nav-item {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text1);
  cursor: pointer;
  border-radius: 0 20px 20px 0;
  margin-right: 12px;
  transition: background .15s, color .15s;
}

.docs-nav-item:hover {
  background: rgba(0,196,107,.08);
  color: var(--primary);
}

.docs-nav-item.active {
  background: rgba(0,196,107,.15);
  color: var(--primary);
  font-weight: 600;
}

.docs-main {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 48px;
}

.docs-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60%;
  text-align: center;
}

.docs-loading {
  padding: 24px;
  color: var(--text2);
  font-size: 13px;
}

.docs-article {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 32px;
}

.docs-article-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.docs-article-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.docs-article-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text1);
  margin: 0 0 8px;
  line-height: 1.3;
}

.docs-article-desc {
  font-size: 14px;
  color: var(--text2);
  margin: 0;
}

/* Markdown body styles */
.markdown-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text1);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: var(--text1);
  font-weight: 700;
  margin: 28px 0 12px;
  line-height: 1.3;
}

.markdown-body h1 { font-size: 22px; display: none; } /* title already shown in header */
.markdown-body h2 { font-size: 18px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.markdown-body h3 { font-size: 15px; }
.markdown-body h4 { font-size: 14px; }

.markdown-body p {
  margin: 0 0 14px;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 24px;
  margin: 0 0 14px;
}

.markdown-body li {
  margin-bottom: 4px;
}

.markdown-body code {
  background: rgba(0,196,107,.08);
  border: 1px solid rgba(0,196,107,.2);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: var(--primary);
}

.markdown-body pre {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 14px 0;
}

.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e6edf3;
  font-size: 12px;
}

.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 13px;
}

.markdown-body th {
  background: rgba(0,196,107,.08);
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text1);
}

.markdown-body td {
  border: 1px solid var(--border);
  padding: 7px 12px;
  color: var(--text1);
}

.markdown-body tr:hover td {
  background: rgba(255,255,255,.02);
}

.markdown-body blockquote {
  border-left: 3px solid var(--primary);
  margin: 14px 0;
  padding: 8px 16px;
  background: rgba(0,196,107,.05);
  border-radius: 0 6px 6px 0;
  color: var(--text2);
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.markdown-body a {
  color: var(--primary);
  text-decoration: underline;
}

.docs-ask-agent {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ── Dataform Wizard Stepper ──────────────────────────────────────────────── */

.wiz-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  padding: 16px;
}

.wiz-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.wiz-fixed {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}

.wiz-gh-ok {
  font-size: 12px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 5px;
}

.wiz-gh-warn {
  font-size: 12px;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 5px;
}

.wiz-gh-warn a { color: var(--warning); text-decoration: underline; }

/* Step cards */
.wiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.wiz-card-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(0,177,49,.15);
}

.wiz-card-done {
  border-color: var(--success);
}

.wiz-card-locked {
  opacity: 0.5;
  pointer-events: none;
}

.wiz-card-skipped {
  border-color: var(--border-light);
  opacity: 0.75;
}

.wiz-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

/* Step number badge */
.wiz-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.wiz-step-badge-active {
  background: var(--primary);
  color: #000;
}

.wiz-step-badge-done {
  background: var(--success);
  color: #000;
}

.wiz-step-badge-skipped {
  background: var(--warning);
  color: #000;
}

.wiz-step-badge-locked {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
}

.wiz-card-info {
  flex: 1;
  min-width: 0;
}

.wiz-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.wiz-card-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}

/* Status pill */
.wiz-status {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

.wiz-status-done    { background: rgba(63,185,80,.12);  color: var(--success); }
.wiz-status-skipped { background: rgba(210,153,34,.12); color: var(--warning); }
.wiz-status-ready   { background: rgba(0,177,49,.12);   color: var(--primary); }
.wiz-status-locked  { background: var(--bg3);           color: var(--text2); }

/* Card form body */
.wiz-card form {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

.wiz-card .form-grid { margin-top: 14px; }

.wiz-step-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.wiz-run-btn { min-width: 170px; }

/* Completed step summary */
.wiz-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px;
  font-size: 12px;
}

.wiz-summary span {
  background: var(--bg3);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text2);
}

@media (max-width: 768px) {
  .docs-layout { flex-direction: column; }
  .docs-sidebar { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
  .docs-main { padding: 0 16px 32px; }
}
