/* =========================================================================
   Checklist de Kits — sistema independiente
   Lenguaje visual tomado del login del Visor Plan Nescafé (visor_nestle):
   banda espresso con luz ambiental, papel cálido, Inter, rojo Nestlé como
   único acento fuerte y el verde de Plan Nescafé para lo «conforme».
   ========================================================================= */

:root {
    --ink: #12100e;
    --paper: #fdfcfa;
    --surface: #ffffff;
    --field: #f7f4f0;
    --text: #17140f;
    --text-soft: #423b33;
    --muted: #6c635a;
    --line: #e6e0d8;
    --line-strong: #d5cdc2;
    --dim: #b7aca0;

    --red: #e31e24;
    --red-dark: #b7181d;
    --red-wash: rgba(227, 30, 36, 0.07);
    --green: #009640;
    --green-dark: #007a34;
    --green-wash: rgba(0, 150, 64, 0.08);
    --gray: #6d6e71;
    --forest: #1b5e20;

    --radius-lg: 14px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(24, 20, 16, 0.045);
    --shadow: 0 6px 20px -8px rgba(24, 20, 16, 0.16);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@font-face {
    font-family: 'Inter respaldo';
    src: local('Arial');
    size-adjust: 107%;
    ascent-override: 90%;
    descent-override: 22.5%;
    line-gap-override: 0%;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', 'Inter respaldo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(227, 30, 36, 0.18); }

h1, h2, h3, p { margin: 0; }

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

/* -------------------------------------------------------------------------
   Banda de marca
   ------------------------------------------------------------------------- */

.ck-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    background: var(--ink);
    padding: clamp(1.5rem, 4vw, 2.75rem) 16px clamp(2rem, 5vw, 3.25rem);
}

/* Luz ambiental: brasa roja, café y verde de bosque — la misma del login. */
.ck-brand::before {
    content: '';
    position: absolute;
    inset: -40%;
    z-index: -2;
    background:
        radial-gradient(30% 50% at 6% 30%, rgba(227, 30, 36, 0.40), transparent 70%),
        radial-gradient(34% 60% at 78% 10%, rgba(164, 117, 81, 0.32), transparent 72%),
        radial-gradient(40% 60% at 40% 100%, rgba(27, 94, 32, 0.45), transparent 72%);
    filter: blur(6px);
}

.ck-terrain {
    position: absolute;
    inset: -20% -10%;
    z-index: -1;
    background: url('../img/login-terrain.svg') no-repeat center / cover;
    opacity: 0.22;
}

.ck-brand__inner {
    max-width: 76rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 3.5vw, 2.5rem);
}

.ck-lockup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.25rem);
}

.ck-lockup img { width: auto; flex: none; }
.ck-lockup__plan { height: clamp(2rem, 4.8vw, 2.75rem); }
.ck-lockup__nestle { height: clamp(2.25rem, 5.2vw, 3rem); }
.ck-lockup__bosques { height: clamp(2rem, 4.8vw, 2.7rem); }
.ck-lockup__fcoh { height: clamp(1.3rem, 3vw, 1.7rem); }

.ck-lockup__rule {
    flex: none;
    width: 1px;
    height: 1.75rem;
    background: rgba(243, 231, 218, 0.22);
}

.ck-brand__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem 2rem;
}

.ck-eyebrow {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #f3e7da;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.ck-display {
    font-weight: 600;
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.ck-lede {
    margin-top: 0.625rem;
    color: var(--dim);
    font-size: 1.0625rem;
}

.ck-brand__actions { display: flex; gap: 0.75rem; }

/* -------------------------------------------------------------------------
   Estructura
   ------------------------------------------------------------------------- */

.ck-main {
    flex: 1;
    width: 100%;
    max-width: 76rem;
    margin: 0 auto;
    padding: 0 16px 3rem;
    /* Las tarjetas suben sobre la banda: la división gana profundidad. */
    margin-top: -1.25rem;
    position: relative;
    /* Nada puede ensanchar la página: si pasa, la barra fija con «Guardar»
       queda fuera de la pantalla en el celular. */
    overflow-x: clip;
}

.ck-footer {
    padding: 1.5rem 16px 9rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
}

.ck-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: clamp(1.125rem, 3vw, 1.75rem);
    margin-bottom: 1.25rem;
}

