/* ==========================================================================
   Design system -- minimalista, um único tema (claro).

   Poucas cores: fundo cinza-claro, superfícies brancas, uma cor de destaque
   (a "cor principal" da empresa, ver Configurações) e texto neutro. Tudo sai
   das variáveis abaixo -- para mudar a cara do sistema, mexa só no :root.
   ========================================================================== */

:root {
    /* Marca (--brand-h e --brand-s vêm da cor principal da empresa) */
    --brand-h: 218;
    --brand-s: 100%;
    --brand-l: 16%;
    --brand-hover-l: 24%;
    --accent: #f0b018;   /* dourado da logo */
    --brand: hsl(var(--brand-h) var(--brand-s) var(--brand-l));
    --brand-hover: hsl(var(--brand-h) var(--brand-s) var(--brand-hover-l));
    --brand-soft: hsl(var(--brand-h) 60% 96%);
    --brand-ring: hsl(var(--brand-h) var(--brand-s) var(--brand-l) / 0.3);

    /* Superfícies */
    --bg: hsl(220 20% 97.5%);
    --surface: #ffffff;
    --surface-2: hsl(220 20% 98.5%);
    --sidebar: #ffffff;
    --sidebar-fg: hsl(220 9% 40%);
    --sidebar-fg-strong: hsl(222 28% 14%);

    /* Texto */
    --fg: hsl(222 28% 14%);
    --fg-muted: hsl(220 9% 42%);
    --fg-subtle: hsl(220 9% 56%);

    /* Traços */
    --border: hsl(220 14% 91%);
    --border-strong: hsl(220 14% 84%);

    /* Estados */
    --success: hsl(152 55% 33%);
    --success-soft: hsl(152 50% 95%);
    --danger: hsl(0 68% 48%);
    --danger-soft: hsl(0 80% 97%);
    --warning: hsl(36 90% 40%);
    --warning-soft: hsl(40 90% 95%);
    --info: hsl(205 80% 40%);
    --info-soft: hsl(205 80% 96%);

    /* Forma: cantos suaves, quase nenhuma sombra */
    --radius: 10px;
    --radius-sm: 8px;
    --radius-lg: 12px;
    --shadow-sm: none;
    --shadow: 0 6px 20px -10px hsl(220 30% 10% / 0.18);
    --shadow-lg: 0 16px 40px -16px hsl(220 30% 10% / 0.25);

    --sidebar-w: 236px;
    --topbar-h: 56px;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------------------------------------------------------------- base --- */

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; letter-spacing: -0.011em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Todo icone inline tem 20px por padrão; os blocos abaixo ajustam onde precisa. */
svg { width: 20px; height: 20px; flex-shrink: 0; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

.muted   { color: var(--fg-muted); }
.subtle  { color: var(--fg-subtle); }
.small   { font-size: 0.8125rem; }
.strong  { font-weight: 600; }
.mono    { font-family: var(--mono); }
.right   { text-align: right; }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }

.row { display: flex; gap: .5rem; align-items: center; }
.row-between { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ------------------------------------------------------------- estrutura -- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--sidebar);
    color: var(--sidebar-fg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.1rem 1.25rem;
    color: var(--sidebar-fg-strong);
    font-weight: 650;
    font-size: 1rem;
    letter-spacing: -0.01em;
}
.sidebar__brand:hover { text-decoration: none; }

.sidebar__logo {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--brand);
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: .85rem;
    flex-shrink: 0;
}

.sidebar__tenant {
    margin: 0 .85rem .75rem;
    padding: .6rem .75rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.sidebar__tenant-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sidebar-fg); opacity: .7; }
.sidebar__tenant-name { color: var(--sidebar-fg-strong); font-weight: 600; font-size: .9rem; margin-top: .1rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { padding: .25rem .6rem 1rem; display: flex; flex-direction: column; gap: 1px; }

.nav__section {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
    color: var(--fg-subtle);
    padding: 1.1rem .65rem .35rem;
}

.nav__link {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .65rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-fg);
    font-size: .9rem; font-weight: 500;
    transition: background .12s, color .12s;
}
.nav__link:hover { background: var(--surface-2); color: var(--sidebar-fg-strong); text-decoration: none; }
.nav__link.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav__link svg { width: 18px; height: 18px; flex-shrink: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
}

