/* Visuaali 3. etapp, rühm 5 — Tootearendus (rnd), Sertifitseerimine (iso), Labor.
 * Tokenid tulevad niidupaber.css-ist (--np-*). Paigutus kehtib mõlemas teemas,
 * värvid ainult heledas (tume teema jääb style.css-i reeglitele).
 * Skoop: .rcp-kaart (retsepti kaart #productModal-is), #iso (sertifitseerimine). */

/* ── 3.4 Retsepti kaart ───────────────────────────────────────────────── */
.rcp-kaart { font-size: .875rem; }
.rcp-pais {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
    padding: 0 2.25rem 1rem 0; border-bottom: 1px solid var(--np-line, #e6dccf); margin-bottom: 1rem;
}
.rcp-rida1 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rcp-kood { font-size: 1.35rem; letter-spacing: .01em; }
.rcp-ver { font-size: .75rem; padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.rcp-nimi { font-size: 1.05rem; margin-top: .2rem; }
.rcp-kat { font-size: .8125rem; margin-top: .15rem; }
.rcp-tegevused { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.rcp-menyy { position: relative; }
.rcp-menyy > summary { list-style: none; cursor: pointer; min-width: 2.2rem; text-align: center; }
.rcp-menyy > summary::-webkit-details-marker { display: none; }
.rcp-menyy-sisu {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 11rem;
    display: flex; flex-direction: column; gap: .25rem; padding: .4rem;
    border-radius: var(--np-r-sm, 8px); background: #fff; border: 1px solid #ddd; box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.rcp-menyy-sisu .btn { width: 100%; text-align: left; justify-content: flex-start; }
.rcp-kirjeldus { margin: 0 0 1rem; line-height: 1.5; }
.rcp-ai:empty { display: none; }
.rcp-ai { margin-bottom: 1rem; }

.rcp-sisu { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 900px) { .rcp-sisu { grid-template-columns: minmax(0, 1fr) 280px; } }

.rcp-alapealkiri { margin: 0 0 .5rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.rcp-vahe { margin-top: 1.25rem; }
.rcp-vaike { font-size: .75rem; font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: .35rem; }
.rcp-koostis-pais { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.rcp-summa { font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rcp-tyhi { padding: 1rem; border-radius: var(--np-r-md, 12px); text-align: center; border: 1px dashed #ccc; }

.rcp-faas { border-radius: var(--np-r-md, 12px); margin-bottom: .75rem; overflow: hidden; border: 1px solid #e6dccf; border-left-width: 4px; }
.rcp-faas-pais { display: flex; align-items: center; gap: .6rem; padding: .5rem .85rem; }
.rcp-faas-taht {
    display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem;
    border-radius: 50%; font-weight: 700; font-size: .85rem; flex: 0 0 auto;
}
.rcp-faas-nimi { font-weight: 600; }
.rcp-faas-kokku { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.rcp-faas-info { margin: 0 .85rem .5rem; padding: .35rem .6rem; border-radius: 6px; font-size: .8125rem; }
.rcp-tabel { width: 100%; font-size: .8125rem; border-collapse: collapse; table-layout: fixed; }
.rcp-tabel th:nth-child(1) { width: 6.5rem; }
.rcp-tabel th:nth-child(2) { width: 32%; }
.rcp-tabel th:nth-child(4) { width: 5.5rem; }
.rcp-tabel td { overflow-wrap: anywhere; }
.rcp-kaart .rcp-tabel th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; padding: .35rem .85rem; }
.rcp-kaart .rcp-tabel td { padding: .35rem .85rem; }
.rcp-kaart .rcp-tabel .rcp-arv { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.rcp-kood-lahter { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .75rem; white-space: nowrap; }

.rcp-inci { margin-top: 1rem; }
.rcp-inci-tekst { line-height: 1.6; }
.rcp-inci-tabel { margin-top: .5rem; font-size: .8125rem; }
.rcp-inci-tabel > summary { cursor: pointer; }

.rcp-spets { align-self: start; padding: .85rem 1rem; border-radius: var(--np-r-md, 12px); border: 1px solid #e6dccf; }
.rcp-spets-loend { margin: 0; }
.rcp-spets-rida { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem 0; border-bottom: 1px solid #eee; }
.rcp-spets-rida:last-child { border-bottom: 0; }
.rcp-spets-rida dt { margin: 0; }
.rcp-spets-rida dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.rcp-maaramata { margin-top: .5rem; font-size: .8125rem; display: flex; flex-direction: column; gap: .15rem; }
.rcp-maaramata .rcp-vaike { margin-left: 0; }
.rcp-versioonid { list-style: none; margin: 0; padding: 0; font-size: .8125rem; }
.rcp-versioonid li { padding: .25rem 0; border-bottom: 1px solid #eee; }
.rcp-versioonid li:last-child { border-bottom: 0; }

@media (max-width: 768px) {
    .rcp-pais { padding-right: 2rem; }
    .rcp-tegevused { width: 100%; }
    .rcp-kaart .rcp-tabel th, .rcp-kaart .rcp-tabel td { padding: .3rem .5rem; }
    .rcp-tabel th:nth-child(1) { width: 4.8rem; }
    .rcp-tabel th:nth-child(4) { width: 4rem; }
    .rcp-menyy-sisu { right: auto; left: 0; }
}

/* värvid — hele teema */
html:not([data-theme="dark"]) .rcp-pais { border-bottom-color: var(--np-line); }
html:not([data-theme="dark"]) .rcp-kood { color: var(--np-bark); }
html:not([data-theme="dark"]) .rcp-ver { background: var(--np-surface-2); color: var(--np-ink-2); border: 1px solid var(--np-line); }
html:not([data-theme="dark"]) .rcp-nimi { color: var(--np-ink); }
html:not([data-theme="dark"]) .rcp-kat,
html:not([data-theme="dark"]) .rcp-vaike,
html:not([data-theme="dark"]) .rcp-kaubanimi { color: var(--np-ink-3); }
html:not([data-theme="dark"]) .rcp-kirjeldus { color: var(--np-ink-2); }
html:not([data-theme="dark"]) .rcp-alapealkiri { color: var(--np-ink-2); }
html:not([data-theme="dark"]) .rcp-summa-ok { color: var(--np-moss-ink); }
html:not([data-theme="dark"]) .rcp-summa-viga { color: var(--np-danger); }
html:not([data-theme="dark"]) .rcp-tyhi { border-color: var(--np-line-strong); color: var(--np-ink-2); }
html:not([data-theme="dark"]) .rcp-faas { background: var(--np-surface); border-color: var(--np-line); border-left-color: var(--np-bark); }
html:not([data-theme="dark"]) .rcp-faas-pais { background: var(--np-surface-2); }
html:not([data-theme="dark"]) .rcp-faas-taht { background: var(--np-bark); color: #fff; }
html:not([data-theme="dark"]) .rcp-faas-nimi { color: var(--np-ink); }
html:not([data-theme="dark"]) .rcp-faas-kokku { color: var(--np-ink-2); }
html:not([data-theme="dark"]) .rcp-faas-info { background: var(--np-action-soft); color: var(--np-ink-2); }
html:not([data-theme="dark"]) .rcp-kood-lahter { color: var(--np-bark); }
html:not([data-theme="dark"]) .rcp-kaart .rcp-tabel th { background: transparent !important; box-shadow: inset 0 -1px 0 var(--np-line) !important; color: var(--np-ink-3); }
html:not([data-theme="dark"]) .rcp-kaart .rcp-tabel td { border-bottom: 1px solid var(--np-line); }
html:not([data-theme="dark"]) .rcp-kaart .rcp-tabel tr:last-child td { border-bottom: 0; }
html:not([data-theme="dark"]) .rcp-inci-tekst { color: var(--np-ink-2); }
html:not([data-theme="dark"]) .rcp-inci-tabel > summary { color: var(--np-info-ink); }
html:not([data-theme="dark"]) .rcp-spets { background: var(--np-surface-2); border-color: var(--np-line); }
html:not([data-theme="dark"]) .rcp-spets-rida { border-bottom-color: var(--np-line); }
html:not([data-theme="dark"]) .rcp-spets-rida dt { color: var(--np-ink-2); }
html:not([data-theme="dark"]) .rcp-maaramata { color: var(--np-ink-3); }
html:not([data-theme="dark"]) .rcp-versioonid li { border-bottom-color: var(--np-line); color: var(--np-ink-2); }
html:not([data-theme="dark"]) .rcp-menyy-sisu { background: var(--np-surface); border-color: var(--np-line); box-shadow: var(--np-shadow-2); }
[data-theme="dark"] .rcp-menyy-sisu { background: #2a2622; border-color: #444; }
[data-theme="dark"] .rcp-faas, [data-theme="dark"] .rcp-spets { border-color: #444; }
[data-theme="dark"] .rcp-faas-taht { background: #5c4033; color: #fff; }
[data-theme="dark"] .rcp-spets-rida, [data-theme="dark"] .rcp-versioonid li { border-bottom-color: #3a3632; }

/* ── 3.5 Sertifitseerimise navigatsioon: ISO vaated rühmadeks ─────────── */
#iso .cert-ryhm { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem; }
#iso .cert-ryhm-nimi { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 0 .35rem 0 .15rem; white-space: nowrap; }
#iso .cert-loendur {
    display: inline-flex; align-items: center; justify-content: center; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem;
    margin-left: .35rem; border-radius: 999px; font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
@media (min-width: 769px) {
    .section.active#iso > .cert-subbar { padding: .4rem .5rem; border-radius: var(--np-r-md, 12px); gap: .35rem 0; }
    #iso .cert-ryhm { padding: .1rem .6rem; }
    #iso .cert-ryhm + .cert-ryhm { border-left: 1px solid #e6dccf; }
    #iso .cert-ryhm-yld { padding-left: 0; }
}
@media (max-width: 768px) {
    /* telefonis jääb üks külgsuunas keritav kiibirida (mobile.css), rühm ainult ümbrisena */
    #iso .cert-ryhm { display: contents; }
    #iso .cert-ryhm-nimi { display: none; }
}
html:not([data-theme="dark"]) .section.active#iso > .cert-subbar { background: var(--np-surface-2); border: 1px solid var(--np-line); }
html:not([data-theme="dark"]) #iso .cert-ryhm + .cert-ryhm { border-left-color: var(--np-line); }
html:not([data-theme="dark"]) #iso .cert-ryhm-nimi { color: var(--np-ink-3); }
html:not([data-theme="dark"]) #iso .cert-loendur { background: var(--np-warn-soft); color: var(--np-warn-ink); }
[data-theme="dark"] #iso .cert-loendur { background: #4a3a1c; color: #f3d9a4; }
[data-theme="dark"] #iso .cert-ryhm + .cert-ryhm { border-left-color: #444; }
@media (max-width: 768px) {
    html:not([data-theme="dark"]) .section.active#iso > .cert-subbar { background: transparent; border: 0; }
}

/* ── 3.2 ISO Ülevaade: valmisolek ja lahtised asjad ──────────────────── */
#iso .isoyv-sissejuhatus { font-size: .85rem; margin: 0 0 .75rem; }
#iso .isoyv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 1000px) { #iso .isoyv { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
#iso .isoyv > .card { margin: 0; }
#iso .isoyv-pealkiri { margin: 0 0 .75rem; font-size: 1rem; }
#iso .isoyv-suur { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
#iso .isoyv-pct { font-size: 2.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
#iso .isoyv-jaotus { font-size: .85rem; }
#iso .isoyv-riba { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: #eee; }
#iso .isoyv-riba-suur { height: 10px; margin: .75rem 0 1rem; }
#iso .isoyv-riba > span { display: block; height: 100%; }
#iso .isoyv-faasid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; }
#iso .isoyv-faas { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; font-size: .8125rem; }
#iso .isoyv-faas .isoyv-riba { grid-column: 1 / -1; }
#iso .isoyv-faas-arv { font-variant-numeric: tabular-nums; }
#iso .isoyv-read { display: grid; gap: .35rem; }
#iso .isoyv-rida {
    display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; font: inherit; font-size: .9rem;
    padding: .55rem .75rem; border-radius: var(--np-r-sm, 8px); border: 1px solid #e6dccf; background: transparent; color: inherit;
}
#iso button.isoyv-rida { cursor: pointer; }
#iso .isoyv-tapp { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #999; }
#iso .isoyv-tekst { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#iso .isoyv-vihje { font-size: .75rem; }
#iso .isoyv-vihje:empty { display: none; }
#iso .isoyv-nool { font-size: 1.2rem; line-height: 1; }
#iso .isoyv-korras { margin: .85rem 0 0; font-size: .8125rem; }
#iso .isoyv-korras > span { font-weight: 600; }
#iso .isoyv-korras-koik { margin: 0; }

html:not([data-theme="dark"]) #iso .isoyv-sissejuhatus,
html:not([data-theme="dark"]) #iso .isoyv-jaotus,
html:not([data-theme="dark"]) #iso .isoyv-faas-nimi { color: var(--np-ink-2); }
html:not([data-theme="dark"]) #iso .isoyv-faas-arv,
html:not([data-theme="dark"]) #iso .isoyv-vihje,
html:not([data-theme="dark"]) #iso .isoyv-nool,
html:not([data-theme="dark"]) #iso .isoyv-korras { color: var(--np-ink-3); }
html:not([data-theme="dark"]) #iso .isoyv-pealkiri,
html:not([data-theme="dark"]) #iso .isoyv-pct { color: var(--np-ink); }
html:not([data-theme="dark"]) #iso .isoyv-riba { background: var(--np-line); }
html:not([data-theme="dark"]) #iso .isoyv-riba-tehtud { background: var(--np-moss); }
html:not([data-theme="dark"]) #iso .isoyv-riba-osa { background: #d9b46a; }
html:not([data-theme="dark"]) #iso .isoyv-rida { border-color: var(--np-line); background: var(--np-surface); color: var(--np-ink); }
html:not([data-theme="dark"]) #iso button.isoyv-rida:hover { background: var(--np-surface-2); border-color: var(--np-line-strong); }
html:not([data-theme="dark"]) #iso .isoyv-oht .isoyv-tapp { background: var(--np-danger); }
html:not([data-theme="dark"]) #iso .isoyv-hoiatus .isoyv-tapp { background: var(--np-brass); }
html:not([data-theme="dark"]) #iso .isoyv-info .isoyv-tapp { background: var(--np-info-ink); }
html:not([data-theme="dark"]) #iso .isoyv-korras-koik { color: var(--np-moss-ink); }
[data-theme="dark"] #iso .isoyv-riba { background: #3a3632; }
[data-theme="dark"] #iso .isoyv-riba-tehtud { background: #6cc08f; }
[data-theme="dark"] #iso .isoyv-riba-osa { background: #c9a35a; }
[data-theme="dark"] #iso .isoyv-rida { border-color: #444; }
[data-theme="dark"] #iso .isoyv-oht .isoyv-tapp { background: #e0705f; }
[data-theme="dark"] #iso .isoyv-hoiatus .isoyv-tapp { background: #c9a35a; }

/* ── 3.3 SOP-i register ──────────────────────────────────────────────── */
#isoDocs .isodok-pais { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
#isoDocs .isodok-pais h2 { margin: 0; }
#isoDocs .isodok-tegevused { display: flex; gap: .4rem; align-items: flex-start; flex-wrap: wrap; }
#isoDocs .isodok-tegevused details { position: relative; }
#isoDocs .isodok-tegevused summary { list-style: none; cursor: pointer; }
#isoDocs .isodok-tegevused summary::-webkit-details-marker { display: none; }
#isoDocs .isodok-lisa-vorm,
#isoDocs .isodok-haldus-sisu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; padding: 1rem;
    border-radius: var(--np-r-md, 12px); background: #fff; border: 1px solid #ddd; box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
#isoDocs .isodok-lisa-vorm { width: min(680px, 90vw); }
#isoDocs .isodok-haldus-sisu { display: flex; flex-direction: column; gap: .35rem; padding: .45rem; min-width: 16rem; }
#isoDocs .isodok-haldus-sisu .btn { width: 100%; text-align: left; justify-content: flex-start; }
#isoDocs .isodok-tabel td { vertical-align: top; }
#isoDocs .isodok-nr, #isoDocs .isodok-kp { white-space: nowrap; }
#isoDocs .isodok-arv { font-variant-numeric: tabular-nums; }
#isoDocs .isodok-vastutus { font-size: .8125rem; line-height: 1.45; }
#isoDocs .isodok-v-silt { font-size: .72rem; }
@media (max-width: 768px) {
    #isoDocs .isodok-tegevused { width: 100%; }
    #isoDocs .isodok-lisa-vorm, #isoDocs .isodok-haldus-sisu { position: static; width: auto; margin-top: .5rem; box-shadow: none; }
    #isoDocs .isodok-lisa[open], #isoDocs .isodok-haldus[open] { flex-basis: 100%; }
}
html:not([data-theme="dark"]) #isoDocs .isodok-lisa-vorm,
html:not([data-theme="dark"]) #isoDocs .isodok-haldus-sisu { background: var(--np-surface); border-color: var(--np-line); box-shadow: var(--np-shadow-2); }
html:not([data-theme="dark"]) #isoDocs .isodok-v-silt { color: var(--np-ink-3); }
html:not([data-theme="dark"]) #isoDocs .isodok-moodas { color: var(--np-danger); font-weight: 600; }
[data-theme="dark"] #isoDocs .isodok-lisa-vorm, [data-theme="dark"] #isoDocs .isodok-haldus-sisu { background: #2a2622; border-color: #444; }
[data-theme="dark"] #isoDocs .isodok-moodas { color: #e0705f; font-weight: 600; }
