/* ============================================================================
   ZakERP site - user manual.
   Loaded on top of site.css + page.css by every chapter and by the manual home.
   ========================================================================== */

/* ------------------------------------------------------------ chapter nav */
.man-side { position: sticky; top: calc(var(--nav-h) + 1.2rem); display: grid; gap: 1.6rem; }

.man-side h5 {
    font-family: var(--font); font-size: .74rem; letter-spacing: .13em; text-transform: uppercase;
    color: var(--ink-3); margin-bottom: .8rem; font-weight: 700;
}
.man-side .chapters { list-style: none; padding: 0; display: grid; gap: .12rem; }
.man-side .chapters a {
    display: flex; align-items: center; gap: .6rem;
    padding: .46rem .65rem; border-radius: var(--r-sm);
    font-size: .9rem; color: var(--ink-2); transition: color .2s, background .2s;
}
.man-side .chapters a i { font-size: .95rem; opacity: .75; width: 1.1rem; flex-shrink: 0; }
.man-side .chapters a:hover { color: var(--ink); background: var(--surface-2); }
.man-side .chapters a.current {
    color: var(--brand-light); background: color-mix(in srgb, var(--brand) 13%, transparent);
    font-weight: 600;
}
:root[data-theme="light"] .man-side .chapters a.current { color: var(--brand-dark); }
.man-side .chapters .soon { color: var(--ink-3); opacity: .55; cursor: default; }

@media (max-width: 940px) {
    .man-side { position: static; }
    .man-side .chapters { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}

/* ---------------------------------------------------------------- search */
.man-search { position: relative; }
.man-search input {
    width: 100%; padding: .62rem .8rem .62rem 2.2rem;
    border-radius: var(--r-sm); border: 1px solid var(--border);
    background: var(--surface); color: var(--ink); font-size: .92rem;
    transition: border-color .2s, background .2s;
}
.man-search input::placeholder { color: var(--ink-3); }
.man-search input:focus { outline: none; border-color: var(--brand); background: var(--surface-2); }
.man-search > i {
    position: absolute; left: .72rem; top: 50%; transform: translateY(-50%);
    color: var(--ink-3); font-size: .95rem; pointer-events: none;
}

.man-results {
    position: absolute; z-index: 40; inset: calc(100% + .45rem) 0 auto 0;
    max-height: 340px; overflow-y: auto;
    background: var(--surface-solid); border: 1px solid var(--border-strong);
    border-radius: var(--r); box-shadow: var(--shadow-lg); padding: .35rem;
}
:root[data-theme="light"] .man-results { background: #fff; }
.man-results[hidden] { display: none; }
.man-results a { display: block; padding: .55rem .7rem; border-radius: var(--r-sm); }
.man-results a:hover, .man-results a.sel { background: var(--surface-2); }
.man-results .r-t { font-size: .9rem; font-weight: 600; color: var(--ink); }
.man-results .r-c { font-size: .74rem; color: var(--brand-light); margin-top: .1rem; }
:root[data-theme="light"] .man-results .r-c { color: var(--brand-dark); }
.man-results .r-x { font-size: .8rem; color: var(--ink-3); margin-top: .18rem; line-height: 1.45;
                    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.man-results .r-none { padding: .9rem .7rem; font-size: .88rem; color: var(--ink-3); }

/* big search on the manual home */
.man-search.big input { padding: 1rem 1rem 1rem 3rem; font-size: 1.02rem; border-radius: var(--r); }
.man-search.big > i { left: 1.05rem; font-size: 1.15rem; }

/* --------------------------------------------------------- chapter cards */
.chap-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.chap-card {
    display: block; padding: 1.5rem; border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--border);
    transition: transform .26s var(--ease), border-color .26s, background .26s, box-shadow .26s;
}
.chap-card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); box-shadow: var(--shadow); }
.chap-card .c-ico {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    font-size: 1.2rem; margin-bottom: 1rem; color: #fff; background: var(--grad-brand);
}
.chap-card h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.chap-card p { font-size: .92rem; line-height: 1.6; }
.chap-card .c-meta { margin-top: .9rem; font-size: .78rem; color: var(--ink-3); display: flex; gap: .9rem; }

