/* ══════════════════════════════════════════════════════════════════
   app-launcher — UI styles
   ══════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&display=swap');

:root {
  --a:  #0071E3;
  --a2: #0051A8;

  --bg:    #F5F5F7;
  --bg2:   #FFFFFF;
  --bg3:   #E8E8ED;
  --tx:    #1D1D1F;
  --dim:   rgba(29,29,31,.56);
  --dim2:  rgba(29,29,31,.36);
  --bd:    rgba(0,0,0,.09);
  --bd2:   rgba(0,0,0,.17);
  --danger: #FF3B30;
  --ok:     #34C759;
  --warn:   #FF9F0A;

  --input-bg:       #FFFFFF;
  --input-bg-focus: rgba(0,113,227,.04);
  --topbar-bg:      rgba(245,245,247,.88);
  --modal-bg:       #FFFFFF;
  --toast-bg:       #FFFFFF;
  --shadow:         rgba(0,0,0,.06);
  --scroll-c:       rgba(0,0,0,.14);

  --fs-xs:   10px;
  --fs-sm:   11px;
  --fs-nm:   12px;
  --fs-base: 13px;
  --fs-md:   14px;
  --fs-lg:   15px;

  --nav-h:     48px;
  --side-w:    260px;
  --radius:    10px;
  --radius-lg: 14px;
}

html[data-theme="dark"] {
  --bg:   #000000;
  --bg2:  #1C1C1E;
  --bg3:  #2C2C2E;
  --tx:   #F5F5F7;
  --dim:  rgba(245,245,247,.56);
  --dim2: rgba(245,245,247,.34);
  --bd:   rgba(255,255,255,.08);
  --bd2:  rgba(255,255,255,.16);
  --input-bg:       rgba(255,255,255,.06);
  --input-bg-focus: rgba(0,113,227,.12);
  --topbar-bg:      rgba(0,0,0,.82);
  --modal-bg:       #1C1C1E;
  --toast-bg:       #2C2C2E;
  --shadow:         rgba(0,0,0,.40);
  --scroll-c:       rgba(255,255,255,.12);
}

html[data-theme="graphite"] {
  --bg:   #242426;
  --bg2:  #323234;
  --bg3:  #3E3E42;
  --tx:   #F0F0F2;
  --dim:  rgba(240,240,242,.55);
  --dim2: rgba(240,240,242,.34);
  --bd:   rgba(255,255,255,.10);
  --bd2:  rgba(255,255,255,.18);
  --input-bg:       rgba(255,255,255,.07);
  --input-bg-focus: rgba(0,113,227,.15);
  --topbar-bg:      rgba(36,36,38,.88);
  --modal-bg:       #323234;
  --toast-bg:       #3E3E42;
  --shadow:         rgba(0,0,0,.25);
  --scroll-c:       rgba(255,255,255,.15);
}

html[data-theme="overa-hr"] {
  --a:   #4c8cd5;
  --a2:  #3a75b8;
  --bg:    #f5f5f5;
  --bg2:   #ffffff;
  --bg3:   #e8e8e8;
  --tx:    #1a1a1a;
  --dim:   rgba(26,26,26,.56);
  --dim2:  rgba(26,26,26,.35);
  --bd:    rgba(0,0,0,.09);
  --bd2:   rgba(0,0,0,.15);
  --danger: #e44540;
  --input-bg:       #ffffff;
  --input-bg-focus: rgba(0,0,0,.03);
  --topbar-bg:      rgba(245,245,245,.94);
  --modal-bg:       #ffffff;
  --toast-bg:       #ffffff;
  --shadow:         rgba(0,0,0,.08);
  --scroll-c:       rgba(0,0,0,.14);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'DM Sans', system-ui, sans-serif; font-size: var(--fs-base); color: var(--tx); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--a); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--tx); }

/* ── Topbar ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  background: var(--topbar-bg); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bd);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  z-index: 100;
}
.topbar-logo { font-size: var(--fs-md); font-weight: 700; letter-spacing: -.3px; }
.topbar-logo span { color: var(--a); }
.topbar-spacer { flex: 1; }
.topbar-tabs { display: flex; gap: 2px; }
.topbar-tab {
  height: 30px; padding: 0 14px; border-radius: 8px;
  border: none; background: none;
  font-size: var(--fs-sm); font-weight: 500; color: var(--dim);
  transition: background .15s, color .15s;
}
.topbar-tab:hover { background: var(--bg3); color: var(--tx); }
.topbar-tab.active { background: var(--bg3); color: var(--tx); font-weight: 600; }
/* Con el mismo aspecto que una pestaña, pero es un enlace a otra pagina. */
.topbar-link {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 14px; border-radius: 8px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--dim);
  text-decoration: none; transition: background .15s, color .15s;
}
.topbar-link:hover { background: var(--bg3); color: var(--tx); }

