:root {
  --primary: 237 100% 40%;
  --primary-strong: 237 100% 34%;
  --primary-soft: 237 100% 96%;
  --secondary: 160 75% 70%;
  --background: 280 40% 97%;
  --foreground: 0 0% 10%;
  --card: 0 0% 100%;
  --muted: 280 30% 92%;
  --muted-foreground: 280 8% 42%;
  --border: 280 20% 90%;
  --success: 157 62% 36%;
  --success-soft: 157 55% 94%;
  --warning: 35 92% 46%;
  --warning-soft: 39 100% 94%;
  --danger: 355 72% 48%;
  --danger-soft: 355 80% 96%;
  --shadow: 280 30% 20%;
  --sidebar-width: 248px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
}

.dark {
  --primary: 237 100% 60%;
  --primary-strong: 237 100% 68%;
  --primary-soft: 280 48% 22%;
  --secondary: 160 75% 70%;
  --background: 280 75% 15%;
  --foreground: 280 70% 90%;
  --card: 280 60% 18%;
  --muted: 280 50% 22%;
  --muted-foreground: 280 22% 70%;
  --border: 280 40% 30%;
  --success-soft: 157 38% 18%;
  --warning-soft: 35 45% 20%;
  --danger-soft: 355 42% 20%;
  --shadow: 280 90% 4%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  font-family: "DM Sans", "Avenir Next", Avenir, Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid hsl(var(--secondary)); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.03em; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.02; font-weight: 600; }
h2 { font-size: 1.28rem; line-height: 1.2; font-weight: 600; }
h3 { font-size: 1rem; line-height: 1.35; font-weight: 600; }
.muted { color: hsl(var(--muted-foreground)); }
.eyebrow { display: block; color: hsl(var(--muted-foreground)); font-size: .7rem; line-height: 1.2; letter-spacing: .11em; text-transform: uppercase; font-weight: 800; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.08rem; font-weight: 700; letter-spacing: -.03em; }
.brand-logo { display: block; width: 106px; height: auto; object-fit: contain; }
.brand-logo-dark { display: none; }
.dark .brand-logo-light { display: none; }
.dark .brand-logo-dark { display: block; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); cursor: pointer; font-weight: 700; transition: transform .15s ease, background .15s ease, opacity .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button.primary { color: hsl(0 0% 100%); background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.button.primary:hover:not(:disabled) { background: hsl(var(--primary-strong)); }
.button.full { width: 100%; }
.text-button { color: hsl(var(--muted-foreground)); background: none; border: 0; cursor: pointer; font-size: .78rem; font-weight: 700; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 50%; cursor: pointer; }
.panel { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); box-shadow: 0 12px 35px hsl(var(--shadow) / .045); }
.alert { margin: 18px 0; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .88rem; }
.alert-error { color: hsl(var(--danger)); background: hsl(var(--danger-soft)); border: 1px solid hsl(var(--danger) / .18); }
.toast { position: fixed; z-index: 100; top: 20px; right: 24px; padding: 12px 18px; color: hsl(0 0% 100%); background: hsl(var(--foreground)); border-radius: var(--radius-sm); box-shadow: 0 15px 40px hsl(var(--shadow) / .2); animation: toast-in .25s ease-out; transition: opacity .2s ease, transform .2s ease; }
.toast.hide { opacity: 0; transform: translateY(-8px); pointer-events: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* Acceso */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .92fr) 1.08fr; background: hsl(var(--card)); }
.auth-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; overflow: hidden; padding: 48px clamp(36px, 6vw, 90px); color: hsl(280 70% 92%); background: hsl(280 75% 15%); }
.auth-panel::before, .auth-panel::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-panel::before { width: 38vw; height: 38vw; right: -18vw; top: 16%; background: hsl(var(--primary) / .45); filter: blur(3px); }
.auth-panel::after { width: 24vw; height: 24vw; left: -12vw; bottom: -10vw; background: hsl(var(--secondary) / .22); filter: blur(30px); }
.auth-panel > * { position: relative; z-index: 1; }
.auth-brand .brand-logo-light { display: none; }
.auth-brand .brand-logo-dark { display: block; }
.auth-copy { max-width: 580px; }
.auth-copy .eyebrow { color: hsl(var(--secondary)); }
.auth-copy h1 { max-width: 600px; margin: 18px 0 22px; font-size: clamp(2.9rem, 6vw, 5.5rem); font-weight: 500; }
.auth-copy p { max-width: 510px; color: hsl(280 32% 78%); font-family: "PT Serif", Georgia, serif; font-size: 1.3rem; line-height: 1.5; }
.auth-principle { max-width: 360px; padding-top: 20px; border-top: 1px solid hsl(280 40% 35%); }
.auth-principle span { color: hsl(var(--secondary)); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.auth-principle p { margin: 8px 0 0; color: hsl(280 35% 82%); }
.auth-form-wrap { display: grid; place-items: center; min-height: 100vh; padding: 42px; background: hsl(var(--background)); }
.auth-form { width: min(430px, 100%); padding: 42px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); box-shadow: 0 30px 80px hsl(var(--shadow) / .08); }
.auth-form h2 { margin: 8px 0 6px; font-size: 2rem; }
.auth-form > label, .workflow-card label { display: grid; gap: 8px; margin: 18px 0; font-size: .78rem; font-weight: 800; }
.auth-form input, .workflow-card textarea { width: 100%; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); padding: 13px 14px; transition: border .15s, box-shadow .15s; }
.auth-form input:focus, .workflow-card textarea:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .12); outline: 0; }
.setup-steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.setup-steps li { display: flex; align-items: center; gap: 12px; color: hsl(280 24% 64%); }
.setup-steps li span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid hsl(280 35% 38%); border-radius: 50%; font-size: .75rem; font-weight: 800; }
.setup-steps .done, .setup-steps .current { color: hsl(280 70% 92%); }
.setup-steps .done span { color: hsl(280 75% 15%); background: hsl(var(--secondary)); border-color: hsl(var(--secondary)); }
.setup-steps .current span { border-color: hsl(var(--secondary)); }

