/*
 * Kenie - folha de estilo do painel.
 *
 * Tema unico, escuro. Sem tema claro e sem alternador, de proposito.
 * Nada externo: fontes do sistema, icones em icons.css (mascara SVG).
 *
 * Indice
 *   1. Tokens            6. Tabelas           11. Caixa de resultado, log, segredo
 *   2. Base              7. Filtro/paginacao  12. Modal, aviso flutuante, carregando
 *   3. Casca             8. Formularios       13. Dashboard
 *   4. Cabecalho de pag. 9. Cartoes e listas  14. Login
 *   5. Botoes           10. Selos e alertas   15. Utilitarios e telas pequenas
 *
 * Classes com comportamento em assets/js/app.js (nao renomear): nav-link,
 * custom-select*, modal-overlay/modal-box, notification*, loading-overlay,
 * select-all/row-select, data-table, pagination-*, form-input/form-select/
 * form-textarea, field-error, invalid, hidden, btn-action, btn-delete,
 * btn-reload, btn-modal-close, btn-group-toggle, error-template.
 */

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
    /* Sem isso os controles nativos (date, number, file, barra de rolagem)
       saem no tema claro do SO por cima do fundo escuro. */
    color-scheme: dark;

    --bg: #0b0e13;
    --surface: #12161d;
    --surface-2: #181d26;
    --surface-3: #202734;
    --border: #232a36;
    --border-strong: #333d4d;

    --text: #e7eaf0;
    --text-2: #a5afbf;
    --text-3: #717c8f;

    --accent: #6aa5ff;
    --accent-fill: #2d6fe4;
    --accent-fill-hover: #3c7df0;
    --accent-soft: rgba(106, 165, 255, 0.13);
    --focus-ring: rgba(106, 165, 255, 0.45);

    --ok: #3fca8b;
    --ok-soft: rgba(63, 202, 139, 0.12);
    --warn: #e2b23f;
    --warn-soft: rgba(226, 178, 63, 0.12);
    --danger: #f26a63;
    --danger-fill: #c9403a;
    --danger-fill-hover: #d94f48;
    --danger-soft: rgba(242, 106, 99, 0.12);
    --info: var(--accent);
    --info-soft: var(--accent-soft);
    --neutral-soft: rgba(165, 175, 191, 0.1);

    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --sidebar-width: 232px;
    --sidebar-collapsed: 64px;
    --header-height: 52px;

    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
    --ease: 0.15s ease;

    /* Nomes antigos (herdados do Kargo), mantidos para estilo inline de view. */
    --bg-primary: var(--bg);
    --bg-secondary: var(--surface);
    --bg-tertiary: var(--surface-2);
    --bg-hover: var(--surface-3);
    --text-primary: var(--text);
    --text-secondary: var(--text-2);
    --text-muted: var(--text-3);
    --border-primary: var(--border);
    --border-secondary: var(--border);
    --accent-primary: var(--accent);
    --accent-secondary: var(--ok);
    --accent-warning: var(--warn);
    --accent-danger: var(--danger);
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

h2 { font-size: 1.43rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.93rem; }

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

p { color: var(--text-2); }

small {
    font-size: 0.86rem;
    color: var(--text-3);
}

strong { font-weight: 600; color: var(--text); }

code, kbd, pre, .mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

code {
    padding: 0.1em 0.38em;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--text);
    overflow-wrap: anywhere;
}

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

::selection { background: rgba(106, 165, 255, 0.35); }

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.hidden { display: none !important; }
[hidden] { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ==========================================================================
   3. Casca: barra lateral, cabecalho, area de conteudo
   ========================================================================== */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    transition: width var(--ease), transform 0.2s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    height: var(--header-height);
    padding: 0 16px;
    flex: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    font-size: 1.07rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    flex: none;
    width: 28px;
    height: 28px;
}

.brand-name { white-space: nowrap; }

.sidebar-nav {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
}

/* Rotulo de grupo no menu: <li class="nav-section">Administração</li> */
.nav-section {
    padding: 16px 10px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    color: var(--text-2);
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--ease), color var(--ease);
}

