/* Real dcycle product chrome — mirrors dcycle-front-app
   Used by all Leia iframe mockups */

:root {
  --c-primary: #2945ff;
  --c-primary-h: #1a35e0;
  --c-cyan: #38cfd9;
  --c-purple: #ced2fa;
  --c-sec-80: #f0f3fe;
  --c-sec-40: rgba(41, 69, 255, 0.12);
  --c-warm-60: #eaeaea;
  --c-warm-40: #d1d4d8;
  --c-cold-20: #415062;
  --c-cold-10: #1e293b;
  --c-white: #ffffff;
  --c-bg: #fafbfc;
  --c-success: #009ca6;
  --c-error: #ff2990;
  --c-warning: #ff7629;

  /* Official Leia angular gradient */
  --leia-grad: conic-gradient(from 90deg at 50% 50%,
    #8CB8FF 0deg,
    #2945FF 180deg,
    #162ECE 253deg,
    #2337C2 360deg);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-10: 0 4px 4px -2px rgba(65, 80, 98, 0.06), 0 2px 4px -2px rgba(65, 80, 98, 0.08);
  --shadow-20: 0 8px 12px -4px rgba(65, 80, 98, 0.08), 0 4px 6px -4px rgba(65, 80, 98, 0.1);
}

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

html, body {
  width: 1280px;
  height: 800px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  background: var(--c-bg);
  color: var(--c-cold-10);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
}

/* ── App frame — locked to 1280x800, single column (no sidebar) ───── */
.app {
  display: flex;
  flex-direction: column;
  width: 1280px;
  height: 800px;
  background: var(--c-bg);
}

/* Topbar logo (mini D mark on the left, replacing the sidebar workspace switcher) */
.topbar .tb-brand {
  display: inline-flex; align-items: center; gap: 8px;
  margin-right: 14px;
  padding-right: 14px;
  border-right: 1px solid var(--c-warm-60);
}
.topbar .tb-brand .d-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.topbar .tb-brand .d-mark svg { width: 13px; height: 13px; fill: white; }
.topbar .tb-brand .name { font-size: 12px; font-weight: 600; color: var(--c-cold-10); }

/* ── Mouse cursor (animated) ───────────────────── */
.cursor-svg {
  position: absolute;
  width: 22px; height: 22px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  z-index: 50;
  pointer-events: none;
  will-change: transform, opacity;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}
.cursor-click-ring {
  position: absolute;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--c-primary);
  z-index: 49;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
}

/* ── Shared "Leia is doing X" pattern ──────── */

/* Big banner header: makes it crystal clear what Leia is doing */
.leia-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(180deg, rgba(240, 243, 254, 0.85), rgba(255, 255, 255, 0.7));
  border: 1px solid var(--c-warm-60);
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-10);
}
.leia-banner .lb-mark {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--c-warm-60);
}
.leia-banner .lb-mark img {
  width: 28px; height: 28px;
  animation: leia-banner-spin 12s linear infinite;
}
@keyframes leia-banner-spin { to { transform: rotate(360deg); } }
.leia-banner .lb-body { flex: 1; min-width: 0; }
.leia-banner .lb-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: 4px;
}
.leia-banner .lb-action {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--c-cold-10);
  line-height: 1.25;
}
.leia-banner .lb-progress {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--c-cold-20);
  font-weight: 500;
}
.leia-banner .lb-progress .dot {
  width: 6px; height: 6px;
  background: var(--c-primary);
  border-radius: 50%;
  animation: lb-pulse 1.4s ease-in-out infinite;
}
@keyframes lb-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.4; }
}