/* Aplicación */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 28px 18px 22px; background: hsl(var(--card)); border-right: 1px solid hsl(var(--border)); }
.sidebar .brand { padding: 0 10px 26px; }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; min-height: 46px; gap: 12px; padding: 0 12px; color: hsl(var(--muted-foreground)); border-radius: var(--radius-sm); font-size: .88rem; font-weight: 650; }
.nav-item svg { width: 19px; }
.nav-item:hover:not(.disabled), .nav-item.active { color: hsl(var(--primary)); background: hsl(var(--primary-soft)); }
.nav-item.disabled { cursor: default; opacity: .55; }
.nav-item small { margin-left: auto; font-size: .57rem; letter-spacing: .06em; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid hsl(var(--border)); }
.tenant-switcher { display: flex; align-items: center; gap: 10px; padding: 8px; }
.tenant-avatar, .user-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; color: hsl(0 0% 100%); background: hsl(var(--primary)); border-radius: 10px; font-weight: 800; }
.tenant-switcher span:last-child { display: grid; }
.tenant-switcher strong { font-size: .82rem; }
.tenant-switcher small { color: hsl(var(--muted-foreground)); font-size: .68rem; }
.sidebar-footer > p { margin: 12px 8px 0; color: hsl(var(--muted-foreground)); font-size: .66rem; }
.main-area { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 clamp(24px, 4vw, 54px); background: hsl(var(--background) / .88); border-bottom: 1px solid hsl(var(--border)); backdrop-filter: blur(14px); }
.topbar-context { display: grid; gap: 2px; }
.topbar-context strong { font-size: .92rem; }
.topbar-actions, .user-menu { display: flex; align-items: center; gap: 12px; }
.user-menu { padding-left: 4px; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; }
.user-copy { display: grid; min-width: 110px; }
.user-copy strong { font-size: .78rem; }
.user-copy small { color: hsl(var(--muted-foreground)); font-size: .64rem; }
.mobile-menu { display: none; }
.page-content { width: min(1460px, 100%); margin: 0 auto; padding: 40px clamp(24px, 4vw, 54px) 72px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-heading h1 { margin: 8px 0 12px; font-size: clamp(2rem, 4vw, 3.2rem); }
.page-heading p { max-width: 680px; margin-bottom: 0; color: hsl(var(--muted-foreground)); }
.heading-actions { display: flex; align-items: center; gap: 12px; }
.date-range { white-space: nowrap; color: hsl(var(--muted-foreground)); font-size: .8rem; }
.metrics-grid { display: grid; grid-template-columns: 1.8fr repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.metric-card { min-height: 138px; padding: 22px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); }
.metric-card > span, .metric-top span { color: hsl(var(--muted-foreground)); font-size: .76rem; font-weight: 650; }
.metric-card > strong { display: block; margin: 13px 0 0; font-size: 2.35rem; line-height: 1; letter-spacing: -.04em; }
.metric-card > small { color: hsl(var(--muted-foreground)); font-size: .68rem; }
.metric-card.featured { color: hsl(0 0% 100%); background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.metric-top { display: flex; justify-content: space-between; align-items: center; }
.metric-card.featured .metric-top span, .metric-card.featured p { color: hsl(0 0% 100% / .76); }
.metric-top strong { font-size: 1.55rem; }
.metric-card.featured p { margin: 12px 0 0; font-size: .75rem; }
.progress { height: 7px; margin-top: 16px; overflow: hidden; background: hsl(0 0% 100% / .2); border-radius: 99px; }
.progress span { display: block; height: 100%; width: 0; background: hsl(var(--secondary)); border-radius: inherit; }
.progress .w-0 { width: 0; } .progress .w-5 { width: 5%; } .progress .w-10 { width: 10%; } .progress .w-15 { width: 15%; } .progress .w-20 { width: 20%; }
.progress .w-25 { width: 25%; } .progress .w-30 { width: 30%; } .progress .w-35 { width: 35%; } .progress .w-40 { width: 40%; } .progress .w-45 { width: 45%; }
.progress .w-50 { width: 50%; } .progress .w-55 { width: 55%; } .progress .w-60 { width: 60%; } .progress .w-65 { width: 65%; } .progress .w-70 { width: 70%; }
.progress .w-75 { width: 75%; } .progress .w-80 { width: 80%; } .progress .w-85 { width: 85%; } .progress .w-90 { width: 90%; } .progress .w-95 { width: 95%; } .progress .w-100 { width: 100%; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.calendar-panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid hsl(var(--border)); }
.panel-heading h2 { margin: 5px 0 0; }
.legend { display: flex; gap: 12px; color: hsl(var(--muted-foreground)); font-size: .63rem; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.published { background: hsl(var(--success)); } .dot.review { background: hsl(var(--primary)); } .dot.draft { background: hsl(var(--muted-foreground)); }
.content-list { display: grid; }
.content-row { display: grid; grid-template-columns: 50px 68px minmax(0, 1fr) 144px; align-items: center; gap: 15px; min-height: 114px; padding: 15px 22px; border-bottom: 1px solid hsl(var(--border)); transition: background .15s ease; }
.content-row:last-child { border-bottom: 0; }
.content-row:hover { background: hsl(var(--primary-soft) / .55); }
.date-tile { display: grid; justify-items: center; }
.date-tile strong { font-size: 1.25rem; line-height: 1; }
.date-tile span { margin-top: 4px; color: hsl(var(--muted-foreground)); font-size: .58rem; letter-spacing: .1em; }
.content-thumb { width: 68px; height: 68px; object-fit: cover; background: hsl(var(--muted)); border-radius: 10px; }
.content-main { min-width: 0; }
.row-meta { display: flex; align-items: center; gap: 8px; color: hsl(var(--muted-foreground)); font-size: .64rem; }
.type-label { color: hsl(var(--primary)); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.content-main h3 { max-width: 650px; margin: 7px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-list { display: flex; gap: 5px; overflow: hidden; }
.channel-list span { flex: 0 0 auto; padding: 3px 7px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / .58); border-radius: 5px; font-size: .58rem; }
.row-status { position: relative; display: grid; justify-items: end; gap: 7px; padding-right: 16px; }
.status { display: inline-flex; align-items: center; width: fit-content; min-height: 25px; padding: 0 9px; border-radius: 99px; font-size: .6rem; font-weight: 800; }
.status-draft { color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); }
.status-brand_validation { color: hsl(var(--warning)); background: hsl(var(--warning-soft)); }
.status-human_review, .status-approved, .status-scheduled { color: hsl(var(--primary)); background: hsl(var(--primary-soft)); }
.status-published, .status-measured { color: hsl(var(--success)); background: hsl(var(--success-soft)); }
.status.large { min-height: 34px; padding: 0 14px; font-size: .68rem; }
.blocker { color: hsl(var(--warning)); font-size: .57rem; }
.row-arrow { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); font-size: 1.4rem; }
.side-stack { display: grid; gap: 20px; }
.compact-panel { overflow: hidden; }
.panel-count { color: hsl(var(--muted-foreground)); font-size: .7rem; }
.connection-list { display: grid; padding: 8px 20px; }
.connection-row { display: grid; grid-template-columns: 34px 1fr 8px; align-items: center; gap: 10px; min-height: 58px; border-bottom: 1px solid hsl(var(--border)); }
.connection-row:last-child { border-bottom: 0; }
.channel-icon { display: grid; place-items: center; width: 30px; height: 30px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 8px; font-size: .7rem; font-weight: 800; }
.connection-row div { display: grid; }
.connection-row strong { font-size: .76rem; }
.connection-row small { color: hsl(var(--muted-foreground)); font-size: .62rem; }
.connection-state { width: 7px; height: 7px; background: hsl(var(--muted-foreground)); border-radius: 50%; }
.connection-state.connected { background: hsl(var(--success)); }
.panel-note, .brand-panel > p { margin: 0; padding: 16px 20px 20px; color: hsl(var(--muted-foreground)); font-size: .71rem; line-height: 1.55; border-top: 1px solid hsl(var(--border)); }
.brand-panel { display: block; }
.brand-panel:hover { border-color: hsl(var(--primary) / .24); }
.shield { display: grid; place-items: center; width: 32px; height: 32px; color: hsl(var(--success)); background: hsl(var(--success-soft)); border-radius: 50%; font-weight: 900; }
.rule-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid hsl(var(--border)); }
.rule-summary span { display: grid; justify-items: center; gap: 2px; padding: 14px 6px; color: hsl(var(--muted-foreground)); font-size: .52rem; text-align: center; border-right: 1px solid hsl(var(--border)); }
.rule-summary span:last-child { border-right: 0; }
.rule-summary strong { color: hsl(var(--foreground)); font-size: 1rem; }

/* Detalle */
.back-link { display: inline-block; margin-bottom: 26px; color: hsl(var(--muted-foreground)); font-size: .78rem; font-weight: 700; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.detail-heading h1 { max-width: 900px; margin: 10px 0 10px; font-size: clamp(2rem, 4vw, 3.4rem); }
.detail-heading p { color: hsl(var(--muted-foreground)); }
.detail-grid { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr); gap: 22px; align-items: start; }
.visual-card { position: sticky; top: 98px; overflow: hidden; }
.visual-card > img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: hsl(var(--muted)); }
.visual-meta { display: grid; gap: 5px; padding: 18px 20px; }
.visual-meta span { color: hsl(var(--muted-foreground)); font-size: .68rem; }
.visual-meta strong { font-size: .72rem; }
.detail-stack { display: grid; gap: 16px; }
.detail-card, .workflow-card, .blocker-card { padding: 24px; }
.detail-card dl { display: grid; margin: 18px 0 0; }
.detail-card dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid hsl(var(--border)); }
.detail-card dt { color: hsl(var(--muted-foreground)); font-size: .68rem; }
.detail-card dd { margin: 0; font-size: .78rem; font-weight: 650; }
.validation-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.validation-title h2 { margin: 6px 0 0; }
.validation-card > p { margin: 16px 0 0; color: hsl(var(--muted-foreground)); font-size: .78rem; }
.validation-card.failed .shield { color: hsl(var(--danger)); background: hsl(var(--danger-soft)); }
.check-list { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.check-list li { padding: 10px 12px; background: hsl(var(--warning-soft)); border-radius: 8px; font-size: .75rem; }
.check-list li.error { color: hsl(var(--danger)); background: hsl(var(--danger-soft)); }
.blocker-card { border-left: 4px solid hsl(var(--warning)); }
.blocker-card p { margin: 10px 0 0; font-size: .8rem; }
.workflow-card h2 { margin: 6px 0 0; }
.workflow-card form { margin-top: 18px; }

/* ADN de marca */
.dna-heading { align-items: center; }
.dna-heading .heading-actions form { margin: 0; }
.dna-progress-card { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(240px, .7fr); align-items: center; gap: 28px; margin-bottom: 18px; padding: 20px 24px; }
.dna-progress-copy { display: flex; align-items: center; gap: 24px; }
.dna-progress-copy > div { display: grid; min-width: 86px; }
.dna-progress-copy strong { margin-top: 4px; font-size: 1.8rem; letter-spacing: -.04em; }
.dna-progress-copy p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .72rem; }
.dna-progress { margin: 0; background: hsl(var(--muted)); }
.dna-stepper { display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); gap: 7px; margin-bottom: 20px; overflow-x: auto; }
.dna-step { display: flex; align-items: center; gap: 8px; min-width: 112px; min-height: 52px; padding: 9px 10px; color: hsl(var(--muted-foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); font-size: .67rem; }
.dna-step > span { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; background: hsl(var(--muted)); border-radius: 50%; font-size: .62rem; font-weight: 800; }
.dna-step.complete > span { color: hsl(var(--success)); background: hsl(var(--success-soft)); }
.dna-step.current { color: hsl(var(--primary)); border-color: hsl(var(--primary) / .3); box-shadow: 0 0 0 3px hsl(var(--primary) / .07); }
.dna-step.current > span { color: hsl(0 0% 100%); background: hsl(var(--primary)); }
.dna-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.dna-form-card { overflow: hidden; }
.dna-section-heading { display: flex; align-items: flex-start; gap: 16px; padding: 25px 28px; border-bottom: 1px solid hsl(var(--border)); }
.dna-section-heading .step-number { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; color: hsl(0 0% 100%); background: hsl(var(--primary)); border-radius: 12px; font-weight: 900; }
.dna-section-heading h2 { margin: 5px 0 5px; }
.dna-section-heading p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .72rem; }
.dna-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 28px; }
.dna-form label { display: grid; align-content: start; gap: 7px; color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; }
.dna-form label.wide { grid-column: 1 / -1; }
.dna-form label > span { display: flex; align-items: center; gap: 8px; }
.dna-form label i { padding: 2px 5px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 4px; font-size: .51rem; font-style: normal; letter-spacing: .04em; text-transform: uppercase; }
.dna-form input, .dna-form textarea { width: 100%; padding: 12px 13px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; resize: vertical; }
.dna-form input:focus, .dna-form textarea:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .1); outline: 0; }
.dna-form label small { font-weight: 500; line-height: 1.45; }
.dna-form-actions { display: flex; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; padding-top: 5px; }
.dna-guide-card { position: sticky; top: 98px; padding: 24px; }
.dna-guide-card h2 { margin: 7px 0 12px; }
.dna-guide-card > p, .dna-guide-card li { color: hsl(var(--muted-foreground)); font-size: .7rem; }
.dna-guide-card ul { display: grid; gap: 8px; margin: 18px 0; padding-left: 18px; }
.dna-safe-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; padding: 13px; background: hsl(var(--success-soft)); border-radius: var(--radius-sm); }
.dna-safe-note .shield { flex: 0 0 auto; width: 28px; height: 28px; }
.dna-safe-note p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .66rem; }
.dna-permission-note { margin: 0; padding: 28px; color: hsl(var(--muted-foreground)); }
.dna-review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.dna-review-main, .dna-review-aside { display: grid; gap: 16px; }
.dna-review-aside { position: sticky; top: 98px; }
.dna-summary-card { overflow: hidden; }
.dna-summary-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid hsl(var(--border)); }
.dna-summary-heading h2 { margin: 5px 0 0; font-size: .92rem; }
.dna-summary-heading > a { color: hsl(var(--primary)); font-size: .68rem; font-weight: 800; }
.dna-summary-card dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.dna-summary-card dl > div { padding: 15px 20px; border-right: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.dna-summary-card dl > div:nth-child(even) { border-right: 0; }
.dna-summary-card dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.dna-summary-card dt { margin-bottom: 6px; color: hsl(var(--muted-foreground)); font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.dna-summary-card dd { margin: 0; font-size: .73rem; white-space: pre-line; }
.dna-summary-card dd ul { display: grid; gap: 4px; margin: 0; padding-left: 16px; }
.dna-decision-card, .dna-version-card { padding: 22px; }
.dna-decision-card h2 { margin: 7px 0 10px; }
.dna-decision-card > p { color: hsl(var(--muted-foreground)); font-size: .7rem; }
.dna-decision-card form { margin-top: 10px; }
.dna-active-state { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: hsl(var(--success)); font-size: .74rem; }
.dna-version-card dl { display: grid; gap: 0; margin: 12px 0 0; }
.dna-version-card dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; border-top: 1px solid hsl(var(--border)); font-size: .7rem; }
.dna-version-card dt { color: hsl(var(--muted-foreground)); }
.dna-version-card dd { margin: 0; font-weight: 800; }

/* Integraciones */
.integration-heading { align-items: center; }
.domain-chip { padding: 9px 13px; color: hsl(var(--success)); background: hsl(var(--success-soft)); border: 1px solid hsl(var(--success) / .18); border-radius: 99px; font-size: .72rem; font-weight: 800; }
.integration-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.provider-card { overflow: hidden; }
.provider-heading { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 15px; padding: 24px; border-bottom: 1px solid hsl(var(--border)); }
.provider-heading h2 { margin: 3px 0; }
.provider-heading p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .73rem; }
.provider-symbol { display: grid; place-items: center; width: 48px; height: 48px; color: hsl(0 0% 100%); border-radius: 14px; font-size: 1.2rem; font-weight: 900; }
.meta-symbol { background: hsl(220 92% 54%); }
.integration-steps { display: grid; grid-template-columns: repeat(3, 1fr); padding: 22px 24px; border-bottom: 1px solid hsl(var(--border)); }
.integration-step { position: relative; display: flex; align-items: flex-start; gap: 10px; padding-right: 20px; color: hsl(var(--muted-foreground)); }
.integration-step::after { content: ""; position: absolute; top: 15px; right: 8px; width: calc(100% - 52px); border-top: 1px solid hsl(var(--border)); transform: translateX(50%); }
.integration-step:last-child::after { display: none; }
.integration-step > span { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: 50%; font-size: .7rem; font-weight: 800; }
.integration-step div { display: grid; gap: 2px; }
.integration-step strong { color: hsl(var(--foreground)); font-size: .72rem; }
.integration-step small { font-size: .6rem; }
.integration-step.current > span { color: hsl(0 0% 100%); background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.integration-step.complete > span { color: hsl(var(--success)); background: hsl(var(--success-soft)); border-color: hsl(var(--success) / .25); }
.credential-box { margin: 20px 24px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.credential-box summary { padding: 15px 17px; cursor: pointer; font-size: .76rem; font-weight: 800; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 17px 17px; }
.settings-form label { display: grid; gap: 7px; color: hsl(var(--muted-foreground)); font-size: .68rem; font-weight: 800; }
.settings-form label:nth-of-type(3), .settings-form .readonly-field, .settings-form .button { grid-column: 1 / -1; }
.settings-form input { width: 100%; padding: 11px 12px; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.button.secondary { color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-color: hsl(var(--primary) / .18); }
.readonly-field { display: grid; gap: 6px; }
.readonly-field > span { color: hsl(var(--muted-foreground)); font-size: .68rem; font-weight: 800; }
.readonly-field code { overflow: auto; padding: 10px 12px; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 8px; font-size: .68rem; white-space: nowrap; }
.scope-box { margin: 0 24px 20px; padding: 18px; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.scope-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.scope-list code { padding: 5px 7px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 5px; font-size: .61rem; }
.scope-box p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .68rem; }
.connect-action { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-top: 1px solid hsl(var(--border)); }
.connect-action small { color: hsl(var(--muted-foreground)); font-size: .64rem; }
.detected-accounts { padding: 20px 24px; border-top: 1px solid hsl(var(--border)); }
.account-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; min-height: 55px; border-bottom: 1px solid hsl(var(--border)); }
.account-row:last-child { border-bottom: 0; }
.account-type { display: grid; place-items: center; width: 28px; height: 28px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 8px; font-size: .65rem; font-weight: 900; }
.account-row div { display: grid; }
.account-row strong { font-size: .74rem; }
.account-row small { color: hsl(var(--muted-foreground)); font-size: .62rem; }
.integration-aside { display: grid; gap: 20px; }
.readiness-card, .roadmap-card { padding: 22px; }
.readiness-card h2 { margin: 6px 0 18px; }
.readiness-state { display: flex; align-items: center; gap: 10px; padding: 12px; background: hsl(var(--warning-soft)); border-radius: var(--radius-sm); }
.readiness-state i { width: 9px; height: 9px; background: hsl(var(--warning)); border-radius: 50%; }
.readiness-state.ready { background: hsl(var(--success-soft)); }
.readiness-state.ready i { background: hsl(var(--success)); }
.readiness-state span { display: grid; }
.readiness-state strong { font-size: .75rem; }
.readiness-state small { color: hsl(var(--muted-foreground)); font-size: .61rem; }
.readiness-card > p { margin: 16px 0 0; color: hsl(var(--muted-foreground)); font-size: .7rem; }
.roadmap-card > .eyebrow { margin-bottom: 9px; }
.roadmap-row { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid hsl(var(--border)); }
.roadmap-row:last-child { border-bottom: 0; }
.roadmap-row > span { display: grid; place-items: center; width: 26px; height: 26px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-radius: 50%; font-size: .65rem; font-weight: 800; }
.roadmap-row div { display: grid; }
.roadmap-row strong { font-size: .75rem; }
.roadmap-row small { color: hsl(var(--muted-foreground)); font-size: .61rem; }
.security-note { display: flex; align-items: flex-start; gap: 12px; padding: 20px; }
.security-note strong { font-size: .76rem; }
.security-note p { margin: 4px 0 0; color: hsl(var(--muted-foreground)); font-size: .66rem; }

/* Error */
.error-page { min-height: 100vh; display: grid; align-content: center; justify-items: start; gap: 70px; width: min(720px, calc(100% - 48px)); margin: 0 auto; }
.error-page section { max-width: 640px; }
.error-page h1 { margin: 12px 0; }
.error-page p { margin-bottom: 28px; color: hsl(var(--muted-foreground)); }

@media (max-width: 1120px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-card.featured { grid-column: 1 / -1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; }
  .integration-layout { grid-template-columns: 1fr; }
  .integration-aside { grid-template-columns: repeat(3, 1fr); }
  .dna-editor-layout, .dna-review-layout { grid-template-columns: 1fr; }
  .dna-guide-card, .dna-review-aside { position: static; }
  .dna-review-aside { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  :root { --sidebar-width: 268px; }
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 50px hsl(var(--shadow) / .16); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar-context { margin-right: auto; margin-left: 12px; }
  .user-copy { display: none; }
  .page-heading, .detail-heading { align-items: flex-start; flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
  .visual-card { position: static; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel { min-height: 420px; }
  .auth-form-wrap { min-height: auto; }
  .integration-aside { grid-template-columns: 1fr; }
  .dna-progress-card { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .page-content { padding: 28px 16px 60px; }
  .topbar { padding: 0 14px; }
  .topbar-actions { gap: 7px; }
  .user-menu form { display: none; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card.featured { grid-column: 1 / -1; }
  .content-row { grid-template-columns: 42px 56px minmax(0, 1fr); min-height: 98px; padding: 12px; gap: 10px; }
  .content-thumb { width: 56px; height: 56px; }
  .content-main h3 { font-size: .86rem; }
  .row-status { grid-column: 3; justify-items: start; padding: 0; }
  .row-arrow { display: none; }
  .legend { display: none; }
  .side-stack { grid-template-columns: 1fr; }
  .heading-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .auth-panel { min-height: 360px; padding: 34px 26px; }
  .auth-copy h1 { font-size: 2.75rem; }
  .auth-principle, .setup-steps { display: none; }
  .auth-form-wrap { padding: 22px 14px; }
  .auth-form { padding: 28px 22px; }
  .detail-card dl > div { grid-template-columns: 90px 1fr; }
  .integration-steps { grid-template-columns: 1fr; gap: 12px; }
  .integration-step::after { display: none; }
  .settings-form { grid-template-columns: 1fr; }
  .settings-form label { grid-column: 1 / -1; }
  .connect-action { align-items: stretch; flex-direction: column; }
  .provider-heading { grid-template-columns: 42px 1fr; }
  .provider-heading > .status { grid-column: 2; }
  .dna-progress-copy { align-items: flex-start; flex-direction: column; gap: 8px; }
  .dna-form { grid-template-columns: 1fr; padding: 22px 18px; }
  .dna-form label { grid-column: 1 / -1; }
  .dna-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .dna-summary-card dl { grid-template-columns: 1fr; }
  .dna-summary-card dl > div { border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .dna-summary-card dl > div:nth-last-child(-n+2) { border-bottom: 1px solid hsl(var(--border)); }
  .dna-summary-card dl > div:last-child { border-bottom: 0; }
  .dna-review-aside { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