.nav-link i { font-size: 1.14rem; color: var(--text-3); transition: color var(--ease); }

.nav-link:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}

.nav-link.active {
    background: var(--surface-3);
    color: var(--text);
}

.nav-link.active i { color: var(--accent); }

.sidebar-footer {
    flex: none;
    padding: 12px 20px;
    font-size: 0.79rem;
    line-height: 1.4;
    color: var(--text-3);
}

.main-wrapper {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--ease);
}

.header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--header-height);
    padding: 0 20px;
    background: rgba(11, 14, 19, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header .menu-toggle { display: none; }

.main-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 32px 56px;
}

.sidebar-backdrop { display: none; }

/* Barra lateral recolhida (so' em tela larga; ver a secao 15 para a estreita) */
@media (min-width: 901px) {
    .sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
    .sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-collapsed); }
    .sidebar-collapsed .sidebar-header { padding: 0; justify-content: center; }
    .sidebar-collapsed .brand-name,
    .sidebar-collapsed .nav-link span,
    .sidebar-collapsed .sidebar-footer { display: none; }
    .sidebar-collapsed .nav-link { justify-content: center; padding: 0; }
    .sidebar-collapsed .nav-section {
        height: 1px;
        margin: 10px 8px;
        padding: 0;
        background: var(--border);
        color: transparent;
    }
}

.welcome-message,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 56px 20px;
    text-align: center;
    color: var(--text-3);
}

.empty-state {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}

.empty-state i { font-size: 1.7rem; margin-bottom: 6px; }
.empty-state h3 { color: var(--text); }
.welcome-message p { color: var(--text-3); }

.error-template {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 20px;
    border: 1px solid rgba(242, 106, 99, 0.35);
    border-radius: var(--radius-lg);
    background: var(--danger-soft);
}

/* ==========================================================================
   4. Cabecalho de pagina e de secao
   ========================================================================== */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 22px;
}

.page-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    min-width: 0;
    min-height: 34px;
}

.page-header h2 { overflow-wrap: anywhere; }

/* Linha de apoio abaixo do titulo: <p class="page-subtitle"> dentro de .page-title */
.page-subtitle {
    flex-basis: 100%;
    color: var(--text-3);
}

.page-actions,
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.action-buttons { gap: 4px; flex-wrap: nowrap; }

.section { margin-top: 32px; }

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 32px 0 12px;
}

.section > .section-header:first-child { margin-top: 0; }

.section-header p {
    flex-basis: 100%;
    font-size: 0.93rem;
    color: var(--text-3);
}

/* Barra de acoes da instancia: principais a esquerda, destrutiva a direita */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.toolbar-spacer { flex: 1; }

/* ==========================================================================
   5. Botoes
   .btn e .btn-action sao a mesma coisa (o segundo e' o nome que o app.js
   conhece para <a data-url>). Variante: -primary, -secondary, -danger,
   -ghost. Tamanho: -sm. So' icone: .btn-icon (use title + aria-label).
   ========================================================================== */
.btn,
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 34px;
    padding: 0 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.btn:hover,
.btn-action:hover {
    background: var(--surface-3);
    border-color: #435066;
    text-decoration: none;
}

.btn:active,
.btn-action:active { transform: translateY(0.5px); }

.btn i,
.btn-action i { color: var(--text-2); }

.btn-primary {
    background: var(--accent-fill);
    border-color: transparent;
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-fill-hover);
    border-color: transparent;
}

.btn-danger {
    background: var(--danger-fill);
    border-color: transparent;
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-fill-hover);
    border-color: transparent;
}

.btn-primary i,
.btn-danger i { color: inherit; }

/* Destrutivo discreto: contorno vermelho, preenche so' no hover */
.btn-danger-outline {
    background: transparent;
    border-color: rgba(242, 106, 99, 0.4);
    color: var(--danger);
}

.btn-danger-outline i { color: inherit; }

.btn-danger-outline:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-2);
}