/* Live steps list — Leia's thinking */
.leia-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.leia-steps .step {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px;
  color: var(--c-cold-20);
  line-height: 1.5;
  transition: color 0.4s;
}
.leia-steps .step .marker {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--c-warm-40);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.4s, border-color 0.4s;
  background: white;
}
.leia-steps .step .marker svg { width: 9px; height: 9px; color: white; opacity: 0; }
.leia-steps .step .spinner {
  width: 10px; height: 10px;
  border: 1.5px solid rgba(41, 69, 255, 0.2);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  opacity: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.leia-steps .step.active { color: var(--c-cold-10); font-weight: 500; }
.leia-steps .step.active .marker { border-color: var(--c-primary); background: white; }
.leia-steps .step.active .spinner { opacity: 1; }

.leia-steps .step.done { color: var(--c-cold-10); }
.leia-steps .step.done .marker {
  background: var(--c-success);
  border-color: var(--c-success);
}
.leia-steps .step.done .marker svg { opacity: 1; }

/* Toast notification (slides in from right) */
.toast {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 12px;
  background: white;
  border: 1px solid var(--c-warm-60);
  border-radius: 999px;
  box-shadow: var(--shadow-20);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-cold-10);
  z-index: 40;
  opacity: 0;
  transform: translateX(20px);
}
.toast .ic {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,156,166,0.15);
  color: var(--c-success);
  display: flex; align-items: center; justify-content: center;
}
.toast .ic svg { width: 11px; height: 11px; }
.toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* ── Left sidebar ──────────────────────── */
.sidebar {
  background: var(--c-white);
  border-right: 1px solid var(--c-warm-60);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sb-top {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--c-warm-60);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sb-back {
  display: flex; align-items: center; gap: 6px;
  color: var(--c-cold-20);
  font-size: 11px;
  font-weight: 500;
}
.sb-back svg { width: 12px; height: 12px; }
.sb-project {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--c-bg);
  border: 1px solid var(--c-warm-60);
}
.sb-project .d-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-project .d-mark svg { width: 13px; height: 13px; fill: white; }
.sb-project .name {
  font-size: 12px; font-weight: 600;
  color: var(--c-cold-10);
  flex: 1;
}
.sb-project .chev {
  width: 12px; height: 12px;
  color: var(--c-cold-20);
}

.sb-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--c-cold-20);
  padding: 8px 8px 4px;
  margin-top: 8px;
}
.sb-group:first-child { margin-top: 0; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--c-cold-20);
  cursor: pointer;
  transition: background 0.12s;
}
.sb-item:hover { background: var(--c-bg); }
.sb-item.active {
  background: var(--c-sec-80);
  color: var(--c-primary);
  font-weight: 500;
}
.sb-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.sb-item .count {
  margin-left: auto;
  background: var(--c-warm-60);
  color: var(--c-cold-20);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}

.sb-bottom {
  border-top: 1px solid var(--c-warm-60);
  padding: 6px 8px 10px;
}
.sb-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
}
.sb-user .av {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--c-sec-80);
  color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0;
}
.sb-user .who { font-size: 11px; font-weight: 600; color: var(--c-cold-10); }
.sb-user .role { font-size: 10px; color: var(--c-cold-20); }

/* ── Main column (kept for legacy compat; no-op when not present) ───── */
.main {
  display: grid;
  grid-template-rows: 44px 1fr;
  overflow: hidden;
  flex: 1;
}

/* When .topbar + .workspace are direct children of .app (no .main wrapper) */
.app > .topbar { height: 44px; flex-shrink: 0; }
.app > .workspace { flex: 1; }

.topbar {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-warm-60);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 8px;
  font-size: 12px;
}
.crumb {
  display: flex; align-items: center; gap: 6px;
  color: var(--c-cold-20);
}
.crumb .sep { opacity: 0.4; }
.crumb .now { color: var(--c-cold-10); font-weight: 500; }
.crumb .leia-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px 2px 4px;
  background: var(--c-bg);
  border: 1px solid var(--c-warm-60);
  border-radius: 6px;
}
.crumb .leia-chip img { width: 12px; height: 12px; }
.tb-spacer { flex: 1; }
.tb-avs {
  display: flex; align-items: center;
}
.tb-avs .av {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-sec-80);
  color: var(--c-primary);
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--c-white);
  margin-left: -6px;
}
.tb-avs .av:first-child { margin-left: 0; }
.tb-avs .plus { background: var(--c-warm-60); color: var(--c-cold-20); }
.tb-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  color: var(--c-cold-20);
  display: flex; align-items: center; justify-content: center;
}
.tb-icon:hover { background: var(--c-bg); }
.tb-icon svg { width: 14px; height: 14px; }

