/* FixGest — workbench palette: ESD-mat teal, cool bench grey, manila repair tags. */

@font-face {
    font-family: "Archivo";
    src: url("fonts/archivo-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
}

:root {
    color-scheme: light;
    --paper: #eef1f3;
    --surface: #ffffff;
    --surface-2: #f6f8f9;
    --ink: #17212b;
    --ink-2: #4c5a67;
    --line: #d6dde3;
    --mat: #1d5c57;
    --mat-strong: #164944;
    --mat-soft: #dcebe8;
    --mat-ink: #ffffff;
    --rail: #173f3b;
    --rail-ink: #d7e9e6;
    --rail-hover: #1f504b;
    --tag: #ead6a4;
    --tag-edge: #c9ad6c;
    --tag-ink: #4a3710;
    --signal: #c03a21;
    --signal-soft: #fbe6e1;
    --ok: #1f7a4a;
    --ok-soft: #dff1e6;
    --focus: #2b7de9;

    --radius-sm: 6px;
    --radius: 10px;
    --shadow: 0 1px 2px rgb(23 33 43 / 6%), 0 0 0 1px var(--line);
    --font: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
    --step--1: 0.8125rem;
    --step-0: 0.9375rem;
    --step-1: 1.125rem;
    --step-2: 1.375rem;
    --step-3: 1.875rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --paper: #11171b;
        --surface: #182127;
        --surface-2: #1d272e;
        --ink: #e3e9ed;
        --ink-2: #9aa9b4;
        --line: #2a363e;
        --mat: #4fb0a3;
        --mat-strong: #6cc6b9;
        --mat-soft: #1c3532;
        --mat-ink: #0d1a18;
        --rail: #0e2523;
        --rail-ink: #b9d6d1;
        --rail-hover: #163532;
        --tag: #cdb27a;
        --tag-edge: #a88d55;
        --tag-ink: #2a1f08;
        --signal: #f07a62;
        --signal-soft: #3a1f19;
        --ok: #5cc48c;
        --ok-soft: #173326;
        --shadow: 0 0 0 1px var(--line);
    }
}

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
    margin: 0;
    font-stretch: 88%;
    line-height: 1.2;
    text-wrap: balance;
}
h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: var(--step-1); font-weight: 650; }
h3 { font-size: var(--step-0); font-weight: 650; margin-top: 1rem; }
p { margin: 0.4rem 0; }
a { color: var(--mat); text-underline-offset: 2px; }
a:hover { color: var(--mat-strong); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

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

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.icon-sm { width: 0.95em; height: 0.95em; }

.muted { color: var(--ink-2); }
.prewrap { white-space: pre-wrap; }
.lead { font-size: var(--step-1); }
.code { font-variant-numeric: slashed-zero tabular-nums; letter-spacing: 0.02em; }
.overdue { color: var(--signal); font-weight: 600; }
.center { text-align: center; }

/* ---------------------------------------------------------------- shell */

.shell {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--rail);
    color: var(--rail-ink);
    padding: 1.25rem 0.85rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    /* A long menu (or a short screen) scrolls inside the sidebar, so Configuração stays reachable. */
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.sidebar-top { display: flex; align-items: center; justify-content: space-between; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: var(--step-2);
    font-weight: 800;
    font-stretch: 75%;
    letter-spacing: 0.01em;
    color: inherit;
    text-decoration: none;
    padding: 0 0.4rem;
}
.sidebar .brand:hover { color: #fff; }

/* The brand mark is a tiny manila tag. */
.brand-mark {
    width: 1.4rem;
    height: 0.95rem;
    background: var(--tag);
    clip-path: polygon(28% 0, 100% 0, 100% 100%, 28% 100%, 0 50%);
    position: relative;
}
.brand-mark::after {
    content: "";
    position: absolute;
    left: 22%;
    top: 50%;
    width: 0.22rem;
    height: 0.22rem;
    margin-top: -0.11rem;
    border-radius: 50%;
    background: var(--rail);
}

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    color: inherit;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    cursor: pointer;
}

.nav { display: flex; flex-direction: column; flex: 1; margin-top: 1.5rem; gap: 1rem; }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--rail-ink);
    text-decoration: none;
    font-weight: 500;
}
.nav a:hover { background: var(--rail-hover); color: #fff; }
.nav a[aria-current="page"] {
    background: var(--rail-hover);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--tag);
}

.nav-group > summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--rail-ink);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { background: var(--rail-hover); color: #fff; }
.nav-group > summary:focus-visible { outline: 2px solid var(--tag); outline-offset: 1px; }
.nav-group-toggle { display: inline-flex; margin-left: auto; transition: transform 0.15s; transform: rotate(-90deg); }
.nav-group > summary .nav-count + .nav-group-toggle { margin-left: 0.4rem; }
.nav-group[open] > summary .nav-group-toggle { transform: none; }
/* The count moves to the item inside once the tree is open. */
.nav-group[open] > summary .nav-count { display: none; }
.nav-group[open] > summary .nav-group-toggle { margin-left: auto; }
.nav-group[data-nav-current]:not([open]) > summary { color: #fff; box-shadow: inset 3px 0 0 var(--tag); }
.nav-group ul { margin: 0.15rem 0 0.1rem 1.05rem; padding-left: 0.5rem; border-left: 1px solid rgb(215 233 230 / 18%); }
/* Diagnóstico: nested tree items, tighter than the top level so a model fits at the fourth level. */
.nav-subgroup > summary { gap: 0.4rem; padding: 0.35rem 0.5rem; font-size: var(--step--1); }
.nav-subgroup ul { margin-left: 0.55rem; padding-left: 0.35rem; }
.nav a.nav-sub, .nav a.nav-sub-all { padding: 0.3rem 0.5rem; font-size: var(--step--1); }
.nav a.nav-sub-all { color: rgb(215 233 230 / 70%); font-style: italic; }
.nav-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgb(255 255 255 / 8%);
    border-radius: var(--radius-sm);
    padding: 0 0.6rem;
}
.nav-search input {
    background: transparent;
    border: 0;
    color: #fff;
    padding: 0.55rem 0;
    width: 100%;
    font: inherit;
}
.nav-search input::placeholder { color: rgb(215 233 230 / 60%); }
.nav-search input:focus { outline: none; }
.nav-search:focus-within { outline: 2px solid var(--tag); outline-offset: 1px; }

.nav-user {
    margin-top: auto;
    border-top: 1px solid rgb(255 255 255 / 10%);
    padding: 0.9rem 0.4rem 0;
    display: grid;
    gap: 0.35rem;
    font-size: var(--step--1);
}
.nav-user-name { display: flex; align-items: center; gap: 0.5rem; color: inherit; text-decoration: none; }
a.nav-user-name:hover, a.nav-user-name:focus-visible { text-decoration: underline; }
.link-button {
    background: none;
    border: 0;
    color: var(--rail-ink);
    font: inherit;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
}
.link-button:hover { opacity: 1; text-decoration: underline; }

.main {
    padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem;
    max-width: 92rem;
    width: 100%;
}

@media (max-width: 860px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: sticky;
        height: auto;
        overflow-y: visible;
        padding: calc(0.7rem + env(safe-area-inset-top, 0px)) 1rem 0.7rem;
        z-index: 10;
    }
    .nav-toggle { display: inline-flex; }
    .nav { display: none; margin-top: 0.8rem; padding-bottom: 0.5rem; }
    .sidebar.is-open .nav { display: flex; }
    .sidebar.is-open { max-height: 100dvh; overflow-y: auto; }
    .main { padding-top: 1.25rem; }
}

/* ---------------------------------------------------------------- page structure */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.summary { color: var(--ink-2); margin: 0.3rem 0 0; max-width: 70ch; }
.crumbs { margin: 0 0 0.2rem; font-size: var(--step--1); }
.crumbs a { color: var(--ink-2); }
.step { margin: 0 0 0.2rem; color: var(--mat); font-weight: 600; font-size: var(--step--1); }
.head-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.section { margin-top: 2rem; }
.section > h2 { margin-bottom: 0.75rem; }