.btn-ghost:hover {
    background: var(--surface-3);
    border-color: transparent;
    color: var(--text);
}

.btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 0.89rem;
    border-radius: 6px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
}

.btn-icon i { font-size: 1.07rem; }
.btn-icon:hover i { color: var(--text); }

.btn-block { width: 100%; }

.btn:disabled,
.btn[aria-disabled="true"],
.btn-action[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

/* ==========================================================================
   6. Tabelas
   <div class="table-container"><div class="table-wrapper">
     <table class="data-table"> ... </table>
   </div></div>
   ========================================================================== */
.table-container {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
}

.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
    padding: 11px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.data-table thead th {
    padding-top: 9px;
    padding-bottom: 9px;
    background: var(--surface-2);
    color: var(--text-3);
    font-size: 0.79rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr { transition: background var(--ease); }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }

/* Linha em destaque (ex.: usuario desativado: .row-muted) */
.data-table tr.row-muted td { color: var(--text-3); }

.data-table-compact th,
.data-table-compact td { padding: 7px 12px; }

/* Celula com duas linhas: nome em cima, detalhe embaixo */
.cell-main { display: block; font-weight: 550; color: var(--text); }
.cell-sub { display: block; font-size: 0.86rem; color: var(--text-3); }

.col-check { width: 1%; padding-right: 0 !important; }
.col-actions { width: 1%; white-space: nowrap; text-align: right !important; }
.col-actions .action-buttons { justify-content: flex-end; }
/* Linha com varios formularios (usuarios): quebra em vez de estourar. */
.col-actions .action-buttons-wrap { flex-wrap: wrap; white-space: normal; min-width: 260px; }
.col-num { text-align: right !important; }

/* Formulario dentro de celula (trocar papel, redefinir senha...) */
.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inline-form .form-input,
.inline-form .form-select,
.inline-form .custom-select { width: auto; min-width: 140px; }

/* Cabecalho de grupo recolhivel (herdado; app.js: .btn-group-toggle) */
.group-header-row td { background: var(--surface-2); }

.btn-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: none;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-group-toggle i { transition: transform var(--ease); }
.btn-group-toggle.collapsed i { transform: rotate(-90deg); }
.group-count { color: var(--text-3); font-weight: 400; }

/* ==========================================================================
   7. Barra de filtro e paginacao
   ========================================================================== */
/*
 * <form class="filter-bar" data-target="main-content" data-url="/jobs" method="get">
 *   <div class="form-group"> label + campo </div> ...
 *   <div class="filter-actions"> botoes </div>
 * </form>
 */
.filter-bar,
.table-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.filter-bar .form-group {
    flex: 1 1 160px;
    max-width: 260px;
    margin: 0;
}

.filter-bar .form-group-grow { max-width: none; flex-grow: 3; }

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/*
 * Paginacao feita no servidor (links): .pager
 *   <nav class="pager">
 *     <span class="pager-info">1–25 de 312</span>
 *     <div class="pager-links">
 *       <a class="pager-link disabled">‹</a> <a class="pager-link active">1</a> ...
 *     </div>
 *   </nav>
 * Dentro de .table-container vira rodape da tabela.
 *
 * Paginacao feita no navegador pelo app.js: .table-pagination, que EXIGE
 * .pagination-info com #pagination-from/-to/-total e #pagination-numbers.
 * Nao use .pagination-info numa pagina paginada pelo servidor.
 */
.pager,
.table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-top: 14px;
}

.table-container > .pager,
.table-container > .table-pagination {
    margin: 0;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}

.pager-info,
.pagination-info {
    font-size: 0.93rem;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.pager-links,
.pagination-controls,
.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pager-link,
.pagination-controls .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-2);
    font-size: 0.93rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.pager-link:hover,
.pagination-controls .btn:hover {
    background: var(--surface-3);
    color: var(--text);
    text-decoration: none;
}

.pager-link.active,
.pagination-controls .btn-primary {
    background: var(--accent-soft);
    border-color: rgba(106, 165, 255, 0.35);
    color: var(--accent);
    font-weight: 600;
}