/* ── Layout ── */
.layout { display: flex; height: 100vh; padding-top: var(--nav-h); }

/* ── Sidebar ── */
.sidebar {
  width: var(--side-w); flex-shrink: 0;
  background: var(--bg2); border-right: 1px solid var(--bd);
  overflow-y: auto; display: flex; flex-direction: column;
  padding: 10px 0 16px;
}
.sidebar-section { margin-bottom: 4px; }
.sidebar-app-header {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; color: var(--dim);
  text-transform: uppercase; letter-spacing: .5px;
  user-select: none;
}
.sidebar-app-header:hover { color: var(--tx); }
.sidebar-app-header .icon { font-size: 14px; }
.sidebar-flow { padding: 2px 0; }
.sidebar-flow-header {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 26px; cursor: pointer;
  font-size: var(--fs-nm); font-weight: 500; color: var(--dim);
}
.sidebar-flow-header:hover { color: var(--tx); }
.sidebar-flow-header .chevron { font-size: 10px; transition: transform .15s; margin-left: auto; }
.sidebar-flow-header.open .chevron { transform: rotate(90deg); }
.sidebar-configs { padding: 2px 0 4px; }
.sidebar-config-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 38px; cursor: pointer;
  font-size: var(--fs-nm); color: var(--dim);
  border-radius: 6px; margin: 0 6px;
  transition: background .12s, color .12s;
}
.sidebar-config-item:hover { background: var(--bg3); color: var(--tx); }
.sidebar-config-item.active { background: rgba(0,113,227,.1); color: var(--a); font-weight: 500; }
.sidebar-config-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bd2); flex-shrink: 0; }
.sidebar-config-item.active .dot { background: var(--a); }
.sidebar-add-config {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px 4px 38px; margin: 2px 6px;
  font-size: var(--fs-xs); color: var(--dim2); cursor: pointer;
  border-radius: 6px; border: none; background: none; width: 100%;
  transition: color .12s;
}
.sidebar-add-config:hover { color: var(--a); }

/* ── Main content ── */
.main-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.screen { display: none; flex: 1; overflow: hidden; }
.screen.active { display: flex; flex-direction: column; }

/* ── Welcome / Gallery ── */
.gallery-wrap { flex: 1; overflow-y: auto; padding: 24px; }
.gallery-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 4px; }
.gallery-sub { font-size: var(--fs-nm); color: var(--dim); margin-bottom: 24px; }

/* ── Launch form wrapper ── */
.launch-wrap {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ── Stepper ── */
.stepper {
  display: flex; align-items: center; gap: 0;
  padding: 16px 0 4px;
}
.step-item {
  display: flex; align-items: center; gap: 8px;
  flex: 1; cursor: default;
}
.step-item:last-child { flex: 0; }
.step-circle {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700;
  flex-shrink: 0; transition: background .2s, color .2s;
}
.step-circle.done  { background: var(--a); color: #fff; cursor: pointer; }
.step-circle.active { background: var(--tx); color: var(--bg2); }
.step-circle.future { background: var(--bg3); color: var(--dim); }
.step-label { font-size: var(--fs-xs); font-weight: 500; color: var(--dim); white-space: nowrap; }
.step-label.done   { color: var(--a); cursor: pointer; }
.step-label.active { color: var(--tx); font-weight: 600; }
.step-connector { flex: 1; height: 1px; background: var(--bd2); margin: 0 8px; }
.step-connector.done { background: var(--a); }

/* ── Step views ── */
.step-view { display: none; flex: 1; overflow-y: auto; }
.step-view.active { display: flex; flex-direction: column; gap: 16px; }

/* ── Readonly banner ── */
.readonly-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--bg3);
  border-radius: var(--radius); font-size: var(--fs-sm); color: var(--dim);
  border: 1px solid var(--bd);
}
.readonly-banner a { font-size: var(--fs-sm); }