.content { padding: 1.75rem 1.5rem 3rem; max-width: 1400px; width: 100%; }

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.page-head p { margin: .2rem 0 0; color: var(--fg-muted); font-size: .9rem; }

/* ---------------------------------------------------------------- cards --- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card__head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.card__body { padding: 1.25rem; }
.card__body--flush { padding: 0; }
.card__foot { padding: .85rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat { display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; }
.stat__icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center; flex-shrink: 0;
    background: var(--brand-soft); color: var(--brand);
}
.stat__icon svg { width: 21px; height: 21px; }
.stat__icon--success { background: var(--success-soft); color: var(--success); }
.stat__icon--warning { background: var(--warning-soft); color: var(--warning); }
.stat__value { font-size: 1.6rem; font-weight: 680; line-height: 1.1; letter-spacing: -0.02em; }
.stat__label { font-size: .8rem; color: var(--fg-muted); }

/* ---------------------------------------------------------------- botões -- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .5rem .9rem;
    font: inherit; font-size: .875rem; font-weight: 550;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: var(--surface); color: var(--fg);
    cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); }
.btn--secondary { background: var(--brand-soft); color: var(--brand); }
.btn--secondary:hover { background: hsl(var(--brand-h) 60% 92%); }
.btn--success { background: var(--brand); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--fg); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.93); }
.btn--sm { padding: .32rem .6rem; font-size: .8125rem; }
.btn--icon { padding: .38rem; }
.btn--icon svg { width: 17px; height: 17px; }
.btn--block { width: 100%; }

.btn-group { display: inline-flex; gap: .25rem; }

/* --------------------------------------------------------------- formulário */

.field { margin-bottom: 1.05rem; }
.field:last-child { margin-bottom: 0; }

.label { display: block; font-size: .8125rem; font-weight: 570; margin-bottom: .35rem; color: var(--fg); }
.label .req { color: var(--danger); }

.input, .select, .textarea {
    width: 100%;
    padding: .55rem .7rem;
    font: inherit; font-size: .9rem;
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.input::placeholder { color: var(--fg-subtle); }
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .6rem center; }

.input--error, .select--error { border-color: var(--danger); }
.field__error { display: block; margin-top: .3rem; font-size: .8rem; color: var(--danger); }
.field__hint { display: block; margin-top: .3rem; font-size: .8rem; color: var(--fg-muted); }

.check { display: flex; align-items: flex-start; gap: .6rem; padding: .4rem 0; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: .12rem 0 0; accent-color: var(--brand); flex-shrink: 0; cursor: pointer; }
.check__text { font-size: .875rem; }
.check__desc { display: block; font-size: .78rem; color: var(--fg-muted); }

.search {
    position: relative; display: inline-flex; align-items: center; max-width: 320px; width: 100%;
}
.search svg { position: absolute; left: .65rem; width: 16px; height: 16px; color: var(--fg-subtle); pointer-events: none; }
.search .input { padding-left: 2.1rem; }

fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
legend { padding: 0; font-size: .78rem; font-weight: 640; text-transform: uppercase;
    letter-spacing: .05em; color: var(--fg-muted); margin-bottom: .75rem; }

/* --------------------------------------------------------------- tabelas -- */

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

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
    text-align: left; font-weight: 600; font-size: .76rem;
    text-transform: uppercase; letter-spacing: .04em; color: var(--fg-muted);
    padding: .7rem 1.25rem; border-bottom: 1px solid var(--border); white-space: nowrap;
    background: var(--surface-2);
}
.table td { padding: .8rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table__actions { text-align: right; white-space: nowrap; }

/* Cabeçalho que ordena a coluna */
.th-ordenavel { padding: 0 !important; }
.th-ordenavel a {
    display: block; padding: .7rem 1.25rem;
    color: inherit; font: inherit; text-decoration: none;
}
.th-ordenavel a:hover { color: var(--fg); background: var(--border); text-decoration: none; }
.th-ordenavel.is-active a { color: var(--brand); }

.empty { padding: 3rem 1.5rem; text-align: center; color: var(--fg-muted); }
.empty svg { width: 40px; height: 40px; color: var(--fg-subtle); margin-bottom: .75rem; }
.empty h3 { margin-bottom: .25rem; color: var(--fg); }

/* --------------------------------------------------------------- badges --- */

.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .16rem .55rem; border-radius: 999px;
    font-size: .75rem; font-weight: 570; line-height: 1.5;
    background: var(--surface-2); color: var(--fg-muted); border: 1px solid var(--border);
}
.badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge--warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge--info    { background: var(--info-soft);    color: var(--info);    border-color: transparent; }
.badge--brand   { background: var(--brand-soft);   color: var(--brand);   border-color: transparent; }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------------------------------------------------------- resumo -- */

