/* Ayuda visual de horas extra (ficha de empresa del administrador). docs/HORAS_EXTRA_PLAN.md
   Estética propia y fija (no depende del tema de la app): tinta profunda, esmeralda para lo que cuenta como extra,
   ámbar para los márgenes de cortesía y gris rayado para lo que no computa. */
.ahx-open {
    display: inline-flex; align-items: center; gap: .4rem; margin-left: .6rem; vertical-align: middle;
    font: 700 .78rem/1 'Segoe UI', system-ui, sans-serif; letter-spacing: .01em;
    color: #0e7a55; background: #e3f5ee; border: 1px solid #b7e4d2; border-radius: 999px; padding: .35rem .75rem; cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.ahx-open:hover { background: #d3efe4; box-shadow: 0 4px 14px rgba(14, 122, 85, .18); transform: translateY(-1px); }
.ahx-open svg { width: 15px; height: 15px; }

.modal.ahx-modal { padding: 1.25rem; align-items: flex-start; overflow-y: auto; }
.modal.ahx-modal .ahx {
    --ink: #0d1b2a; --ink-2: #44546a; --ink-3: #7c8aa0; --line: #e3e8ef; --paper: #ffffff; --soft: #f5f7fa;
    --emerald: #0f9f6e; --emerald-soft: #dff5ec; --amber: #c67a12; --amber-soft: #fdf1df; --rose: #d1453b; --rose-soft: #fde7e5;
    --navy: #22344d; --theory: #e8eefb; --cut: #a9b4c3;
    max-width: 1080px; width: 100%; margin: 0 auto; padding: 0; overflow: hidden; border-radius: 22px;
    background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(5, 12, 24, .45);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; text-align: left;
}
.ahx * { box-sizing: border-box; }
.ahx h2, .ahx h3, .ahx h4 { margin: 0; line-height: 1.15; text-wrap: balance; color: inherit; }
.ahx p { margin: 0; }
.ahx .num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Cabecera */
.ahx-hero {
    position: relative; padding: 2rem 2.25rem 1.6rem; color: #f3f6fb;
    background:
        radial-gradient(900px 260px at 85% -40%, rgba(15, 159, 110, .35), transparent 60%),
        radial-gradient(600px 220px at 0% 120%, rgba(198, 122, 18, .22), transparent 60%),
        #0d1b2a;
}
.ahx-hero .close-modal {
    position: absolute; top: 1rem; right: 1rem; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; font-size: 1rem;
}
.ahx-hero .close-modal:hover { background: rgba(255, 255, 255, .2); }
.ahx-eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #6fe0b4; }
.ahx-hero h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); font-weight: 800; margin-top: .45rem; letter-spacing: -.01em; }
.ahx-hero p { margin-top: .55rem; max-width: 60ch; color: #b9c6d8; font-size: 1rem; }
.ahx-config { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.ahx-config span {
    display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .8rem; border-radius: 10px;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-size: .82rem; color: #dfe7f2;
}
.ahx-config b { color: #fff; font-weight: 800; }
.ahx-config small { color: #8fa1b9; font-size: .72rem; }

.ahx-body { padding: 1.75rem 2.25rem 2.25rem; display: grid; gap: 2rem; }
.ahx-sec-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.ahx-sec-h h3 { font-size: 1.25rem; font-weight: 800; }
.ahx-sec-h p { color: var(--ink-2); font-size: .92rem; }

/* Simulador */
.ahx-sim { border: 1px solid var(--line); border-radius: 18px; padding: 1.25rem 1.25rem 1.1rem; background: linear-gradient(180deg, #fbfcfe, #f4f7fb); }
.ahx-presets { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.ahx-presets button {
    font: 600 .82rem/1 inherit; padding: .5rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink);
    cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.ahx-presets button:hover { border-color: #b9c5d6; box-shadow: 0 3px 10px rgba(13, 27, 42, .08); transform: translateY(-1px); }
.ahx-presets button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.ahx-track-wrap { overflow-x: auto; padding-bottom: .25rem; }
.ahx-track { position: relative; min-width: 620px; height: 132px; }
.ahx-axis { position: absolute; left: 0; right: 0; top: 0; height: 18px; }
.ahx-axis span { position: absolute; transform: translateX(-50%); font-size: .7rem; color: var(--ink-3); font-weight: 600; }
.ahx-axis span:first-child { transform: none; } .ahx-axis span:last-child { transform: translateX(-100%); }
.ahx-lane { position: absolute; left: 0; right: 0; top: 26px; height: 64px; border-radius: 14px; background: #e9edf3; overflow: hidden; }
.ahx-z { position: absolute; top: 0; bottom: 0; }
.ahx-z.theory { background: var(--theory); }
.ahx-z.margin { background: repeating-linear-gradient(135deg, var(--amber-soft) 0 7px, #fff7ea 7px 14px); border-inline: 1px dashed #e0a24e; }
.ahx-start { position: absolute; top: 18px; bottom: 34px; width: 2px; background: var(--ink); }
.ahx-start::after { content: attr(data-label); position: absolute; top: 3px; left: 6px; font-size: .66rem; font-weight: 800; white-space: nowrap; color: var(--ink); }
.ahx-start { top: 26px; bottom: auto; height: 64px; }
.ahx-seg { position: absolute; top: 18px; height: 28px; border-radius: 8px; transition: left .25s ease, width .25s ease; }
.ahx-seg.work { background: var(--navy); }
.ahx-seg.margin { background: #f0a43c; }
.ahx-seg.extra { background: var(--emerald); box-shadow: 0 0 0 3px rgba(15, 159, 110, .18); }
.ahx-seg.cut { background: repeating-linear-gradient(90deg, var(--cut) 0 4px, transparent 4px 8px); }
.ahx-seg.break { background: #fff; border: 2px dashed #9aa7ba; }
.ahx-seg.missing { background: repeating-linear-gradient(135deg, var(--rose-soft) 0 6px, transparent 6px 12px); border: 1px dashed var(--rose); }
.ahx-pin { position: absolute; top: 96px; transform: translateX(-50%); font-size: .74rem; font-weight: 800; padding: .2rem .5rem; border-radius: 6px; background: var(--ink); color: #fff; white-space: nowrap; transition: left .25s ease; }
.ahx-pin::before { content: ""; position: absolute; left: 50%; top: -6px; transform: translateX(-50%); border: 6px solid transparent; border-top: 0; border-bottom-color: var(--ink); }

.ahx-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem 1.2rem; margin-top: .9rem; }
.ahx-ctl label { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 700; color: var(--ink-2); margin-bottom: .3rem; }
.ahx-ctl label b { color: var(--ink); font-size: .95rem; }
.ahx-ctl input[type=range] { width: 100%; accent-color: var(--ink); }
.ahx-ctl select { width: 100%; font: inherit; padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }

.ahx-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .9rem; font-size: .78rem; color: var(--ink-2); }
.ahx-legend i { display: inline-block; width: 20px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: 0; }

/* Resultado */
.ahx-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.4fr; gap: .8rem; margin-top: 1.1rem; }
.ahx-kpi { border-radius: 16px; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--line); display: grid; gap: .25rem; align-content: start; }
.ahx-kpi span { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ahx-kpi b { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.ahx-kpi small { color: var(--ink-3); font-size: .78rem; }
.ahx-kpi.extra { background: linear-gradient(160deg, #0f9f6e, #0b7d57); border: 0; color: #fff; }
.ahx-kpi.extra span, .ahx-kpi.extra small { color: rgba(255, 255, 255, .78); }
.ahx-kpi.extra.zero { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.ahx-kpi.extra.zero span, .ahx-kpi.extra.zero small { color: var(--ink-3); }
.ahx-kpi .neg { color: var(--rose); } .ahx-kpi .pos { color: var(--emerald); }
.ahx-why { border-radius: 16px; padding: 1rem 1.1rem; background: var(--soft); border: 1px solid var(--line); display: grid; gap: .5rem; align-content: start; }
.ahx-why h4 { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ahx-why ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.ahx-why li { display: grid; grid-template-columns: 22px 1fr; gap: .5rem; font-size: .86rem; color: var(--ink-2); align-items: start; }
.ahx-why li i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .75rem; font-weight: 900; color: #fff; }
.ahx-why li i.ok { background: var(--emerald); } .ahx-why li i.mg { background: #f0a43c; } .ahx-why li i.ct { background: var(--cut); } .ahx-why li i.in { background: var(--navy); }

/* Ajustes */
.ahx-settings { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; }
.ahx-set { border: 1px solid var(--line); border-radius: 16px; padding: 1rem; display: grid; gap: .5rem; align-content: start; background: #fff; }
.ahx-set svg { width: 100%; height: 54px; }
.ahx-set h4 { font-size: .92rem; font-weight: 800; }
.ahx-set p { font-size: .8rem; color: var(--ink-2); }
.ahx-set .val { font-size: .8rem; font-weight: 800; color: var(--emerald); }

/* Herencia */
.ahx-inherit { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1rem; align-items: start; }
.ahx-co { border-radius: 18px; padding: 1.2rem; background: #0d1b2a; color: #e7edf6; display: grid; gap: .7rem; align-content: start; }
.ahx-co h4 { font-size: 1rem; font-weight: 800; color: #fff; }
.ahx-co .r { display: flex; justify-content: space-between; font-size: .86rem; border-bottom: 1px solid rgba(255, 255, 255, .1); padding-bottom: .4rem; }
.ahx-co .r b { color: #6fe0b4; }
.ahx-people { display: grid; gap: .7rem; }
.ahx-person { display: grid; grid-template-columns: 44px 1fr auto; gap: .8rem; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: .8rem 1rem; background: #fff; }
.ahx-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
.ahx-person h5 { margin: 0; font-size: .95rem; font-weight: 800; color: var(--ink); }
.ahx-person p { font-size: .8rem; color: var(--ink-2); }
.ahx-tag { font-size: .72rem; font-weight: 800; padding: .3rem .6rem; border-radius: 999px; white-space: nowrap; }
.ahx-tag.inh { background: #eef1f5; color: var(--ink-2); } .ahx-tag.own { background: var(--emerald-soft); color: #0b7d57; }
.ahx-foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; padding-top: .25rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-3); }
.ahx-foot b { color: var(--ink-2); }

@media (max-width: 920px) {
    .ahx-result { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ahx-why { grid-column: 1 / -1; }
    .ahx-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ahx-inherit { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .ahx-hero, .ahx-body { padding-inline: 1.1rem; }
    .ahx-result { grid-template-columns: 1fr; }
    .ahx-settings { grid-template-columns: 1fr; }
    .ahx-kpi b { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) { .ahx-seg, .ahx-pin, .ahx-open { transition: none; } }

/* 3.42.0: ejemplo de cálculo semanal o mensual */
.ahx-tabla { border-collapse: collapse; margin: .25rem 0 .75rem; font-size: .9rem; }
.ahx-tabla th, .ahx-tabla td { padding: .35rem .7rem; border: 1px solid #e2e8f0; text-align: center; }
.ahx-tabla th { background: #f1f5f9; font-weight: 600; }
.ahx-tabla td:last-child, .ahx-tabla th:last-child { background: #e8eefb; }
.ahx-periodo { display: block; padding: 1rem 1.25rem; border-radius: 14px; background: #f8fafc; border: 1px solid #e2e8f0; line-height: 1.5; }
.ahx-periodo p { margin: .5rem 0; } .ahx-periodo ul { margin: .25rem 0 .5rem; padding-left: 1.2rem; }

/* 3.47.4: la ventana cabe en la pantalla y se desplaza por dentro (antes, la parte de abajo quedaba cortada) */
.modal.ahx-modal .ahx { max-height: calc(100vh - 2.5rem); max-height: calc(100dvh - 2.5rem); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 640px) { .modal.ahx-modal { padding: .5rem; } .modal.ahx-modal .ahx { max-height: calc(100dvh - 1rem); border-radius: 16px; } }
.ahx-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .5rem; }
.ahx-title-row > .company-section-subtitle { margin: 0 !important; }
.ahx-body { grid-template-columns: minmax(0, 1fr); }
.ahx-body > section, .ahx-sim, .ahx-presets { min-width: 0; }
.ahx-presets { flex-wrap: wrap; }