/* ── Config chip ── */
.config-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: var(--bg3);
  border-radius: 20px; font-size: var(--fs-sm); color: var(--dim);
  border: 1px solid var(--bd);
}
.config-chip .env-badge {
  display: inline-block; padding: 1px 7px;
  background: var(--a); color: #fff;
  border-radius: 10px; font-size: var(--fs-xs); font-weight: 700;
}
.config-chip a { font-size: var(--fs-xs); color: var(--a); margin-left: 4px; }

/* ── Cards ── */
.card {
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: var(--radius-lg); padding: 20px;
}
.card-title { font-size: var(--fs-md); font-weight: 600; margin-bottom: 14px; }
.card-sub { font-size: var(--fs-nm); color: var(--dim); margin-bottom: 16px; }

/* ── Form fields ── */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: var(--fs-sm); font-weight: 500; color: var(--dim); }
.field input, .field select, .field textarea {
  height: 36px; padding: 0 10px;
  background: var(--input-bg); border: 1px solid var(--bd2);
  border-radius: 8px; color: var(--tx);
  transition: border-color .15s, box-shadow .15s;
}
.field .multiselect-grid { height: auto; padding: 8px; }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--a);
  box-shadow: 0 0 0 3px rgba(0,113,227,.12);
  background: var(--input-bg-focus);
}
.field textarea { height: auto; padding: 8px 10px; resize: vertical; }
.fields-row { display: flex; gap: 12px; }
.fields-row .field { flex: 1; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: 8px;
  border: none; font-weight: 600; font-size: var(--fs-sm);
  transition: opacity .15s, box-shadow .15s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--a); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: .88; }
.btn-secondary { background: var(--bg3); color: var(--tx); }
.btn-secondary:hover:not(:disabled) { background: var(--bd2); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: .88; }
.btn-ghost { background: none; color: var(--a); }
.btn-ghost:hover:not(:disabled) { background: rgba(0,113,227,.06); }
.btn-sm { height: 28px; padding: 0 12px; font-size: var(--fs-xs); border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: var(--fs-md); border-radius: 10px; }

/* ── Dropzone ── */
.dropzone {
  border: 2px dashed var(--bd2); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--bg);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--a); background: rgba(0,113,227,.04); }
.dropzone .dz-icon { font-size: 32px; margin-bottom: 8px; }
.dropzone .dz-label { font-size: var(--fs-sm); font-weight: 500; margin-bottom: 4px; }
.dropzone .dz-sub { font-size: var(--fs-xs); color: var(--dim); }
.dropzone .dz-file { font-size: var(--fs-sm); font-weight: 600; color: var(--a); margin-top: 8px; }
.dropzone input[type=file] { display: none; }