/* Ficha de leitura: os dados do registro antes de uma ação de confirmação. */
.resumo {
    display: grid; gap: 1rem 2rem; margin: 0 0 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    padding-bottom: 1.25rem; border-bottom: 1px solid var(--border);
}
.resumo dt { font-size: .78rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .04em; }
.resumo dd { margin: .2rem 0 0; }

/* ------------------------------------------------------------------ abas -- */

/* Filtro de uma listagem: "Na portaria / Entregues / Todas". São links de
   verdade (cada aba tem URL), então funcionam com o botão voltar e podem ser
   enviados por mensagem. */
.abas { display: flex; gap: .25rem; flex-wrap: wrap; }
.abas__item {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .8rem; border-radius: var(--radius);
    font-size: .875rem; font-weight: 550; color: var(--fg-muted);
    text-decoration: none; white-space: nowrap;
    transition: background .15s, color .15s;
}
.abas__item:hover { background: var(--surface-2); color: var(--fg); }
.abas__item.is-active { background: var(--brand-soft); color: var(--brand); }

/* --------------------------------------------------------------- alertas -- */

.alert {
    display: flex; align-items: flex-start; gap: .7rem;
    padding: .8rem 1rem; border-radius: var(--radius);
    font-size: .9rem; margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: .1rem; }
.alert--success { background: var(--success-soft); color: var(--success); }
.alert--danger  { background: var(--danger-soft);  color: var(--danger); }
.alert--warning { background: var(--warning-soft); color: var(--warning); }
.alert--info    { background: var(--info-soft);    color: var(--info); }

.alerts { position: fixed; top: 1rem; right: 1rem; z-index: 100; width: min(380px, calc(100vw - 2rem)); }
.alerts .alert { box-shadow: var(--shadow-lg); background-color: var(--surface); border-color: var(--border); }
.alerts .alert--success { border-left: 3px solid var(--success); }
.alerts .alert--danger  { border-left: 3px solid var(--danger); }
.alerts .alert--warning { border-left: 3px solid var(--warning); }

/* ------------------------------------------------------------ paginação --- */

.pagination { display: flex; align-items: center; gap: .3rem; }
.pagination__info { color: var(--fg-muted); font-size: .85rem; }
.page-link {
    min-width: 32px; height: 32px; padding: 0 .5rem;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: .85rem; color: var(--fg); background: var(--surface);
}
.page-link:hover { background: var(--surface-2); text-decoration: none; }
.page-link svg { width: 15px; height: 15px; }
.page-link.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-link.is-disabled { opacity: .45; pointer-events: none; }

/* ------------------------------------------------------------- dropdown --- */

.dropdown { position: relative; }
.dropdown__menu {
    position: absolute; right: 0; top: calc(100% + .4rem); z-index: 40;
    min-width: 210px; padding: .35rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.dropdown__item {
    display: flex; align-items: center; gap: .6rem; width: 100%;
    padding: .5rem .6rem; border: 0; border-radius: var(--radius-sm);
    font: inherit; font-size: .875rem; text-align: left;
    background: transparent; color: var(--fg); cursor: pointer;
}
.dropdown__item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown__item svg { width: 16px; height: 16px; color: var(--fg-muted); }
.dropdown__divider { height: 1px; background: var(--border); margin: .35rem 0; }
.dropdown__header { padding: .5rem .6rem .35rem; }

/* --------------------------------------------------------------- avatar --- */

.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; flex-shrink: 0;
    background: var(--brand-soft); color: var(--brand);
    font-size: .78rem; font-weight: 650; letter-spacing: .02em;
}
.avatar--lg { width: 56px; height: 56px; font-size: 1.15rem; }

/* ------------------------------------------------------ personalização --- */

.sidebar__logo-completa { height: 40px; width: auto; max-width: 100%; display: block; }
.sidebar__logo--img { object-fit: contain; background: hsl(0 0% 100% / .08); padding: 3px; }