.pager-link.disabled,
.pagination-controls .btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.pager-gap { padding: 0 4px; color: var(--text-3); }

/* ==========================================================================
   8. Formularios
   ========================================================================== */
/* Moldura opcional em volta de um formulario */
.form-container {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.form { max-width: 920px; }
.form-container > .form,
.modal-box .form,
.form.form-wide { max-width: none; }

/* Grade de campos: 2 colunas que viram 1 em tela estreita. -3 = ate' 3. */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 18px 20px;
}

.form-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-grid .form-group { margin-bottom: 0; }
.form-group-full { grid-column: 1 / -1; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin-bottom: 18px;
}

.form-label {
    font-size: 0.93rem;
    font-weight: 550;
    color: var(--text);
}

.form-label .optional { font-weight: 400; color: var(--text-3); }

.form-hint,
.form-group > small {
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-3);
}

.form-input,
.form-select,
.form-textarea,
.filter-select {
    width: 100%;
    height: 36px;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    transition: border-color var(--ease), box-shadow var(--ease);
}

.form-textarea {
    height: auto;
    min-height: 96px;
    padding: 9px 11px;
    line-height: 1.5;
    resize: vertical;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover { border-color: #46536a; }

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.filter-select:focus,
.custom-select.open .custom-select-toggle {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-3); opacity: 0.75; }

.form-input:disabled,
.form-input[readonly],
.form-textarea:disabled {
    background: var(--surface-2);
    color: var(--text-2);
}

.form-input:disabled { cursor: not-allowed; opacity: 0.7; }

.form-input.invalid,
.form-select.invalid,
.form-textarea.invalid { border-color: var(--danger); }

.form-input.invalid:focus { box-shadow: 0 0 0 3px var(--danger-soft); }

.field-error {
    font-size: 0.86rem;
    color: var(--danger);
}

.form-input-sm,
.inline-form .form-input,
.inline-form .form-select {
    height: 30px;
    padding: 0 9px;
    font-size: 0.93rem;
    border-radius: 6px;
}

input[type="number"].form-input { font-variant-numeric: tabular-nums; }

/* <input type="file" class="form-input"> */
input[type="file"].form-input {
    padding: 0 11px 0 0;
    line-height: 34px;
    color: var(--text-2);
    cursor: pointer;
    overflow: hidden;
}

input[type="file"].form-input::file-selector-button {
    height: 34px;
    margin-right: 11px;
    padding: 0 12px;
    border: 0;
    border-right: 1px solid var(--border-strong);
    background: var(--surface-3);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

/* Caixa de marcar e radio: qualquer checkbox do painel ja' sai assim */
input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    display: inline-grid;
    place-content: center;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1px solid #4a566b;
    border-radius: 4px;
    background: var(--bg);
    vertical-align: -3px;
    cursor: pointer;
    transition: background var(--ease), border-color var(--ease);
}

input[type="radio"] { border-radius: 50%; }

input[type="checkbox"]:hover,
input[type="radio"]:hover { border-color: var(--accent); }

input[type="checkbox"]:checked,
input[type="checkbox"]:indeterminate,
input[type="radio"]:checked {
    background: var(--accent-fill);
    border-color: var(--accent-fill);
}

input[type="checkbox"]:checked::after {
    content: "";
    width: 10px;
    height: 10px;
    background: #fff;
    clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 26%, 86% 13%, 37% 71%);
}

input[type="checkbox"]:indeterminate::after {
    content: "";
    width: 8px;
    height: 2px;
    background: #fff;
}

input[type="radio"]:checked::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled { opacity: 0.45; cursor: not-allowed; }

/* <label class="form-check"><input type="checkbox"> <span>Texto <small>apoio em outra linha</small></span></label> */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--text);
    cursor: pointer;
}

.form-check input { margin-top: 2.5px; }
.form-check small { display: block; }

.form-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
}

.form-actions-end { justify-content: flex-end; }

