/* Gearbe: piezas nuevas sobre la base del taller (base.css). */

/* ---------- Acceso ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.auth-col { width: min(420px, 100%); display: grid; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; text-decoration: none; color: var(--ink); }
.auth-card { padding: 22px; display: grid; gap: 14px; }
.auth-card h1 { font-size: 26px; }
.auth-card .lede { margin: 0; }
.auth-foot { text-align: center; font-size: 14px; color: var(--muted); }
.auth-foot a, .linkish { color: var(--machine); font-weight: 600; }
.linkish { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.check input { margin-top: 3px; accent-color: var(--machine); width: 16px; height: 16px; flex: 0 0 auto; }
.form-error { color: var(--err); background: var(--err-soft); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13.5px; margin: 0; }
.form-ok { color: var(--ok); background: var(--ok-soft); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13.5px; margin: 0; }

/* ---------- Avisos ---------- */
.banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius); border: 1px solid transparent; font-size: 14px; }
.banner.info { background: var(--machine-soft); color: var(--ink); border-color: var(--line); }
.banner.warn { background: var(--warn-soft); color: var(--ink); }
.banner.err { background: var(--err-soft); color: var(--ink); }
.banner b { font-weight: 650; }

/* ---------- Barra lateral: plan y usuario ---------- */
.usage-mini { display: grid; gap: 6px; }
.usage-mini .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.meter { height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--machine); border-radius: 999px; }
.meter.warn > span { background: var(--brass); }
.meter.full > span { background: var(--err); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: var(--radius-sm); }
.user-chip .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--machine-soft); color: var(--machine); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.user-chip .who { min-width: 0; font-size: 13px; line-height: 1.25; }
.user-chip .who span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Conexiones ---------- */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.conn-card { padding: 14px 16px; display: grid; gap: 10px; }
.conn-card .top { display: flex; gap: 10px; align-items: center; }
.conn-card .top > div { min-width: 0; flex: 1; }
.conn-card .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-card .meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-card .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.steps-guide { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.code-block { margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.45; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; max-height: 260px; overflow: auto; white-space: pre; }
.seg-tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface); gap: 2px; flex-wrap: wrap; }
.seg-tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Editor: conexión y entrada ---------- */
.cred-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.with-btn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.endpoint { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.endpoint .eyebrow { font-size: 11px; }
.endpoint .url { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.endpoint .url code { font-family: var(--font-mono); font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; overflow-x: auto; white-space: nowrap; display: block; }
.endpoint ol { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.save-state { font-size: 12.5px; color: var(--faint); min-width: 76px; }
.save-state.err { color: var(--err); }
.problems { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.problems li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.node.has-problem { border-color: var(--brass); }

/* ---------- Historial ---------- */
.filters-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters-row select { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 10px; background: var(--surface); }
.run-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.run-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

/* ---------- Facturación ---------- */
.usage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.usage-card { padding: 14px 16px; display: grid; gap: 8px; }
.usage-card .label { font-size: 12.5px; color: var(--muted); }
.usage-card .value { font-family: var(--font-display); font-stretch: 112%; font-weight: 750; font-size: 22px; }
.usage-card .value small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--muted); }
.plan .current { position: absolute; top: -11px; right: 18px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; letter-spacing: .04em; text-transform: uppercase; }
.plan { position: relative; }

/* ---------- Cuenta ---------- */
.settings { display: grid; gap: 16px; max-width: 720px; }
.settings .panel-pad { display: grid; gap: 12px; }
.danger-zone { border-color: var(--err-soft); }

/* ---------- Varios ---------- */
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.center-load { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.hide { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: grid; gap: 12px; }
.row-wrap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-only svg { width: 16px; height: 16px; }

@media (max-width: 860px) {
  .usage-grid { grid-template-columns: minmax(0, 1fr); }
  .conn-grid { grid-template-columns: minmax(0, 1fr); }
  .bottom-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Navegación con enlaces */
.nav a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; text-decoration: none; }
.nav a svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--machine-soft); color: var(--machine); font-weight: 600; }
.bottom-nav a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; font-size: 11px; color: var(--muted); border-radius: 8px; text-decoration: none; }
.bottom-nav a svg { width: 20px; height: 20px; }
.bottom-nav a[aria-current="page"] { color: var(--machine); font-weight: 600; background: var(--machine-soft); }
a.btn { text-decoration: none; }
.side-foot a:not(.btn):not(.user-chip) { color: var(--machine); font-weight: 600; text-decoration: none; }

/* Ajustes de la barra lateral y primeros pasos */
.side { min-width: 0; overflow: hidden; }
.side-foot, .side-foot > * { min-width: 0; max-width: 100%; }
.user-chip .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ob-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14.5px; }
.ob-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; border: 2px solid var(--line-strong); color: transparent; }
.ob-dot.done { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.ob-list .done-text { color: var(--muted); text-decoration: line-through; }

/* «Pídele un cambio» en el editor */
.ai-edit { display: grid; gap: 6px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ai-edit-row { display: flex; gap: 8px; align-items: center; }
.ai-edit-row .app-tile { width: 30px; height: 30px; flex: 0 0 auto; }
.ai-edit input { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; }
.ai-edit .form-error { margin: 0; }
@media (max-width: 560px) { .ai-edit-row { flex-wrap: wrap; } .ai-edit input { flex-basis: calc(100% - 40px); } }

/* Tu negocio: copias de seguridad y embudo */
:root { --viz-1: #008300; }
.backup-box { margin: 14px 0; }
.backup-box .row-wrap { align-items: center; gap: 10px; }
.chip.err { color: var(--err); background: var(--err-soft); border-color: transparent; }
.panel-head .row-wrap select { min-height: 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); padding: 0 8px; font: inherit; font-size: 13.5px; }
.panel table th[scope="row"] { text-transform: none; letter-spacing: normal; font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ink); }
table.funnel .fz-cell { width: 34%; min-width: 120px; }
.fbar { display: block; height: 10px; border-radius: 4px; background: var(--surface-2); }
.fbar > span { display: block; height: 100%; border-radius: 4px; background: var(--viz-1); }
.hint.panel-pad { padding-top: 10px; padding-bottom: 12px; }

/* Confirmar la automatización de la demo */
.demo-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.demo-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.demo-steps .app-tile { width: 30px; height: 30px; flex: 0 0 auto; }