.swatch {
    width: 30px; height: 30px; padding: 0;
    border: 2px solid var(--border-strong); border-radius: 50%;
    cursor: pointer; transition: transform .1s, border-color .1s;
}
.swatch:hover { transform: scale(1.12); border-color: var(--fg-muted); }

/* Faixa de "entrar como": vermelha de propósito, para ninguém esquecer */
.personificando {
    position: sticky; top: 0; z-index: 80;
    display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
    padding: .55rem 1.25rem;
    background: var(--danger); color: #fff;
    font-size: .875rem; font-weight: 550;
}
.personificando svg { width: 17px; height: 17px; }
.personificando form { margin-left: auto; }
.personificando .btn {
    background: hsl(0 0% 100% / .16); color: #fff; border-color: hsl(0 0% 100% / .3);
}
.personificando .btn:hover { background: hsl(0 0% 100% / .26); }

/* --------------------------------------------------------------- anexos --- */

.anexos { list-style: none; margin: 0; padding: 0; }

.anexo {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.anexo:last-child { border-bottom: 0; }

.anexo__tipo {
    flex-shrink: 0; width: 42px; height: 34px;
    display: grid; place-items: center;
    border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: .62rem; font-weight: 700; letter-spacing: .04em; color: var(--fg-muted);
}
.anexo__nome { flex: 1; min-width: 0; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo__meta { font-size: .76rem; color: var(--fg-subtle); white-space: nowrap; }

/* Campo de arquivo com a cara do resto do sistema */
.input[type="file"] { padding: .4rem .5rem; cursor: pointer; }
.input[type="file"]::file-selector-button {
    margin-right: .7rem; padding: .32rem .7rem;
    font: inherit; font-size: .82rem; font-weight: 550;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--fg); cursor: pointer;
}
.input[type="file"]::file-selector-button:hover { background: var(--surface); }

@media (max-width: 560px) {
    .anexo__meta { display: none; }
}

/* --------------------------------------------------------------- grafico -- */

.chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: .5rem; }
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; min-width: 0; }
.chart__bar {
    width: 100%; border-radius: 5px 5px 2px 2px;
    background: var(--brand);
    min-height: 3px; transition: opacity .12s;
}
.chart__col:hover .chart__bar { opacity: .8; }
.chart__label { font-size: .68rem; color: var(--fg-subtle); white-space: nowrap; }

/* --------------------------------------------------- telas sem estrutura -- */

.auth {
    min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
    background: var(--bg);
}
.auth__card { width: 100%; max-width: 410px; }
.auth__logo {
    width: 46px; height: 46px; border-radius: 13px; margin: 0 auto .9rem;
    background: var(--brand);
    display: grid; place-items: center; color: #fff; font-weight: 700;
}
.auth__logo svg { width: 23px; height: 23px; }
.auth__title { text-align: center; margin-bottom: .3rem; }
.auth__sub { text-align: center; color: var(--fg-muted); font-size: .9rem; margin-bottom: 1.6rem; }
.auth__foot { text-align: center; margin-top: 1.25rem; font-size: .85rem; color: var(--fg-muted); }

.wide { max-width: 720px; margin: 0 auto; }

/* O instalador precisa de mais largura que as telas de login. */
.auth__card:has(> .install) { max-width: 600px; }

.inline-icon { width: 14px; height: 14px; vertical-align: -2px; }

/* Cartões de escolha (seleção de cliente) */
.pick {
    display: flex; align-items: center; gap: .9rem; width: 100%;
    padding: .95rem 1.1rem; margin-bottom: .6rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    font: inherit; text-align: left; color: var(--fg); cursor: pointer;
    transition: border-color .12s, box-shadow .12s, transform .08s;
}
.pick:hover { border-color: var(--brand); text-decoration: none; }
.pick:hover svg { color: var(--brand); }
.pick svg { width: 18px; height: 18px; color: var(--fg-subtle); }
.pick__text { flex: 1; min-width: 0; }
.pick__name { font-weight: 600; display: block; }
.pick__meta { font-size: .8rem; color: var(--fg-muted); display: block; }

/* Lista de requisitos do instalador */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: flex-start; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.checklist li:last-child { border-bottom: 0; }
.checklist svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: .12rem; }
.checklist .ok { color: var(--success); }
.checklist .no { color: var(--danger); }