.panel {
    min-width: 0; /* lets wide tables scroll inside instead of widening the page */
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}
.panel > h2 { margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.9rem; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem; align-items: start; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.empty-state p { color: var(--ink-2); }
.empty-code { font-size: 3rem; font-weight: 800; font-stretch: 70%; color: var(--tag-edge); margin: 0; }

.flash {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin: 0 0 1rem;
    background: var(--ok-soft);
    color: var(--ink);
    border-left: 4px solid var(--ok);
}
.flash .icon { color: var(--ok); margin-top: 0.15rem; }
.flash-error { background: var(--signal-soft); border-left-color: var(--signal); }
.flash-error .icon { color: var(--signal); }
.flash-warning { background: color-mix(in srgb, var(--tag) 30%, var(--surface)); border-left-color: #b7791f; }
.flash-warning .icon { color: #b7791f; }

.callout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--mat-soft);
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    margin-bottom: 1rem;
}

.danger-zone { margin-top: 2rem; }

/* ---------------------------------------------------------------- buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.button:hover { border-color: var(--ink-2); color: var(--ink); }
.button-primary { background: var(--mat); border-color: var(--mat); color: var(--mat-ink); }
.button-primary:hover { background: var(--mat-strong); border-color: var(--mat-strong); color: var(--mat-ink); }
.button-ghost { border-color: transparent; background: transparent; }
.button-danger { color: var(--signal); border-color: currentColor; background: transparent; }
.button-danger:hover { background: var(--signal); color: #fff; border-color: var(--signal); }
.button-small { min-height: 2rem; padding: 0.25rem 0.7rem; font-size: var(--step--1); }
.button-block { width: 100%; }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 0.7rem;
}
.icon-button:hover { background: var(--surface-2); color: var(--signal); }

/* ---------------------------------------------------------------- forms */

.form-grid { display: grid; gap: 1.1rem; }
.form-narrow { max-width: 34rem; }
.stack { display: grid; gap: 1rem; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 650; font-stretch: 88%; font-size: var(--step-1); margin-bottom: 0.6rem; padding: 0; }

.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.grid-4 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.asset-extras { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
/* The pattern pad is the tallest field: always the last column of its row, against the right edge,
   with the notes beside it, under the other extra fields. The pattern also spans a last 1fr row, so
   its height goes there and doesn't pull the rows above apart. */
.asset-notes { grid-column: 1 / -1; }
.asset-extras:has(> div:not([hidden]) .pattern-field) { grid-template-rows: auto auto 1fr; }
.asset-extras:has(> div:not([hidden]) .pattern-field) > .asset-notes { grid-column: 1 / -2; }
.asset-extras > div:has(.pattern-field) { grid-column: -2 / -1; grid-row: 1 / 4; justify-self: end; }
@media (max-width: 30rem) {
    .asset-extras:has(> div:not([hidden]) .pattern-field) { grid-template-rows: none; }
    .asset-extras > div:has(.pattern-field) { grid-row: auto; justify-self: start; }
    .asset-extras:has(> div:not([hidden]) .pattern-field) > .asset-notes { grid-column: 1 / -1; }
}

.field { display: grid; gap: 0.3rem; align-content: start; min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: var(--step--1); color: var(--ink-2); }
.field-wide { grid-column: 1 / -1; }

input, select, textarea {
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.65rem;
    min-height: 2.5rem;
    width: 100%;
    min-width: 0;
}
textarea { resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mat); outline-offset: -1px; border-color: var(--mat); }
/* A select whose empty first option reads like a placeholder ("Selecione"), lighter until a choice is made. */
select.select-placeholder:has(> option[value=""]:checked) { color: var(--ink-2); }
select.select-placeholder option { color: var(--ink); }
select.select-placeholder option[value=""] { color: var(--ink-2); }
input:disabled, textarea:disabled, select:disabled { background: var(--surface-2); color: var(--ink-2); cursor: not-allowed; border-color: var(--line); }
input[type="checkbox"], input[type="radio"] { width: 1.1rem; height: 1.1rem; min-height: 0; accent-color: var(--mat); }
input[type="color"] { padding: 0.15rem; width: 3rem; cursor: pointer; }
[aria-invalid="true"] { border-color: var(--signal); }

.field-error { color: var(--signal); font-size: var(--step--1); margin: 0; font-weight: 600; }
.help { color: var(--ink-2); font-size: var(--step--1); margin: 0; }

.check { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 500; }
.check-grid { display: grid; gap: 0.5rem 1rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }

.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.sticky-actions {
    position: sticky;
    bottom: 0;
    background: var(--paper);
    padding: 0.85rem 0 calc(0.85rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
}

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.toolbar input[type="search"] { flex: 1 1 18rem; width: auto; }
.toolbar select { width: auto; flex: 0 1 14rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; padding: 0; list-style: none; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font: inherit;
    font-size: var(--step--1);
    cursor: pointer;
}
button.chip:hover { border-color: var(--mat); color: var(--mat); }
.chips-static .chip { cursor: default; }

/* ---------------------------------------------------------------- tables */

.table-wrap {
    position: relative; /* keeps absolutely positioned .sr-only labels inside the scroll box */
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel .table-wrap { box-shadow: none; border-radius: 0; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.65rem 0.85rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table thead th { font-size: var(--step--1); font-weight: 600; color: var(--ink-2); white-space: nowrap; background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { width: 1%; white-space: nowrap; text-align: right; }
.table tfoot th { text-align: right; font-weight: 500; color: var(--ink-2); }
.table tfoot td, .table tfoot th { border-bottom: 0; padding-block: 0.35rem; }
/* Configuração › Campos por tipo: a grid of checkboxes, field names down the left. */
.type-fields td, .type-fields thead th:not(:first-child) { text-align: center; }
.type-fields tbody th[scope="row"] { font-weight: 500; min-width: 9rem; }
.type-fields .group-row th { background: var(--surface-2); font-size: var(--step--1); font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.type-fields input[type="checkbox"] { width: 1.15rem; height: 1.15rem; }
.type-fields th, .type-fields td { padding-inline: 0.5rem; }
.type-fields thead th { white-space: normal; min-width: 4rem; }
.type-fields .new-row th { background: var(--surface-2); }
.type-fields .new-row input:not([type]) { width: 100%; min-width: 9rem; }
.type-fields tbody th[scope="row"] input { width: 100%; min-width: 10.5rem; font-weight: 500; }
.type-fields.table-edit th, .type-fields.table-edit td { padding-inline: 0.15rem; }
.type-fields select { width: auto; }
.type-fields.table-edit thead th { min-width: 3rem; }
.table .grand-total th, .table .grand-total td { font-size: var(--step-1); font-weight: 700; color: var(--ink); border-top: 2px solid var(--ink); padding-top: 0.6rem; }
.cell-clip { max-width: 22rem; }
.is-inactive td { color: var(--ink-2); }

.table-edit td { padding: 0.4rem 0.5rem; }
.table-edit textarea { min-height: 2.5rem; }
.table-edit .input-num { width: 7rem; text-align: right; }
.order-cell { white-space: nowrap; width: 1%; }
.new-row td { background: var(--surface-2); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; color: var(--ink-2); }

/* ---------------------------------------------------------------- repair tag (the signature element) */

.tag {
    --tag-hole: var(--surface);
    position: relative;
    display: inline-flex;
    align-items: center;
    background: var(--tag);
    color: var(--tag-ink);
    font-weight: 750;
    font-stretch: 78%;
    letter-spacing: 0.02em;
    font-size: var(--step--1);
    line-height: 1;
    padding: 0.32rem 0.6rem 0.32rem 1.15rem;
    clip-path: polygon(0.55rem 0, 100% 0, 100% 100%, 0.55rem 100%, 0 50%);
    border-radius: 0 3px 3px 0;
    text-decoration: none;
    white-space: nowrap;
}
.tag::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 50%;
    width: 0.32rem;
    height: 0.32rem;
    margin-top: -0.16rem;
    border-radius: 50%;
    background: var(--tag-hole);
    box-shadow: inset 0 0 0 1px var(--tag-edge);
}
a.tag:hover { color: var(--tag-ink); filter: brightness(0.96); }
.table .tag { --tag-hole: var(--surface); }
.table tbody tr:hover .tag { --tag-hole: var(--surface-2); }

.tag-large {
    font-size: var(--step-2);
    padding: 0.55rem 1rem 0.55rem 1.9rem;
    clip-path: polygon(0.9rem 0, 100% 0, 100% 100%, 0.9rem 100%, 0 50%);
    --tag-hole: var(--paper);
}
.tag-large::before { left: 0.75rem; width: 0.5rem; height: 0.5rem; margin-top: -0.25rem; }

/* ---------------------------------------------------------------- status & priority */

.status {
    display: inline-block;
    background: var(--status);
    color: var(--status-ink);
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: var(--step--1);
    font-weight: 600;
    white-space: nowrap;
}

.priority { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--step--1); font-weight: 600; }
.priority::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--dot); }

.badge {
    display: inline-block;
    font-size: 0.75rem;
    background: var(--mat-soft);
    color: var(--mat-strong);
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    font-weight: 600;
}

/* ---------------------------------------------------------------- dashboard board */

.board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
    gap: 1rem;
    align-items: start;
}

.lane {
    background: var(--surface-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--status);
    padding: 0.85rem;
}
.lane-head { display: flex; align-items: center; justify-content: space-between; font-size: var(--step-0); margin-bottom: 0.7rem; }
.lane-head a { color: var(--ink); text-decoration: none; }
.lane-head a:hover { text-decoration: underline; }
.count {
    min-width: 1.6rem;
    text-align: center;
    border-radius: 999px;
    background: var(--status);
    color: #fff;
    font-size: var(--step--1);
    padding: 0.05rem 0.45rem;
}
.lane-empty { color: var(--ink-2); font-size: var(--step--1); margin: 0; }
.lane-closed { opacity: 0.85; }
.lane-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }

.wo-card {
    display: grid;
    gap: 0.25rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    box-shadow: 0 0 0 1px var(--line);
    color: var(--ink);
    text-decoration: none;
}
.wo-card:hover { box-shadow: 0 0 0 2px var(--mat); color: var(--ink); }
.wo-card.is-overdue { box-shadow: 0 0 0 1px var(--signal), inset 3px 0 0 var(--signal); }
.wo-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.2rem; }
.wo-card-customer { font-size: var(--step-0); }
.wo-card-device { font-size: var(--step--1); color: var(--ink-2); }
.wo-card-problem { font-size: var(--step--1); }
.wo-card-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; font-size: 0.78rem; color: var(--ink-2); margin-top: 0.3rem; }
.wo-card-meta > span { display: inline-flex; align-items: center; gap: 0.25rem; }

/* ---------------------------------------------------------------- work order page */

.wo-title { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--status);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.status-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.status-label { font-size: var(--step--1); color: var(--ink-2); font-weight: 600; }
.status-options { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.status-option {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font: inherit;
    font-size: var(--step--1);
    font-weight: 600;
    cursor: pointer;
}
.status-option:hover { border-color: var(--status); }
.status-option.is-current { background: var(--status); border-color: var(--status); color: var(--status-ink); }
.delivered { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ok); font-weight: 600; margin: 0; }

.wo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; align-items: start; }
.wo-main, .wo-side { display: grid; gap: 1rem; min-width: 0; }
@media (max-width: 1100px) { .wo-layout { grid-template-columns: minmax(0, 1fr); } }

.item-type { font-size: 0.72rem; font-weight: 700; border-radius: 4px; padding: 0.05rem 0.4rem; background: var(--mat-soft); color: var(--mat-strong); }
.item-part { background: var(--tag); color: var(--tag-ink); }

.quick-add { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 1rem; }
.quick-add .chip .muted { margin-left: 0.2rem; }

.add-item { margin-top: 0.9rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.add-item summary { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; color: var(--mat); font-weight: 600; }
.add-item-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; margin-top: 0.8rem; }
.add-item-form .field-grow { flex: 1 1 14rem; }
.add-item-form .field-num { flex: 0 1 7rem; }

.note-form { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.note-form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.note-form-actions select { width: auto; }
.notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.note {
    position: relative;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 0.6rem 2.6rem 0.6rem 0.85rem;
    border-left: 3px solid var(--line);
}
.note-customer { border-left-color: var(--mat); }
.note form { position: absolute; top: 0.35rem; right: 0.35rem; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: var(--step--1); color: var(--ink-2); margin: 0 0 0.2rem; }
.note-meta strong { color: var(--ink); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
.facts dt { color: var(--ink-2); font-size: var(--step--1); padding-top: 0.1rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts-wide { grid-template-columns: repeat(auto-fit, minmax(10rem, max-content) minmax(10rem, 1fr)); }

.contact-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.3rem; }
.contact-list li { display: flex; align-items: center; gap: 0.5rem; overflow-wrap: anywhere; }
.contact-list .icon { color: var(--ink-2); }

.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; font-size: var(--step--1); }
.history li { display: grid; border-left: 2px solid var(--line); padding-left: 0.7rem; }

.item-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.item-list li { display: grid; gap: 0.1rem; }
.item-list a { display: inline-flex; align-items: center; gap: 0.5rem; }
.item-list .muted { font-size: var(--step--1); padding-left: 1.65rem; }

.link-list { list-style: none; padding: 0; margin: 0; display: grid; }
.link-list a { display: block; padding: 0.55rem 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500; }
.link-list li:last-child a { border-bottom: 0; }

/* ---------------------------------------------------------------- check-in */

.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0 0 1rem; counter-reset: step; }
.steps li {
    counter-increment: step;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-2);
    font-weight: 600;
    font-size: var(--step--1);
    padding: 0.35rem 0.85rem 0.35rem 0.4rem;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.steps li::before {
    content: counter(step);
    display: inline-grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--surface-2);
}
.steps .current { color: var(--ink); }
.steps .current::before { background: var(--mat); color: var(--mat-ink); }
.steps .done::before { content: "✓"; background: var(--mat-soft); color: var(--mat-strong); }

.chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1rem; }
.chosen a { font-size: var(--step--1); margin-left: 0.4rem; }
.chosen-row { display: flex; flex-wrap: wrap; gap: 0 2rem; border-bottom: 1px solid var(--line); }

.pick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.pick-list a {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 1px var(--line);
    color: var(--ink);
    text-decoration: none;
}
.pick-list a > span { display: grid; }
.pick-list a:hover { box-shadow: 0 0 0 2px var(--mat); }
.pick-list .icon { width: 1.6rem; height: 1.6rem; color: var(--mat); }

/* ---------------------------------------------------------------- configuration */