.ck-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 1.375rem;
}

.ck-card__head h2 {
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.ck-card__head p { color: var(--muted); font-size: 0.875rem; margin-top: 0.15rem; }

.ck-head-action { margin-left: auto; flex: none; }

.ck-step {
    flex: none;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------
   Campos
   ------------------------------------------------------------------------- */

.ck-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.125rem;
}

.ck-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ck-col-2 { grid-column: span 2; }
.ck-col-3 { grid-column: span 3; }

.ck-field { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.ck-field label,
.ck-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-soft);
}

.ck-req { color: var(--red); }

.ck-hint { font-size: 0.75rem; color: var(--muted); }

.ck-input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.875rem;
    font: inherit;
    color: var(--text);
    background: var(--field);
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.ck-input:hover { border-color: var(--line-strong); }

.ck-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(18, 16, 14, 0.08);
}

.ck-input--calc,
.ck-input--calc:hover {
    background: transparent;
    border: 1px dashed var(--line-strong);
    color: var(--text-soft);
    font-weight: 600;
    cursor: default;
}

.ck-input--calc:focus { box-shadow: none; border-color: var(--line-strong); }

.ck-input.is-bad { color: var(--red); border-color: rgba(227, 30, 36, 0.45); background: var(--red-wash); }

.ck-num { font-variant-numeric: tabular-nums; }

.ck-textarea { resize: vertical; min-height: 7rem; line-height: 1.55; }

.ck-field.has-error .ck-input { border-color: var(--red); background: var(--red-wash); }
.ck-field.has-error label { color: var(--red-dark); }

/* -------------------------------------------------------------------------
   Checklist
   ------------------------------------------------------------------------- */

.ck-section {
    border: 0;
    margin: 0 0 1.5rem;
    padding: 0;
    min-width: 0;
}

.ck-section:last-child { margin-bottom: 0; }

.ck-section__title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0 0 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--line);
}

.ck-section__letter {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    background: var(--red);
    color: #fff;
    font-size: 0.75rem;
}

.ck-section__count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--field);
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.ck-section__count.is-complete { background: var(--green-wash); color: var(--green-dark); }

.ck-item {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto minmax(12rem, 16rem);
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s var(--ease);
}