/* Lista suspensa propria (app.js: CustomSelectManager) */
.custom-select { position: relative; }

.custom-select-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    cursor: pointer;
}

.custom-select-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.custom-select-toggle i {
    color: var(--text-3);
    transition: transform var(--ease);
}

.custom-select.open .custom-select-toggle i { transform: rotate(180deg); }

.custom-select-menu {
    position: absolute;
    z-index: 50;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-height: 260px;
    padding: 4px;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    box-shadow: var(--shadow-pop);
}

.custom-select-option {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    cursor: pointer;
}

.custom-select-option:hover {
    background: var(--surface-3);
    color: var(--text);
}

.custom-select-option.active {
    background: var(--accent-soft);
    color: var(--text);
}

select.form-select { cursor: pointer; }

/* ==========================================================================
   9. Cartoes, chave-valor, listas, medidor
   ========================================================================== */
/*
 * <div class="card">
 *   <div class="card-header"><h3>Título</h3> <span class="badge badge-ok">ok</span></div>
 *   <div class="card-body"> ... </div>
 *   <div class="card-footer"> ... </div>
 * </div>
 * Varios lado a lado: <div class="card-grid"> (ou .card-grid-2 para pares).
 */
.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.card-header h3 i { color: var(--text-3); }
.card-body { flex: 1; padding: 16px 18px; }
.card-body > * + * { margin-top: 12px; }

.card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: 0.93rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: 16px;
}

.card-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 16px;
    align-items: start;
}

/*
 * Chave-valor: <dl class="kv-list"><dt>Hostname</dt><dd>acme.exemplo</dd>...</dl>
 * .kv-list-stacked poe o rotulo acima do valor (cartao estreito).
 */
.kv-list {
    display: grid;
    grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
    gap: 9px 20px;
}

.kv-list dt { color: var(--text-3); }

.kv-list dd {
    min-width: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.kv-list-stacked { grid-template-columns: 1fr; gap: 0; }
.kv-list-stacked dt { font-size: 0.86rem; }
.kv-list-stacked dd { margin-bottom: 10px; }
.kv-list-stacked dd:last-child { margin-bottom: 0; }

/*
 * Lista de itens (backups, arquivos):
 * <ul class="item-list">
 *   <li class="item">
 *     <i class="icon-archive"></i>
 *     <div class="item-main"><span class="item-title">acme-2026-11-29.gz</span>
 *                            <span class="item-meta">29/11/2026 03:00 · 48 MB</span></div>
 *     <div class="item-actions"> botoes </div>
 *   </li>
 * </ul>
 */
.item-list {
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.card .item-list { border: 0; background: none; }

.item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
}

.item:last-child { border-bottom: 0; }
.item > i { color: var(--text-3); font-size: 1.14rem; }
.item-main { flex: 1; min-width: 0; }

.item-title {
    display: block;
    font-weight: 550;
    overflow-wrap: anywhere;
}

.item-meta {
    display: block;
    font-size: 0.86rem;
    color: var(--text-3);
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/*
 * Medidor (uso de disco, memoria):
 * <div class="meter" role="meter" aria-valuenow="72" aria-valuemin="0" aria-valuemax="100">
 *   <div class="meter-fill meter-warn" style="width: 72%"></div>
 * </div>
 * Sem modificador = cor de destaque; -ok, -warn, -danger para estado.
 */
.meter {
    height: 6px;
    border-radius: 3px;
    background: var(--surface-3);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
}

.meter-ok { background: var(--ok); }
.meter-warn { background: var(--warn); }
.meter-danger { background: var(--danger); }

.meter-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    font-size: 0.86rem;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.meter-label strong { font-weight: 550; }

/* ==========================================================================
   10. Selos (badge/status) e alertas
   ========================================================================== */
/*
 * <span class="badge badge-ok">ativo</span>     -ok -warn -danger -info -neutral
 * <span class="badge badge-ok badge-dot">ativo</span>   com bolinha de estado
 * .status status-<x> e' o mesmo selo com bolinha, com os nomes que as views
 * ja' usam: active, inactive, running, pending, waiting, completed, failed,
 * cancelled.
 */
.badge,
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px;
    border-radius: 11px;
    background: var(--neutral-soft);
    color: var(--text-2);
    font-size: 0.82rem;
    font-weight: 550;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.badge-dot::before,
.status::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.badge-ok,
.status-active,
.status-completed { background: var(--ok-soft); color: var(--ok); }

.badge-warn,
.status-pending,
.status-waiting { background: var(--warn-soft); color: var(--warn); }

.badge-danger,
.status-failed { background: var(--danger-soft); color: var(--danger); }

.badge-info,
.status-running { background: var(--info-soft); color: var(--info); }

.badge-neutral,
.status-inactive,
.status-cancelled { background: var(--neutral-soft); color: var(--text-2); }

/* Parado/cancelado: bolinha vazada, para nao depender so' da cor */
.status-inactive::before,
.status-cancelled::before {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px currentColor;
}

.status-running::before { animation: pulse 1.4s ease-in-out infinite; }

/* Papel do usuario */
.badge-admin { background: var(--accent-soft); color: var(--accent); }
.badge-operador { background: var(--neutral-soft); color: var(--text-2); }

.badge-group {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 5px;
}

/*
 * <div class="alert alert-info">texto</div>   -info -success -warning -error
 * O icone vem sozinho, pelo tipo.
 */
.alert {
    position: relative;
    margin-bottom: 18px;
    padding: 11px 14px 11px 42px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-2);
    line-height: 1.55;
}

.alert::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 14px;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--alert-icon) center / contain no-repeat;
    mask: var(--alert-icon) center / contain no-repeat;
}

