/* Stamp Manager — app-specific overrides (Adminto handles layout) */

/*
 * The template declares  --ct-font-sans-serif: "Public Sans", serif  but never loads Public Sans:
 * no @font-face, no font file, no stylesheet link. The browser therefore fell through to the bare
 * `serif` fallback and rendered the whole application in Times New Roman — which is why 11px
 * labels were hard to read here and fine on any other site.
 *
 * Fixed with the standard system stack rather than by fetching the webfont: it needs no network
 * request, cannot flash unstyled text, and gives each OS its own UI face — Segoe UI on Windows,
 * San Francisco on macOS — all designed for small interface text. This file loads after
 * app.min.css, so the override survives a template update.
 */
:root {
    --ct-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
        "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Status dot in footer */
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 4px;
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* WorkBench layout variable for height calc */
:root {
    --wb-chrome-height: 200px; /* topbar + breadcrumb + footer + padding */
}

/* ── A box's × (clearable.js) ────────────────────────────────────────────── */
/* Shown while the box has text and the mouse or the cursor is on it — or on the × itself. */
input.sm-has-clear { padding-right: 24px !important; }
.sm-clear-x {
    position: fixed;
    transform: translateY(-50%);
    display: none;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 16px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    z-index: 3;
}
.sm-clear-x:hover { color: var(--bs-body-color); background: var(--bs-tertiary-bg); }
input:focus + .sm-clear-x.has-text,
input:hover + .sm-clear-x.has-text,
.sm-clear-x.has-text:hover { display: block; }

/* ── sm-typeahead ────────────────────────────────────────────────────────── */
.sm-typeahead .sm-ta-menu {
    padding: .25rem 0;
    max-height: 320px;
    overflow-y: auto;
}

.sm-typeahead .sm-ta-row {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    font-size: .85rem;
    padding: .3rem .75rem;
    cursor: pointer;
}

/* Keyboard and mouse highlight look identical, and hovering moves the keyboard
   position too, so there is only ever one highlighted row. It has to be obvious:
   a tertiary-grey tint is invisible against the menu background. */
.sm-typeahead .sm-ta-row.active,
.sm-typeahead .sm-ta-row:hover {
    background: var(--ct-primary-bg-subtle);
    box-shadow: inset 4px 0 0 var(--ct-primary);
    color: var(--ct-primary-text-emphasis);
}

.sm-typeahead .sm-ta-tag {
    min-width: 34px;
    font-size: .72rem;
    color: var(--ct-secondary-color);
}

.sm-typeahead .sm-ta-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.sm-typeahead .sm-ta-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hierarchy context, e.g. "Germany › Bavaria" */
.sm-typeahead .sm-ta-path {
    font-size: .72rem;
    color: var(--ct-secondary-color);
}

.sm-typeahead .sm-ta-clear {
    font-size: .8rem;
    padding: .3rem .75rem;
}

/* "+ Add supplier": the way out when the list does not hold what is needed, set apart from the matches. */
.sm-typeahead .sm-ta-add {
    border-top: 1px solid var(--ct-border-color);
    color: var(--ct-primary);
    gap: .5rem;
    align-items: baseline;
}

.sm-typeahead .sm-ta-add-label {
    font-weight: 500;
    white-space: nowrap;
}

/* The logo, bigger than the theme ships it.

   Adminto sets --ct-logo-lg-height: 22px, which left the mark looking lost in a 245px sidebar. What limits
   it is the sidebar's width, never its height: 245px less the .logo padding of 22px each side is 201px. So
   the mark puts "Pro" on a second line — 220x70 rather than 300x52 — and the same 200px then buys a mark
   more than twice as tall. At 58px it renders about 182 wide, with room still to spare.

   Only the wide mark grows: below 245px the theme swaps to .logo-sm, which is square and already right. */
:root {
    --ct-logo-lg-height: 58px;
}

/* The mark on a page that is not the sidebar (Partials/_BrandMark): both files are in the markup and the
   one that suits the background is shown. A single file was dark ink on a dark theme — invisible. */
.brand-mark .on-dark { display: none; }
[data-bs-theme="dark"] .brand-mark .on-light { display: none; }
[data-bs-theme="dark"] .brand-mark .on-dark { display: inline; }

/* A row that opens what it names (row-link.js): the whole row is the link, so it points like one. */
tr[data-href] { cursor: pointer; }

/* Date boxes typed as dd/mm/yyyy (date-field.js): the browser's own box kept out of sight but drawn, so its calendar
   still opens; the icon at the text box's right end opens it. */
.sm-date-native { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.sm-date {
    padding-right: 1.9rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238a969c'%3E%3Cpath d='M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1h2zm11 10H4v8h16v-8zM7 5H4v4h16V5h-3v2h-2V5H9v2H7V5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .55rem center;
    background-size: 14px;
}
.sm-date.is-invalid { background-image: none; }

/* A product's name on Current Stock opens its page: a link that still reads as the row's name, underlined on pointing. */
a.stock-product { text-decoration: none; }
a.stock-product:hover, a.stock-product:focus-visible { text-decoration: underline; color: var(--bs-link-color) !important; }

/* To do's dot in the menu (docs/BRING_AGAIN_PLAN.md BA-C): red when something is urgent, amber for the rest — no number. */
.todo-dot { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; margin-left: auto; border-radius: 50%; }
.todo-dot.d-none { display: none !important; }

/* Where a catalogue picture comes from (docs/PICTURE_ORIGINS_PLAN.md PO3): red for a reference picture (MICHEL's, never
   out), yellow for an official one (the post's), the plain border for your own and the not said. */
.sm-pic { border: 1px solid var(--ct-border-color); }
/* Drawn inside the picture, so a card or a tile keeps its size wherever it is shown — Entry, Browse, the catalogue panel. */
.sm-pic-official { outline: 2px solid var(--ct-warning); outline-offset: -2px; }
.sm-pic-reference { outline: 2px solid var(--ct-danger); outline-offset: -2px; }
/* The kinds on a thumbnail, there only while it is pointed at (PO8): a click marks it, the lit one again unmarks it. */
.sm-pic-kinds { position: absolute; left: 0; right: 0; bottom: 3px; display: none; gap: 2px; justify-content: center; }
.sm-group-image:hover .sm-pic-kinds, .sm-img-card:hover .sm-pic-kinds, .sm-pic-kinds:focus-within { display: flex; }
.sm-pic-kinds button {
    width: 16px; height: 16px; padding: 0; border-radius: 3px; font-size: 10px; line-height: 1;
    border: 1px solid var(--ct-border-color); background: var(--ct-secondary-bg); color: var(--ct-body-color);
}
.sm-pic-kinds button[data-kind="official"] { border-color: var(--ct-warning); }
.sm-pic-kinds button[data-kind="reference"] { border-color: var(--ct-danger); }
.sm-pic-kinds button.is-on { background: var(--ct-primary); border-color: var(--ct-primary); color: #fff; }

/* A document's file box takes files dropped on it (js/file-drop.js): every box shown while files are dragged over the
   window, the one under the pointer marked. */
[data-file-drop] { border-radius: 6px; outline: 2px dashed transparent; outline-offset: 4px; transition: outline-color .1s, background-color .1s; }
.file-dragging [data-file-drop] { outline-color: var(--ct-border-color); }
.file-dragging [data-file-drop].file-drop-over { outline-color: var(--ct-primary); background-color: rgba(var(--ct-primary-rgb), .08); }