.workspace {
  overflow: hidden;
  position: relative;
  display: flex;
  background: var(--c-bg);
}

/* ── Cards / panels ─────────────────────── */
.panel {
  background: var(--c-white);
  border: 1px solid var(--c-warm-60);
  border-radius: var(--radius);
}
.panel-h {
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-warm-60);
  display: flex; align-items: center; gap: 8px;
}
.panel-h .t {
  font-size: 13px; font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--c-cold-10);
}

/* Tables (light blue header like product) */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tbl thead th {
  background: var(--c-sec-80);
  color: var(--c-cold-20);
  font-weight: 600;
  font-size: 11px;
  text-align: left;
  padding: 10px 14px;
  letter-spacing: 0;
}
.tbl thead th:first-child { border-top-left-radius: 8px; }
.tbl thead th:last-child { border-top-right-radius: 8px; }
.tbl tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-warm-60);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody td.v { font-weight: 600; color: var(--c-cold-10); }
.tbl tbody td .hl {
  font-weight: 600; color: var(--c-cold-10);
}

/* Badges */
.bdg {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px; font-weight: 500;
}
.bdg.success { background: rgba(0, 156, 166, 0.1); color: var(--c-success); }
.bdg.warn { background: rgba(255, 118, 41, 0.1); color: var(--c-warning); }
.bdg.error { background: rgba(255, 41, 144, 0.1); color: var(--c-error); }
.bdg.info { background: var(--c-sec-80); color: var(--c-primary); }
.bdg.quickwin {
  background: rgba(0, 156, 166, 0.12);
  color: var(--c-success);
  font-weight: 600;
}
.bdg.dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--c-warm-40);
  background: var(--c-white);
  color: var(--c-cold-10);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { border-color: var(--c-cold-20); }
.btn.primary {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}
.btn.primary:hover { background: var(--c-primary-h); border-color: var(--c-primary-h); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--c-cold-20); }
.btn.ghost:hover { background: var(--c-bg); color: var(--c-cold-10); }
.btn.sm { padding: 4px 10px; font-size: 11px; }

/* "Ask Leia" input */
.ask-leia {
  position: relative;
  background: var(--c-white);
  border: 1px solid var(--c-warm-60);
  border-radius: 12px;
  padding: 12px 50px 12px 14px;
  font-size: 12px;
  color: var(--c-cold-20);
  margin: 14px;
}
.ask-leia .send {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--c-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
}
.ask-leia .send svg { width: 14px; height: 14px; }

/* Right tab panel */
.tabs-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--c-warm-60);
}
.tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-cold-20);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--c-cold-10); }
.tab.active {
  color: var(--c-cold-10);
  border-bottom-color: var(--c-primary);
}
.tab svg { width: 13px; height: 13px; }
.tab .pill {
  background: var(--c-primary);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
}

/* Inline highlights */
.code-hl {
  font-family: inherit;
  font-weight: 600;
  color: var(--c-cold-10);
}

/* Live status pill (like "Revisando perfil eléctrico") */
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--c-white);
  border: 1px solid var(--c-warm-60);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--c-cold-10);
  box-shadow: var(--shadow-sm);
}
.live-pill .mark {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-sec-80);
  display: flex; align-items: center; justify-content: center;
}
.live-pill .mark img { width: 14px; height: 14px; }
.live-pill .flash {
  color: var(--c-primary);
  margin-right: 2px;
}
.live-pill .flash svg { width: 11px; height: 11px; }

/* Cursor */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--c-cold-10);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Common fade */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shared icons util */
.ic { width: 14px; height: 14px; flex-shrink: 0; }