.alert,
.alert-info {
    --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

.alert-success {
    --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8.5 12.5l2.5 2.5 4.5-5'/%3E%3C/svg%3E");
}

.alert-warning,
.alert-error {
    --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.alert-info { border-color: rgba(106, 165, 255, 0.3); background: var(--info-soft); }
.alert-info::before { color: var(--info); }
.alert-success { border-color: rgba(63, 202, 139, 0.3); background: var(--ok-soft); }
.alert-success::before { color: var(--ok); }
.alert-warning { border-color: rgba(226, 178, 63, 0.3); background: var(--warn-soft); }
.alert-warning::before { color: var(--warn); }
.alert-error { border-color: rgba(242, 106, 99, 0.35); background: var(--danger-soft); }
.alert-error::before { color: var(--danger); }

.alert strong { color: var(--text); }
.alert code { background: rgba(255, 255, 255, 0.08); }

/* ==========================================================================
   11. Caixa de resultado, log, credencial de uso unico
   ========================================================================== */
/* Resultado de job/lote, recarregado sozinho enquanto data-poll-active="1" */
.result-box {
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.result-box > * + * { margin-top: 12px; }

.result-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
}

/* "Em andamento" com bolinha pulsando */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
}

.live-indicator::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/*
 * Barra de progresso em segmentos (lote, dashboard):
 * <div class="progress-bar">
 *   <span class="progress-seg seg-ok" style="flex-grow: 3" title="..."></span> ...
 * </div>
 * flex-grow recebe a contagem crua; nao precisa calcular porcentagem.
 */
.progress-bar {
    display: flex;
    gap: 2px;
    height: 8px;
    border-radius: 4px;
    background: var(--surface-3);
    overflow: hidden;
}

.progress-bar-lg { height: 12px; border-radius: 6px; }

.progress-seg {
    flex: 0 0 0;
    min-width: 0;
    background: var(--border-strong);
    transition: flex-grow 0.4s ease;
}

.seg-ok { background: var(--ok); }
.seg-warn { background: var(--warn); }
.seg-danger { background: var(--danger); }
.seg-info { background: var(--accent); }
.seg-neutral { background: #56627a; }

/* Legenda de contagens: bolinha + rotulo + numero */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    list-style: none;
    font-size: 0.93rem;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-item strong { font-weight: 600; }

.legend-dot {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--border-strong);
}

.legend-dot.seg-ok { background: var(--ok); }
.legend-dot.seg-warn { background: var(--warn); }
.legend-dot.seg-danger { background: var(--danger); }
.legend-dot.seg-info { background: var(--accent); }
.legend-dot.seg-neutral { background: #56627a; }

/*
 * Log: <pre class="log-box">...</pre>   (.log-box-tall para o visualizador)
 * Com barra de titulo: ponha dentro de .card, logo apos .card-header.
 */
.log-box {
    max-height: 320px;
    padding: 12px 14px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #080a0e;
    color: #c4ccd9;
    font-family: var(--font-mono);
    font-size: 0.86rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 4;
}

.log-box-tall { max-height: min(70vh, 720px); }
.log-box-nowrap { white-space: pre; overflow-wrap: normal; }

.card > .log-box {
    border: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/*
 * Credencial mostrada uma unica vez:
 * <div class="secret-box">
 *   <div class="secret-box-title"><i class="icon-key"></i> Guarde agora: não será mostrado de novo</div>
 *   <dl class="kv-list">
 *     <dt>URL</dt><dd><code class="secret-value">https://acme.exemplo/</code></dd>
 *     <dt>Senha</dt><dd><code class="secret-value">x7Kq...</code></dd>
 *   </dl>
 * </div>
 * .secret-value seleciona o valor inteiro com um clique.
 */
.secret-box {
    padding: 16px 18px;
    border: 1px solid rgba(226, 178, 63, 0.45);
    border-radius: var(--radius-lg);
    background: var(--warn-soft);
}

.secret-box > * + * { margin-top: 12px; }

.secret-box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
}

.secret-box-title i { color: var(--warn); }

.secret-value {
    display: inline-block;
    padding: 4px 9px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    font-size: 0.93rem;
    user-select: all;
    cursor: text;
}

/* ==========================================================================
   12. Modal, aviso flutuante, carregando
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 16px 16px;
    overflow-y: auto;
    background: rgba(4, 6, 9, 0.7);
    backdrop-filter: blur(2px);
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 620px;
    padding: 22px 24px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
}

.modal-box:focus { outline: none; }
.modal-box .page-header { padding-right: 34px; }

.btn-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-3);
    font-size: 1.15rem;
    cursor: pointer;
}

.btn-modal-close:hover { background: var(--surface-3); color: var(--text); }

/* Criado pelo app.js: .notification.notification-{success,error,warning,info} */
.notification {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: min(420px, calc(100vw - 40px));
    padding: 12px 12px 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    color: var(--text);
    box-shadow: var(--shadow-pop);
    animation: toast-in 0.18s ease-out;
}

.notification::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--info);
}