.settings-list { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.texts-list { display: grid; gap: 0.1rem; }
.text-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.text-row label { font-size: var(--step--1); color: var(--ink-2); }
.text-row input.untranslated { border-style: dashed; background: var(--surface-2); }
.text-row input.untranslated::placeholder { font-style: italic; }
@media (max-width: 700px) { .text-row { grid-template-columns: 1fr; gap: 0.3rem; } }

/* ---------------------------------------------------------------- guest pages */

body.guest { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background: var(--rail); }
.guest-card {
    width: min(100%, 26rem);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    display: grid;
    gap: 1rem;
}
.guest-card .brand { color: var(--ink); padding: 0; margin: 0; }
.guest-card .brand-mark::after { background: var(--surface); }
.guest-card .empty-state { box-shadow: none; padding: 1rem 0; }

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------- billing (vendas) */

/* Document numbers read like the series stamp on a paper invoice book. */
.docno { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; white-space: nowrap; }
a.docno { text-decoration: none; }
a.docno:hover { text-decoration: underline; }
.doc-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }

.doc-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.5;
    border-radius: 4px;
    padding: 0.05rem 0.5rem;
    white-space: nowrap;
    vertical-align: middle;
    background: var(--mat-soft);
    color: var(--mat-strong);
}
.doc-heading .doc-status { font-size: var(--step--1); }
.doc-status-draft { color: var(--tag-ink); box-shadow: inset 0 0 0 1.5px var(--tag-edge); background: var(--tag); }
.doc-status-paid { background: var(--ok-soft); color: var(--ok); }
.doc-status-partial, .doc-status-unpaid { background: var(--signal-soft); color: var(--signal); }
.doc-status-cancelled { background: var(--surface-2); color: var(--ink-2); text-decoration: line-through; }

.is-cancelled td, .is-cancelled > a, .is-cancelled > span:not(.doc-status) { color: var(--ink-2); text-decoration: line-through; }

.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.doc-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.doc-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.doc-list .muted { font-size: var(--step--1); }

.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toolbar-flush { margin: 0; flex: 1 1 18rem; }
.date-filter { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--step--1); color: var(--ink-2); font-weight: 600; }
.date-filter input { width: auto; }
.field-inline { display: flex; align-items: center; gap: 0.5rem; }
.field-inline select { width: auto; }
.form-actions-end { justify-content: flex-end; margin-top: 0.75rem; }

.pick-list form { display: contents; }
.pick-list button {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 1px var(--line);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.pick-list button > span { display: grid; }
.pick-list button:hover { box-shadow: 0 0 0 2px var(--mat); }

.table-lines td { vertical-align: top; }
.table-lines .input-desc { min-width: 12rem; }
.table-lines .input-qty { width: 4.5rem; }
.table-lines select { width: auto; }
.table-lines small { display: block; margin-top: 0.2rem; }

.issue-panel { box-shadow: var(--shadow), inset 0 3px 0 var(--mat); }
.issue-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0 0 1rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.issue-total strong { font-size: var(--step-3); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.issue-panel .field, .issue-panel .pay-rows { margin-bottom: 1rem; }
.pay-rows legend { font-size: var(--step--1); color: var(--ink-2); font-weight: 600; font-stretch: 100%; margin-bottom: 0.3rem; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; gap: 0.5rem; margin-bottom: 0.5rem; }
.input-num { text-align: right; font-variant-numeric: tabular-nums; }
.balance { display: flex; justify-content: space-between; margin: 0.9rem 0 0; padding-top: 0.7rem; border-top: 1px solid var(--line); }
.balance strong { font-size: var(--step-1); font-variant-numeric: tabular-nums; }

.callout-danger { background: var(--signal-soft); color: var(--signal); }
.callout-danger p { display: flex; gap: 0.5rem; align-items: center; margin: 0; font-weight: 600; }

details.danger-zone summary { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; color: var(--signal); font-weight: 600; font-size: var(--step--1); }
details.danger-zone[open] { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
details.danger-zone form { margin-top: 0.8rem; }

/* Register close: one tile per payment method, the day's total in the mat colour. */
.cash-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); margin-bottom: 1.25rem; }
.cash-tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.cash-tile h2 { font-size: var(--step-0); color: var(--ink-2); font-weight: 600; margin: 0; }
.cash-amount { font-size: var(--step-2); font-weight: 750; font-variant-numeric: tabular-nums; margin: 0.25rem 0; }
.cash-tile .muted { margin: 0; font-size: var(--step--1); }
.cash-total { background: var(--mat); color: var(--mat-ink); box-shadow: none; }
.cash-total h2 { color: inherit; opacity: 0.85; }

.table-lines td { vertical-align: middle; }

/* Narrow screens: each document line becomes a small card with labelled fields. */
@media (max-width: 700px) {
    .table-lines, .table-lines tbody, .table-lines tfoot { display: block; }
    .table-lines thead { display: none; }
    .table-lines tbody tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--line);
    }
    .table-lines tbody tr:hover td { background: none; }
    .table-lines tbody td { display: grid; gap: 0.2rem; padding: 0; border: 0; text-align: left; width: auto; }
    .table-lines tbody td[data-label]::before { content: attr(data-label); font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
    .table-lines tbody td:first-child { grid-column: 1 / -1; }
    .table-lines .input-desc, .table-lines .input-num, .table-lines .input-qty, .table-lines select { width: 100%; min-width: 0; }
    .table-lines .line-total { font-weight: 700; }
    .table-lines .actions { align-self: end; justify-self: end; }
    .table-lines tfoot tr { display: flex; justify-content: space-between; gap: 1rem; }
    .table-lines tfoot th { text-align: left; }
    .table-lines tfoot td:empty { display: none; }
    .table-lines .grand-total { border-top: 2px solid var(--ink); margin-top: 0.4rem; }
    .table-lines .grand-total th, .table-lines .grand-total td { border-top: 0; }
}

.day-nav { display: flex; align-items: center; gap: 0.4rem; }
.day-nav input[type="date"] { width: auto; }

/* ---------------------------------------------------------------- stock */

.tabs { display: flex; gap: 0.25rem; overflow-x: auto; margin: -0.25rem 0 1.25rem; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tabs a { padding: 0.55rem 0.9rem; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--mat); border-bottom-color: var(--mat); }

.qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.qty-low { color: var(--tag-ink); background: var(--tag); border-radius: 4px; padding: 0 0.35rem; }
.qty-out { color: var(--signal); }
td.qty-in { color: var(--ok); font-weight: 600; }
td.qty-out { color: var(--signal); font-weight: 600; }

.move { font-size: 0.75rem; font-weight: 700; border-radius: 4px; padding: 0.05rem 0.45rem; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.move-purchase, .move-return { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.move-sale { background: var(--mat-soft); color: var(--mat-strong); box-shadow: none; }

.stock-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 1rem; }
.stock-hero p { margin: 0; }
.stock-big { font-size: var(--step-3); font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stock-big .qty { font-weight: inherit; }
.stock-big .qty-low { padding: 0 0.5rem; }

.barcode-panel { text-align: center; }
.barcode-panel .barcode { width: 100%; height: 4rem; fill: var(--ink); }
.barcode-panel .code { margin: 0.3rem 0 0; letter-spacing: 0.08em; }

.input-tiny { width: 3.5rem; }

.product-picker { display: flex; align-items: center; gap: 0.5rem; margin: 0.9rem 0 0.4rem; }
.product-picker > .icon { color: var(--mat); flex: none; }
.product-picker input { flex: 1 1 auto; min-width: 0; }
.pick-list-compact { margin: 0.5rem 0 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.pick-list-compact button { padding: 0.55rem 0.8rem; }
.pick-list-compact .qty-low { padding: 0 0.25rem; }

.table-receive input { min-width: 6rem; }

/* ---------------------------------------------------------------- special orders */

.status-now { display: flex; align-items: center; gap: 0.6rem; margin-right: auto; }
.so-status-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.so-status-form select { width: auto; max-width: 100%; }
.so-status-form input { width: 14rem; max-width: 100%; }
.picked { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 0.2rem 0 0; min-height: 2.6rem; }
.picked .icon { color: var(--mat); }
.note-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; margin: 1rem 0 0; }
.cell-check { width: 2.5rem; }
.cell-check input { width: 1.1rem; height: 1.1rem; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.9rem 0; font-size: var(--step--1); font-weight: 600; }
.bulk-bar select { width: auto; max-width: 100%; }
.tabs .count { margin-left: 0.25rem; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.so-notice { display: flex; gap: 0.75rem; align-items: flex-start; margin: 0 0 1rem; padding: 0.7rem 1rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.so-notice .icon { color: var(--mat); flex: none; }
.so-notice > span { display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; }
.so-notice a { font-weight: 600; }
.subhead { display: flex; align-items: center; gap: 0.4rem; font-size: var(--step-0); margin: 1.1rem 0 0.5rem; }
.subhead .icon { color: var(--mat); }

/* ---------------------------------------------------------------- advances */

.advance-box { margin: 1rem 0 0.25rem; padding: 0.4rem 0.9rem 0.6rem; border-radius: var(--radius-sm); background: var(--ok-soft); }
.advance-box .subhead { margin-top: 0.5rem; }
.advance-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.advance-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; }
.advance-list li > span:first-child { display: grid; flex: 1 1 12rem; min-width: 0; }
.advance-deduct { display: flex; gap: 0.4rem; align-items: center; }
.advance-deduct input { width: 7rem; }
.advance-summary { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: flex-start; border-left: 5px solid var(--ok); margin-bottom: 1rem; }
.advance-summary > div { flex: 1 1 18rem; }
.advance-left { margin: 0; display: grid; text-align: right; }
.advance-left strong { font-size: var(--step-3); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- reports */

.report-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.report-cards a { display: grid; gap: 0.3rem; height: 100%; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; border-top: 3px solid var(--mat); }
.report-cards a:hover { box-shadow: var(--shadow), 0 0 0 2px var(--mat); }
.report-cards strong { font-size: var(--step-1); }
.report-cards .muted { font-size: var(--step--1); }
.period-presets { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: -0.4rem 0 1rem; font-size: var(--step--1); }
.period-presets a { padding: 0.2rem 0.7rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.period-presets a[aria-current] { background: var(--mat); color: #fff; box-shadow: none; }
.report-table td.negative { color: var(--signal); }
.report-table tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }
.report-table tr.is-cancelled td { color: var(--ink-2); text-decoration: line-through; }

/* ---------------------------------------------------------------- public status page */

body.public { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: var(--paper); }
.public-head { background: var(--rail); padding: 0.9rem max(1rem, calc((100% - 36rem) / 2)); }
.public-head .brand { color: #fff; padding: 0; margin: 0; text-decoration: none; }
.public-main { width: min(100% - 2rem, 36rem); margin: 0 auto; padding: 2rem 0 3rem; display: grid; gap: 1rem; align-content: start; }
.public-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.5rem; display: grid; gap: 1rem; }
.public-card h1 { margin: 0; font-size: var(--step-3); }
.public-card h2 { margin: 0; font-size: var(--step-1); }
.public-card .lead { margin: 0; color: var(--ink-2); }
.public-card .flash { margin: 0; }
.lookup-form { display: grid; gap: 0.9rem; }
.lookup-form input { font-size: var(--step-1); letter-spacing: 0.04em; }
.lookup-form .button { justify-self: start; }
.public-card .hint { margin: 0; font-size: var(--step--1); }
.status-card { border-top: 6px solid var(--status); }
.status-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.status-card-head .device { margin: 0; font-weight: 600; color: var(--ink-2); }
.status-now { margin: 0; }
.status-pill { display: inline-block; padding: 0.4rem 1rem; border-radius: 999px; background: var(--status); color: var(--status-ink); font-weight: 700; font-size: var(--step-2); line-height: 1.2; }
.progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; counter-reset: step; }
.progress li { position: relative; padding-top: 0.9rem; font-size: var(--step--1); color: var(--ink-2); font-weight: 600; }
.progress li::before { content: ""; position: absolute; inset: 0 0 auto; height: 0.4rem; border-radius: 999px; background: var(--line); }
.progress li.is-done::before { background: var(--mat); }
.progress li.is-current { color: var(--ink); }
.progress li.is-current::before { background: var(--status); }
.ready-callout { margin: 0; font-weight: 600; }
.public-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.public-notes li { border-left: 3px solid var(--mat); padding-left: 0.8rem; }
.public-notes time { font-size: var(--step--1); color: var(--ink-2); }
.public-notes p { margin: 0.2rem 0 0; }
.public-back { margin: 0; }
.public-foot { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; padding: 1.5rem max(1rem, calc((100% - 36rem) / 2)); background: var(--surface); border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--ink-2); }
.public-foot p { margin: 0 0 0.2rem; }
.public-foot strong { color: var(--ink); }
.public-code { font-family: inherit; font-weight: 700; letter-spacing: 0.08em; }

/* ---------------------------------------------------------------- kits (conjuntos) */

.kit-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 70rem) { .kit-layout { grid-template-columns: minmax(0, 1fr) 20rem; } }
.kit-layout .panel { display: grid; gap: 0.9rem; }
.kit-layout .hint { margin: 0; font-size: var(--step--1); }
.table-lines small { display: block; margin-top: 0.2rem; }
.kit-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem; margin: 0.75rem 0; }
.kit-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; min-width: 0; }
.kit-pick select, .kit-pick input { width: auto; min-width: 0; max-width: 100%; flex: 1 1 12rem; }
.kit-save summary { cursor: pointer; color: var(--mat); font-weight: 600; font-size: var(--step--1); }
.kit-save[open] summary { margin-bottom: 0.5rem; }

