/* Validation UI - minimal overrides */

nav ul {
    margin-bottom: 0;
}

.login-container {
    max-width: 400px;
    margin: 10% auto;
}

details {
    margin-bottom: 1rem;
}

details summary {
    cursor: pointer;
    font-weight: 600;
}

details[open] summary {
    margin-bottom: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.form-actions .delete-btn {
    margin-left: auto;
}

/* HTMX request indicator: hidden until htmx adds `.htmx-request`, then shown
   inline. Overrides htmx's default opacity toggle so the marker reserves no
   space while idle. */
.htmx-indicator {
    display: none;
    align-items: center;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-flex;
}

/* Clickable Event ID / User ID cells copy their value into the search form. */
.fill-search {
    cursor: pointer;
}

.fill-search:hover {
    text-decoration: underline;
}

/* Audit stage details: wrap long payloads and keep the copy button anchored
   to the top-right of the (pretty-printed JSON) block. */
.audit-data-wrap {
    position: relative;
}

.audit-data-wrap .copy-detail {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: auto;
    padding: 0.1rem 0.6rem;
    margin: 0;
    font-size: 0.75rem;
}

pre.audit-data {
    white-space: pre-wrap;
    word-break: break-word;
}

table td input,
table td select {
    margin-bottom: 0;
}

/* Searchable select ("combobox"): a text input with a filterable dropdown of
   options, used for the audit-log app-code picker. Behaves like a <select>
   (all options visible on focus) but filters by substring as you type. */
.combobox {
    position: relative;
}

.combobox input {
    margin-bottom: 0;
}

.combobox-list {
    position: absolute;
    z-index: 10;
    left: 0;
    right: 0;
    top: 100%;
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
    max-height: 16rem;
    overflow-y: auto;
    background: var(--pico-form-element-background-color);
    border: var(--pico-border-width) solid var(--pico-form-element-border-color);
    border-radius: var(--pico-border-radius);
    box-shadow: var(--pico-card-box-shadow);
}

.combobox-list li {
    padding: 0.4rem 0.75rem;
    cursor: pointer;
}

.combobox-list li:hover {
    background: var(--pico-primary-focus);
}

/* Keyboard-active option: solid contrast so it's clearly visible while
   navigating with arrow keys (--pico-primary-focus alone is too faint). */
.combobox-list li.active {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
}

.flash-success {
    color: var(--pico-ins-color);
    background-color: var(--pico-form-element-valid-active-border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 1rem;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.inline-form input {
    margin-bottom: 0;
}

.inline-form button {
    width: auto;
    flex-shrink: 0;
    margin-bottom: 0;
}

/* Layout widths.
   Pages use Pico's `.container-fluid` (full-width) so dense data tables get
   the whole viewport. Modals, however, stay bounded: Pico caps them at
   510px/700px, which is too narrow for the event timeline, so we widen the
   modal to a viewport-relative max that still never overflows the screen. */
dialog > article {
    max-width: min(1200px, 92vw);
}