/* --------------------------------------------------------------- HTMX ---- */

/* Indicador de carregamento -- só aparece durante a requisição */
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-request .table { opacity: .55; transition: opacity .1s; }

.spinner {
    width: 15px; height: 15px; border-radius: 50%;
    border: 2px solid var(--border-strong); border-top-color: var(--brand);
    animation: spin .6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* [x-cloak] evita o "pisca" do Alpine antes de ele inicializar */
[x-cloak] { display: none !important; }

/* ------------------------------------------------------------ responsivo -- */

.menu-toggle { display: none; }

@media (max-width: 900px) {
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 60;
        transform: translateX(-100%); transition: transform .2s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: translateX(0); }
    .menu-toggle { display: inline-flex; }
    .content { padding: 1.25rem 1rem 3rem; }
    .backdrop { position: fixed; inset: 0; background: hsl(220 30% 8% / .5); z-index: 50; }
    .table th, .table td { padding-left: .85rem; padding-right: .85rem; }
}

@media (max-width: 560px) {
    .page-head { flex-direction: column; align-items: stretch; }
    .stat__value { font-size: 1.35rem; }
    .alerts { top: auto; bottom: 1rem; right: 1rem; left: 1rem; width: auto; }
}

/* --------------------------------------------------------- impressão ---- */

/* O cabeçalho de relatório existe só no papel. */
.impressao { display: none; }

@media print {
    /* Nada de cromo da interface: só o conteúdo. */
    .sidebar, .topbar, .alerts, .pagination, .search, .personificando,
    .btn, .btn-group, .table__actions, .htmx-indicator, .spinner,
    .backdrop, .dropdown__menu, .field__hint, .cron {
        display: none !important;
    }

    /* Tinta é cara: fundo branco e texto preto. */
    :root {
        --bg: #fff !important;
        --surface: #fff !important;
        --surface-2: #fff !important;
        --fg: #000 !important;
        --fg-muted: #333 !important;
        --fg-subtle: #555 !important;
        --border: #bbb !important;
        --border-strong: #999 !important;
        --brand: #000 !important;
        --brand-soft: #fff !important;
    }

    body { background: #fff; color: #000; font-size: 11pt; }
    .shell { display: block; }
    .content { padding: 0; max-width: none; }
    .page-head { display: none; }

    .impressao {
        display: block;
        margin-bottom: 1rem;
        padding-bottom: .6rem;
        border-bottom: 2px solid #000;
    }
    .impressao__marca { display: flex; align-items: center; gap: .8rem; }
    .impressao__logo { width: 44px; height: 44px; object-fit: contain; }
    .impressao__empresa { font-size: 1.1rem; font-weight: 700; }
    .impressao__titulo { font-size: 1rem; font-weight: 600; margin-top: .5rem; }
    .impressao__meta { font-size: .78rem; color: #444; }

    .card { border: 0; box-shadow: none; break-inside: auto; }
    .card__head, .card__foot { display: none; }
    .card__body { padding: 0; }

    .table { font-size: 10pt; width: 100%; }
    .table th {
        background: #eee !important; color: #000;
        border-bottom: 1px solid #000;
    }
    .table td, .table th { padding: .3rem .4rem; }
    .table tbody tr { break-inside: avoid; }
    thead { display: table-header-group; }   /* cabeçalho se repete a cada folha */

    .badge {
        border: 1px solid #999 !important; background: none !important;
        color: #000 !important; padding: 0 .3rem;
    }
    .avatar { display: none; }
    .grid { display: block; }
    .card + .card, .grid > * + * { margin-top: 1rem; }

    a[href]::after { content: ''; }   /* sem o URL colado em cada link */

    @page { margin: 1.5cm 1.2cm; }
}

/* ------------------------------------------------------- ajustes finais -- */

.nav { padding: .5rem .75rem 1rem; gap: 2px; }
.nav__link { min-height: 38px; }
.topbar { padding: 0 clamp(1rem, 3vw, 2rem); }
.content { width: 100%; max-width: 1240px; padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; }
.page-head h1 { font-size: clamp(1.4rem, 2vw, 1.75rem); font-weight: 700; }

@media (max-width: 700px) {
    .content { padding: 1.25rem .9rem 3rem; }
    .page-head { align-items: flex-start; }
    .page-head .btn { width: 100%; }
}