/* ---------------------------------------------------------------- product photos */

.product-thumb { flex: none; width: 2.75rem; height: 2.75rem; border-radius: calc(var(--radius) / 2); object-fit: cover; background: var(--paper); }
.product-thumb.is-empty { display: grid; place-items: center; color: var(--line); box-shadow: inset 0 0 0 1px var(--line); }
.product-thumb.is-empty .icon { width: 1.2rem; height: 1.2rem; }
.product-cell { display: flex; gap: 0.75rem; align-items: center; min-width: 0; }
.product-cell > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pick-list button .product-thumb { width: 2.5rem; height: 2.5rem; }
.photo-grid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); }
.photo-grid li { display: grid; gap: 0.4rem; }
.photo-link { display: block; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.photo-link img { width: 100%; height: 100%; object-fit: contain; display: block; }
.photo-link:hover { box-shadow: 0 0 0 2px var(--mat); }
.photo-grid li:first-child .photo-link { box-shadow: 0 0 0 2px var(--tag); }
.photo-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; min-height: 2rem; }
.photo-upload { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.photo-upload input[type=file] { flex: 1 1 14rem; min-width: 0; max-width: 100%; }
.photo-upload .hint { flex-basis: 100%; margin: 0; font-size: var(--step--1); }

/* ---------------------------------------------------------------- contracts and recurring work orders */

.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.plain-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; min-width: 0; }
.plain-list li > .icon { color: var(--mat); flex: none; }
.hours-balance { margin: 0; font-size: var(--step-2); font-weight: 700; }
.hours-balance .muted { font-size: var(--step--1); font-weight: 400; }
.negative { color: var(--signal); }
.segmented { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1rem; font-size: var(--step--1); }
.segmented a { padding: 0.25rem 0.8rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.segmented a[aria-current] { background: var(--mat); color: #fff; box-shadow: none; }
.contract-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.contract-hours label { font-size: var(--step--1); color: var(--ink-2); font-weight: 600; }
.contract-hours input { width: 5.5rem; }
#contrato > p { margin-top: 0; }

/* ---------------------------------------------------------------- notes board */

.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.board { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); align-items: start; }
/* Paper notes keep dark ink in both themes: they are paper. */
.sticky {
    --sticky-ink: #2a2418;
    position: relative;
    display: grid;
    gap: 0.6rem;
    padding: 1.05rem 1rem 0.8rem;
    background: var(--sticky);
    color: var(--sticky-ink);
    border-radius: 2px 2px 14px 2px;
    box-shadow: 0 1px 1px rgb(0 0 0 / 12%), 0 6px 14px -8px rgb(0 0 0 / 35%);
    min-width: 0;
}
.sticky::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 0.4rem;
    background: rgb(0 0 0 / 9%);
}
.sticky a { color: inherit; }
.sticky.is-done { opacity: 0.62; }
.sticky.is-done .sticky-body { text-decoration: line-through; text-decoration-thickness: 1px; }
.sticky-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 0.75rem; font-size: var(--step--1); font-weight: 700; }
.sticky-type { opacity: 0.75; }
.sticky-due { display: inline-flex; align-items: center; gap: 0.3rem; }
.sticky-due .icon { width: 0.95rem; height: 0.95rem; }
.sticky-due.overdue { color: #a1260f; }
.sticky-due.is-today { text-decoration: underline; text-underline-offset: 3px; }
.sticky-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--step-0); line-height: 1.45; }
.sticky-meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-size: var(--step--1); }
.sticky-meta li { display: flex; align-items: center; gap: 0.4rem; min-width: 0; overflow-wrap: anywhere; }
.sticky-meta .icon { width: 0.95rem; height: 0.95rem; flex: none; opacity: 0.7; }
.sticky-meta .tag { --tag-hole: var(--sticky); }
.sticky-address { white-space: pre-wrap; }
.sticky-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; border-top: 1px dashed rgb(0 0 0 / 18%); padding-top: 0.6rem; font-size: var(--step--1); }
.sticky-who { opacity: 0.75; }
.note-actions { display: inline-flex; align-items: center; gap: 0.75rem; }
.sticky .link-button { color: var(--sticky-ink); font-weight: 600; }
.sticky .button { background: rgb(255 255 255 / 55%); color: var(--sticky-ink); border-color: rgb(0 0 0 / 18%); }
.linked-to { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; color: var(--ink-2); font-size: var(--step--1); }
.mini-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; font-size: var(--step--1); }
.mini-notes li { display: grid; gap: 0.1rem; padding: 0.4rem 0.6rem; border-left: 4px solid var(--sticky); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- calendar */

.cal-title { font-stretch: 85%; }
.cal { margin-top: 1rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays span { padding: 0.5rem 0.6rem; font-size: var(--step--1); font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.cal-grid { list-style: none; margin: 0; padding: 0; }
.cal-day { min-height: 7.5rem; padding: 0.35rem 0.4rem 0.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.is-weekend { background: var(--surface-2); }
.cal-day.is-other { background: var(--paper); }
.cal-day.is-other .cal-num { color: var(--ink-2); opacity: 0.6; }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; }
.cal-num { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; border-radius: 999px; font-weight: 700; font-size: var(--step--1); }
.cal-day.is-today .cal-num { background: var(--mat); color: var(--mat-ink); }
.cal-long { display: none; }
.cal-add { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: var(--radius-sm); color: var(--ink-2); opacity: 0; }
.cal-add .icon { width: 0.95rem; height: 0.95rem; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--mat-soft); color: var(--mat-strong); }
.cal-events { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
.cal-event { min-width: 0; }
.cal-event a {
    display: flex;
    gap: 0.3rem;
    padding: 0.15rem 0.35rem;
    border-left: 3px solid var(--ev);
    border-radius: 0 4px 4px 0;
    background: color-mix(in srgb, var(--ev) 16%, var(--surface));
    color: var(--ink);
    font-size: 0.75rem;
    line-height: 1.3;
    text-decoration: none;
    min-width: 0;
}
.cal-event a:hover { background: color-mix(in srgb, var(--ev) 30%, var(--surface)); }
.cal-note a { background: var(--ev); color: #2a2418; border-left-color: rgb(0 0 0 / 22%); }
.cal-note a:hover { background: var(--ev); filter: brightness(0.95); }
.cal-absence a { border-left-style: dotted; }
.cal-event.is-done a { opacity: 0.55; text-decoration: line-through; }
.cal-time { font-weight: 700; flex: none; }
.cal-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-detail { color: var(--ink-2); }
.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.9rem 0 0; padding: 0; font-size: var(--step--1); color: var(--ink-2); }
.cal-legend li::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.4rem; vertical-align: -0.05rem; border-radius: 2px; }
.cal-legend .cal-note::before { background: #f2d36b; }
.cal-legend .cal-promised::before { background: var(--mat); }
.cal-legend .cal-recurring::before { background: #0f766e; }
.cal-legend .cal-fee::before { background: #64748b; }
.cal-legend .cal-absence::before { background: #38bdf8; }

/* Narrow screens: an agenda of the days that have something, plus today. */
@media (max-width: 52rem) {
    .cal-weekdays { display: none; }
    .cal-grid { grid-template-columns: 1fr; }
    .cal-day { min-height: 0; border-right: 0; padding: 0.6rem 0.8rem; }
    .cal-day.is-empty:not(.is-today), .cal-day.is-other.is-empty { display: none; }
    .cal-day.is-other { display: none; }
    .cal-num { display: none; }
    .cal-long { display: inline; font-weight: 700; font-size: var(--step--1); }
    .cal-day.is-today .cal-long { color: var(--mat); }
    .cal-add { opacity: 1; }
    .cal-event a { font-size: var(--step--1); padding: 0.3rem 0.5rem; }
    .cal-text { white-space: normal; }
}

/* ---------------------------------------------------------------- timeclock */

.nav-clock { display: grid; gap: 0.2rem; margin-top: 0.2rem; }
.nav-clock-state { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--rail-ink); text-decoration: none; opacity: 0.8; }
.nav-clock-state.is-in { opacity: 1; color: #fff; }
.nav-clock-state.is-in .icon { color: #7ee0b0; }
.nav-clock .link-button { padding-left: 1.6rem; font-weight: 600; }
.clock-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; border-left: 5px solid var(--line); }
.clock-card.is-in { border-left-color: var(--ok); }
.clock-state { margin: 0; font-size: var(--step-2); font-weight: 700; }
.clock-card .muted { margin: 0.2rem 0 0; }
.clock-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.clock-form input { width: min(100%, 14rem); }
.button-large { min-height: 2.9rem; padding: 0.5rem 1.2rem; font-size: var(--step-1); }
.week-nav { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--step--1); font-weight: 600; }
.team-week th.is-today, .punch-table tr.is-today > th { color: var(--mat); }
.team-week tr.is-selected { background: var(--mat-soft); }
.punch-table th[scope="row"] { white-space: nowrap; font-weight: 600; }
.punches { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.punches li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; }
.punches li.is-forgotten .punch-times { color: var(--signal); font-weight: 600; }
.punch-times { font-variant-numeric: tabular-nums; }
.punch-edit { font-size: var(--step--1); }
.badge-warn { background: var(--signal-soft); color: var(--signal); }
.absence-chip { display: inline-block; margin: 0 0.3rem 0.2rem 0; padding: 0.05rem 0.55rem; border-radius: 999px; font-size: var(--step--1); font-weight: 600; background: color-mix(in srgb, var(--ev) 22%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ev) 60%, transparent); }
.presence-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ok); margin-right: 0.15rem; }
.presence-dot.is-forgotten { background: var(--signal); }
.link-danger { color: var(--signal); }
.plain-list .inline-form { display: inline; }
.absence-list { margin-bottom: 1.25rem; }

/* ---------------------------------------------------------------- customer portal */

.public-head.is-wide { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-inline: max(1rem, calc((100% - 52rem) / 2)); }
.public-main.is-wide { width: min(100% - 2rem, 52rem); }
.portal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.25rem; font-weight: 600; }
.portal-nav a { color: var(--rail-ink); text-decoration: none; }
.portal-nav a:hover { color: #fff; text-decoration: underline; }
.portal-hello h1 { margin: 0; font-size: var(--step-3); }
.portal-hello .lead { margin: 0.4rem 0 0; color: var(--ink-2); }
.portal-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.portal-order { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; padding: 0.7rem 0.8rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.portal-order:hover { background: var(--mat-soft); }
.portal-order .tag { --tag-hole: var(--surface-2); }
.portal-order-text { display: grid; flex: 1 1 12rem; min-width: 0; }
.portal-order-text .muted { font-size: var(--step--1); }
.portal-due { margin: 0; font-weight: 700; color: var(--signal); }
.portal-panel { display: grid; gap: 1rem; }
.portal-invite { align-items: end; }
.portal-invite .field { flex: 1 1 16rem; }
.invite-link input { font-family: ui-monospace, monospace; font-size: var(--step--1); }

/* ---------------------------------------------------------------- service requests */

.nav-count { margin-left: auto; min-width: 1.35rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--tag); color: var(--tag-ink); font-size: 0.75rem; font-weight: 750; text-align: center; }
/* Honeypot: out of sight for people, still in the form for bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.request-form { display: grid; gap: 1.1rem; }
.request-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.8rem; min-width: 0; }
.request-form legend { font-weight: 700; font-size: var(--step-1); margin-bottom: 0.6rem; padding: 0; }
.req-status { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: var(--step--1); font-weight: 650; vertical-align: middle; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.req-new { background: var(--tag); color: var(--tag-ink); box-shadow: none; }
.req-contacted { background: var(--mat-soft); color: var(--mat-strong); box-shadow: none; }
.req-converted { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--tag-edge); }
.request-problem { margin: 0; font-size: var(--step-1); line-height: 1.5; overflow-wrap: anywhere; }
.customer-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.customer-choice legend { font-weight: 600; font-size: var(--step--1); color: var(--ink-2); margin-bottom: 0.5rem; }
.choice { display: grid; gap: 0.5rem; padding: 0.75rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.choice .check span { overflow-wrap: anywhere; }
.choice:has(input[type="radio"]:not(:checked)) .field { display: none; }
.portal-actions { margin: 0; }
.consent { display: grid; gap: 0.3rem; }
.consent .check, .request-form .check { align-items: flex-start; font-size: var(--step-0); }
.consent input[type="checkbox"], .request-form .check input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; flex: none; }

/* ---------------------------------------------------------------- messages */

.provider-list, .transport-list { border: 0; padding: 0; margin: 0 0 1.1rem; display: grid; gap: 0.5rem; min-width: 0; }
.provider { display: grid; gap: 0.6rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.provider:has(> .provider-pick input:checked), .provider:has(> input:checked), label.provider:has(input:checked) { box-shadow: inset 0 0 0 2px var(--mat); background: var(--surface); }
.provider-pick, .provider-off { display: flex; gap: 0.7rem; align-items: flex-start; cursor: pointer; }
.provider-off { padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.provider-off:has(input:checked) { box-shadow: inset 0 0 0 2px var(--mat); background: var(--surface); }
.provider input[type="radio"], .provider-off input[type="radio"] { margin-top: 0.25rem; flex: none; }
.provider-head { display: grid; gap: 0.1rem; min-width: 0; }
.provider-head .muted { font-size: var(--step--1); overflow-wrap: anywhere; }
.provider-links { margin: 0 0 0 1.7rem; display: flex; gap: 1rem; font-size: var(--step--1); }
.provider-fields { margin-left: 1.7rem; }
.provider:has(> .provider-pick input:not(:checked)) > .provider-fields,
.provider:has(> .provider-pick input:not(:checked)) > .provider-links { display: none; }
.smtp-fields { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
.smtp-fields legend { font-weight: 650; margin-bottom: 0.6rem; padding: 0; }
.panel:has(input[name="mail_transport"][value="smtp"]:not(:checked)) .smtp-fields { display: none; }
.test-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.test-row label { font-weight: 600; font-size: var(--step--1); }
.test-row input { width: min(100%, 16rem); }
.label-like { display: block; font-weight: 600; font-size: var(--step--1); color: var(--ink-2); margin-bottom: 0.35rem; }
.message-list { list-style: none; margin: 0; padding: 0; display: grid; }
.message { padding: 0.7rem 0; border-bottom: 1px solid var(--line); display: grid; gap: 0.3rem; min-width: 0; }
.message:last-child { border-bottom: 0; }
.message-head { display: flex; flex-wrap: wrap; gap: 0.3rem 0.7rem; align-items: center; min-width: 0; }
.message-channel { display: inline-flex; gap: 0.3rem; align-items: center; font-size: var(--step--1); font-weight: 650; color: var(--mat-strong); }
.message-channel svg { width: 1rem; height: 1rem; }
.message-to { overflow-wrap: anywhere; }
.message-when { font-size: var(--step--1); }
.message.is-failed .message-channel { color: var(--signal); }
.message-subject { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.message-body summary { cursor: pointer; color: var(--ink-2); overflow-wrap: anywhere; }
.message-body p { margin: 0.5rem 0 0; overflow-wrap: anywhere; }
.message .field-error { margin: 0; }
.template-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chip { display: inline-block; padding: 0.3rem 0.75rem; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; font-size: var(--step--1); font-weight: 600; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--mat); }
.chip.is-current { background: var(--mat); color: #fff; box-shadow: none; }
.compose-toggle { font-size: var(--step-0); }
.compose-toggle span { display: inline-flex; gap: 0.45rem; align-items: center; }
.compose-channel:has(.compose-toggle input:not(:checked)) .compose-fields { opacity: 0.55; }
.compose-channel.is-off .compose-fields { display: none; }
.sms-count { margin-top: 0.3rem; }
.placeholders dt code { font-size: var(--step--1); }
.invite-send { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; }

/* ---------------------------------------------------------------- ledger */

.year-nav { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.year-nav strong { font-size: var(--step-1); }
.ledger-figures { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-bottom: 1.25rem; }
.figure { padding: 0.9rem 1.1rem; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 0.2rem; }
.figure span { font-size: var(--step--1); color: var(--ink-2); font-weight: 600; }
.figure strong { font-size: var(--step-2); font-variant-numeric: tabular-nums; }
.figure-result { background: var(--mat); box-shadow: none; }
.figure-result span, .figure-result strong { color: #fff; }
.figure-result.is-negative { background: var(--signal); }
.ledger-months tr.is-empty td, .ledger-months tr.is-empty th, .table tr.is-empty td { color: var(--ink-3, var(--ink-2)); opacity: 0.6; }
.ledger-months tfoot th, .ledger-months tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.bars-col { width: 9rem; min-width: 6rem; }
.bars-col .bar { display: block; height: 0.4rem; border-radius: 999px; width: var(--w, 0%); margin: 0.12rem 0; }
.bar-in { background: var(--mat); }
.bar-out { background: var(--signal); }
.legend { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; font-size: var(--step--1); font-weight: 500; color: var(--ink-2); }
.legend .bar { display: inline-block; width: 0.8rem; height: 0.4rem; margin: 0; }
.ledger-columns { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); margin: 1.25rem 0; }
.ledger-columns .panel { margin: 0; }
.ledger-unpaid li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.4rem 0.8rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.ledger-unpaid li:last-child { border-bottom: 0; }
.ledger-unpaid li > span { min-width: 0; overflow-wrap: anywhere; }
.ledger-unpaid .muted { display: block; font-size: var(--step--1); }
.ledger-unpaid .num { font-variant-numeric: tabular-nums; }
.overdue { color: var(--signal); font-weight: 650; }
.ledger-kind { font-size: var(--step--1); font-weight: 650; }
.ledger-expense { color: var(--signal); }
.ledger-income { color: var(--mat-strong); }
.ledger-filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-bottom: 1rem; }
.ledger-filters .field { min-width: min(100%, 10rem); flex: 1 1 10rem; }
.ledger-lines td { vertical-align: top; }
.ledger-lines select, .ledger-lines input:not([type="checkbox"]) { width: 100%; min-width: 7rem; }
.ledger-lines .input-money { text-align: right; min-width: 6rem; }
.ledger-lines tr.has-error td { background: var(--signal-soft); }
.ledger-totals { margin-top: 1rem; justify-content: end; }
@media (max-width: 40rem) {
    .ledger-unpaid li { grid-template-columns: minmax(0, 1fr) auto; }
    .ledger-unpaid li form, .ledger-unpaid li .button { grid-column: 1 / -1; justify-self: start; }
}
.nowrap { white-space: nowrap; }
@media (max-width: 40rem) {
    .narrow-hide { display: none; }
    .ledger-months .bars-col { display: none; }
}

/* ---------------------------------------------------------------- reminders */

.button-row { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.reminder-list li { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.reminder-list li:last-child { border-bottom: 0; }
.reminder-list li.is-inactive { opacity: 0.6; }
.reminders-actions { flex-wrap: wrap; align-items: center; }
.reminders-actions .hint { flex-basis: 100%; margin: 0; }
.reminders-table td:first-child .check { margin: 0; }
.asset-reminders { margin-top: 1.25rem; }

/* ---------------------------------------------------------------- stores */

.nav-store { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; color: var(--rail-ink); }
.nav-store label { display: inline-flex; opacity: 0.8; }
.nav-store select { flex: 1; min-width: 0; padding: 0.3rem 0.5rem; font-size: var(--step--1); background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: var(--radius-sm, 6px); }
.nav-store select option { color: #111; }
.table tr.is-current th, .table tr.is-current td { background: var(--surface-2); }
.signatures { margin-top: 14mm; }

/* Unlock patterns: drawn in the asset and work order pages, and drawn by hand in the asset form. */
.pattern-drawing { display: block; flex: none; }
.pattern-drawing .pattern-spot { fill: var(--line); }
.pattern-drawing .pattern-line { fill: none; stroke: var(--mat); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.75; }
.pattern-drawing .pattern-dot { fill: var(--ink-2); }
.pattern-drawing .pattern-dot.is-start { fill: var(--ok); }
.pattern-drawing .pattern-order { fill: var(--surface); font: 700 11px var(--font); text-anchor: middle; pointer-events: none; }
.pattern-value { display: inline-flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.pattern-pad { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.pattern-input { width: 9.5rem; height: 9.5rem; touch-action: none; cursor: crosshair; user-select: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.pattern-input .pattern-dot { fill: var(--line); transition: fill 0.1s; }
.pattern-input .pattern-dot.is-on { fill: var(--mat); }
.pattern-input .pattern-order { fill: var(--mat-ink); font-size: 12px; }
.pattern-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pattern-input .pattern-dot.is-start { fill: var(--ok); }
.pattern-field .hint { margin: 0; font-size: var(--step--1); }

/* Garantias LG */
.lg-total { display: grid; justify-items: end; gap: 0.1rem; }
.lg-total strong { font-size: var(--step-2); font-variant-numeric: tabular-nums; }
.lg-parts input { width: 100%; min-width: 7rem; }
.lg-parts .input-qty { width: 4.5rem; min-width: 0; }
.lg-parts .input-num { width: 7rem; min-width: 0; text-align: right; }
.lg-worten { align-items: end; }
.toggle-button { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.6rem; padding: 0.4rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-weight: 600; cursor: pointer; width: fit-content; }
.toggle-button:has(input:checked) { background: #e30613; border-color: #e30613; color: #fff; }
.toggle-button:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.badge-worten { display: inline-block; margin-top: 0.2rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: #e30613; color: #fff; font-size: var(--step--1); font-weight: 700; }
.lg-parts .input-date { width: 9.5rem; min-width: 0; }
.lg-photos { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }
.lg-photo { display: grid; gap: 0.4rem; align-content: start; padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.lg-photo.is-missing { border-style: dashed; border-color: var(--signal); }
.lg-photo label { font-weight: 600; font-size: var(--step--1); }
.lg-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm, 6px); background: var(--surface-2); }
.lg-photo-empty { display: flex; align-items: center; justify-content: center; gap: 0.3rem; aspect-ratio: 4 / 3; border-radius: var(--radius-sm, 6px); background: var(--surface-2); color: var(--signal); font-size: var(--step--1); font-weight: 600; }
.lg-photo input[type="file"] { font-size: var(--step--1); max-width: 100%; }
.lg-photo .link-button { color: var(--signal); opacity: 1; justify-self: start; display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--step--1); }
@media (min-width: 60rem) { .lg-customer > .field:nth-child(5) { grid-column: span 2; } }
.lg-manual .link-button { color: var(--signal); opacity: 1; display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--step--1); }
.lg-manual { display: grid; gap: 0.35rem; margin-top: 1rem; justify-items: start; }
.lg-manual label { font-weight: 600; }
.lg-manual-file { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; margin: 0; }
.lg-manual-file a, .lg-manual-file > span:first-child { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; overflow-wrap: anywhere; }
.lg-manual input[type="file"] { max-width: 100%; }
.lg-photo-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; aspect-ratio: 4 / 3; border-radius: var(--radius-sm, 6px); background: var(--surface-2); text-decoration: none; color: inherit; padding: 0.5rem; text-align: center; }
.lg-photo-pdf small { font-size: var(--step--1); color: var(--muted, inherit); overflow-wrap: anywhere; }
.lg-rate + .lg-rate-info { margin-top: 0.25rem; }
.toggle-button:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.list-tabela-valores-lg input[name$="[name]"] { min-width: 17rem; }
.list-tabela-valores-lg .input-num { width: 5.5rem; min-width: 0; }
.list-tabela-valores-lg .input-qty { width: 4rem; min-width: 0; }
.list-tabela-valores-lg select { min-width: 8rem; }
.lg-accessories { margin: 1rem 0 0; }
.lg-accessories legend { font-size: var(--step-0, 1rem); margin-bottom: 0.4rem; }
.lg-dashboard { margin-top: 2rem; }
.lg-dashboard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.lg-dashboard-head h2 { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; font-size: var(--step-1); }
.lane-more { display: block; text-align: center; font-size: var(--step--1); padding: 0.3rem; }
/* LG's logo (the circle, from the file the team supplied) in front of «Garantias LG». */
.lg-mark { display: inline-block; flex: none; width: 1.25em; height: 1.25em; vertical-align: -0.2em; }
.lg-title { display: flex; align-items: center; gap: 0.45rem; }
.nav .lg-mark { width: 1.15rem; height: 1.15rem; }
/* WhatsApp: a floating button in the corner of the work order, opening a small chat window. */
.wa-chat { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; }
.wa-chat > summary { list-style: none; display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: #25d366; color: #fff; box-shadow: 0 4px 14px rgb(0 0 0 / 0.25); cursor: pointer; order: 2; }
.wa-chat > summary::-webkit-details-marker { display: none; }
.wa-chat > summary:hover { background: #1ebe5b; }
.wa-chat > summary:focus-visible { outline: 3px solid var(--mat); outline-offset: 3px; }
.wa-chat > summary .icon { width: 1.9rem; height: 1.9rem; }
.wa-chat[open] > summary { background: #128c7e; }
.wa-panel { order: 1; width: min(21rem, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: 0 8px 28px rgb(0 0 0 / 0.28); overflow: hidden; }
.wa-panel-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; background: #075e54; color: #fff; }
.wa-panel-head strong { display: block; }
.wa-panel-head small { opacity: 0.85; }
.wa-panel-body { padding: 0.8rem 0.9rem; background: #efeae2; display: grid; gap: 0.6rem; }
.wa-panel-body textarea { width: 100%; min-height: 7.5rem; resize: vertical; background: #fff; color: #111; border-radius: 0.6rem; border: 1px solid #d6d1c8; padding: 0.55rem 0.65rem; font: inherit; }
.wa-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wa-presets button { border: 1px solid #c9c3b8; background: #fff; color: #111; border-radius: 999px; padding: 0.2rem 0.7rem; font: inherit; font-size: var(--step--1); cursor: pointer; }
.wa-send { justify-self: end; display: inline-flex; align-items: center; gap: 0.4rem; border: 0; border-radius: 999px; padding: 0.5rem 1rem; background: #25d366; color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
.wa-send:hover { background: #1ebe5b; }
.wa-form { display: grid; gap: 0.6rem; }
.wa-empty { margin: 0; color: #333; font-size: var(--step--1); }
@media print { .wa-chat { display: none; } }
.item-tax-form select { min-width: 7.5rem; padding-block: 0.2rem; font-size: var(--step--1); }
.stock-pick-add { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; }
.stock-pick-add .input-qty { width: 3.5rem; }
.pick-summary { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0 0 1rem; padding: 0.6rem 0.8rem; background: var(--surface-2); border-radius: var(--radius-sm); font-size: var(--step--1); }
#itens .panel-head h2 { margin: 0; }
/* Dashboard lanes minimise to their header and count (a <details>; app.js remembers which). */
.lane-summary { display: flex; align-items: center; gap: 0.4rem; list-style: none; cursor: pointer; }
.lane-summary::-webkit-details-marker { display: none; }
.lane-summary .lane-head { flex: 1; margin-bottom: 0; min-width: 0; }
.lane[open] > .lane-summary { margin-bottom: 0.7rem; }
.lane-toggle { display: grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; color: var(--ink-2); transition: transform 0.15s; }
.lane-summary:hover .lane-toggle { background: var(--surface); color: var(--ink); }
.lane:not([open]) .lane-toggle { transform: rotate(-90deg); }
.lane:not([open]) { padding-block: 0.55rem; }
.lane-summary:focus-visible { outline: 2px solid var(--mat); outline-offset: 3px; border-radius: var(--radius-sm); }
.lane-grip { display: grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-2); cursor: grab; touch-action: none; }
.lane-grip[hidden] { display: none; }
.lane-grip:hover { background: var(--surface); color: var(--ink); }
.lane-grip:focus-visible { outline: 2px solid var(--mat); outline-offset: 1px; }
.board.is-sorting, .board.is-sorting * { cursor: grabbing; user-select: none; }
.lane.is-dragging { opacity: 0.6; box-shadow: 0 0 0 2px var(--mat), var(--shadow); }

/* Férias */
.vac-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.6rem; margin: 0; }
.vac-stats > div { padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.vac-stats dt { font-size: var(--step--1); color: var(--ink-2); font-weight: 600; }
.vac-stats dd { margin: 0; font-size: var(--step-2); font-weight: 800; font-variant-numeric: tabular-nums; }
.vac-stats small { color: var(--ink-2); font-size: var(--step--1); }
.vac-stats .is-left { border-color: var(--mat); background: var(--mat-soft); }
.vac-requests > li { justify-content: space-between; padding-bottom: 0.55rem; border-bottom: 1px solid var(--line); }
.vac-requests > li:last-child { border-bottom: 0; padding-bottom: 0; }
.vac-requests > li > div { min-width: 0; flex: 1 1 16rem; }
.vac-decide { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.vac-decide input { width: min(100%, 12rem); }
.vac-status-pending { background: var(--signal-soft); color: var(--signal); }
.vac-status-approved { background: var(--ok-soft); color: var(--ok); }
.vac-status-rejected, .vac-status-cancelled { background: var(--surface-2); color: var(--ink-2); text-decoration: line-through; }
.vac-team .input-qty { width: 4.5rem; }
.text-danger { color: #dc2626; }
.holiday-list li { display: block; }
.vac-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0 0 0.75rem; font-size: var(--step--1); color: var(--ink-2); }
.vac-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.vac-cell { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 3px; border: 1px solid var(--line); }
.vac-months { display: grid; gap: 1rem; }
.vac-map { border-collapse: separate; border-spacing: 2px; font-size: 0.7rem; }
.vac-map caption { text-align: left; font-weight: 700; padding-bottom: 0.2rem; }
.vac-map th, .vac-map td { padding: 0; text-align: center; min-width: 1.35rem; height: 1.35rem; }
.vac-map thead th { font-weight: 600; color: var(--ink-2); line-height: 1.1; }
.vac-map thead th span { display: block; font-weight: 400; font-size: 0.6rem; }
.vac-map thead th.is-today { color: var(--mat); }
.vac-map tbody th { text-align: left; padding-right: 0.5rem; white-space: nowrap; font-weight: 600; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.vac-map td { border-radius: 3px; background: var(--surface-2); }
.vac-map .is-off, .vac-cell.is-off { background: color-mix(in srgb, var(--ink-2) 22%, var(--surface)); }
.vac-map thead th.is-off { background: none; opacity: 0.6; }
.vac-map .is-approved, .vac-cell.is-approved { background: #38bdf8; }
.vac-map .is-pending, .vac-cell.is-pending { background: repeating-linear-gradient(45deg, #38bdf8 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px #38bdf8; }
.vac-wide { display: grid; gap: 1rem; margin-top: 1rem; }

/* Despesas do negócio */
.badge-ok { background: var(--ok-soft); color: var(--ok); text-decoration: none; }
.expense-grid { font-size: var(--step--1); }
.expense-grid th[scope="row"] { white-space: nowrap; }
.expense-grid tbody tr.is-empty th, .fixed-expenses tr.is-empty { color: var(--ink-2); }
.expense-name { display: inline-flex; align-items: center; gap: 0.35rem; }
.expense-add { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: var(--radius-sm); color: var(--mat); }
.expense-add:hover { background: var(--mat-soft); }
.expense-grid td a { color: inherit; }
.expense-grid th[scope="row"], .expense-grid thead th:first-child, .expense-grid tfoot th { position: sticky; left: 0; background: var(--surface); z-index: 1; }

/* Painel: presenças */
.presence-dashboard { margin-top: 2rem; }
.presence-dashboard h2 .icon { color: var(--mat); }
.presence-dashboard h2 .count { margin-left: 0.4rem; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
.presence-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.presence-team .plain-list li { gap: 0.3rem 0.6rem; }
.presence-team .presence-dot { background: var(--line); }
.presence-team .presence-dot.is-in { background: var(--ok); }
.presence-team .presence-dot.is-forgotten { background: var(--signal); }
.presence-hours { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Painel: Garantias LG and Presenças minimise as a whole */
.dash-block-head { list-style: none; cursor: pointer; align-items: center; border-radius: var(--radius-sm); }
.dash-block-head::-webkit-details-marker { display: none; }
.dash-block-head h2 { flex: 1; min-width: 0; }
.dash-block-head h2 .count { margin-left: 0.4rem; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
.dash-block-head:hover .lane-toggle { background: var(--surface); color: var(--ink); }
.dash-block-head:focus-visible { outline: 2px solid var(--mat); outline-offset: 3px; }
.dash-block:not([open]) .lane-toggle { transform: rotate(-90deg); }
.dash-block:not([open]) > .dash-block-head { margin-bottom: 0; padding: 0.6rem 0.8rem; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); }

/* Tree item in a link list (Configuração › Listas › Menu LG): opens in place, without JavaScript. */
.link-tree summary { display: flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-weight: 500; color: var(--mat); cursor: pointer; list-style: none; }
.link-tree summary::-webkit-details-marker { display: none; }
.link-tree summary::before { content: ""; width: 0.45em; height: 0.45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; flex: none; }
.link-tree[open] summary::before { transform: rotate(45deg); }
.link-tree[open] summary, .link-list li:last-child .link-tree summary { border-bottom: 0; }
.link-tree ul { list-style: none; margin: 0 0 0 0.2rem; padding: 0 0 0 1.1rem; }
/* Items inside a tree have no lines between them; an open tree ends with one line, like a closed one. */
.link-tree ul a { border-bottom: 0; padding: 0.4rem 0; }
.link-tree[open] { border-bottom: 1px solid var(--line); }
.link-list li:last-child .link-tree[open] { border-bottom: 0; }

/* «Peças por encomendar» floating window: bottom right, on every page while parts wait, clear of
   the forms' buttons (bottom left); the WhatsApp button sits above it, and pages end with room for it. */
.order-float { position: fixed; right: 1rem; bottom: 1rem; z-index: 39; width: min(21rem, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid #d97706; border-radius: var(--radius); box-shadow: 0 6px 22px rgb(0 0 0 / 0.18); font-size: var(--step--1); }
.order-float > summary { list-style: none; display: flex; align-items: center; gap: 0.45rem; padding: 0.55rem 0.75rem; cursor: pointer; font-weight: 600; color: var(--ink); }
.order-float > summary::-webkit-details-marker { display: none; }
.order-float > summary .icon { color: #d97706; }
.order-float-title { flex: 1; }
.order-float .count { background: #d97706; color: #fff; border-radius: 999px; padding: 0 0.5rem; font-size: 0.85em; min-width: 1.5rem; text-align: center; }
.order-float-toggle { display: inline-flex; transition: transform 0.15s; }
.order-float-grip { display: inline-flex; padding: 0.2rem; margin: -0.2rem 0; border: 0; border-radius: 4px; background: none; color: var(--ink-2); cursor: grab; touch-action: none; }
.order-float-grip:hover, .order-float-grip:focus-visible { background: var(--line); color: var(--ink); }
.order-float-grip[hidden] { display: none; }
.order-float.is-dragging { opacity: 0.92; user-select: none; }
.order-float.is-dragging .order-float-grip { cursor: grabbing; }
.order-float:not([open]) .order-float-toggle { transform: rotate(180deg); }
.order-float-body { max-height: min(22rem, 55vh); overflow-y: auto; border-top: 1px solid var(--line); padding: 0.4rem 0.75rem 0.6rem; }
.order-float-hint { margin: 0 0 0.3rem; color: var(--ink-2); }
.order-float ul { list-style: none; margin: 0; padding: 0; }
.order-float-supplier { margin-top: 0.5rem; font-weight: 700; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.order-float-item { display: flex; gap: 0.55rem; align-items: flex-start; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.order-float-item form { margin: 0; flex: none; }
.order-float-item > a { min-width: 0; flex: 1; display: grid; text-decoration: none; color: var(--ink); }
.order-float-part { overflow-wrap: anywhere; }
.order-float-meta { color: var(--ink-2); font-size: 0.9em; }
.order-float-item.is-in-cart .order-float-part { text-decoration: line-through; color: var(--ink-2); }
.cart-box { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; margin-top: 0.05rem; padding: 0; border: 2px solid var(--ink-2); border-radius: 4px; background: var(--surface); color: transparent; cursor: pointer; }
.cart-box[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.cart-box:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.order-float-foot { margin: 0.5rem 0 0; }
@media (max-width: 860px) {
    .order-float { right: 0.6rem; bottom: 0.6rem; width: min(19rem, calc(100vw - 1.2rem)); }
    .order-float-body { max-height: 40vh; }
}
body:has(.order-float) .wa-chat { bottom: 4.6rem; }
body:has(.order-float[open]) .wa-chat { bottom: calc(min(22rem, 55vh) + 6.5rem); }
body:has(.order-float[open]) .main { padding-bottom: calc(min(22rem, 55vh) + 7rem); }
body:has(.order-float:not([open])) .main { padding-bottom: 6rem; }
@media print { .order-float { display: none; } }

/* Desenho da etiqueta: the label at its real size (CSS mm), fields placed in mm and dragged by app.js. */
.ld-tools { display: grid; gap: 0.8rem; }
.ld-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; }
.ld-row .field { margin: 0; min-width: min(16rem, 100%); }
.ld-stage { margin: 1.2rem 0; overflow-x: auto; padding: 0.6rem 0.2rem 1rem; }
.ld-size-note { margin: 0 0 0.6rem; }
.ld-label { --ld-scale: 3; position: relative; background: #fff; color: #000; border: 1px solid #b9c2c8; border-radius: calc(1.5mm * var(--ld-scale));
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.12), 0 6px 18px rgb(0 0 0 / 0.08); overflow: hidden; flex: none;
    font-family: Archivo, system-ui, sans-serif; line-height: 1.15; touch-action: none; }
.ld-el { position: absolute; white-space: nowrap; cursor: grab; padding: 0 calc(0.3mm * var(--ld-scale)); border-radius: calc(0.6mm * var(--ld-scale)); outline: 1px dashed transparent; user-select: none; }
.ld-el:hover, .ld-el.is-dragging { outline-color: var(--accent, #0f6b62); background: rgb(15 107 98 / 0.06); }
.ld-el.is-dragging { cursor: grabbing; }
.ld-el.is-bold { font-weight: 700; }
.ld-table .input-num { width: 5rem; text-align: right; }
[data-ld-other][hidden] { display: none; }

/* Configuração › Geral › Empresa: the company's logo, shown and chosen in place. */
#empresa { container-type: inline-size; }
@container (min-width: 40rem) { .settings-list > .company-logo { grid-column: 1 / span 2; } }
.company-logo-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.company-logo-preview { width: 12rem; height: 6rem; display: grid; place-items: center; border: 1px dashed var(--line, #c9d1d6);
    border-radius: 6px; background: #fff; padding: 0.4rem; }
.company-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.company-logo-actions { display: grid; gap: 0.5rem; min-width: 0; }
.company-logo-actions input[type=file] { font: inherit; max-width: 100%; }
.company-logo-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ld-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.8rem; border: 1px dashed var(--accent, #0f6b62);
    border-radius: 999px; background: var(--surface, #fff); color: inherit; font: inherit; font-weight: 600; cursor: grab; }
.ld-chip:active { cursor: grabbing; }
.ld-chip .icon { opacity: 0.6; }
.ld-label.is-drop { outline: 2px dashed var(--accent, #0f6b62); outline-offset: 3px; }
.ld-chip-group { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.ld-chip-pick { position: relative; display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border: 1px solid var(--line, #c9d1d6);
    border-radius: 999px; background: var(--surface, #fff); cursor: pointer; }
.ld-chip-pick:hover, .ld-chip-pick:focus-within { border-color: var(--accent, #0f6b62); }
.ld-chip-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ld-el-img { display: block; padding: 0; }
.ld-el-img img { height: 100%; width: auto; display: block; pointer-events: none; }
.ld-img-empty { display: grid; place-items: center; height: 100%; padding: 0 2mm; border: 1px dashed #9aa5ab; color: #6b767c; font-size: 0.8rem; white-space: nowrap; }
[data-ld-image-send][hidden] { display: none; }
/* The × on a field in the label designer: shows on hover or focus and deletes the field. */
.ld-el-del { position: absolute; top: -0.55rem; right: -0.6rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 0;
    background: #b3261e; color: #fff; font: 700 0.9rem/1 system-ui, sans-serif; display: grid; place-items: center; cursor: pointer;
    opacity: 0; transition: opacity 0.12s; padding: 0; }
.ld-el:hover .ld-el-del, .ld-el:focus-within .ld-el-del, .ld-el-del:focus-visible { opacity: 1; }
@media (hover: none) { .ld-el-del { opacity: 1; } }

/* Diagnóstico: the equipment tree as cards, and the administrators' «Organizar» panel. */
.diag-grid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: 0.75rem; }
.diag-card { display: flex; flex-direction: column; gap: 0.2rem; height: 100%; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--mat); border-radius: var(--radius); color: inherit; text-decoration: none; }
.diag-card:hover, .diag-card:focus-visible { border-color: var(--mat); background: var(--mat-soft); }
.diag-card span { font-size: var(--step--1); }
.diag-manage summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.diag-add { display: grid; gap: 0.4rem; margin: 0.8rem 0; }
.diag-rows { list-style: none; margin: 0; padding: 0; }
.diag-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.35rem 0; border-top: 1px solid var(--line); }
.diag-rows form { display: flex; gap: 0.3rem; margin: 0; }
.diag-rename { flex: 1 1 14rem; min-width: 0; }
.diag-rename input { flex: 1; min-width: 0; }

/* iPanic Analyzer (Diagnóstico): panic log in, likely fault, phone diagram and the log excerpt. */
.panic-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 64rem) { .panic-layout { grid-template-columns: 22rem minmax(0, 1fr); } }
.panic-input { display: grid; gap: 0.8rem; }
.panic-input textarea { font-family: ui-monospace, monospace; font-size: var(--step--1); }
.panic-note { margin: 0; font-size: var(--step--1); }
.panic-results { display: grid; gap: 1rem; min-width: 0; }
.panic-results > .panel, .panic-results > .empty-state { margin: 0; }
.panic-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 0.6rem; margin: 0; }
.panic-facts > div { padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.panic-facts dt { font-size: var(--step--1); color: var(--ink-2); }
.panic-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.panic-diag { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) { .panic-diag { grid-template-columns: minmax(0, 1fr) 12rem; } }
.panic-card { padding: 0.8rem 1rem; margin: 0 0 0.8rem; border: 1px solid var(--line); border-left: 4px solid var(--signal); border-radius: var(--radius-sm); background: var(--surface); }
.panic-card.is-medium { border-left-color: #d98c1f; }
.panic-card.is-critical { border-left-width: 6px; }
.panic-card h3 { margin: 0 0 0.4rem; font-size: var(--step-0); }
.panic-card h4 { margin: 0.6rem 0 0.2rem; font-size: var(--step--1); color: var(--ink-2); }
.panic-card p { margin: 0.3rem 0; }
.panic-card.is-inactive { opacity: 0.6; }
.panic-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.panic-tag { padding: 0.1rem 0.5rem; border-radius: var(--radius-sm); background: var(--mat-soft); font-size: var(--step--1); overflow-wrap: anywhere; }
.panic-tag.is-hit { background: var(--signal-soft); color: var(--signal); font-weight: 700; font-family: ui-monospace, monospace; }
.panic-phone { margin: 0; text-align: center; }
.panic-phone figcaption { font-size: var(--step--1); font-weight: 700; color: var(--ink-2); text-transform: uppercase; }
.panic-phone svg { max-width: 100%; height: auto; }
.panic-zone { font-weight: 700; color: var(--signal); margin: 0.3rem 0 0; }
.ph-body { fill: var(--paper); stroke: var(--ink-2); stroke-width: 3; }
.ph-part { fill: var(--surface); stroke: var(--line); }
.ph-lens { fill: var(--ink-2); }
.ph-board { fill: var(--mat-soft); stroke: var(--mat); stroke-width: 1.5; }
.ph-text { fill: var(--ink-2); font-size: 10px; }
.ph-zone { fill: var(--signal); animation: ph-pulse 1.5s infinite; }
.ph-zone.is-medium { fill: #d98c1f; }
@keyframes ph-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.95; } }
@media (prefers-reduced-motion: reduce) { .ph-zone { animation: none; opacity: 0.8; } }
.panic-log { margin: 0; max-height: 24rem; overflow: auto; padding: 0.75rem; border-radius: var(--radius-sm); background: #0b1418; color: #d7e0e4; font-size: 0.78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.panic-log mark { background: rgb(240 122 98 / 28%); color: #ffd2c8; }
.panic-sig-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.panic-sig-list .panel-head h2 { font-size: var(--step-0); margin: 0; }
.panic-reason-title { margin: 0.9rem 0 0.3rem; font-size: var(--step--1); color: var(--ink-2); }
.panic-reason { margin: 0; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12rem; overflow: auto; }
.panic-tally { padding: 0.6rem 0.8rem; margin: 0.6rem 0; border-radius: var(--radius-sm); background: var(--ok-soft); }
.panic-tally h3 { margin: 0 0 0.3rem; font-size: var(--step--1); }
.panic-tally ul { margin: 0; padding-left: 1.1rem; }
.panic-confirm { display: grid; gap: 0.7rem; margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.panic-confirm h3 { margin: 0; }
.panic-delete { margin-top: 0.6rem; color: var(--signal); }
.panic-library .reason-cell { max-width: 32rem; font-family: ui-monospace, monospace; font-size: var(--step--1); overflow-wrap: anywhere; }
.panic-source { font-size: var(--step--1); margin-top: 0.4rem; }
.panic-smc { margin-top: 1rem; padding: 0.75rem 1rem; border-left: 4px solid var(--mat); background: var(--surface-2); border-radius: var(--radius-sm); }
.panic-smc h3 { margin: 0 0 0.4rem; font-size: var(--step-0); overflow-wrap: anywhere; }
.panic-smc ul { margin: 0 0 0.3rem; padding-left: 1.2rem; }
.external-sends { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.external-sends li { display: block; padding: 0.55rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; font-size: var(--step--1); line-height: 1.5; }
.external-sends strong { font-size: var(--step-0); }
.external-sends .badge { display: inline-block; width: auto; margin-inline: 0.3rem; }
.external-sends a { margin-left: 0.3rem; }
.diag-info { display: grid; gap: 0.35rem; margin: 0; }
.diag-info > div { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 0.75rem; padding: 0.3rem 0; border-top: 1px solid var(--line); }
.diag-info > div:first-child { border-top: 0; }
.diag-info dt { font-weight: 600; color: var(--ink-2); }
.diag-info dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 40rem) { .diag-info > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } }
.diag-area { margin: 1.2rem 0 0.5rem; font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.diag-area:first-of-type { margin-top: 0; }
.diag-fault { border: 1px solid var(--line); border-left: 4px solid var(--mat); border-radius: var(--radius); margin-bottom: 0.5rem; background: var(--surface); }
.diag-fault summary { cursor: pointer; padding: 0.6rem 0.9rem; font-weight: 600; }
.diag-fault[open] summary { border-bottom: 1px solid var(--line); }
.diag-fault-body { padding: 0.6rem 0.9rem 0.8rem; overflow-wrap: anywhere; }
.diag-fault-body h4 { margin: 0.4rem 0 0.3rem; font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.diag-fault-body ol { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.diag-fault-body li { margin-bottom: 0.2rem; }
.diag-source { font-size: var(--step--1); margin: 0.4rem 0 0; }
.diag-images { list-style: none; margin: 0.4rem 0 0.6rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.diag-images li { position: relative; display: flex; flex-direction: column; gap: 0.2rem; max-width: 10rem; font-size: var(--step--1); }
.diag-images img { display: block; width: 10rem; height: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.diag-images form { position: absolute; top: 0.25rem; right: 0.25rem; margin: 0; }
.diag-fault-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.5rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.diag-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; min-width: 0; }
.diag-upload label { font-weight: 600; font-size: var(--step--1); }
.diag-upload input[type=file] { max-width: 100%; min-width: 0; }
.diag-upload input[type=text] { flex: 1 1 10rem; min-width: 0; }

/* Marcas por tipo: the logo cell of each brand row. Logos sit on white so dark logos read in the dark theme too. */
.brand-logo-edit { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.brand-logo-box { width: 3.5rem; height: 1.9rem; display: grid; place-items: center; flex: none;
    border: 1px dashed var(--line); border-radius: var(--radius-sm); background: #fff; padding: 2px; }
.brand-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo-pick { position: relative; cursor: pointer; }
.brand-logo-edit [data-brand-logo-send][hidden] { display: none; }
.brand-logo-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Asset form: the brand list with logos (app.js; without JS a plain datalist). */
.brand-combo { position: relative; }
.brand-combo.has-logo input { padding-left: 2.9rem; }
.brand-combo-logo { position: absolute; left: 0.4rem; top: 50%; transform: translateY(-50%); width: 2.1rem; height: 1.4rem;
    object-fit: contain; background: #fff; border-radius: 3px; pointer-events: none; }
.brand-combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: 0.25rem;
    list-style: none; max-height: 16rem; overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-sm); box-shadow: 0 6px 18px rgb(0 0 0 / 14%); }
.brand-combo-option { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.5rem; border-radius: 4px; cursor: pointer; }
.brand-combo-option:hover, .brand-combo-option[aria-selected="true"] { background: var(--mat-soft); }
.brand-combo-option img, .brand-combo-blank { width: 2.1rem; height: 1.4rem; flex: none; object-fit: contain; background: #fff; border-radius: 3px; }
.brand-combo-blank { display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-size: var(--step--1); font-weight: 700; }
.brand-combo-empty { padding: 0.4rem 0.5rem; font-size: var(--step--1); }

/* Desenho dos documentos: the sheet itself is styled by docsheet.css; these are the editing aids. */
.dd-pick { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; margin-bottom: 1rem; }
.dd-pick .field { margin: 0; min-width: min(16rem, 100%); }
[data-dd-type-open][hidden], [data-dd-paper-apply][hidden] { display: none; }
.dd-models { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; flex-basis: 100%; }
.dd-models-label { font-weight: 600; margin-right: 0.2rem; }
.dd-model { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); color: inherit; text-decoration: none; }
.dd-model:hover { border-color: var(--mat); }
.dd-model.is-current { border-color: var(--mat); background: var(--mat); color: #fff; }
.dd-model.is-current .muted { color: inherit; opacity: 0.8; }
.dd-chips { gap: 0.5rem; }
.dd-stage { display: grid; justify-items: start; }
.dd-sheet.is-editable { box-shadow: 0 1px 3px rgb(0 0 0 / 0.12), 0 6px 18px rgb(0 0 0 / 0.08); border: 1px solid #b9c2c8; touch-action: none; }
.dd-sheet.is-editable .dd-el { cursor: grab; outline: 1px dashed transparent; outline-offset: 1px; user-select: none; }
.dd-sheet.is-editable .dd-el:hover, .dd-sheet.is-editable .dd-el.is-dragging { outline-color: var(--accent, #0f6b62); background-color: rgb(15 107 98 / 0.05); }
.dd-sheet.is-editable .dd-el.is-dragging { cursor: grabbing; }
.dd-sheet.is-editable .dd-line, .dd-sheet.is-editable .dd-line:hover { padding-bottom: 2px; }
.dd-sheet.is-drop { outline: 2px dashed var(--accent, #0f6b62); outline-offset: 3px; }
.dd-el:hover .ld-el-del, .dd-el:focus-within .ld-el-del { opacity: 1; }
.dd-resize { position: absolute; right: -4px; bottom: -4px; width: 10px; height: 10px; background: var(--accent, #0f6b62); border: 2px solid #fff;
    border-radius: 2px; cursor: nwse-resize; opacity: 0; transition: opacity 0.12s; }
.dd-el:hover .dd-resize, .dd-el.is-dragging .dd-resize { opacity: 1; }
@media (hover: none) { .dd-resize { opacity: 1; } }
.dd-table-edit .dd-text { width: 12rem; min-width: 8rem; font: inherit; }
.dd-table-edit textarea.dd-text { resize: vertical; }
.dd-actions { flex-wrap: wrap; }
.dd-dirty { margin-bottom: 1rem; }
.dd-name { display: flex; align-items: center; gap: 0.2rem; }
.dd-name input { flex: 1; min-width: 0; }
.dd-ext { font-weight: 600; color: var(--muted, #5b666c); }
.doc-choices th[scope=row] { font-weight: 600; white-space: nowrap; }
.doc-choices select { width: 100%; min-width: 12rem; }
.doc-choices-none { margin: 0.25rem 0 0; font-size: var(--step--1); }

/* An area the person may only see (Permissions::VIEW): what would change it is hidden. */
[data-readonly] form[method="post" i],
[data-readonly] button[form],
[data-readonly] a[href$="/novo"],
[data-readonly] a[href$="/nova"],
[data-readonly] a[href$="/editar"] { display: none !important; }

/* Configuração › Utilizadores: areas and levels */
.perm-table td, .perm-table th { vertical-align: middle; }
.perm-table .perm-level { text-align: center; white-space: nowrap; }
.perm-table .perm-level input { width: 1.1rem; height: 1.1rem; }
.perm-table .help { margin: 0.15rem 0 0; }
.perm-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.temp-password { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.temp-password code { font-size: 1.35rem; letter-spacing: 0.08em; padding: 0.3rem 0.7rem; background: var(--surface); border: 1px dashed var(--line); border-radius: 6px; user-select: all; }
@media (max-width: 560px) { .perm-table .perm-head-text { display: none; } }
.user-form { display: grid; gap: 1rem; margin-bottom: 1rem; }
.user-form .panel { margin: 0; }
.temp-password-panel { margin: 0 0 1rem; }
.perm-table th[scope="row"] .help { font-weight: 400; }
.perm-table + .checkbox, .perm-table-wrap + * { margin-top: 0.8rem; }
.cell-email { overflow-wrap: anywhere; min-width: 10rem; }