.notification-success::before { background: var(--ok); }
.notification-error::before { background: var(--danger); }
.notification-warning::before { background: var(--warn); }
.notification-error { border-color: rgba(242, 106, 99, 0.45); }
.notification-message { flex: 1; overflow-wrap: anywhere; }

.notification-close {
    flex: none;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--text-3);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.notification-close:hover { background: var(--surface-3); color: var(--text); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(6px); }
}

/*
 * Carregando: nada de tela escurecida. A camada continua cobrindo a pagina
 * enquanto .show (segura clique duplo numa acao POST), mas e' invisivel; o
 * que aparece e' um filete no topo, e so' se a resposta passar de ~150ms.
 * Some no mesmo instante em que .show sai.
 */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    visibility: hidden;
    cursor: progress;
}

.loading-overlay.show { visibility: visible; }

.loading-spinner {
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    overflow: hidden;
    opacity: 0;
}

.loading-overlay.show .loading-spinner {
    opacity: 1;
    transition: opacity 0.1s linear 0.15s;
}

.loading-spinner::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 35%;
    background: var(--accent);
    border-radius: 1px;
}

.loading-overlay.show .loading-spinner::before {
    animation: loading-slide 1s ease-in-out infinite;
}

@keyframes loading-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(290%); }
}

/* ==========================================================================
   13. Dashboard
   ========================================================================== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/*
 * <div class="stat-card">
 *   <div class="stat-label"><span class="legend-dot seg-ok"></span> Ativas</div>
 *   <div class="stat-value">12</div>
 *   <div class="stat-hint">4 serviços de pé</div>
 * </div>
 * O numero fica sempre na cor do texto; o estado vai na bolinha do rotulo.
 */
