/* Wicked Coatings ERP documentation — dark theme matching the ERP itself */

:root {
    --bg: #0f1117;
    --surface: #181b23;
    --surface-2: #1f232e;
    --border: #2a2f3d;
    --text: #c6cad6;
    --muted: #8b8fa3;
    --heading: #f3f4f8;
    --brand: #e25b2b;
    --brand-light: #f0784b;
    --brand-dark: #b8481f;
    --ok: #3fb950;
    --warn: #d29922;
    --bad: #f85149;
    --radius: 0.9rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
}

/* ---------------------------------------------------------------- login */
.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.5rem;
}
.login-card {
    width: 100%;
    max-width: 430px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.2rem;
}
.login-card h1 {
    color: var(--heading);
    font-size: 1.35rem;
    margin: 1.4rem 0 0.4rem;
}
.login-lede { color: var(--muted); font-size: 0.95rem; margin-top: 0; }
.login-card label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 1.2rem 0 0.4rem;
}
.login-card input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1.4rem;
    letter-spacing: 0.35em;
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    color: var(--heading);
}
.login-card input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.login-card button {
    width: 100%;
    margin-top: 1.1rem;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border: none;
    border-radius: 0.6rem;
    cursor: pointer;
}
.login-card button:hover { filter: brightness(1.1); }
.login-error {
    background: color-mix(in srgb, var(--bad) 14%, transparent);
    border: 1px solid var(--bad);
    color: #ffb4ad;
    padding: 0.65rem 0.9rem;
    border-radius: 0.6rem;
    font-size: 0.92rem;
}
.login-foot { color: var(--muted); font-size: 0.8rem; margin-top: 1.4rem; }

/* ---------------------------------------------------------------- brand */
.login-brand, .side-brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-badge {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.6rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent);
}
.brand-name { margin: 0; font-weight: 700; color: var(--heading); font-size: 0.95rem; }
.brand-sub {
    margin: 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand-light);
    font-weight: 600;
}

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 290px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.2rem 1rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.side-brand { padding: 0.2rem 0.4rem 1rem; border-bottom: 1px solid var(--border); }
.sidebar nav { padding-top: 0.8rem; }
.nav-heading {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 1.1rem 0.5rem 0.3rem;
}
.sidebar nav a {
    display: block;
    padding: 0.38rem 0.6rem;
    border-radius: 0.45rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}
.sidebar nav a:hover { background: var(--surface-2); color: var(--heading); }
.sidebar nav a.active {
    background: color-mix(in srgb, var(--brand) 16%, transparent);
    color: var(--brand-light);
    font-weight: 600;
}
.side-foot {
    margin-top: 1.6rem;
    padding: 1rem 0.5rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--muted);
}
.side-foot p { margin: 0.2rem 0; }
.side-foot a { color: var(--muted); }
.side-foot a:hover { color: var(--brand-light); }

/* -------------------------------------------------------------- content */
.content {
    flex: 1;
    min-width: 0;
    padding: 2rem clamp(1.2rem, 4vw, 3.5rem) 3rem;
    max-width: 1080px;
}
.breadcrumb {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
    margin-bottom: 0.8rem;
}

.doc h1 {
    color: var(--heading);
    font-size: 2rem;
    line-height: 1.25;
    margin: 0 0 0.6rem;
}
.doc h2 {
    color: var(--heading);
    font-size: 1.35rem;
    margin: 2.4rem 0 0.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}
.doc h3 { color: var(--heading); font-size: 1.08rem; margin: 1.6rem 0 0.4rem; }
.doc p.lede { font-size: 1.08rem; color: var(--muted); }
.doc a { color: var(--brand-light); }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc li { margin: 0.3rem 0; }
.doc code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    padding: 0.08rem 0.35rem;
    font-size: 0.88em;
    color: var(--heading);
}

/* screenshots */
figure.screenshot {
    margin: 1.4rem 0 1.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem;
}
figure.screenshot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}
figure.screenshot figcaption {
    padding: 0.6rem 0.4rem 0.1rem;
    font-size: 0.83rem;
    color: var(--muted);
}