.ck-item:hover { background: #fbf9f6; }
.ck-item.is-no { background: var(--red-wash); }
.ck-item.has-error { box-shadow: inset 3px 0 0 var(--red); }
.ck-item.has-error .ck-item__obs { border-color: var(--red); background: #fff; }

.ck-item__num {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.ck-item__text { font-size: 0.9375rem; color: var(--text); }

.ck-item__obs { min-height: 2.375rem; padding: 0.4rem 0.75rem; font-size: 0.875rem; }

/* Control segmentado Sí / No / N/A */
.ck-seg {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--field);
    border-radius: 10px;
}

.ck-seg--wide { display: flex; }
.ck-seg--wide .ck-seg__opt { flex: 1; }

.ck-seg__opt { position: relative; cursor: pointer; }

.ck-seg__opt input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.ck-seg__opt span {
    display: block;
    min-width: 3.25rem;
    padding: 0.4rem 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    border-radius: 7px;
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.ck-seg__opt:hover span { color: var(--text); }
.ck-seg__opt input:focus-visible + span { box-shadow: 0 0 0 2px var(--ink); }
.ck-seg__opt input:checked + span { color: #fff; box-shadow: var(--shadow-sm); }
.ck-seg__opt--si input:checked + span { background: var(--green); }
.ck-seg__opt--no input:checked + span { background: var(--red); }
.ck-seg__opt--na input:checked + span { background: var(--gray); }

/* -------------------------------------------------------------------------
   Tablas
   ------------------------------------------------------------------------- */

.ck-table-wrap {
    /* relative: el texto oculto (.ck-sr) de los encabezados no escapa del
       scroll y no ensancha la página en tabletas. */
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.ck-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.ck-table th {
    padding: 0.625rem 0.625rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-soft);
    background: #faf8f5;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.ck-table td { padding: 0.25rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ck-table tbody tr:last-child td { border-bottom: 0; }
.ck-table tr.is-diff td { background: var(--red-wash); }

.ck-t-num { width: 2.75rem; text-align: center !important; color: var(--muted); font-variant-numeric: tabular-nums; }
.ck-t-qty { width: 6.5rem; }
.ck-t-yn { width: 6rem; }
.ck-t-del { width: 2.75rem; text-align: center; }

.ck-cell {
    width: 100%;
    min-width: 5rem;
    min-height: 2.375rem;
    padding: 0.375rem 0.5rem;
    font: inherit;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.ck-cell:hover { background: var(--field); }
.ck-cell:focus { outline: none; background: #fff; border-color: var(--ink); }

.ck-table--list td { padding: 0.75rem 0.625rem; }
.ck-table--list tbody tr:hover td { background: #fbf9f6; }

.ck-t-actions { text-align: right; }
.ck-t-actions .ck-link + .ck-link { margin-left: 0.875rem; }

.ck-muted { color: var(--muted); }
.ck-nowrap { white-space: nowrap; }

/* -------------------------------------------------------------------------
   Botones, chips, estados
   ------------------------------------------------------------------------- */

.ck-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.625rem 1.125rem;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease), color 0.2s var(--ease);
}

.ck-btn svg { width: 1.125rem; height: 1.125rem; }
.ck-btn:active { transform: scale(0.98); }
.ck-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.ck-btn--primary { background: var(--red); color: #fff; border-radius: var(--radius-lg); padding-inline: 1.5rem; font-weight: 600; }
.ck-btn--primary:hover { background: var(--red-dark); }
.ck-btn--primary:disabled { opacity: 0.7; cursor: progress; }

.ck-btn--light { background: #fff; color: var(--ink); font-weight: 600; }
.ck-btn--light:hover { background: #f3e7da; }

.ck-btn--ghost { color: #fff; border-color: rgba(243, 231, 218, 0.3); }
.ck-btn--ghost:hover { background: rgba(243, 231, 218, 0.1); }

.ck-btn--quiet { color: var(--text); background: var(--field); min-height: 2.5rem; font-size: 0.875rem; }
.ck-btn--quiet:hover { background: var(--line); }

.ck-btn.is-loading .ck-btn__label::before {
    content: '';
    display: inline-block;
    width: 0.875rem;
    height: 0.875rem;
    margin-right: 0.5rem;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ck-spin 0.7s linear infinite;
}

@keyframes ck-spin { to { transform: rotate(360deg); } }

.ck-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    color: var(--dim);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.ck-icon-btn svg { width: 1rem; height: 1rem; }
.ck-icon-btn:hover { color: var(--red); background: var(--red-wash); }

.ck-link { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.ck-link:hover { color: var(--red); text-decoration-color: currentColor; }

.ck-chip {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    background: var(--field);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.ck-chip--si { background: var(--green-wash); color: var(--green-dark); }
.ck-chip--no { background: var(--red-wash); color: var(--red-dark); }
.ck-chip--na { background: rgba(109, 110, 113, 0.1); color: var(--gray); }

.ck-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.2rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 999px;
}

.ck-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ck-status--ok { background: var(--green); color: white; }
.ck-status--bad { background: var(--red-wash); color: var(--red-dark); }

.ck-guard {
    height: 2.6rem;
    display: flex;
    margin: 35px 20px;
}

.ck-alert {
    padding: 0.875rem 1.125rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    position: relative;
    z-index: 1;
}

.ck-alert--error { background: #fff; color: var(--red-dark); border: 1px solid rgba(227, 30, 36, 0.35); box-shadow: var(--shadow); }

/* Buscador y vacío */
.ck-search { display: flex; gap: 0.625rem; margin-bottom: 1.25rem; }
.ck-search .ck-input { flex: 1; }

.ck-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--muted);
}

.ck-empty__title { color: var(--text); font-size: 1.0625rem; font-weight: 600; }
.ck-empty .ck-btn { margin-top: 0.75rem; }

/* Firmas */
.ck-firmas {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.125rem;
    margin: 1.5rem 0 0.75rem;
}

.ck-firma {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.ck-firma__rol { font-weight: 600; font-size: 0.875rem; }

/* -------------------------------------------------------------------------
   Barra inferior fija
   ------------------------------------------------------------------------- */

.ck-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 0.75rem 16px calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(253, 252, 250, 0.9);
    backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--line);
}

.ck-dock__inner {
    max-width: 76rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.ck-progress { flex: 1; min-width: 0; }

.ck-progress__bar {
    height: 4px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.ck-progress__bar span {
    display: block;
    height: 100%;
    background: var(--green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease);
}

.ck-progress__txt { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.ck-progress__txt strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 62rem) {
    .ck-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ck-item { grid-template-columns: 2rem minmax(0, 1fr) auto; }
    .ck-item__obs { grid-column: 2 / -1; }
}

@media (max-width: 44rem) {
    .ck-lockup__rule { display: none; }
    .ck-grid, .ck-grid--4 { grid-template-columns: minmax(0, 1fr); }
    .ck-col-2, .ck-col-3 { grid-column: auto; }
    .ck-card__head { flex-wrap: wrap; }
    .ck-head-action { margin-left: 2.875rem; }
    .ck-item { grid-template-columns: 1.5rem minmax(0, 1fr); padding-inline: 0.25rem; }
    .ck-item .ck-seg, .ck-item__obs { grid-column: 2 / -1; }
    .ck-firmas { grid-template-columns: minmax(0, 1fr); }
    .ck-btn--primary { padding-inline: 1.125rem; }

    /* Barra inferior: progreso arriba, botón a todo el ancho abajo */
    .ck-dock { padding-top: 0.625rem; }
    .ck-dock__inner { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .ck-dock .ck-btn--primary { width: 100%; }
    .ck-progress__txt { gap: 0.375rem; font-size: 0.75rem; }
    .ck-progress__count { margin-right: auto; }
    .ck-progress__txt .ck-chip { padding: 0.0625rem 0.4375rem; font-size: 0.6875rem; }

    /* Muestreo como tarjetas apiladas */
    #tablaMuestreo thead { display: none; }
    #tablaMuestreo, #tablaMuestreo tbody, #tablaMuestreo tr, #tablaMuestreo td { display: block; width: 100%; }
    #tablaMuestreo tr { position: relative; padding: 0.75rem; border-bottom: 1px solid var(--line); }
    #tablaMuestreo td { border: 0; padding: 0.15rem 0; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; }
    #tablaMuestreo td::before { content: attr(data-label); font-size: 0.75rem; color: var(--muted); }
    #tablaMuestreo td.ck-t-num { font-weight: 600; color: var(--text); text-align: left !important; }
    #tablaMuestreo td.ck-t-del { position: absolute; top: 0.5rem; right: 0.5rem; width: auto; display: block; }
    #tablaMuestreo td.ck-t-del::before { content: none; }
    #tablaMuestreo .ck-cell { background: var(--field); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* =========================================================================
   Documento imprimible (ver.php) — réplica del formato Word
   ========================================================================= */

.ck-doc-body { background: #ebe6df; }

.ck-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 16px;
    background: rgba(253, 252, 250, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.ck-toolbar__spacer { flex: 1; }

.ck-doc {
    width: min(100% - 32px, 216mm);
    margin: 1.5rem auto 3rem;
    padding: 14mm 14mm 16mm;
    background: #fff;
    box-shadow: 0 10px 40px -16px rgba(24, 20, 16, 0.35);
    font-size: 10.5pt;
    line-height: 1.35;
    color: #111;
}

.ck-doc__head { text-align: center; margin-bottom: 1.25rem; }

.ck-doc__logos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.875rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--red);
}

.ck-doc__logos img { width: auto; max-width: 24%; }
.ck-doc__plan { height: 13mm; }
.ck-doc__nestle { height: 15mm; }
.ck-doc__bosques { height: 13mm; }
.ck-doc__fcoh { height: 7.5mm; }

.ck-doc h1 { font-size: 15pt; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.ck-doc h1 span { font-size: 12pt; font-weight: 600; color: var(--text-soft); }
.ck-doc__sub { margin-top: 0.25rem; font-size: 9.5pt; color: var(--muted); font-style: italic; }

.ck-doc h2 {
    margin: 1.25rem 0 0.5rem;
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ck-doc table { width: 100%; border-collapse: collapse; }

.ck-doc__meta { margin-bottom: 1rem; }
.ck-doc__meta th { text-align: left; font-weight: 600; white-space: nowrap; padding: 0.3rem 0.5rem 0.3rem 0; width: 1%; }
.ck-doc__meta td { border-bottom: 1px solid #999; padding: 0.3rem 1.25rem 0.3rem 0.25rem; }

.ck-doc__grid th, .ck-doc__grid td { border: 1px solid #8a8580; padding: 0.3rem 0.4rem; vertical-align: top; }
.ck-doc__grid th { background: var(--ink); color: #fff; font-size: 9pt; font-weight: 600; }
.ck-doc__grid .c { text-align: center; }
.ck-doc__grid .mark { font-size: 12pt; line-height: 1; }
.ck-doc__grid tr.is-no td { background: #fdecec; }
.ck-doc__sec td { background: #f1ece6; font-weight: 700; font-size: 9.5pt; }
.ck-doc__grid--small { font-size: 8.5pt; }
.ck-doc__grid--small td { height: 7mm; }

.w-num { width: 7%; }
.w-yn { width: 5.5%; }
.w-obs { width: 26%; }

.ck-doc__tally { margin-top: 0.4rem; font-size: 9pt; color: var(--muted); text-align: right; }
.ck-doc__line { margin-bottom: 0.5rem; }

.ck-doc__conc th, .ck-doc__conc td { border: 1px solid #8a8580; padding: 0.35rem 0.5rem; }
.ck-doc__conc th { text-align: left; font-weight: 600; background: #f7f4f0; width: 30%; }
.ck-doc__conc td { width: 20%; }
.ck-doc__conc td.is-bad { color: var(--red-dark); font-weight: 700; }

.ck-doc__hallazgos {
    min-height: 32mm;
    padding: 0.5rem;
    border: 1px solid #8a8580;
    background-image: repeating-linear-gradient(transparent 0 6.2mm, #d9d4cd 6.2mm 6.3mm);
    line-height: 6.3mm;
}

.ck-doc__actas { min-height: 20mm; }

.ck-doc__firmas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10mm;
    margin-top: 16mm;
    text-align: center;
    font-size: 9.5pt;
    break-inside: avoid;
}

.ck-doc__firma-linea { border-top: 1px solid #111; margin-bottom: 0.3rem; }
.ck-doc__firma-nombre { min-height: 1.3em; }

@media (max-width: 44rem) {
    .ck-doc { padding: 16px; font-size: 9pt; overflow-x: auto; }
    .ck-doc__firmas { grid-template-columns: 1fr; }
}

@page { size: letter; margin: 12mm; }

@media print {
    .ck-doc-body { background: #fff; }
    .ck-toolbar { display: none; }
    .ck-doc { width: auto; margin: 0; padding: 0; box-shadow: none; }
    .ck-doc__page { break-before: page; }
    .ck-doc__page h2:first-child { margin-top: 0; }
    .ck-doc__grid tr { break-inside: avoid; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* -------------------------------------------------------------------------
   Usuario de SIMFCOH en la banda
   ------------------------------------------------------------------------- */

.ck-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-left: auto;
    padding: 0.3rem 0.35rem 0.3rem 0.3rem;
    border: 1px solid rgba(243, 231, 218, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.ck-user__avatar {
    display: grid;
    place-items: center;
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 50%;
    background: var(--red);
    font-size: 0.8125rem;
    font-weight: 600;
}

.ck-user__name { font-size: 0.875rem; font-weight: 500; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ck-user__out {
    font: inherit;
    font-size: 0.8125rem;
    color: #f3e7da;
    background: none;
    border: 0;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
}

.ck-user__out:hover { background: rgba(243, 231, 218, 0.12); color: #fff; }

/* Acceso */
.ck-acceso {
    max-width: 34rem;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
    padding: clamp(1.5rem, 4vw, 2.25rem);
}

.ck-acceso h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
.ck-acceso .ck-alert { margin: 0; width: 100%; box-shadow: none; }
.ck-acceso .ck-btn--primary { margin-top: 2rem; margin-bottom: 2rem; }

/* -------------------------------------------------------------------------
   Evidencias
   ------------------------------------------------------------------------- */

.ck-evidencias { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.125rem; }

.ck-evid { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }

.ck-evid__drop {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--field);
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.ck-evid__drop:hover,
.ck-evid.is-drag .ck-evid__drop { border-color: var(--ink); background: #f3eee8; }
.ck-evid.has-error .ck-evid__drop { border-color: var(--red); background: var(--red-wash); }
.ck-evid.has-img .ck-evid__drop { border-style: solid; border-color: var(--line); background: #1b1815; }

.ck-evid__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.ck-evid__empty { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 1rem; text-align: center; color: var(--muted); }
.ck-evid__empty svg { width: 2rem; height: 2rem; margin-bottom: 0.25rem; color: var(--dim); }
.ck-evid__empty strong { color: var(--text); font-weight: 600; font-size: 0.9375rem; }
.ck-evid__empty small { font-size: 0.75rem; }
.ck-evid.has-img .ck-evid__empty { display: none; }

/* El input real queda accesible por teclado pero invisible. */
.ck-evid__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ck-evid__input:focus-visible + input + .ck-evid__bar,
.ck-evid:focus-within .ck-evid__drop { outline: 2px solid var(--ink); outline-offset: 2px; }

.ck-evid__bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.5rem; }
.ck-evid__name { font-size: 0.8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-evid__remove { visibility: hidden; }
.ck-evid.has-img .ck-evid__remove { visibility: visible; }

@media (max-width: 44rem) {
    .ck-evidencias { grid-template-columns: minmax(0, 1fr); }
    .ck-user { margin-left: 0; width: 100%; }
    .ck-user__name { flex: 1; }
}

/* Evidencias en el documento impreso */
.ck-doc__evidencias { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6mm; break-inside: avoid; }
.ck-doc__evidencias figure { margin: 0; border: 1px solid #8a8580; padding: 2mm; text-align: center; }
.ck-doc__evidencias img { width: 100%; height: 70mm; object-fit: contain; display: block; }
.ck-doc__evidencias figcaption { margin-top: 1.5mm; font-size: 9pt; font-weight: 600; }

/* Campos que el sistema llena (proyecto fijo, técnico de SIMFCOH, nombres de firma) */
.ck-input--locked,
.ck-input--locked:hover {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 500;
    cursor: default;
}

.ck-input--locked:focus { box-shadow: none; border-color: var(--line); }

.ck-cell.is-bad { border-color: var(--red); background: var(--red-wash); }