.stat-card {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 0.93rem;
    font-weight: 500;
}

.stat-value {
    margin-top: 6px;
    font-size: 2.1rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.stat-hint {
    margin-top: 4px;
    font-size: 0.86rem;
    color: var(--text-3);
}

/*
 * Cartao "Saude do servidor" (Dashboard): units do host a esquerda,
 * medidores de carga, memoria e disco a direita; empilha em tela estreita.
 */
.servidor-card { margin-bottom: 16px; }

.servidor-corpo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.card .servidor-servicos { border-right: 1px solid var(--border); border-radius: 0; }
.servidor-servicos .item > .icon-success { color: var(--ok); }
.servidor-servicos .item > .icon-error { color: var(--danger); }
.servidor-servicos code { font-size: 0.93rem; }

.servidor-recursos {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 16px 18px;
}

.servidor-dica {
    margin-top: 5px;
    font-size: 0.82rem;
    color: var(--text-3);
}

@media (max-width: 700px) {
    .card .servidor-servicos { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* ==========================================================================
   14. Login
   ========================================================================== */
.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px 16px;
    background:
        radial-gradient(900px 480px at 50% -10%, rgba(45, 111, 228, 0.14), transparent 70%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 372px;
    padding: 32px 28px 28px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 26px;
    text-align: center;
}

.login-brand .brand-mark {
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
}

.login-brand h1 { font-size: 1.43rem; }
.login-brand p { color: var(--text-3); }
.login-card .alert { margin-bottom: 18px; }
.login-card .form-actions { margin-top: 24px; }
.login-card .btn { height: 38px; }

.login-footer {
    margin-top: 18px;
    font-size: 0.82rem;
    color: var(--text-3);
    text-align: center;
}

/* ==========================================================================
   15. Utilitarios e telas pequenas
   ========================================================================== */
.text-muted { color: var(--text-3) !important; }
.text-secondary { color: var(--text-2) !important; }
.text-ok { color: var(--ok) !important; }
.text-warn { color: var(--warn) !important; }
.text-danger { color: var(--danger) !important; }
.text-right { text-align: right !important; }
.nowrap { white-space: nowrap !important; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 16px !important; }

/* Empilha filhos com espaco regular / poe em linha com quebra */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

@media (max-width: 900px) {
    .sidebar {
        width: min(280px, 84vw);
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.show {
        transform: none;
        box-shadow: var(--shadow-pop);
    }

    .sidebar.show + .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(4, 6, 9, 0.6);
    }

    .main-wrapper { margin-left: 0; }
    .header .sidebar-toggle { display: none; }
    .header .menu-toggle { display: inline-flex; }
    .header { padding: 0 12px; }
    .main-content { padding: 20px 16px 48px; }

    /* Coluna secundaria de tabela, escondida em tela estreita */
    .col-hide-sm { display: none; }
    .badge-group { display: inline-grid; grid-template-columns: repeat(2, max-content); }

    .data-table th,
    .data-table td { padding: 10px 12px; }
}

@media (max-width: 560px) {
    h2 { font-size: 1.29rem; }
    .kv-list { grid-template-columns: 1fr; gap: 0; }
    .kv-list dt { font-size: 0.86rem; }
    .kv-list dd { margin-bottom: 10px; }
    .kv-list dd:last-child { margin-bottom: 0; }
    .filter-bar .form-group { max-width: none; flex-basis: 100%; }
    .filter-actions { margin-left: 0; }
    .toolbar-spacer { display: none; }
    .item { flex-wrap: wrap; }
    .login-card { padding: 28px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .loading-overlay.show .loading-spinner::before { width: 100%; animation: none; }
}