/* callouts */
.callout {
    border-radius: 0.7rem;
    padding: 0.9rem 1.1rem;
    margin: 1.2rem 0;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.95rem;
}
.callout strong:first-child { color: var(--heading); }
.callout.tip { border-left: 4px solid var(--ok); }
.callout.note { border-left: 4px solid var(--brand); }
.callout.warn { border-left: 4px solid var(--warn); }
.callout.danger { border-left: 4px solid var(--bad); }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.2rem 0; }
table.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
table.doc-table th {
    text-align: left;
    background: var(--surface-2);
    color: var(--heading);
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.doc-table td {
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
table.doc-table tr:last-child td { border-bottom: none; }

/* status pills */
.pill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pill.brand { color: var(--brand-light); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }

/* step flow */
.flow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin: 1rem 0;
}
.flow .step {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    color: var(--heading);
    white-space: nowrap;
}
.flow .arrow { color: var(--brand); font-weight: 700; }

/* pager + footer */
.pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}
.pager a {
    color: var(--brand-light);
    text-decoration: none;
    font-size: 0.92rem;
    max-width: 46%;
}
.pager a:hover { text-decoration: underline; }
.doc-foot { margin-top: 2rem; font-size: 0.78rem; color: var(--muted); }
.doc-foot a { color: var(--muted); }

/* -------------------------------------------------- full-text search */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(8px);
    padding: 0.4rem 0 0.8rem;
    margin-bottom: 0.6rem;
}
.doc-search { position: relative; max-width: 580px; }
.doc-search input {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    color: var(--heading);
    font-size: 0.95rem;
}
.doc-search input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.doc-search input::placeholder { color: var(--muted); }
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    max-height: 62vh;
    overflow-y: auto;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    z-index: 50;
}
.search-item {
    display: block;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.active { background: var(--surface-2); }
.search-meta { display: block; font-size: 0.78rem; font-weight: 600; color: var(--brand-light); }
.search-snip { display: block; font-size: 0.85rem; color: var(--text); margin-top: 0.15rem; }
.search-snip mark, mark.hl {
    background: color-mix(in srgb, var(--brand) 38%, transparent);
    color: var(--heading);
    border-radius: 0.2rem;
    padding: 0 0.12rem;
}
.search-empty { padding: 0.8rem 1rem; color: var(--muted); font-size: 0.9rem; }

/* anchored headings shouldn't hide under the sticky search bar */
.doc h2[id], .doc h3[id] { scroll-margin-top: 5.2rem; }

/* "New" badge — marks features added on top of the original system scope */
.badge-new {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.55rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.62em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent);
    cursor: help;
}
.sidebar nav a .badge-new { margin-left: 0.45rem; font-size: 0.6rem; padding: 0.05rem 0.42rem; }

/* sidebar quick filter */
.nav-filter {
    width: 100%;
    margin: 0.8rem 0 0.2rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--heading);
}
.nav-filter:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.nav-filter::placeholder { color: var(--muted); }

/* responsive */
@media (max-width: 900px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .content { padding: 1.4rem 1.1rem 2.5rem; }
}

/* print — clean white pages without navigation chrome */
@media print {
    body { background: #fff; color: #1a1d26; font-size: 12pt; }
    .sidebar, .pager, .doc-foot, .breadcrumb, .nav-filter, .topbar { display: none !important; }
    mark.hl { background: none; color: #000; }
    .content { max-width: none; padding: 0; }
    .doc h1, .doc h2, .doc h3 { color: #000; }
    .doc h2 { border-top-color: #ccc; }
    .doc a { color: #000; text-decoration: none; }
    figure.screenshot { border-color: #ccc; background: #fff; break-inside: avoid; }
    .callout { background: #f5f5f5; border-color: #ccc; color: #1a1d26; }
    table.doc-table { background: #fff; border-color: #ccc; }
    table.doc-table th { background: #eee; color: #000; border-color: #ccc; }
    table.doc-table td { border-color: #ddd; }
    .pill { color: #000; border-color: #999; background: #f0f0f0; }
    .badge-new { color: #000; background: #f0f0f0; box-shadow: none; border: 1px solid #999; }
    .flow .step { color: #000; background: #f0f0f0; border-color: #999; }
    .flow .arrow { color: #000; }
}
