:root {
    --navy: #16305A;
    --navy-deep: #0E2244;
    --navy-soft: #1B3A6B;
    --gold: #D9A038;
    --gold-soft: #F2CE86;
    --green: #2E9E5B;
    --amber: #E0A32E;
    --red: #C6362F;
    --teal: #1FA5A0;
    --purple: #7B3FA0;
    --orange: #E2703A;
    --ink: #17233B;
    --muted: #64708A;
    --line: #DEE4EF;
    --line-soft: #EDF1F7;
    --bg: #F3F6FB;
    --card: #FFFFFF;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(14, 34, 68, .08);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Montserrat, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

svg { width: 18px; height: 18px; flex: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.01em; }

.shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }

.wide { width: min(1560px, calc(100% - 32px)); margin: 0 auto; }

/* ---------- botones ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 8px 20px rgba(22, 48, 90, .25); }
.btn-primary:hover { background: var(--navy-soft); }
.btn-gold { background: var(--gold); color: #2A1D00; }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.btn-line { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-line:hover { border-color: var(--navy); }
.btn-danger { background: #B3261E; color: #fff; box-shadow: 0 8px 20px rgba(179, 38, 30, .25); }
.btn-danger:hover { background: #8F1D17; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
}
.icon-btn:hover { color: var(--navy); border-color: var(--navy); }

/* ---------- alertas ---------- */

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
}
.alert-info { background: #E8F0FF; color: #1B3A6B; }
.alert-success { background: #E4F6EC; color: #1C6E40; }
.alert-error { background: #FCE9E8; color: #98241E; }

.form-errors {
    margin: 0 0 18px;
    padding: 14px 16px 14px 34px;
    border-radius: 12px;
    background: #FCE9E8;
    color: #98241E;
    font-size: 13px;
    font-weight: 600;
}
.form-errors li { margin-bottom: 4px; }

/* ---------- landing ---------- */

.landing { background: linear-gradient(160deg, var(--navy-deep), var(--navy) 55%, #24467C); color: #fff; }

.nav { padding: 22px 0; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-logo img { height: 34px; display: block; }
.nav-links { display: flex; gap: 26px; font-size: 14px; font-weight: 600; }
.nav-links a { opacity: .82; }
.nav-links a:hover { opacity: 1; }

.hero { padding: 60px 0 90px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4vw, 50px); line-height: 1.08; margin: 18px 0 20px; }
.hero h1 em { font-style: normal; color: var(--gold-soft); }
.lead { font-size: 17px; line-height: 1.65; color: rgba(255, 255, 255, .84); margin: 0 0 28px; max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note { margin: 22px 0 0; font-size: 13px; color: rgba(255, 255, 255, .6); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
}
.eyebrow-light { color: var(--gold-soft); }

.hero-card {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 20px;
    padding: 26px;
    backdrop-filter: blur(6px);
}
.hero-card-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 20px; }
.hero-motor { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }
.hero-motor:last-child { border-bottom: 0; }
.hero-motor b { flex: 1; font-weight: 600; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-verde { background: var(--green); }
.dot-amarillo { background: var(--amber); }
.dot-rojo { background: var(--red); }
.dot-off { background: rgba(255, 255, 255, .22); }

.section { padding: 84px 0; }
.section-light { background: #fff; }
.section-soft { background: var(--bg); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); margin: 14px 0 14px; }
.section-head p { margin: 0; color: var(--muted); font-size: 16px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #EDF2FC; color: var(--navy); margin-bottom: 16px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; counter-reset: step; }
.step { position: relative; padding-top: 42px; }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--navy);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}
.step h4 { font-size: 15px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.cta-band { background: var(--navy-deep); color: #fff; padding: 70px 0; text-align: center; }
.cta-band h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 12px; }
.cta-band p { color: rgba(255, 255, 255, .78); max-width: 60ch; margin: 0 auto 26px; }

.footer { background: #0B1B36; color: rgba(255, 255, 255, .7); padding: 40px 0 26px; font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; }
.footer-inner img { height: 30px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 18px; }

/* ---------- auth ---------- */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-side { background: linear-gradient(160deg, var(--navy-deep), var(--navy) 60%, #24467C); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side img { height: 34px; }
.auth-side h2 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; margin-bottom: 16px; }
.auth-side p { color: rgba(255, 255, 255, .78); max-width: 44ch; }
.auth-side ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; font-size: 14px; }
.auth-side li { display: flex; align-items: flex-start; gap: 10px; color: rgba(255, 255, 255, .86); }
.auth-side li svg { color: var(--gold-soft); margin-top: 3px; }

.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(430px, 100%); }
.auth-card h1 { font-size: 26px; margin-bottom: 8px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 26px; }
.auth-foot { margin-top: 22px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-foot a { color: var(--navy); font-weight: 600; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="range"]):not([type="color"]), select, textarea) {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 11px 13px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
:where(textarea) { min-height: 84px; resize: vertical; line-height: 1.5; }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus {
    outline: 0;
    border-color: var(--navy-soft);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, .12);
}
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):disabled { background: #F7F9FC; color: var(--muted); cursor: not-allowed; }
:where(input, select, textarea)::placeholder { color: #9AA6B8; }
.field .hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ---------- app shell ---------- */

.appbar { background: var(--navy-deep); color: #fff; position: sticky; top: 0; z-index: 30; }
.appbar-inner { width: min(1560px, calc(100% - 32px)); margin: 0 auto; display: flex; align-items: center; gap: 28px; height: 64px; }
.appbar-logo { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 800; }
.appbar-logo img { height: 26px; }
.appbar-logo sup { font-size: 9px; }
.appbar-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
    display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px;
    font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .74);
    border: 0; background: transparent; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.nav-link svg { width: 16px; height: 16px; }
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-link.is-active { background: rgba(255, 255, 255, .14); color: #fff; }
.nav-link:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.nav-salir { display: none; }

.nav-group { position: relative; }
.nav-group.is-active > .nav-trigger { background: rgba(255, 255, 255, .14); color: #fff; }
.nav-trigger svg:last-child { width: 13px; height: 13px; opacity: .7; transition: transform .18s ease; }
.nav-group.is-open > .nav-trigger { background: rgba(255, 255, 255, .12); color: #fff; }
.nav-group.is-open .nav-trigger svg:last-child { transform: rotate(180deg); }

.nav-menu {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 40;
    min-width: 296px; padding: 8px;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 18px 46px rgba(6, 20, 44, .28);
}
.nav-menu a {
    display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: var(--ink);
}
.nav-menu a:hover { background: var(--line-soft); }
.nav-menu a.is-active { background: #EDF2FC; }
.nav-menu-icon {
    width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
    background: var(--line-soft); color: var(--navy);
}
.nav-menu a.is-active .nav-menu-icon { background: var(--navy); color: #fff; }
.nav-menu-icon svg { width: 15px; height: 15px; }
.nav-menu-body { display: grid; gap: 2px; min-width: 0; }
.nav-menu-body b { font-size: 13.5px; font-weight: 700; }
.nav-menu-body em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.45; }

.appbar-burger {
    display: none; width: 40px; height: 40px; margin-left: auto; border: 0; border-radius: 11px;
    background: rgba(255, 255, 255, .1); cursor: pointer; padding: 0;
    flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.appbar-burger span { display: block; width: 17px; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
.appbar-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.appbar-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.appbar-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.appbar-user { display: flex; align-items: center; gap: 10px; padding-left: 22px; border-left: 1px solid rgba(255, 255, 255, .14); }
.appbar-user .icon-btn { background: transparent; border-color: rgba(255, 255, 255, .2); color: rgba(255, 255, 255, .8); }
.appbar-user .icon-btn:hover { color: #fff; border-color: #fff; }
.appbar-user-meta { display: flex; flex-direction: column; line-height: 1.25; font-size: 12px; }
.appbar-user-meta strong { font-size: 13px; }
.appbar-user-meta span { color: rgba(255, 255, 255, .6); }

.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--gold); color: #2A1D00;
    font-size: 13px; font-weight: 800;
}

.page { padding: 28px 0 70px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-head h1 { font-size: 25px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.toolbar input, .toolbar select {
    width: auto; border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; font: inherit; font-size: 14px; background: #fff;
}
.toolbar input { min-width: 260px; }

/* ---------- tarjetas y tablas ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat b { display: block; font-size: 27px; line-height: 1.1; }
.stat span { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stat-verde b { color: var(--green); }
.stat-amarillo b { color: var(--amber); }
.stat-rojo b { color: var(--red); }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }
table.data th {
    text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
    color: var(--muted); padding: 13px 16px; border-bottom: 1px solid var(--line); background: #FAFBFE; white-space: nowrap;
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #FAFBFE; }
table.data .cliente { font-weight: 700; }
table.data .muted { color: var(--muted); font-size: 13px; }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
    background: #EDF2FC; color: var(--navy);
}
.badge-verde { background: #E4F6EC; color: #1C6E40; }
.badge-amarillo { background: #FDF3DE; color: #8A6110; }
.badge-rojo { background: #FCE9E8; color: #98241E; }
.badge-off { background: #EEF1F6; color: var(--muted); }

.track { height: 7px; border-radius: 999px; background: var(--line-soft); overflow: hidden; min-width: 90px; }
.track i { display: block; height: 100%; border-radius: 999px; background: var(--navy-soft); }

.empty { padding: 60px 24px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; margin-bottom: 12px; color: var(--line); }

/* ---------- ficha maestra ---------- */

.ficha-head {
    background: linear-gradient(140deg, var(--navy-deep), var(--navy) 65%, #24467C);
    color: #fff;
    border-radius: 18px;
    padding: 26px 28px;
    margin-bottom: 20px;
}
.ficha-head-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 18px; }
.ficha-head h1 { font-size: 26px; }
.ficha-head .sub { color: rgba(255, 255, 255, .74); font-size: 14px; margin-top: 4px; }
.ficha-head-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.cycle-bar { margin-top: 22px; }
.cycle-bar-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 7px; color: rgba(255, 255, 255, .8); }
.cycle-bar .track { background: rgba(255, 255, 255, .18); height: 9px; }
.cycle-bar .track i { background: var(--gold); }

.exec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 22px; }
.exec-item { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 12px 14px; }
.exec-item span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .6); margin-bottom: 4px; }
.exec-item b { font-size: 14px; font-weight: 700; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sec { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; scroll-margin-top: 84px; }
.sec-head {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 18px;
    background: var(--navy);
    color: #fff;
}
.sec-head h3 { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sec-head .num {
    width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
    background: rgba(255, 255, 255, .18); font-size: 11px; font-weight: 800;
}
.sec-head .spacer { margin-left: auto; }
.sec-body { padding: 18px; }
.sec-foot { padding: 0 18px 18px; display: flex; justify-content: flex-end; gap: 10px; }

.sec-gold .sec-head { background: var(--gold); color: #2A1D00; }
.sec-gold .sec-head .num { background: rgba(0, 0, 0, .12); }
.sec-red .sec-head { background: var(--red); }
.sec-green .sec-head { background: var(--green); }
.sec-teal .sec-head { background: var(--teal); }
.sec-purple .sec-head { background: var(--purple); }
.sec-orange .sec-head { background: var(--orange); }

.kv { display: grid; gap: 10px; }
.kv-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: baseline; font-size: 14px; }
.kv-row span { font-size: 12px; font-weight: 700; color: var(--muted); }
.kv-row b { font-weight: 600; }

.read-only .field input, .read-only .field select, .read-only .field textarea { background: #F7F9FC; color: var(--muted); }

.motor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.motor {
    border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center;
    display: flex; flex-direction: column; gap: 10px;
}
.motor-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; color: #fff; }
.motor-icon svg { width: 22px; height: 22px; }
.motor h4 { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1.3; min-height: 2.6em; display: grid; place-items: center; }
.motor .score { font-size: 22px; font-weight: 800; }
.motor .levels { display: flex; justify-content: center; gap: 7px; }
.motor .levels label { cursor: pointer; }
.motor .levels input { position: absolute; opacity: 0; pointer-events: none; }
.motor .levels .dot { width: 15px; height: 15px; opacity: .3; transition: opacity .15s ease, transform .15s ease; }
.motor .levels input:checked + .dot { opacity: 1; transform: scale(1.18); box-shadow: 0 0 0 3px rgba(22, 48, 90, .12); }
.motor textarea { min-height: 56px; font-size: 13px; }
.motor.is-prioritario { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217, 160, 56, .25); }

.check-list { display: grid; gap: 2px; }
.check {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 10px; border-radius: 9px; font-size: 13.5px; cursor: pointer;
}
.check:hover { background: #F7F9FC; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.check.is-done { color: var(--muted); }
.check .fecha { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }

.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.flow-step {
    border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px; text-align: center;
    display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.flow-step:hover { border-color: var(--navy-soft); }
.flow-step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: #EDF2FC; color: var(--navy); font-size: 12px; font-weight: 800; }
.flow-step h5 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.flow-step p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.flow-step input { position: absolute; opacity: 0; pointer-events: none; }
.flow-step.is-done { background: #F1F8F4; border-color: var(--green); }
.flow-step.is-done .n { background: var(--green); color: #fff; }

.cycle-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cycle-chip {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line);
    font-size: 12px; font-weight: 700; background: #fff; color: var(--navy);
}
.cycle-chip svg { width: 15px; height: 15px; }
.cycle-chip.is-focus { background: var(--gold); border-color: var(--gold); color: #2A1D00; }
.cycle-sep { color: var(--line); }

.rows { display: grid; gap: 12px; }
.row-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.row-card .row-num { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.row-grid { display: grid; gap: 10px; grid-template-columns: 2.2fr 1fr 1fr 1fr 1fr; align-items: end; }
.row-grid .field { margin: 0; }

.kpi-grid { display: grid; gap: 10px; grid-template-columns: 1.6fr .8fr .8fr .8fr .8fr; align-items: end; }
.kpi-grid .field { margin: 0; }
.kpi-head { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi-row.is-principal { background: #FFFBF2; border-color: var(--gold); }

.stars { display: flex; gap: 5px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { cursor: pointer; color: var(--line); }
.stars label svg { width: 22px; height: 22px; }
.stars.is-set-1 label:nth-child(-n+1) svg,
.stars.is-set-2 label:nth-child(-n+2) svg,
.stars.is-set-3 label:nth-child(-n+3) svg,
.stars.is-set-4 label:nth-child(-n+4) svg,
.stars.is-set-5 label:nth-child(-n+5) svg { color: var(--gold); fill: var(--gold); }

.semaforo-pick { display: flex; gap: 10px; align-items: center; }
.semaforo-pick label { cursor: pointer; display: inline-grid; place-items: center; }
.semaforo-pick input { position: absolute; opacity: 0; pointer-events: none; }
.semaforo-pick .dot { width: 20px; height: 20px; opacity: .28; transition: opacity .15s ease, transform .15s ease; }
.semaforo-pick input:checked + .dot { opacity: 1; transform: scale(1.15); box-shadow: 0 0 0 3px rgba(22, 48, 90, .12); }

.list-inputs { display: grid; gap: 8px; }
.list-inputs .field { margin: 0; }
.causas-inputs { display: grid; gap: 10px; }
.causa-row { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: #FAFBFE; }
.causa-row input { font-weight: 600; }
.causa-row textarea { min-height: 52px; }

.week-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1100px; }
.week-table th { background: #FAFBFE; border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.week-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.week-table td.narrow { white-space: nowrap; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); background: #fff; border: 1px solid var(--line); }
.tabs a:hover, .tabs a.is-active { color: #fff; background: var(--navy); border-color: var(--navy); }

/* ---------- cuestionario ---------- */

.quiz-motor { margin-bottom: 20px; }
.quiz-motor .sec-head { background: var(--navy-soft); }
.q-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.q-row:last-child { border-bottom: 0; }
.q-text { font-size: 14px; }
.q-text .n { font-weight: 800; color: var(--muted); margin-right: 8px; }
.scale { display: flex; gap: 6px; }
.scale label { position: relative; cursor: pointer; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span {
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff;
    font-size: 13px; font-weight: 700; color: var(--muted);
    transition: all .15s ease;
}
.scale label:hover span { border-color: var(--navy-soft); }
.scale input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }

.quiz-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.quiz-legend b { color: var(--ink); }

.sticky-save {
    position: sticky; bottom: 0; z-index: 20;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
    padding: 14px 0;
    margin-top: 24px;
    backdrop-filter: blur(8px);
}
.sticky-save-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }

/* ---------- filtros, paginación y acciones masivas ---------- */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.filters { margin-bottom: 16px; }
.filters-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input[type="search"],
.filters input[type="text"],
.filters input[type="date"],
.filters input[type="number"],
.filters select {
    width: auto;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 10px 13px;
    font: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--ink);
    max-width: 100%;
    height: 42px;
}
.filters input[type="search"] { min-width: 250px; flex: 1 1 250px; }
.filters input[type="date"] { min-width: 160px; color: var(--ink); }
.filters input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.filters input:focus, .filters select:focus {
    outline: 0; border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(27, 58, 107, .12);
}
.filters-note { font-size: 12.5px; color: var(--muted); }

.mini-select {
    width: auto; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px;
    font: inherit; font-size: 13px; background: #fff;
}

.inline-form { display: flex; gap: 8px; align-items: center; }

.bulkbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 16px; margin-bottom: 14px;
}
.bulkbar .check { padding: 0; gap: 8px; font-size: 13px; }
.bulkbar .check:hover { background: transparent; }

.pager {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
    padding: 12px 4px; font-size: 13px; color: var(--muted);
}
.pager-count { margin-right: auto; }
.pager-count strong { color: var(--ink); }
.pager-links { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pager-link {
    display: inline-grid; place-items: center;
    min-width: 34px; height: 34px; padding: 0 9px;
    border: 1px solid var(--line); border-radius: 9px;
    background: #fff; color: var(--ink); font-size: 13px; font-weight: 600;
}
.pager-link:hover { border-color: var(--navy); color: var(--navy); }
.pager-link.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager-link.is-off { opacity: .4; pointer-events: none; }
.pager-link svg { width: 15px; height: 15px; }
.pager-links > .pager-link:first-child svg { transform: rotate(180deg); }
.pager-gap { padding: 0 2px; }
.pager-size { display: flex; align-items: center; gap: 8px; }
.pager-size label { font-size: 12px; }
.pager-size select {
    width: auto; border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px;
    font: inherit; font-size: 13px; background: #fff;
}

.head-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.head-chip {
    display: flex; flex-direction: column; gap: 2px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 11px; padding: 9px 14px; min-width: 130px;
}
.head-chip em {
    font-style: normal; font-size: 10px; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .6);
}
.head-chip b { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }

.check-cols { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); display: grid; }
.check-inline { display: flex; flex-wrap: wrap; gap: 4px; }
.check-inline .check { width: auto; }

.sub-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 14px; padding-top: 4px;
    border-top: 1px solid var(--line-soft);
    padding-top: 16px;
}
.sub-head svg { width: 15px; height: 15px; }

.callout {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px;
    background: #FFFBF2; border: 1px solid var(--gold); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 16px; font-size: 14px;
}
.callout span {
    font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #8A6110;
    width: 100%;
}
.callout b { font-weight: 700; }
.callout a { margin-left: auto; color: var(--navy); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.callout a svg { width: 14px; height: 14px; }

.tabs a { display: inline-flex; align-items: center; gap: 7px; }
.tabs a svg { width: 15px; height: 15px; }

/* ---------- carga y revisión del reporte ---------- */

.cargar-form input[type="file"] { display: block; width: 100%; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: #FAFBFE; font-size: 13px; }
.rev-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 42%); gap: 18px; margin-bottom: 20px; align-items: start; }
.rev-summary-main { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.rev-stats { margin: 0; }
.rev-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 40%); gap: 20px; align-items: start; }
.rev-form .sec { margin-bottom: 18px; }
.rev-row { border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: #FAFBFE; }
.rev-etapa { border-left: 3px solid var(--navy); padding: 4px 0 4px 16px; margin: 18px 0; }
.rev-etapa-head { display: grid; grid-template-columns: auto 180px minmax(0, 1fr); gap: 12px; align-items: end; margin-bottom: 8px; }
.rev-etapa-head .badge { margin-bottom: 12px; }
.rev-cond-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.rev-cond-head .check { margin-bottom: 12px; white-space: nowrap; }
.field.is-pendiente textarea, .field.is-pendiente input { border-color: #E0A32E; background: #FFF8E6; }
.field.is-pendiente label::after { content: " · dato por validar"; color: #A8760D; font-weight: 700; font-size: 11px; text-transform: none; letter-spacing: 0; }
.resto-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.resto-list li { margin-bottom: 6px; }
.rev-original { position: sticky; top: 84px; max-height: calc(100vh - 104px); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rev-original-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.rev-original-head b { color: var(--ink); }
.rev-original-head svg { width: 16px; height: 16px; }
.rev-original-body { overflow: auto; padding: 16px 18px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.rev-original-body h2 { font-size: 16px; margin: 18px 0 8px; }
.rev-original-body h3 { font-size: 14.5px; margin: 16px 0 6px; }
.rev-original-body h4 { font-size: 13.5px; margin: 14px 0 6px; color: var(--navy); }
.rev-original-body p { margin: 0 0 10px; }
.rev-original-body ol, .rev-original-body ul { margin: 0 0 10px; padding-left: 20px; }
.propuesto-band { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(224, 163, 46, .14); border: 1px solid rgba(224, 163, 46, .45); font-size: 13px; }
.propuesto-band b { display: block; margin-bottom: 2px; }
.propuesto-band span { line-height: 1.5; }
.propuesto-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #E0A32E; color: #fff; }
.propuesto-icon svg { width: 16px; height: 16px; }
.sub-head { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 14px 0 8px; }

@media (max-width: 1100px) {
    .rev-grid, .rev-summary { grid-template-columns: 1fr; }
    .rev-original { position: static; max-height: 380px; }
    .cargar-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .rev-etapa-head, .rev-cond-head { grid-template-columns: 1fr; }
    .rev-cond-head .check { white-space: normal; }
}

/* ---------- etapas, validación, historia ---------- */

.etapa-card { border: 1px solid var(--line); border-left: 5px solid var(--navy); border-radius: 12px; padding: 16px; margin: 16px 0; background: #fff; display: grid; gap: 14px; }
.etapa-card.momento-primero { border-left-color: var(--navy); }
.etapa-card.momento-despues { border-left-color: #7B3FA0; }
.etapa-card.momento-finalmente { border-left-color: var(--green); }
.etapa-card.momento-sueltas { border-left-color: var(--line); background: #FAFBFE; }
.etapa-card.estado-completada { background: #F1F8F4; }
.etapa-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; }
.etapa-momento { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.etapa-titulo input { width: 100%; font-weight: 700; font-size: 15px; }
.etapa-titulo b { font-size: 15px; }
.etapa-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.etapa-grid .field { margin: 0; }
.etapa-grid .etapa-wide { grid-column: span 2; }
.etapa-sub { border-top: 1px dashed var(--line); padding-top: 12px; display: grid; gap: 10px; }
.etapa-sub-head { display: flex; align-items: center; gap: 8px; }
.etapa-sub-head h4 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.etapa-sub-head span { font-size: 12px; font-weight: 700; color: var(--muted); }
.etapa-sub-head svg { width: 15px; height: 15px; color: var(--navy); }
.paso-gigante { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: #FFFBF2; border: 1px solid var(--gold); font-size: 13px; line-height: 1.5; }
.paso-gigante svg { width: 16px; height: 16px; color: var(--gold); flex: none; margin-top: 2px; }
.kpi-row.is-propuesto { border-style: dashed; }
.pendiente-row .row-num { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
.pendiente-row.is-resuelto { opacity: .75; background: #F7F9FC; }
.pendiente-texto { margin: 0; font-size: 13.5px; line-height: 1.5; }
.pendiente-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pendiente-form input[type="text"] { flex: 1 1 320px; }
.condicion-grid { display: grid; grid-template-columns: minmax(0, 2fr) 160px auto; gap: 10px; align-items: end; }
.condicion-grid .field { margin: 0; }
.condicion-grid .check { margin-bottom: 10px; white-space: nowrap; }
.condicion-row.is-critica { border-left: 4px solid var(--red); }
.condicion-row.estado-cumplida { border-left-color: var(--green); background: #F1F8F4; }
.condicion-row.estado-descartada { opacity: .6; }
.cierre-stat.is-rojo b { color: var(--red); }
.cierre-stat.is-amarillo b { color: var(--amber); }
.cierre-stat.is-verde b { color: var(--green); }
.validar-form { margin-top: 14px; }
.motor.is-relacionado { border-color: var(--amber); }
.motor .badge { margin: 4px 0 6px; }
.motor-origen { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.motor-relacion { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.motor-relacion summary { list-style: none; cursor: pointer; font-size: 12.5px; }
.motor-relacion summary::-webkit-details-marker { display: none; }
.motor-relacion textarea { margin-top: 6px; }

@media (max-width: 1100px) {
    .etapa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .etapa-head { grid-template-columns: 1fr 1fr; }
    .etapa-head .etapa-titulo { grid-column: 1 / -1; }
    .etapa-grid { grid-template-columns: 1fr; }
    .etapa-grid .etapa-wide { grid-column: auto; }
    .condicion-grid { grid-template-columns: 1fr; }
    .condicion-grid .check { white-space: normal; }
}

.curso-grid { grid-template-columns: 2fr 1.2fr 1.5fr .8fr 1.5fr; }
.prompt-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.propuesto-band a { font-weight: 700; }
@media (max-width: 1100px) { .curso-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .curso-grid { grid-template-columns: 1fr; } }

.respuestas-bloque { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.respuestas-bloque summary { cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.respuestas-bloque summary span { color: var(--muted); font-size: 12px; }
.respuestas-lista { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; }
.respuestas-lista li { display: grid; gap: 2px; }
.respuesta-pregunta { color: var(--muted); }
.respuesta-valor { font-weight: 600; }
.respuesta-opciones { font-size: 11.5px; color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
    .appbar-inner { gap: 16px; }
    .appbar-logo span { display: none; }
    .appbar-user-meta { display: none; }
    .appbar-user { padding-left: 14px; }
    .nav-link { padding: 8px 11px; font-size: 12.5px; gap: 6px; }
    .nav-link svg { width: 15px; height: 15px; }
}

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .row-grid, .kpi-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .hero-grid, .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .nav-links { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .kv-row { grid-template-columns: 1fr; gap: 2px; }
    .appbar-inner { gap: 12px; height: 60px; }
    .appbar-logo span { display: none; }
    .appbar-burger { display: flex; }

    .appbar-nav {
        position: fixed; top: 60px; left: 0; right: 0; bottom: 0; z-index: 45;
        display: none; flex-direction: column; align-items: stretch; gap: 4px;
        margin: 0; padding: 16px 16px 32px;
        background: var(--navy-deep); overflow-y: auto;
    }
    .appbar-nav.is-open { display: flex; }
    .nav-link { padding: 14px 16px; border-radius: 12px; font-size: 15px; gap: 12px; }
    .nav-link svg { width: 18px; height: 18px; }
    .nav-salir { display: flex; margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .14); border-radius: 0; padding-top: 18px; }

    .nav-group { position: static; }
    .nav-trigger { width: 100%; justify-content: flex-start; }
    .nav-trigger svg:last-child { margin-left: auto; }
    .nav-menu {
        position: static; min-width: 0; margin: 4px 0 8px; padding: 6px;
        background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); box-shadow: none;
    }
    .nav-menu a { color: rgba(255, 255, 255, .82); padding: 12px; }
    .nav-menu a:hover, .nav-menu a.is-active { background: rgba(255, 255, 255, .1); }
    .nav-menu-icon { background: rgba(255, 255, 255, .12); color: #fff; }
    .nav-menu a.is-active .nav-menu-icon { background: var(--gold); color: #2A1D00; }
    .nav-menu-body em { color: rgba(255, 255, 255, .55); }

    .appbar-user { margin-left: 0; padding-left: 0; border-left: 0; order: -1; }
    .appbar-user-meta, .appbar-user .icon-btn { display: none; }
    .row-grid, .kpi-grid { grid-template-columns: 1fr; }
    .q-row { grid-template-columns: 1fr; }
    .scale { flex-wrap: wrap; }
}

/* ---------- filas dinámicas del plan ---------- */

.row-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 4px;
}
.row-head .row-num { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.row-head .row-num svg { width: 13px; height: 13px; color: var(--gold); }
.row-actions { display: flex; gap: 6px; }
.row-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); background: #fff; border-radius: 999px;
    padding: 5px 12px; font: inherit; font-size: 11.5px; font-weight: 700;
    color: var(--muted); cursor: pointer; transition: all .16s ease;
}
.row-btn svg { width: 13px; height: 13px; }
.row-btn:hover { border-color: var(--navy); color: var(--navy); }
.row-btn.is-danger:hover { border-color: var(--red); color: var(--red); background: #fdeceb; }

.row-card.is-principal { background: #FFFBF2; border-color: var(--gold); }
.row-card.estado-completada { border-left: 4px solid var(--green); }
.row-card.estado-en_curso { border-left: 4px solid var(--amber); }
.row-card.estado-descartada { opacity: .6; }

.row-hint {
    display: flex; align-items: center; gap: 7px; margin: 4px 0 0;
    font-size: 12px; color: var(--muted); background: var(--line-soft);
    padding: 8px 12px; border-radius: 9px;
}
.row-hint svg { width: 14px; height: 14px; flex: none; }

.row-add {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line);
}
.row-add span { font-size: 12.5px; color: var(--muted); }

.empty-inline {
    margin: 0 0 4px; padding: 22px; text-align: center;
    background: var(--line-soft); border-radius: 12px;
    color: var(--muted); font-size: 13.5px;
}

/* ---------- hero del landing ---------- */

.hero-brand {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
    letter-spacing: -.02em;
    margin: 18px 0 22px;
    text-transform: uppercase;
}
.hero-brand sup { font-size: .32em; vertical-align: super; letter-spacing: 0; }

.hero-aviso {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    border-left: 4px solid var(--gold);
    border-radius: 14px;
    padding: 16px 20px;
    margin: 0 0 26px;
    max-width: 58ch;
}
.hero-aviso-icon {
    width: 34px; height: 34px; border-radius: 10px; flex: none;
    display: grid; place-items: center;
    background: rgba(217, 160, 56, .2); color: var(--gold-soft);
}
.hero-aviso-icon svg { width: 17px; height: 17px; }
.hero-aviso b { display: block; font-size: 14.5px; margin-bottom: 4px; }
.hero-aviso span { font-size: 13.5px; line-height: 1.55; color: rgba(255, 255, 255, .78); }
.hero-aviso a { color: var(--gold-soft); font-weight: 700; border-bottom: 1px solid rgba(242, 206, 134, .45); }
.hero-aviso a:hover { border-bottom-color: var(--gold-soft); }

/* ---- avisos del sistema de recordatorios ---- */

.aviso {
    display: flex; gap: 12px; align-items: flex-start;
    border: 1px solid var(--line); border-radius: 12px;
    padding: 15px 17px; margin-bottom: 16px; background: var(--paper-alt, #F7F7FB);
}
.aviso-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.aviso-icon svg { width: 16px; height: 16px; }
.aviso b { display: block; font-size: 14px; margin-bottom: 3px; }
.aviso span:not(.aviso-icon) { display: block; font-size: 13px; line-height: 1.6; color: var(--muted); }
.aviso code { font-size: 12px; background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 5px; }
.aviso-alerta { background: #FFF8F3; border-color: #F0C9A8; }
.aviso-alerta .aviso-icon { background: #F5A96B; color: #fff; }

/* ---- dashboard de actividad ---- */

.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; margin-bottom: 18px; }
.hero-stat {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; display: grid; gap: 8px; align-content: start;
}
.hero-stat.is-alerta { border-color: #F0C9A8; background: #FFFBF6; }
.hero-stat.is-critico { border-color: #E8B4B1; background: #FFF7F6; }
.hero-stat-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero-stat > b { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.hero-stat > b em { font-style: normal; font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.hero-stat-foot { font-size: 12px; color: var(--muted); line-height: 1.5; }

.dual-track { display: grid; gap: 6px; margin: 2px 0 4px; }
.dual-row { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 8px; }
.dual-row span { font-size: 11px; color: var(--muted); }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; margin-bottom: 18px; }
.chart-card { padding: 20px 22px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.chart-head h3 { margin: 0; font-size: 15px; }
.chart-head span, .chart-head a { font-size: 12px; color: var(--muted); }
.chart-head a { font-weight: 700; color: var(--navy); }
.chart-empty { margin: 0; font-size: 13px; color: var(--muted); }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-label { font-size: 9px; fill: var(--muted); text-anchor: middle; }
.chart-value { font-size: 10px; font-weight: 800; fill: var(--ink); text-anchor: middle; }

.sbar { display: flex; gap: 2px; height: 30px; border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.sbar i { display: block; height: 100%; }
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.chart-legend li { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-name { color: var(--muted); }
.chart-legend b { font-weight: 800; }

.alert-list { display: grid; gap: 12px; }
.alert-row {
    display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-start;
    border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; padding: 15px 17px; background: var(--card);
}
.alert-row.is-critico { border-left-color: var(--red); }
.alert-row.is-atencion { border-left-color: var(--amber); }
.alert-row.is-seguimiento { border-left-color: var(--line); }
.alert-main { display: flex; gap: 13px; align-items: flex-start; flex: 1; min-width: 240px; }
.alert-level {
    font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    padding: 4px 9px; border-radius: 999px; background: var(--line-soft); color: var(--muted); flex: none;
}
.alert-row.is-critico .alert-level { background: #FBE9E7; color: #9E2B24; }
.alert-row.is-atencion .alert-level { background: #FDF3E0; color: #8A6110; }
.alert-body { display: grid; gap: 5px; }
.alert-name { font-size: 15px; font-weight: 700; }
.alert-name:hover { color: var(--navy); text-decoration: underline; }
.alert-meta { font-size: 12px; color: var(--muted); }
.alert-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.chip {
    font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
    background: var(--line-soft); color: var(--ink);
}
.alert-side { display: flex; align-items: center; gap: 16px; }
.alert-progress { display: grid; gap: 4px; min-width: 150px; }
.alert-progress span { font-size: 11px; color: var(--muted); }

.split-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; margin-top: 18px; }
.rank-list { display: grid; gap: 10px; }
.rank-row { display: grid; grid-template-columns: 1fr 90px 26px; align-items: center; gap: 12px; }
.rank-name { font-size: 13px; }
.rank-row b { font-size: 13px; font-weight: 800; text-align: right; }

.section-title { margin: 26px 0 12px; font-size: 17px; }

/* ---- fechas del ciclo de 90 días ---- */

.cycle-bar-dates {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 12px;
    font-size: 12.5px; color: rgba(255, 255, 255, .82);
}
.cycle-bar-dates span { display: inline-flex; align-items: center; gap: 7px; }
.cycle-bar-dates svg { width: 14px; height: 14px; color: var(--gold-soft); }
.cycle-bar-dates em { font-style: normal; color: rgba(255, 255, 255, .55); }
.cycle-bar-dates b { font-weight: 700; color: #fff; }
.cycle-bar-dates b.is-falta { color: var(--gold-soft); }
.cycle-bar-sep { width: 1px; height: 14px; background: rgba(255, 255, 255, .2); }
.cycle-bar-fix { display: inline-flex; align-items: center; gap: 5px; color: var(--gold-soft); font-weight: 700; }
.cycle-bar-fix:hover { text-decoration: underline; }
.cycle-bar-warn { color: var(--gold-soft) !important; }

/* ---- controles dentro de tablas ---- */

.data select,
.data input[type="text"],
.data input[type="number"],
.data input[type="date"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13.5px;
    background: #fff;
    color: var(--ink);
}
.data input[type="number"] { max-width: 90px; text-align: center; }
.data select:focus,
.data input:focus {
    outline: 0; border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(27, 58, 107, .12);
}
.data input[type="checkbox"] {
    width: 17px; height: 17px; margin: 0; accent-color: var(--navy); cursor: pointer;
}
.data td:has(> input[type="checkbox"]),
.data th:has(> input[type="checkbox"]) { text-align: center; }

/* ---- cierre de ciclo y comparación entre diagnósticos ---- */

.cierre-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cierre-stat { background: #FFFBF2; border: 1px solid var(--gold-soft); border-radius: 12px; padding: 14px 16px; }
.cierre-stat b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.cierre-stat span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.cierre-nota { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); line-height: 1.6; max-width: 78ch; }

.delta-list { display: grid; gap: 2px; background: var(--line-soft); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.delta-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 52px 18px 52px 74px;
    align-items: center; gap: 10px; padding: 11px 16px; background: var(--card); font-size: 13.5px;
}
.delta-name { min-width: 0; }
.delta-antes, .delta-hoy { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta-antes { color: var(--muted); }
.delta-flecha { color: var(--muted); text-align: center; }
.delta-valor {
    text-align: right; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums;
    padding: 3px 9px; border-radius: 999px;
}
.delta-row.is-sube .delta-valor { background: #E4F3EA; color: #1C6E40; }
.delta-row.is-baja .delta-valor { background: #FBEAE8; color: #98241E; }
.delta-row.is-igual .delta-valor { background: var(--line-soft); color: var(--muted); }
.delta-row.is-nulo .delta-valor { background: transparent; color: var(--muted); font-weight: 500; font-size: 12px; }

@media (max-width: 640px) {
    .delta-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
    .delta-flecha { display: none; }
}

/* ---- tablero del equipo y resultados ---- */

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link {
    display: inline-flex; align-items: baseline; gap: 7px;
    background: #fff; border: 1px solid var(--gold-soft); border-radius: 999px;
    padding: 6px 14px; font-size: 13px; font-weight: 600;
}
.chip-link:hover { border-color: var(--gold); }
.chip-link em { font-style: normal; font-weight: 500; font-size: 11.5px; color: #8A6110; }

.motor-rank { display: grid; gap: 14px; }
.motor-rank-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; align-items: start; }
.motor-rank-row.is-foco .rank-pos { background: var(--red); color: #fff; }
.rank-pos {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--line-soft); color: var(--muted); font-size: 12.5px; font-weight: 800;
}
.rank-body { min-width: 0; display: grid; gap: 7px; }
.rank-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rank-top b { font-size: 14.5px; }
.rank-top span { font-size: 14px; font-weight: 800; }
.rank-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 12px; color: var(--muted); }

/* ---------- ajustes finos para móvil ---------- */

@media (max-width: 720px) {
    .wide { width: calc(100% - 24px); }
    .page-head { align-items: flex-start; gap: 14px; }
    .page-head h1 { font-size: 21px; }
    .page-head-actions { width: 100%; }
    .page-head-actions .btn { flex: 1 1 auto; justify-content: center; }

    .hero-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .hero-stat { padding: 15px 16px; }
    .hero-stat > b { font-size: 25px; }
    .hero-stat .dual-track { display: none; }

    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
    .stat { padding: 14px 15px; }
    .stat b { font-size: 22px; }
    .stat span { font-size: 11px; }

    .chart-grid, .split-grid { grid-template-columns: 1fr; }
    .chart-card { padding: 18px 16px; }

    .filters-row { gap: 8px; }
    .filters input[type="search"] { min-width: 100%; flex: 1 1 100%; }
    .filters input[type="date"] { flex: 1 1 calc(50% - 4px); min-width: 0; }
    .filters select { flex: 1 1 calc(50% - 4px); min-width: 0; }
    .filters .btn { flex: 1 1 auto; justify-content: center; }

    .alert-row { flex-direction: column; align-items: stretch; }
    .alert-main { min-width: 0; }
    .alert-side { flex-direction: column; align-items: stretch; gap: 12px; }
    .alert-progress { min-width: 0; }
    .alert-side .btn { justify-content: center; }

    .sec-head { flex-wrap: wrap; gap: 8px; }
    .sec-body { padding: 16px; }
    .sec-foot { padding: 12px 16px; }
    .ficha-head { padding: 22px 18px; }
    .head-chips { gap: 8px; }
    .cierre-grid { grid-template-columns: 1fr 1fr; }

    .row-head { flex-wrap: wrap; }
    .row-actions { margin-left: auto; }
    .bulkbar { padding: 12px 14px; gap: 10px; }
    .bulkbar .btn { flex: 1 1 auto; justify-content: center; }

    .motor-rank-row { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
    .rank-pos { width: 26px; height: 26px; font-size: 11.5px; }
    .rank-row { grid-template-columns: 1fr 70px 24px; }

    .tabs { gap: 4px; }
    .tabs a { padding: 9px 12px; font-size: 12.5px; }

    .pager { flex-direction: column; align-items: stretch; gap: 10px; }
    .pager-size, .pager-links, .pager-count { justify-content: center; text-align: center; }
    .pager-links { flex-wrap: wrap; }
}

@media (max-width: 420px) {
    .hero-grid { grid-template-columns: 1fr; }
    .cierre-grid { grid-template-columns: 1fr; }
}

.analisis-seccion { margin-bottom: 16px; }
.analisis-seccion h4 { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--navy); }
.analisis-seccion h5, .analisis-h5 { margin: 10px 0 4px; font-size: 13px; font-weight: 700; }
.analisis-seccion p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; }
.analisis-lista { margin: 0 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.55; display: grid; gap: 4px; }
.analisis-intro p { font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.analisis-intro h2, .analisis-intro h3 { font-size: 14px; margin: 14px 0 6px; }
.perfil-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.chip .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }

/* ---------- recorridos guiados ---------- */

.nav-menu-check {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-top: 4px;
    border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); font-weight: 600; cursor: pointer; line-height: 1.4;
}
.nav-menu-check input { margin: 2px 0 0; accent-color: var(--navy); }
.nav-menu a.is-hecho .nav-menu-icon { background: #E4F6EC; color: #1C6E40; }
.nav-menu a.is-hecho .nav-menu-body em::after { content: " · visto"; color: #1C6E40; font-weight: 700; }

.tour { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.tour[hidden] { display: none; }
.tour-bloqueo { position: absolute; inset: 0; pointer-events: auto; }
.tour-foco {
    position: fixed; border-radius: 12px; pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(10, 24, 50, .62), 0 0 0 3px var(--gold), 0 0 0 8px rgba(217, 160, 56, .28);
    transition: top .22s ease, left .22s ease, width .22s ease, height .22s ease;
}
.tour-card {
    position: fixed; width: min(400px, calc(100vw - 24px)); padding: 20px 22px 16px;
    background: #fff; color: var(--ink); border-radius: 16px;
    box-shadow: 0 24px 60px rgba(6, 20, 44, .35); pointer-events: auto;
    transition: top .22s ease, left .22s ease;
}
.tour-card::before {
    content: ""; position: absolute; width: 14px; height: 14px; background: #fff; transform: rotate(45deg);
    box-shadow: -3px -3px 6px rgba(6, 20, 44, .06);
}
.tour-card[data-lado="bottom"]::before { top: -7px; left: calc(50% - 7px); }
.tour-card[data-lado="top"]::before { bottom: -7px; left: calc(50% - 7px); transform: rotate(225deg); }
.tour-card[data-lado="right"]::before { left: -7px; top: calc(50% - 7px); transform: rotate(-45deg); }
.tour-card[data-lado="left"]::before { right: -7px; top: calc(50% - 7px); transform: rotate(135deg); }
.tour-card[data-lado="flotante"]::before, .tour-card[data-lado="abajo"]::before { display: none; }
.tour-cerrar {
    position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 9px;
    background: var(--line-soft); color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.tour-cerrar svg { width: 14px; height: 14px; }
.tour-cerrar:hover { background: var(--line); color: var(--navy); }
.tour-eyebrow { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); padding-right: 30px; }
.tour-titulo { margin: 6px 0 8px; font-size: 17px; font-weight: 800; letter-spacing: -.01em; padding-right: 26px; }
.tour-texto { font-size: 13.5px; line-height: 1.6; color: #2E3A55; }
.tour-texto b { color: var(--navy); }
.tour-progreso { height: 4px; border-radius: 4px; background: var(--line-soft); margin: 16px 0 12px; overflow: hidden; }
.tour-progreso i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--navy)); border-radius: 4px; transition: width .25s ease; }
.tour-acciones { display: flex; align-items: center; gap: 8px; }
.tour-spacer { flex: 1; }
.tour-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.tour-btn svg { width: 14px; height: 14px; }
.tour-btn:hover { border-color: var(--navy); }
.tour-btn:disabled { opacity: .4; cursor: default; }
.tour-btn.is-primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 8px 20px rgba(22, 48, 90, .25); }
.tour-btn.is-primary:hover { background: var(--navy-soft); }
.tour-link { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.tour-link:hover { color: var(--red); text-decoration: underline; }
.tour-auto { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--muted); font-weight: 600; cursor: pointer; line-height: 1.4; }
.tour-auto input { margin: 1px 0 0; accent-color: var(--navy); }
body.tour-activo { overflow-x: hidden; }

@media (max-width: 640px) {
    .tour-card { width: auto; padding: 18px 18px 14px; }
    .tour-titulo { font-size: 16px; }
    .tour-acciones { flex-wrap: wrap; }
    .tour-link { order: 3; width: 100%; text-align: left; margin-top: 6px; }
}

/* ---------- página guía ---------- */

.guia-hero {
    background: linear-gradient(135deg, var(--navy-deep), var(--navy) 60%, #24467C); color: #fff;
    border-radius: 18px; padding: 30px 32px; margin-bottom: 22px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
}
.guia-hero h1 { font-size: 27px; }
.guia-hero p { margin: 8px 0 0; color: rgba(255, 255, 255, .78); font-size: 14.5px; line-height: 1.6; max-width: 720px; }
.guia-hero-acciones { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.guia-hero .btn-gold { white-space: nowrap; }
.guia-hero-auto { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255, 255, 255, .78); font-weight: 600; cursor: pointer; }
.guia-hero-auto input { accent-color: var(--gold); }
.guia-reset { background: transparent; border: 0; color: rgba(255, 255, 255, .7); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0; }
.guia-reset:hover { color: #fff; }

.guia-camino { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.guia-paso { position: relative; padding: 16px 16px 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.guia-paso .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #2A1D00; font-size: 12px; font-weight: 800; margin-bottom: 10px; }
.guia-paso h5 { margin: 0 0 4px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.guia-paso p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.guia-paso em { display: block; margin-top: 8px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--navy); }

.guia-grupo { margin-top: 24px; }
.guia-grupo h2 { font-size: 15px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--navy); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.guia-grupo h2 span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
.guia-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.guia-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.guia-card-top { display: flex; align-items: center; gap: 10px; }
.guia-card-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: #EDF2FC; color: var(--navy); flex: none; }
.guia-card-icon svg { width: 17px; height: 17px; }
.guia-card h3 { font-size: 14.5px; font-weight: 800; }
.guia-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; flex: 1; }
.guia-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.guia-card-foot .estado { display: inline-flex; align-items: center; gap: 5px; }
.guia-card-foot .estado svg { width: 13px; height: 13px; }
.guia-card.is-hecho .guia-card-icon { background: #E4F6EC; color: #1C6E40; }
.guia-card .estado-hecho { display: none; color: #1C6E40; }
.guia-card.is-hecho .estado-hecho { display: inline-flex; }
.guia-card.is-hecho .estado-pendiente { display: none; }
.guia-card .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.guia-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.guia-rol { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.guia-rol.is-tuyo { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 160, 56, .18); }
.guia-rol b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.guia-rol b em { font-style: normal; font-size: 11px; color: var(--gold); margin-left: 6px; text-transform: uppercase; letter-spacing: .05em; }
.guia-rol p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

@media (max-width: 900px) {
    .guia-hero { grid-template-columns: 1fr; padding: 24px 20px; }
    .guia-hero-acciones { align-items: flex-start; }
}

.guia-hero-auto[hidden] { display: none; }

@media (max-width: 1440px) and (min-width: 901px) {
    .appbar-inner { gap: 14px; }
    .appbar-logo span { display: none; }
    .appbar-nav { gap: 2px; }
    .nav-link { padding: 8px 9px; font-size: 12.5px; gap: 6px; }
    .appbar-user { padding-left: 12px; gap: 8px; }
}
@media (max-width: 1240px) and (min-width: 901px) {
    .appbar-user-meta { display: none; }
    .nav-guia .nav-trigger > span:first-of-type { display: none; }
    .nav-trigger svg:last-child { display: none; }
}

/* ---------- tipo de diagnóstico ---------- */

.tipo-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 6px; }
.tipo-card {
    position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 12px;
    border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.tipo-card:hover { border-color: var(--navy-soft); }
.tipo-card.is-active { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22, 48, 90, .12); }
.tipo-card.is-incubacion.is-active { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46, 158, 91, .16); }
.tipo-card input { position: absolute; opacity: 0; pointer-events: none; }
.tipo-card-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: #EDF2FC; color: var(--navy); }
.tipo-card.is-incubacion .tipo-card-icon { background: #E4F6EC; color: #1C6E40; }
.tipo-card-icon svg { width: 18px; height: 18px; }
.tipo-card-body { display: grid; gap: 3px; min-width: 0; text-transform: none; letter-spacing: 0; }
.tipo-card-body b { font-size: 14px; font-weight: 800; color: var(--ink); }
.tipo-card-body em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--navy); }
.tipo-card-body small { font-size: 11.5px; line-height: 1.45; color: var(--muted); font-weight: 500; }

/* ---------- creador de diagnósticos ---------- */

.gen-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 22px; align-items: start; }
.gen-main, .gen-steps { min-width: 0; }
.gen-grid > * { min-width: 0; }
.gen-steps { position: sticky; top: calc(var(--topbar-h, 72px) + 14px); }
.gen-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gen-steps li { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.gen-steps li > a, .gen-steps li > span { display: flex; gap: 12px; align-items: center; padding: 11px 12px; color: inherit; text-decoration: none; }
.gen-steps li.is-current { border-color: var(--navy-soft); box-shadow: 0 0 0 2px rgba(27, 58, 107, .12); }
.gen-steps li.is-locked { opacity: .55; }
.gen-step-n {
    flex: 0 0 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--line-soft); color: var(--navy); font-weight: 800; font-size: 13px;
}
.gen-step-n svg { width: 16px; height: 16px; }
.gen-steps li.is-done .gen-step-n { background: #E7F5EC; color: var(--green); }
.gen-steps li.is-current .gen-step-n { background: var(--navy); color: #fff; }
.gen-step-body { display: grid; gap: 2px; min-width: 0; }
.gen-step-body b { font-size: 13.5px; line-height: 1.25; }
.gen-step-body em { font-style: normal; font-size: 12px; color: var(--muted); }
.gen-step-tools { display: flex; gap: 4px; justify-content: flex-end; padding: 0 8px 8px; }
.gen-step-tools form { margin: 0; }
.gen-step-tools .icon-btn { width: 28px; height: 28px; }
.gen-steps-edit li > a { padding-bottom: 4px; }
.gen-agregar { display: grid; gap: 8px; margin-top: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 13px; }
.gen-ayuda { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.gen-ayuda p { margin: 0 0 6px; }

.gen-opts { display: grid; gap: 6px; margin: 8px 0 4px; }
.gen-opt {
    display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line);
    border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; line-height: 1.35; background: #fff;
}
.gen-opt:hover { border-color: var(--navy-soft); }
.gen-opt input { margin-top: 3px; flex: 0 0 auto; width: auto; }
.gen-opt:has(input:checked) { border-color: var(--navy-soft); background: #F1F5FC; }
.gen-campo { padding: 14px 0; border-bottom: 1px solid var(--line-soft); margin: 0; }
.gen-campo > label { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 700; }
.field .gen-opt, .gen-opt span { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); font-weight: 500; }
.gen-motor select { max-width: 360px; }
.gen-req { color: #C2412D; }
.gen-form fieldset, .gen-main fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.is-pendiente.gen-campo > label, .gen-q.is-pendiente .gen-q-head { color: #B4501F; }

.gen-q { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: #fff; }
.gen-q.is-pendiente { border-color: var(--gold); }
.gen-q-head { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gen-q-text { font-weight: 700; font-size: 15px; margin: 6px 0 2px; }
.gen-burbuja { background: #F1F5FC; border-radius: 14px 14px 14px 4px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; max-width: 640px; }
.gen-motor { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; background: #FAFBFE; }
.gen-motor > span:first-child { width: 100%; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.gen-motor b { font-size: 15px; }
.gen-motor .hint { width: 100%; }
.gen-motor form { display: flex; gap: 8px; align-items: center; margin: 0; }

.gen-resultado { margin-top: 18px; }
.gen-salida {
    border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; max-height: 70vh; overflow: auto;
    background: #fff; font-size: 14px; line-height: 1.55;
}
.gen-salida h2, .gen-salida h3, .gen-salida h4 { margin: 18px 0 8px; }
.gen-salida p { margin: 0 0 10px; }
.gen-vivo { border: 1px solid var(--navy-soft); border-radius: 12px; padding: 14px 16px; background: #F7F9FD; }
.gen-vivo-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.gen-parcial {
    white-space: pre-wrap; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 50vh; overflow: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0;
}
.gen-parcial:empty::before { content: 'Esperando las primeras palabras…'; color: var(--muted); }
.gen-spin {
    width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex: 0 0 16px;
    border: 2px solid rgba(27, 58, 107, .2); border-top-color: var(--navy-soft); animation: gen-giro .8s linear infinite;
}
@keyframes gen-giro { to { transform: rotate(360deg); } }
.gen-acciones { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.gen-acciones form { margin: 0; }
.gen-pegar, .gen-prompt, .gen-det, .gen-crear { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: #fff; }
.gen-pegar summary, .gen-prompt summary, .gen-det summary, .gen-crear summary { cursor: pointer; font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.gen-pegar summary svg, .gen-prompt summary svg, .gen-det summary svg, .gen-crear summary svg { width: 16px; height: 16px; }
.gen-pegar textarea { margin-top: 10px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.gen-prompt pre { white-space: pre-wrap; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 50vh; overflow: auto; background: #FAFBFE; padding: 12px; border-radius: 10px; }

.gen-defs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.gen-def { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.gen-def.is-off { opacity: .65; }
.gen-def-top { display: flex; gap: 12px; align-items: center; }
.gen-def-top > div { display: grid; gap: 2px; }
.gen-def p { margin: 0; font-size: 13.5px; color: var(--muted); }
.gen-def-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.gen-edit-q { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.gen-edit-q-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.gen-mini { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.gen-mini input[type="number"] { width: 70px; padding: 4px 8px; }
.gen-mini input[type="checkbox"] { width: auto; }
.gen-borrar { margin-left: auto; color: #B4321F; }
.gen-mono { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.gen-det .gen-edit-q:first-of-type { margin-top: 12px; }
.gen-defecto { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 1100px) {
    .gen-grid { grid-template-columns: 1fr; }
    .gen-steps { position: static; }
    .gen-steps ol { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
    .gen-steps li { flex: 0 0 210px; scroll-snap-align: start; }
    .gen-motor select { max-width: 100%; }
    .gen-motor form { flex-wrap: wrap; }
    .gen-steps li > a, .gen-steps li > span { padding: 9px 10px; }
    .gen-step-body b { font-size: 12.5px; }
    .gen-steps-edit .gen-agregar, .gen-steps-edit .gen-ayuda { display: none; }
}