/* ── Polling panel ── */
.polling-panel {
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.polling-panel.hidden { display: none; }
.polling-spinner {
  width: 36px; height: 36px; border: 3px solid var(--bd2);
  border-top-color: var(--a); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.polling-label { font-size: var(--fs-sm); font-weight: 600; }
.polling-id { font-size: var(--fs-xs); color: var(--dim); font-family: monospace; }
.polling-timer { font-size: var(--fs-xs); color: var(--dim2); }
.polling-actions { display: flex; gap: 8px; }

.paused-panel {
  background: var(--bg3); border: 1px solid var(--bd);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
}
.paused-panel.hidden { display: none; }
.paused-text { flex: 1; font-size: var(--fs-sm); color: var(--dim); }
.paused-text strong { display: block; color: var(--tx); font-weight: 600; margin-bottom: 2px; }

/* ── Validation round ── */
.round-card {
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: var(--radius-lg); overflow: hidden;
}
.round-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600;
  background: var(--bg3); border-bottom: 1px solid var(--bd);
}
.round-header:hover { background: var(--bg3); }
.round-header .chevron { font-size: 11px; transition: transform .15s; }
.round-error-type {
  font-size: var(--fs-xs); font-weight: 500; color: var(--warn);
  background: rgba(255,159,10,.10); border: 1px solid rgba(255,159,10,.25);
  border-radius: 5px; padding: 2px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
.round-header.open .chevron { transform: rotate(90deg); }
.round-body { padding: 16px; }
.round-body.collapsed { display: none; }

.round-excel-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); color: var(--dim2);
  background: var(--bg3); border: 1px solid var(--bd);
  border-radius: 4px; padding: 1px 7px;
}
.round-dl-link {
  color: var(--a); text-decoration: none; font-size: 11px; line-height: 1;
  padding: 1px 2px; border-radius: 3px;
}
.round-dl-link:hover { background: var(--a); color: #fff; }

.round-corrections {
  margin: 8px 0 12px;
  border: 1px solid var(--bd); border-radius: 6px; overflow: hidden;
}
.round-corrections summary {
  padding: 6px 12px; cursor: pointer;
  font-size: var(--fs-xs); color: var(--dim);
  background: var(--bg3); user-select: none;
}
.round-corrections summary:hover { background: var(--bg4, var(--bg3)); }
.corrections-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--fs-xs);
}
.corrections-table td {
  padding: 4px 10px; border-top: 1px solid var(--bd);
  vertical-align: middle;
}
.corrections-table tr:first-child td { border-top: none; }