/* --------------------------------------------------------- numbered steps */
/* A procedure the reader follows with their hands on the keyboard. Numbers on
   the left, a continuous rule joining them, so the eye never loses its place. */
.steps-do { counter-reset: sd; display: grid; gap: 0; margin-block: 1.6rem; }
.steps-do > li {
    counter-increment: sd; list-style: none;
    position: relative; padding: 0 0 1.5rem 3.1rem;
    border-left: 1px solid var(--border); margin-left: 1rem;
}
.steps-do > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps-do > li::before {
    content: counter(sd); position: absolute; left: -1rem; top: -.15rem;
    width: 2rem; height: 2rem; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--border);
    font-family: var(--font-head); font-weight: 700; font-size: .85rem; color: var(--brand-light);
}
:root[data-theme="light"] .steps-do > li::before { background: #fff; color: var(--brand-dark); }
.steps-do > li > b, .steps-do > li > strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: .3rem; font-weight: 600; }
.steps-do > li p { font-size: .95rem; margin: 0; }
.steps-do > li p + p { margin-top: .5rem; }
.steps-do ul { margin-top: .55rem; padding-left: 1.1rem; display: grid; gap: .35rem; }
.steps-do li li { font-size: .93rem; }

/* ------------------------------------------------------- inline UI tokens */
/* Naming a real button or field in running text. Deliberately quiet - the
   reader should be able to scan for it, not be shouted at. */
.ui {
    font-family: var(--font); font-size: .89em; font-weight: 600; color: var(--ink);
    background: var(--surface-2); border: 1px solid var(--border);
    padding: .1em .45em; border-radius: 6px; white-space: nowrap;
}
kbd {
    font-family: var(--font-mono); font-size: .82em; color: var(--ink);
    background: var(--surface-2); border: 1px solid var(--border-strong);
    border-bottom-width: 2px; padding: .12em .45em; border-radius: 5px; white-space: nowrap;
}

/* a menu path: Home › My Work › Apply for Leave */
.path {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem;
    font-size: .89rem; font-weight: 500; color: var(--ink);
    background: var(--surface); border: 1px solid var(--border);
    padding: .3rem .7rem; border-radius: var(--r-sm);
}
.path i { font-size: .68rem; color: var(--ink-3); }
.path .lead-ico { font-size: .95rem; color: var(--brand-light); }
:root[data-theme="light"] .path .lead-ico { color: var(--brand-dark); }

/* --------------------------------------------------------- status legend */
.legend { display: grid; gap: .55rem; margin-block: 1.5rem; }
.legend div {
    display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 1rem; align-items: baseline;
    padding: .7rem .9rem; border-radius: var(--r-sm);
    background: var(--surface); border: 1px solid var(--border);
}
.legend .st { font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: .5rem; }
.legend .st i { font-size: .95rem; }
.legend p { margin: 0; font-size: .92rem; line-height: 1.6; }
.legend .ok i    { color: var(--mint); }
.legend .warn i  { color: var(--amber); }
.legend .bad i   { color: var(--rose); }
.legend .calm i  { color: var(--ink-3); }
.legend .info i  { color: var(--brand-light); }
@media (max-width: 620px) { .legend div { grid-template-columns: 1fr; gap: .25rem; } }

/* --------------------------------------------------------- screenshots -- */
figure.shot { margin-block: 2rem; }
figure.shot img {
    width: 100%; border-radius: var(--r); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
}
figure.shot figcaption { margin-top: .8rem; font-size: .87rem; color: var(--ink-3); text-align: center; }

/* ------------------------------------------------------------- print ---- */
@media print {
    .man-side, .man-search { display: none !important; }
    .steps-do > li { break-inside: avoid; }
    .ui, kbd { border: 1px solid #999; background: none; }
    .legend div, .chap-card { border: 1px solid #ccc; break-inside: avoid; }
}
