/*
 * Utilities used by Kilivi pages that the prebuilt tailadmin.css does not contain (it is compiled
 * once from the template, not from our markup, so an unknown Tailwind class simply has no effect).
 * Same names and values as Tailwind v4, colours from tailadmin's own tokens. Add a class here when
 * a page uses one that tailadmin.css lacks.
 */
.w-20 { width: 5rem; }
.h-2\.5 { height: 0.625rem; }
.pl-5 { padding-left: 1.25rem; }
.gap-x-5 { column-gap: 1.25rem; }
.gap-y-1 { row-gap: 0.25rem; }
.space-y-0\.5 > :not(:last-child) { margin-bottom: 0.125rem; }
.rounded-sm { border-radius: 0.25rem; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.list-disc { list-style-type: disc; }
.underline { text-decoration-line: underline; }
.divide-y > :not(:last-child) { border-bottom-width: 1px; border-bottom-style: solid; }
.divide-gray-100 > :not(:last-child) { border-color: var(--color-gray-100); }
.dark\:divide-gray-800:is(.dark *) > :not(:last-child) { border-color: var(--color-gray-800); }
.bg-gray-400 { background-color: var(--color-gray-400); }
.dark\:bg-gray-600:is(.dark *) { background-color: var(--color-gray-600); }
.text-error-700 { color: #b42318; }
.dark\:text-error-300:is(.dark *) { color: #fda29b; }
.dark\:border-error-800:is(.dark *) { border-color: #912018; }
.dark\:bg-error-900\/20:is(.dark *) { background-color: rgb(122 39 26 / 0.2); }

/* The forms plugin draws the select arrow as a background image on the right and reserves
   2.5rem for it; the px-* utilities on our selects shrank that space, so the arrow sat on the
   text. Keep room for the arrow on every single-choice select. */
select:not([multiple]) {
    padding-right: 2.25rem !important;
    background-position: right 0.6rem center;
}

/* G9 — Debug user and test bracelets. */
.ki-test-badge {
    display: inline-flex; align-items: center; margin-left: 0.375rem; padding: 0.0625rem 0.375rem;
    border-radius: 0.25rem; background-color: #fef0c7; color: #93370d;
    font-size: 0.625rem; font-weight: 700; letter-spacing: 0.05em; line-height: 1rem; vertical-align: middle;
}
.dark .ki-test-badge { background-color: rgb(247 144 9 / 0.15); color: #fec84b; }
/* Raw packet stream: one frame per row, monospace, wraps long frames, selectable for copying. */
.ki-packet-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.75rem; line-height: 1.1rem; white-space: pre-wrap; word-break: break-all; user-select: text;
}
.ki-dir-up { color: #039855; font-weight: 700; }
.ki-dir-down { color: #1570ef; font-weight: 700; }
.ki-readonly-note { font-size: 0.75rem; color: #667085; }

/* Dates and times (Ui.Time): same width whatever the digits. tabular-nums for fonts with proportional
   figures (Outfit), no kerning for pairs like "11" (Liberation Sans, the fallback when Outfit is not
   loaded, e.g. in the visual tests). Table columns no longer shift as the clock or the day changes. */
.ki-time { font-variant-numeric: tabular-nums; font-kerning: none; }
/* Build version at the bottom of the sidebar (G12). A fixed-size box: the visual tests mask it, and
   a new version or commit must not move anything else. */
.ki-version {
    margin-top: auto; flex-shrink: 0; box-sizing: border-box; width: 100%; height: 3rem; padding: 1rem 0;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    font-size: 0.75rem; line-height: 1rem; color: #98a2b3;
    font-variant-numeric: tabular-nums; font-kerning: none;
}

/* G11 — date, month, time and number fields in the user's format (Components/Shared/Fields).
   A text box plus, for dates and months, a 📅 button that opens the browser's calendar on a hidden
   native input: the value shown is always the user's format. */
.ki-field { position: relative; display: inline-flex; align-items: center; }
.ki-field:has(> .w-full) { display: flex; width: 100%; }
.ki-field > input[type="text"] { width: 9.5rem; padding-right: 2.25rem; font-variant-numeric: tabular-nums; font-kerning: none; }
.ki-field > input[type="text"].w-full { width: 100%; }
.ki-field-btn {
    position: absolute; right: 0.375rem; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem;
    border-radius: 0.375rem; font-size: 0.875rem; line-height: 1; opacity: 0.7;
}
.ki-field-btn:hover { opacity: 1; background-color: var(--color-gray-100); }
.ki-field-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.ki-picker { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.ki-time-input:not(.w-full) { width: 5.5rem; }
.ki-time-input { font-variant-numeric: tabular-nums; font-kerning: none; }
input.ki-invalid, input.ki-invalid:focus { border-color: var(--color-error-500); }

/* G14 — safe zone names on the map (Leaflet tooltip, no arrow). */
.leaflet-tooltip.kilivi-zone-label {
    padding: 0.125rem 0.375rem; border: 0; border-radius: 0.25rem; box-shadow: none;
    background: rgb(255 255 255 / 0.85); color: #1d2939; font-size: 0.6875rem; font-weight: 600;
}
.leaflet-tooltip.kilivi-zone-label::before { display: none; }