/* ── Stats row ── */
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  font-size: var(--fs-sm); font-weight: 600;
}
.stat-chip.ok    { background: rgba(52,199,89,.12); color: #1a8c40; }
.stat-chip.warn  { background: rgba(255,159,10,.12); color: #b06800; }
.stat-chip.err   { background: rgba(255,59,48,.12); color: #c0392b; }
.stat-chip.skip  { background: var(--bg3); color: var(--dim); }
html[data-theme="dark"] .stat-chip.ok   { color: #34c759; }
html[data-theme="dark"] .stat-chip.warn { color: #ff9f0a; }
html[data-theme="dark"] .stat-chip.err  { color: #ff453a; }

/* ── Error table ── */
.error-table { width: 100%; border-collapse: collapse; font-size: var(--fs-nm); }
.error-table th {
  text-align: left; padding: 6px 10px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--dim);
  border-bottom: 1px solid var(--bd);
}
.error-table td { padding: 6px 10px; border-bottom: 1px solid var(--bd); vertical-align: middle; }
.error-table tr:last-child td { border-bottom: none; }
.error-table tr.resolved td { opacity: .5; }
.err-type-badge {
  display: inline-block; padding: 1px 7px; border-radius: 8px;
  font-size: var(--fs-xs); font-weight: 600;
  background: rgba(255,59,48,.10); color: #c0392b;
}
.err-type-badge.ok { background: rgba(52,199,89,.12); color: #1a8c40; }
html[data-theme="dark"] .err-type-badge { color: #ff453a; }
html[data-theme="dark"] .err-type-badge.ok { color: #34c759; }

.fix-input {
  height: 30px; padding: 0 8px;
  border: 1px solid var(--bd2); border-radius: 6px;
  background: var(--input-bg); color: var(--tx); width: 100%;
  font-size: var(--fs-nm); box-sizing: border-box;
}
.fix-input:focus { outline: none; border-color: var(--a); }
.fix-input:disabled { opacity: 0.5; cursor: not-allowed; }
.err-context { color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; }
.err-code { font-size: var(--fs-xs); color: var(--dim); }
.err-correction-ro { font-size: var(--fs-xs); color: var(--dim); }

/* Autocomplete custom */
.err-ac-cell { min-width: 260px; }
.ac-wrap { position: relative; display: flex; align-items: center; gap: 6px; }
.ac-wrap .ac-input { flex: 1; }
.ac-spinner {
  width: 14px; height: 14px; flex-shrink: 0;
  border: 2px solid var(--bd2); border-top-color: var(--a);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ac-list {
  display: none; position: fixed;
  background: var(--bg2); border: 1px solid var(--bd2); border-radius: 6px;
  max-height: 220px; overflow-y: auto; z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); list-style: none; margin: 0; padding: 4px 0;
}
.ac-list.open { display: block; }
.ac-list li {
  padding: 6px 10px; font-size: var(--fs-nm); color: var(--tx);
  cursor: pointer; white-space: normal; line-height: 1.3;
}
.ac-list li:hover { background: var(--a); color: #fff; }

/* ── History tabs ── */
.history-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--bd);
  background: var(--bg2); flex-shrink: 0;
}
.history-tab {
  padding: 10px 20px; border: none; background: none; cursor: pointer;
  font-size: var(--fs-sm); color: var(--dim); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.history-tab:hover { color: var(--tx); }
.history-tab.active { color: var(--a); border-bottom-color: var(--a); font-weight: 600; }

/* ── History list ── */
.history-wrap { flex: 1; overflow: hidden; display: flex; }
.history-list { width: 340px; flex-shrink: 0; border-right: 1px solid var(--bd); overflow-y: auto; }
.history-detail { flex: 1; overflow-y: auto; padding: 20px; }
.history-item {
  padding: 12px 16px; border-bottom: 1px solid var(--bd);
  cursor: pointer; transition: background .12s;
}
.history-item:hover { background: var(--bg3); }
.history-item.active { background: rgba(0,113,227,.06); border-left: 3px solid var(--a); }
.history-item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.history-item-name { font-size: var(--fs-sm); font-weight: 600; flex: 1; }
.history-item-meta { font-size: var(--fs-xs); color: var(--dim); }
.history-filters {
  padding: 10px 12px; border-bottom: 1px solid var(--bd);
  display: flex; gap: 6px; flex-wrap: wrap;
}
.history-filters select {
  height: 28px; padding: 0 8px; border: 1px solid var(--bd2);
  border-radius: 6px; background: var(--input-bg); font-size: var(--fs-xs);
  color: var(--tx);
}

/* ── Status badges ── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
}
.badge-running  { background: rgba(0,113,227,.12); color: var(--a); }
.badge-ok       { background: rgba(52,199,89,.12); color: #1a8c40; }
.badge-errors   { background: rgba(255,159,10,.12); color: #b06800; }
.badge-failed   { background: rgba(255,59,48,.12); color: #c0392b; }
.badge-validate { background: var(--bg3); color: var(--dim); }
.badge-mcp {
  display: inline-block; padding: 1px 5px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: rgba(175,82,222,.12); color: #9b40cc;
  vertical-align: middle; margin-left: 4px;
}
html[data-theme="dark"] .badge-mcp { color: #bf5af2; }
html[data-theme="dark"] .badge-ok     { color: #34c759; }
html[data-theme="dark"] .badge-errors { color: #ff9f0a; }
html[data-theme="dark"] .badge-failed { color: #ff453a; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center;
  z-index: 200;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--modal-bg); border-radius: var(--radius-lg);
  padding: 24px; width: 480px; max-width: 94vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  display: flex; flex-direction: column; gap: 16px;
}
.modal-title { font-size: var(--fs-md); font-weight: 700; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Toast ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 300;
}
.toast {
  background: var(--toast-bg); border: 1px solid var(--bd2);
  border-radius: var(--radius); padding: 10px 16px;
  font-size: var(--fs-sm); min-width: 220px;
  box-shadow: 0 4px 20px var(--shadow);
  animation: toastIn .2s ease;
}
.toast.ok   { border-left: 3px solid var(--ok); }
.toast.err  { border-left: 3px solid var(--danger); }
.toast.warn { border-left: 3px solid var(--warn); }
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ── Misc ── */
.hidden { display: none !important; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-end { justify-content: flex-end; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
hr.divider { border: none; border-top: 1px solid var(--bd); margin: 16px 0; }

/* ── Sidebar search ── */
#sidebar-tree { flex: 1; overflow-y: auto; }
#sidebar-version {
  padding: 10px 14px 2px;
  font-size: 11px;
  color: var(--dim);
  border-top: 1px solid var(--bd);
  margin-top: 4px;
  flex-shrink: 0;
}
.sidebar-search-wrap {
  padding: 8px 10px 4px;
  border-bottom: 1px solid var(--bd);
}
.sidebar-search {
  width: 100%; height: 30px; padding: 0 10px;
  background: var(--bg3); border: 1px solid var(--bd2);
  border-radius: 8px; font-size: var(--fs-sm); color: var(--tx);
}
.sidebar-search:focus { outline: none; border-color: var(--a); background: var(--input-bg-focus); }
.sidebar-search-results { padding: 6px 0; }
.sidebar-search-group {
  padding: 4px 12px 2px;
  font-size: var(--fs-xs); font-weight: 700; color: var(--dim2);
  text-transform: uppercase; letter-spacing: .5px;
}
.sidebar-search-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; cursor: pointer;
  font-size: var(--fs-nm); color: var(--dim);
  transition: background .1s, color .1s;
}
.sidebar-search-item:hover { background: var(--bg3); color: var(--tx); }
.sidebar-search-item .meta { font-size: var(--fs-xs); color: var(--dim2); margin-left: auto; white-space: nowrap; }

/* ── Admin screen ── */
.admin-wrap {
  display: flex; height: 100%; overflow-x: auto; overflow-y: hidden;
}
.admin-wrap::-webkit-scrollbar { height: 6px; }
.admin-wrap::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 3px; }
.admin-col {
  flex: 1; display: flex; flex-direction: column;
  border-right: 1px solid var(--bd); overflow: hidden;
  min-width: 220px;
}
.admin-col:last-child { border-right: none; }
.admin-col-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--bd);
  background: var(--bg2); flex-shrink: 0;
}
.admin-col-title {
  flex: 1; font-size: var(--fs-sm); font-weight: 700;
}
.admin-col-list {
  flex: 1; overflow-y: auto; padding: 6px 0;
}
.admin-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; cursor: pointer;
  font-size: var(--fs-sm); color: var(--tx);
  border-left: 3px solid transparent;
  transition: background .12s;
}
.admin-item:hover { background: var(--bg3); }
.admin-item.active { background: rgba(0,113,227,.07); border-left-color: var(--a); }
.admin-item .admin-item-name { flex: 1; font-weight: 500; }
.admin-item .admin-item-sub  { font-size: var(--fs-xs); color: var(--dim); }
.admin-item .admin-item-edit {
  opacity: 0; padding: 2px 8px; border-radius: 5px;
  border: 1px solid var(--bd2); background: var(--bg2);
  font-size: var(--fs-xs); color: var(--dim); cursor: pointer;
  transition: opacity .1s;
}
.admin-item:hover .admin-item-edit { opacity: 1; }
.admin-empty {
  padding: 20px 14px; font-size: var(--fs-sm); color: var(--dim2);
}

/* ── Settings modal — theme + size pickers ── */
.cfg-section-title {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--dim2); margin-bottom: 10px;
}
.cfg-theme-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.cfg-theme-opt {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  cursor: pointer; padding: 6px 8px; border-radius: 12px;
  border: 2px solid transparent; background: none;
  transition: border-color .15s, background .15s;
}
.cfg-theme-opt:hover { background: rgba(128,128,128,.06); }
.cfg-theme-opt.active { border-color: var(--a); background: rgba(0,113,227,.06); }
.cfg-theme-opt > span { font-size: var(--fs-xs); font-weight: 600; color: var(--dim); letter-spacing: .02em; }
.cfg-theme-opt.active > span { color: var(--a); }
.theme-prev {
  width: 62px; height: 42px; border-radius: 9px;
  border: 1.5px solid var(--bd); overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.10);
}
.theme-prev-light    { background: linear-gradient(135deg, #F5F5F7 50%, #FFFFFF 50%); }
.theme-prev-graphite { background: linear-gradient(135deg, #242426 50%, #323234 50%); }
.theme-prev-dark     { background: linear-gradient(135deg, #000000 50%, #1C1C1E 50%); }
.theme-prev-overa-hr {
  background: linear-gradient(135deg, #f5f5f5 55%, #ffffff 55%);
  border: 1.5px solid #d0d0d0;
  position: relative;
}
.theme-prev-overa-hr::after {
  content: ''; position: absolute; bottom: 5px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%; background: #4c8cd5;
}
html[data-theme="overa-hr"] .cfg-theme-opt.active { border-color: #4c8cd5; background: rgba(76,140,213,.08); }
html[data-theme="overa-hr"] .cfg-theme-opt.active > span { color: #4c8cd5; }

/* ── Select option fix — dark/graphite themes ── */
html[data-theme="graphite"] select,
html[data-theme="dark"] select {
  background-color: var(--bg3);
  color: var(--tx);
}
html[data-theme="graphite"] select option,
html[data-theme="graphite"] select optgroup,
html[data-theme="dark"] select option,
html[data-theme="dark"] select optgroup {
  background-color: var(--bg3);
  color: var(--tx);
}

/* ── Admin items — API button ── */
.admin-item-api {
  flex-shrink: 0; padding: 3px 7px; border-radius: 5px;
  border: 1px solid var(--a); background: none;
  font-size: var(--fs-xs); font-weight: 600; color: var(--a);
  opacity: 0; transition: opacity .12s, background .12s;
}
.admin-item:hover .admin-item-api { opacity: 1; }
.admin-item-api:hover { background: rgba(0,113,227,.08); }

/* ── Credentials modal ── */
.modal-wide { width: 560px; max-width: 95vw; }
.creds-tabs {
  display: flex; gap: 2px; margin: 4px 0 16px;
  border-bottom: 1px solid var(--bd); padding-bottom: 0;
}
.creds-tab {
  padding: 6px 16px; border: none; background: none;
  font-size: var(--fs-sm); font-weight: 500; color: var(--dim);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .12s, border-color .12s;
  cursor: pointer;
}
.creds-tab:hover { color: var(--tx); }
.creds-tab.active { color: var(--a); border-bottom-color: var(--a); font-weight: 600; }
.creds-section-label {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--dim2); margin-bottom: 10px;
}
.field-hint-inline {
  font-size: var(--fs-xs); color: var(--dim2); font-weight: 400;
}

/* ── Utilities ── */
.utilities-layout { display: flex; height: 100%; }
.utilities-list { width: 260px; flex-shrink: 0; border-right: 1px solid var(--bd); overflow-y: auto; }
.utilities-list-header { padding: 14px 16px 10px; font-size: var(--fs-sm); font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.utility-card { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--bd); transition: background .15s; }
.utility-card:hover { background: var(--bg3); }
.utility-card.active { background: rgba(0,113,227,.08); border-left: 3px solid var(--a); }
.utility-card-icon { font-size: 1.4rem; }
.utility-card-name { font-weight: 600; margin-top: 4px; }
.utility-card-desc { font-size: var(--fs-sm); color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.utilities-panel { flex: 1; overflow-y: auto; padding: 24px; }
.utilities-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; }

.utility-panel-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.utility-panel-icon { font-size: 2rem; }
.utility-panel-name { font-size: 1.25rem; font-weight: 700; }
.utility-panel-desc { font-size: var(--fs-sm); color: var(--dim); margin-top: 2px; }

.utility-form { background: var(--bg2); border: 1px solid var(--bd); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.utility-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.utility-form .field { margin-bottom: 14px; }

.multiselect-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px; margin-top: 2px;
  background: var(--bg3); border: 1px solid var(--bd2);
  border-radius: 8px;
  min-height: 44px;
}
.multiselect-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px;
  background: var(--bg1); border: 1.5px solid var(--bd2);
  border-radius: 20px; cursor: pointer;
  font-size: var(--fs-sm); user-select: none;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.multiselect-chip:hover { border-color: var(--a); background: var(--bg2); }
.multiselect-chip input { display: none; }
.multiselect-chip:has(input:checked) {
  background: var(--a); border-color: var(--a); color: #fff;
}
.multiselect-chip:has(input:checked)::before {
  content: '✓'; font-size: 11px; font-weight: 700;
}
.multiselect-count { font-size: var(--fs-xs); color: var(--dim2); margin-top: 4px; }

.utility-launch-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.launch-status { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }

/* ── Form.io integration ──────────────────────────────────────────────────── */
/* Scope all Form.io / Bootstrap overrides inside .formio-wrap */
.formio-wrap { margin-top: 8px; }

/* Re-apply our body font inside formio to undo Bootstrap's reset */
.formio-wrap,
.formio-wrap * { font-family: 'DM Sans', system-ui, -apple-system, sans-serif; box-sizing: border-box; }

/* Labels */
.formio-wrap .col-form-label,
.formio-wrap label.col-form-label { font-size: var(--fs-sm); font-weight: 500; color: var(--dim); margin-bottom: 4px; padding: 0; }

/* Form groups */
.formio-wrap .form-group { margin-bottom: 14px; }

/* Inputs / selects / textareas */
.formio-wrap .form-control {
  height: 36px; padding: 0 10px;
  background: var(--input-bg); border: 1px solid var(--bd2);
  border-radius: 8px; color: var(--tx);
  font-size: var(--fs-sm);
  transition: border-color .15s, box-shadow .15s;
  box-shadow: none;
}
.formio-wrap .form-control:focus {
  border-color: var(--a);
  box-shadow: 0 0 0 3px rgba(0,113,227,.12);
  background: var(--input-bg-focus);
  outline: none;
}
.formio-wrap textarea.form-control { height: auto; padding: 8px 10px; resize: vertical; }

/* Select with choices.js — hide default select, style the choices container */
.formio-wrap .choices { margin: 0; }
.formio-wrap .choices__inner {
  min-height: 36px; padding: 3px 8px;
  background: var(--input-bg); border: 1px solid var(--bd2);
  border-radius: 8px; font-size: var(--fs-sm); color: var(--tx);
}
.formio-wrap .choices__inner:focus-within { border-color: var(--a); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
.formio-wrap .choices__list--dropdown { border-radius: 8px; border: 1px solid var(--bd2); box-shadow: 0 4px 16px var(--shadow); background: var(--bg2); z-index: 9999; }
.formio-wrap .choices__list--dropdown .choices__item { font-size: var(--fs-sm); padding: 7px 12px; color: var(--tx); }
.formio-wrap .choices__list--dropdown .choices__item--selectable.is-highlighted { background: rgba(0,113,227,.1); color: var(--a); }
.formio-wrap .choices__item--selectable { padding-right: 20px; }

/* Selected chips inside multiselect choices */
.formio-wrap .choices__list--multiple .choices__item {
  background: var(--a); border: none; border-radius: 20px;
  font-size: var(--fs-xs); padding: 2px 10px; margin: 2px 3px 2px 0;
}
.formio-wrap .choices__button { background-color: transparent; border-left: 1px solid rgba(255,255,255,.4); opacity: .8; filter: invert(1); }

/* Checkbox */
.formio-wrap .checkbox label,
.formio-wrap .form-check-label { font-size: var(--fs-sm); color: var(--tx); cursor: pointer; }
.formio-wrap input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--a); cursor: pointer; }

/* Validation errors */
.formio-wrap .formio-errors .error,
.formio-wrap .form-text.error { font-size: var(--fs-xs); color: var(--danger); margin-top: 3px; }
.formio-wrap .has-error .form-control,
.formio-wrap .has-message .form-control { border-color: var(--danger); }

/* Hide default Form.io submit/cancel buttons if they leak through */
.formio-wrap [ref="buttonSubmit"],
.formio-wrap [ref="buttonCancel"],
.formio-wrap [ref="buttonReset"] { display: none !important; }

/* Info box helper used in htmlelement components */
.formio-wrap .formio-info-box {
  background: rgba(0,113,227,.06); border: 1px solid rgba(0,113,227,.2);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px;
}

/* Ensure Bootstrap grid in formio doesn't break our layout */
.formio-wrap .row { margin-left: 0; margin-right: 0; }
.formio-wrap .col-sm-12 { padding-left: 0; padding-right: 0; }

.util-exec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.util-exec-table th { text-align: left; padding: 6px 10px; color: var(--dim); border-bottom: 1px solid var(--bd); font-weight: 500; }
.util-exec-table td { padding: 7px 10px; border-bottom: 1px solid var(--bd); }
.util-exec-table tr:last-child td { border-bottom: none; }

.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.status-badge.launching, .status-badge.launched { background: #fff3cd; color: #856404; }
.status-badge.running { background: #dbeafe; color: #1e40af; }
.status-badge.completed { background: #d1fae5; color: #065f46; }
.status-badge.failed { background: #fee2e2; color: #991b1b; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-c,rgba(0,0,0,.14)); border-radius: 3px; }
