/* =============================================================================================
   ChronosExtra — "Mostrador", the ChronosWeb design (its branch redesign-c, with the user's later changes), copied on
   top of app.css. app.css is the same file in both apps; ChronosWeb's chronos.css restyles it, and the generic parts
   of that file are copied here as they are (tokens, components, menu bar, status bar, background). The pieces only
   ChronosExtra has (its grids, Início, Recibos…) are restyled at the end, in the same world.
   ============================================================================================= */

@font-face {
    font-family: 'Jost';
    src: url('fonts/jost.woff2') format('woff2');
    font-weight: 100 900;
    font-display: block;
}

/* ---- Look (third redesign, branch redesign-c, 2026-10-16, user's choice "Mostrador"): Chronos as a good watch. A
   clean silver dial for the ground (the animated clock background stays, in silver and blued steel), white sheets with
   a hairline edge, the blued steel of the hands for actions, links, selection and focus, red only for problems, Jost
   for everything; the totals of the maps are the chronograph's registers and they filter. The tokens of app.css are
   redefined here (the --cr-blue-* names now hold the blued steel); app.css components are restyled right below. ---- */
:root {
    --cr-font: 'Jost', 'Segoe UI', system-ui, sans-serif;
    --cr-font-display: var(--cr-font);
    --cr-font-mono: var(--cr-font);
    --cr-text: #11151b;
    --cr-text-2: #333a46;
    --cr-text-3: #4a5260;
    --cr-strong: #11151b;
    --cr-accent: var(--cr-blue-600);
    --cr-ink-700: #2c3a52;
    --cr-ink-800: #1f2a3d;
    --cr-ink-900: #11151b;
    /* Linhas de grelha de todas as tabelas (pedido do utilizador 2026-10-20: mais contraste com o fundo). */
    --grelha: #b1b9c4;
    --grelha-forte: #8e98a6;
    --cr-blue-600: #1d4fb8;
    --cr-blue-500: #2f62cc;
    --cr-blue-300: #9fb6e6;
    --cr-blue-100: #e8eef9;
    --cr-surface: #ffffff;
    --cr-surface-solid: #ffffff;
    --cr-surface-2: #f5f6f8;
    --cr-ground: #eef0f3;
    --cr-hover: #f0f2f5;
    --cr-success: #12805c;
    --cr-warning: #a45d00;
    --cr-danger: #c42b3b;
    --cr-radius: 8px;
    --cr-radius-sm: 6px;
    --cr-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    --cr-shadow-md: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -2px rgba(16, 24, 40, 0.08);
    --cr-shadow-lg: 0 2px 6px rgba(16, 24, 40, 0.06), 0 16px 40px -8px rgba(16, 24, 40, 0.2);
    --cr-glow: 0 0 0 3px rgba(29, 79, 184, 0.22);
    --bs-body-color: var(--cr-text);
    --bs-border-radius: var(--cr-radius-sm);
    --bs-link-hover-color: #173f94;
    --barra-recesso: #eceef2;
    --barra-recesso-borda: var(--cr-line);
    --barra-sep: var(--cr-line);
    --barra-destaque: var(--cr-blue-600);
    --barra-ativo-borda: var(--cr-line-strong);
    --barra-ativo-sombra: 0 1px 2px rgba(16, 24, 40, 0.1);
    --barra-hover: var(--cr-hover);
    --barra-foco-borda: var(--cr-blue-500);
    --tb-hover: var(--cr-hover);
    color-scheme: light;
    accent-color: var(--cr-blue-600);
}

/* 16px (user's request 2026-10-16: a little larger everywhere, easier to read); every size in the app is in rem. */
html, body {
    font-size: 16px;
    background: var(--cr-ground);
    font-variant-numeric: tabular-nums;
}

::selection {
    background: rgba(29, 79, 184, 0.18);
    color: inherit;
}

input, textarea {
    caret-color: var(--cr-blue-600);
}

* {
    scrollbar-width: thin;
    scrollbar-color: #c3c9d1 transparent;
}

.num, input[inputmode="numeric"], input[inputmode="decimal"], input[type="number"], input[type="time"] {
    font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, h5, .display {
    letter-spacing: -0.011em;
}

a {
    color: var(--cr-blue-600);
}

    a:hover {
        color: #173f94;
    }

/* Cards, bars and lists: white with a hairline edge, almost flat (no glass, no blur). */
.painel,
.barra-filtros,
.kpi {
    background: var(--cr-surface-solid);
    border: 1px solid var(--cr-line);
    border-radius: var(--cr-radius);
    box-shadow: var(--cr-shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.painel-titulo {
    gap: .5rem;
    margin-bottom: .8rem;
    font-family: var(--cr-font);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: -.005em;
    text-transform: none;
    color: var(--cr-text);
}

    .painel-titulo::before {
        content: none;
    }

.kpi {
    padding: .45rem .85rem;
    border-radius: var(--cr-radius-sm);
}

.kpi-rotulo {
    font-family: var(--cr-font);
    font-size: .76rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cr-text-2);
}

.kpi-valor {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.kpi.destaque {
    background: var(--cr-blue-100);
    border-color: #cfdcfb;
}

.controlo-rotulo {
    font-family: var(--cr-font);
    font-size: .84rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cr-text-2);
}

.barra-filtros {
    padding: .45rem .6rem;
}

    .barra-filtros .segmentado button,
    .barra-filtros .alternar,
    .barra-filtros .btn {
        text-transform: none;
        letter-spacing: 0;
        font-weight: 500;
    }

.segmentado {
    border-radius: 8px;
}

    .segmentado button {
        border-radius: 6px;
        font-weight: 500;
    }

        .segmentado button.ativo {
            color: var(--cr-text);
        }

.alternar:has(input:checked) {
    color: var(--cr-blue-600);
    border-color: #b3c6ec;
    background: var(--cr-blue-100);
}

.btn-filtro {
    border-color: var(--cr-line-strong);
    border-radius: var(--cr-radius-sm);
    box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
    font-weight: 500;
}

    .btn-filtro:hover, .btn-filtro[aria-expanded="true"] {
        border-color: #aab2bd;
        background: var(--cr-surface-2);
    }

.menu-lista {
    padding: .3rem;
    border-radius: 8px;
    border-color: var(--cr-line);
}

.menu-opcao {
    border-radius: 5px;
    font-size: .9rem;
}

    .menu-opcao:hover {
        background: var(--cr-hover);
    }

.menu-opcao .num {
    font-family: var(--cr-font);
    letter-spacing: 0;
    text-transform: none;
}

/* Fields: white, a firm grey edge, blue edge and ring on focus; read-only on the light ground. */
.form-control, .form-select {
    border-color: var(--cr-line-strong);
    border-radius: var(--cr-radius-sm);
    background-color: #fff;
    box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
}

    .form-control:hover:not(:disabled):not([readonly]):not(:focus),
    .form-select:hover:not(:disabled):not(:focus) {
        border-color: #aab2bd;
    }

    .form-control:focus, .form-select:focus {
        border-color: var(--cr-blue-500);
        box-shadow: var(--cr-glow);
    }

    .form-control:disabled, .form-control[readonly], .form-select:disabled {
        background-color: var(--cr-surface-2);
        box-shadow: none;
    }

    .form-control::placeholder {
        color: #646d7a;
    }

.form-label {
    font-size: .84rem;
    color: var(--cr-text-2);
}

.form-check-input {
    border-color: #aab2bd;
}

    .form-check-input:focus {
        border-color: var(--cr-blue-500);
        box-shadow: var(--cr-glow);
    }

/* Buttons: flat. Primary = the brand blue; outline = white with a grey edge; ghost = text only. */
.btn {
    border-radius: var(--cr-radius-sm);
    font-weight: 500;
}

.btn-primary {
    background: var(--cr-blue-600);
    border: 1px solid #173f94;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

    .btn-primary:hover, .btn-primary:focus-visible, .btn-primary:active {
        background: #173f94;
        border-color: #12357d;
        color: #fff;
    }

.btn-outline-primary,
.btn-outline-secondary {
    background: #fff;
    border-color: var(--cr-line-strong);
    box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
}

.btn-outline-primary {
    color: var(--cr-blue-600);
}

.btn-outline-secondary {
    color: var(--cr-text);
}

    .btn-outline-primary:hover,
    .btn-outline-secondary:hover {
        background: var(--cr-surface-2);
        border-color: #aab2bd;
    }

    .btn-outline-primary:hover {
        color: #173f94;
    }

    .btn-outline-secondary:hover {
        color: var(--cr-text);
    }

.btn-outline-danger {
    background: #fff;
    border-color: #efc2c7;
    color: var(--cr-danger);
}

    .btn-outline-danger:hover {
        background: #fdf1f2;
        border-color: #e39aa3;
        color: #a3192c;
    }

.btn-fantasma:hover {
    background: var(--cr-hover);
    border-color: transparent;
}

.btn-navegar {
    border-color: var(--cr-line-strong);
    background: #fff;
}

    .btn-navegar:hover:not(:disabled) {
        background: var(--cr-surface-2);
        color: var(--cr-blue-600);
    }

/* Small tables and badges. */
.tabela-lista th {
    font-family: var(--cr-font);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cr-text-2);
    background: var(--cr-surface-2);
}

.distintivo {
    border-radius: 5px;
    font-weight: 500;
}

.alert {
    border-radius: var(--cr-radius-sm);
}

.alert-warning { background: #fff8eb; border-color: #f3dbab; color: #7a4a00; }
.alert-success { background: #ecf8f2; border-color: #c4e8d6; color: #0d5c3d; }
.alert-danger { background: #fdf1f2; border-color: #f3c7cc; color: #8e1e2a; }

/* Dialogs: white, one hairline under the title, no tinted header. */
.modal-content {
    border-radius: 12px;
    border: 1px solid var(--cr-line);
}

.modal-header {
    background: #fff;
    padding: 1rem 1.25rem;
}

.modal-title {
    font-weight: 600;
    letter-spacing: -.01em;
}

.modal-body {
    padding: 1.1rem 1.25rem;
}

.modal-footer {
    background: var(--cr-surface-2);
    padding: .75rem 1.25rem;
}

/* ---- No transitions anywhere (request 2026-10-02): a state change (menu category, hover, active item, tooltip,
   page swap) shows at once, never a half-faded frame in between. app.css and the scoped layout CSS keep their
   transition rules as copied; this cancels them all. The continuous background animations (dial, gears) stay. ---- */
*, *::before, *::after {
    transition: none !important;
}

/* ---- Page header: the big title ---- */
/* Page titles: the ink of the text, semibold, tight (many VB6 screen names are long). No bar, no relief: on the light
   ground the title needs nothing but its size. */
.rotulo-modulo {
    font-family: var(--cr-font);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--cr-text);
}

/* A summary card: its name always at the top left, the value under it (with no value, the name stayed in the middle). */
.kpi {
    justify-content: flex-start;
}

/* ---- Menu bar at the top, as in the VB6 program (replaces the ChronosWeb sidebar) ---- */
.page {
    flex-direction: column;
}

.barra-topo {
    position: relative;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 3.5rem;
    padding: 0 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--cr-line);
}

    /* The logo straight on the bar; it is the way back to Início (there is no menu item for it). */
    .barra-topo .marca {
        display: flex;
        align-items: center;
        flex: none;
        margin-right: 1rem;
        border-radius: 8px;
    }

        .barra-topo .marca:focus-visible {
            outline: none;
            box-shadow: var(--cr-glow);
        }

    .barra-topo .marca img {
        display: block;
        height: 2.1rem;
        width: auto;
    }

.barra-topo-direita {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-left: auto;
    /* The categories keep their room; a long unit name gives way (cut with "…"). */
    flex: 0 1 auto;
    min-width: 0;
}

.menu-topo {
    display: flex;
    align-items: center;
    flex: none;
    gap: 1rem;
}

/* Categories: plain text, the current one in blue with a line along the bottom edge of the bar. */
.menu-topo-item {
    display: flex;
    align-items: center;
    gap: .35rem;
    height: 2.25rem;
    padding: 0 .75rem;
    border-radius: 6px;
    color: #262c35;
    font-family: var(--cr-font);
    font-size: .92rem;
    font-weight: 500;
    letter-spacing: -.003em;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
    transition: background-color .15s, color .15s;
}

    .menu-topo-item::-webkit-details-marker {
        display: none;
    }

    .menu-topo-item:hover,
    .menu-topo-grupo[open] > .menu-topo-item {
        background: var(--cr-hover);
        color: var(--cr-text);
    }

    .menu-topo-item:focus-visible {
        outline: none;
        box-shadow: var(--cr-glow);
    }

    /* Category of the current page: blue, underlined on the bar's bottom edge. */
    .menu-topo-item.active {
        position: relative;
        color: var(--cr-blue-600);
    }

        .menu-topo-item.active::after {
            content: "";
            position: absolute;
            left: .75rem;
            right: .75rem;
            bottom: calc(-1 * (3.5rem - 2.25rem) / 2);
            height: 2px;
            border-radius: 2px 2px 0 0;
            background: var(--cr-blue-600);
        }

    .menu-topo-item .menu-topo-seta {
        width: .9rem;
        height: .9rem;
        opacity: .6;
        transition: transform .15s;
    }

.menu-topo-grupo {
    position: relative;
}

    .menu-topo-grupo[open] > .menu-topo-item .menu-topo-seta {
        transform: rotate(180deg);
    }

.menu-topo-lista {
    position: absolute;
    top: calc(100% + .55rem);
    left: 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    min-width: 21rem;
    max-width: 30rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding: .3rem;
    background: var(--cr-surface-solid);
    border: 1px solid var(--cr-line);
    border-radius: 8px;
    box-shadow: var(--cr-shadow-lg);
}

.menu-topo-opcao {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .7rem;
    border-radius: 5px;
    color: var(--cr-text);
    font-size: .9rem;
    line-height: 1.3;
    text-decoration: none;
}

    .menu-topo-opcao:hover,
    .menu-topo-opcao:focus-visible {
        background: var(--cr-hover);
        color: var(--cr-text);
        outline: none;
    }

    .menu-topo-opcao.active {
        background: var(--cr-blue-100);
        color: var(--cr-blue-600);
        font-weight: 500;
    }

    .menu-topo-opcao.sem-acesso {
        color: rgba(16, 36, 69, 0.42);
        cursor: not-allowed;
    }

        .menu-topo-opcao.sem-acesso:hover {
            background: none;
        }

        .menu-topo-opcao.sem-acesso .icone {
            width: .85rem;
            height: .85rem;
            flex: none;
            opacity: .6;
        }

    /* Entries of a VB6 submenu (Mapa de acontecimentos), under their heading. */
    .menu-topo-opcao.no-submenu {
        padding-left: 1.6rem;
    }

.menu-topo-submenu {
    padding: .55rem .75rem .2rem;
    color: var(--cr-text-3);
    font-size: .78rem;
    font-weight: 600;
}

/* Narrow-window menu button (hamburger); hidden on wide screens. */
.menu-abrir {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.menu-abrir-botao {
    display: none;
    width: 2.6rem;
    height: 2.3rem;
    border-radius: 6px;
    border: 1px solid var(--cr-line-strong);
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2826, 34, 51, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.3rem #fff;
    cursor: pointer;
}

.menu-abrir:focus-visible + .menu-abrir-botao {
    box-shadow: var(--cr-glow);
}

/* Medium windows: the unit chip shows only the code, the categories get a little tighter. */
@media (max-width: 1900px) {
    .menu-topo {
        gap: .25rem;
    }

    .menu-topo-item {
        padding: 0 .55rem;
        font-size: .9rem;
    }
}

/* Narrow windows: the menu folds into the button and opens as a list under the bar (below 1550px the categories and
   the right side no longer fit on one line; chronos.js uses the same width). */
@media (max-width: 1550px) {
    .barra-topo {
        flex-wrap: wrap;
        padding: .45rem 1rem;
    }

    .menu-abrir-botao {
        display: block;
        order: 3;
    }

    .barra-topo-direita {
        order: 2;
    }

    .menu-topo {
        order: 4;
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: .4rem 0 .6rem;
    }

    .menu-abrir:checked ~ .menu-topo {
        display: flex;
    }

    .menu-topo-lista {
        position: static;
        min-width: 0;
        max-width: none;
        max-height: none;
        margin: .2rem 0 .4rem 1rem;
        box-shadow: none;
    }
}

/* ---- Status bar (like the two at the bottom of the VB6 main window) ---- */
main {
    position: relative;
    display: flex;
    flex-direction: column;
}

    main > .content {
        flex: 1;
        padding-top: 1.25rem;
        padding-bottom: 1.5rem;
    }

.barra-estado {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem 1.5rem;
    padding: .4rem 1.75rem;
    background: #fff;
    border-top: 1px solid var(--cr-line);
    font-size: .8rem;
    color: var(--cr-text);
}

.barra-estado-rotulo {
    margin-right: .4rem;
    color: var(--cr-text-3);
}

.barra-estado-relogio {
    display: inline-flex;
    gap: .7rem;
    margin-left: auto;
    color: var(--cr-text-2);
}

    .barra-estado-relogio .mono {
        color: var(--cr-text);
        font-weight: 500;
    }

/* ---- The page area: the light ground. On desktop it is exactly the space between the two bars: app.css gave it
   min-height 100vh, which with the two bars made the page taller than the window (scroll bars). ---- */
.fundo-app {
    overflow: hidden;
    background: var(--cr-ground);
}

@media (min-width: 641px) {
    .fundo-app {
        min-height: 0;
    }
}

/* ---- Version (date of the published build) and ISTC copyright, on the right of the status bar ---- */
.barra-estado-versao {
    margin-left: auto;
    font-size: .74rem;
    color: var(--cr-text-2);
}

.barra-estado-copyright {
    margin-left: auto;
    font-size: .74rem;
    color: var(--cr-text-3);
}

    .barra-estado-versao + .barra-estado-copyright {
        margin-left: 1rem;
    }

    .barra-estado-copyright + .barra-estado-relogio {
        margin-left: 1rem;
    }

/* At the right edge of the window, on the same line as before (user's request 2026-10-20). */
.account-copyright {
    position: absolute;
    right: 1.5rem;
    bottom: 1rem;
    z-index: 1;
    text-align: right;
    font-size: .74rem;
    color: var(--cr-text-3);
}


/* ---- Drop-down lists (every .form-select): the open list in the brand's style instead of the system one.
   Customizable <select> (appearance: base-select, Edge/Chrome 135+); other browsers keep their own list.
   The closed box keeps the Bootstrap look and arrow. ---- */
@supports (appearance: base-select) {
    select.form-select:not([multiple]):not([size]),
    select.form-select:not([multiple]):not([size])::picker(select) {
        appearance: base-select;
    }

    /* base-select lays the box out itself; keep Bootstrap's block box with the text centred. */
    select.form-select:not([multiple]):not([size]) {
        display: flex;
        align-items: center;
    }

    select.form-select:not([multiple]):not([size])::picker-icon {
        display: none;
    }

    select.form-select::picker(select) {
        min-width: anchor-size(width);
        max-height: min(24rem, 60vh);
        margin-top: 4px;
        padding: .3rem;
        border: 1px solid var(--cr-line);
        border-radius: 8px;
        background: #fff;
        box-shadow: var(--cr-shadow-lg);
        color: var(--cr-text);
    }

    select.form-select option {
        display: flex;
        align-items: center;
        gap: .5rem;
        min-height: 2rem;
        padding: .3rem .65rem;
        border-radius: 5px;
        font-family: var(--cr-font);
        font-size: .9rem;
        font-weight: 400;
        color: var(--cr-text);
        background: transparent;
        white-space: nowrap;
        cursor: pointer;
    }

        select.form-select option:hover,
        select.form-select option:focus-visible {
            outline: none;
            background: var(--cr-hover);
            color: var(--cr-text);
        }

        select.form-select option:checked {
            background: var(--cr-blue-100);
            color: var(--cr-blue-600);
            font-weight: 500;
        }

        select.form-select option::checkmark {
            order: 1;
            margin-left: auto;
            color: var(--cr-blue-600);
        }

        select.form-select option:disabled {
            color: var(--cr-text-3);
            cursor: default;
        }

    select.form-select optgroup {
        padding-top: .2rem;
    }

        select.form-select optgroup legend {
            padding: .35rem .65rem .2rem;
            font-size: .78rem;
            font-weight: 600;
            color: var(--cr-text-3);
        }

        select.form-select optgroup + optgroup {
            margin-top: .25rem;
            border-top: 1px solid var(--cr-line);
        }
}


/* No divider lines in the criteria bars (user's request 2026-10-12): the groups keep their spacing, without the line. */
.barra-filtros .barra-sep::before {
    content: none;
}

/* ---- One design for every criteria bar (user's requests 2026-10-13 and 2026-10-16) ----
   Left to right: period or year · «Por» · N.º · Secção · Grupo · (wider gap) · view · «Ignorar até» · «Códigos» · ticks;
   then .espaco and the actions (Guardar códigos, Simular…) at the right. Imprimir / Exportar live in the table's foot,
   never here. A list button carries its name inside («N.º: Todos»); every text of the bar is plain case, one size. The
   gap between controls is the bar's (the .barra-sep of the markup no longer count), so every bar is spaced alike. */
.barra-filtros,
.barra-filtros.ped-rel-filtros {
    column-gap: .75rem;
}

    /* Segmented choices of a bar a little tighter (one line on a 1600 px screen with the most criteria). */
    .barra-filtros .segmentado button {
        padding-left: .55rem;
        padding-right: .55rem;
    }

    .barra-filtros .barra-sep {
        display: none;
    }

    /* The two groups of a bar (user's request 2026-10-16): "who" (period, Por, N.º, Secção, Grupo) and "how" (view,
       filters, codes, options) — a wider space after Grupo instead of a line. */
    .barra-filtros > .controlo:has(.selecao-filtro) + :not(.controlo:has(.selecao-filtro)) {
        margin-left: .75rem;
    }

    /* The actions (Guardar códigos, Simular…) always at the right end, also when the bar breaks into two lines: the
       first of them takes the free space, wherever its line is. */
    .barra-filtros > .espaco {
        display: none;
    }

        .barra-filtros > .espaco + * {
            margin-left: auto;
        }


/* ---- Outlines (user's request 2026-10-13): every card, bar, field and inner line has a visible edge, the same on
   every screen: cards and inner lines a cool grey hairline, fields and table frames a firmer grey. Defined here, after
   every screen's own :root, so they win; the screens' CSS keeps using these tokens. ---- */
:root {
    --cr-line: #d5d9df;
    --cr-line-strong: #c3c9d1;
}

main > .content {
    position: relative;
}

/* Início fits the window at any height (a laptop at 125% scaling has ~130px less than a monitor): the summary at the
   bottom (PainelResumo) keeps its own height when there is room and shrinks to the height left when there isn't (its
   chart and top obras shrink with it); the page only scrolls below the summary's minimum. */
@media (min-width: 1101px) {
    main > .content:has(> .home-grelha) {
        display: flex;
        flex-direction: column;
    }

        main > .content:has(> .home-grelha) > * {
            flex-shrink: 0;
        }

        main > .content:has(> .home-grelha) > .resumo {
            flex: 0 1 auto;
            min-height: 17rem;
        }
}

@media (min-width: 1101px) and (max-height: 820px) {
    main > .content:has(> .home-grelha) {
        padding-top: .75rem;
        padding-bottom: 1rem;
    }
}


/* ---- Mostrador (third redesign): the animated clock background in silver and blued steel. The app.css drawing
   (gradient, drifting light, the corner gears on the login) stays; only its colours change. The dial ring that turns
   in the bottom-right corner of every screen is the watch's minute track. ---- */
:root {
    --fr-traco: rgba(29, 79, 184, 0.28);
    --fr-traco-fraco: rgba(29, 79, 184, 0.16);
}

.fundo-app {
    background: var(--cr-ground);
}

.fundo-relogio {
    background: linear-gradient(170deg, #f4f5f8 0%, #eceff3 55%, #e2e6ec 100%);
}

    .fundo-relogio::after {
        background: none;
    }

    .fundo-relogio .luz-1 {
        background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 65%);
    }

    .fundo-relogio .luz-2 {
        background: radial-gradient(circle, rgba(29, 79, 184, 0.07) 0%, rgba(29, 79, 184, 0) 65%);
    }

.fundo-app > .mostrador,
.account-formulario > .mostrador {
    position: absolute;
    z-index: 0;
    right: -220px;
    bottom: -220px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    pointer-events: none;
    background:
        repeating-conic-gradient(from 0deg, rgba(28, 33, 41, 0.28) 0deg 1.4deg, transparent 1.4deg 30deg),
        repeating-conic-gradient(from 0deg, rgba(29, 79, 184, 0.2) 0deg 0.6deg, transparent 0.6deg 6deg);
    -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%, #000 67%, transparent 68%);
    mask: radial-gradient(circle, transparent 58%, #000 59%, #000 67%, transparent 68%);
    animation: rodar-mostrador 240s linear infinite;
}

@keyframes rodar-mostrador {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fundo-app > .mostrador,
    .account-formulario > .mostrador {
        animation: none;
    }
}

/* Sheets keep the dial away from the data: white, never translucent. */
.painel, .barra-filtros, .tabela-rolagem {
    background-color: #fff;
}

@media print {
    .fundo-app > .mostrador {
        display: none;
    }
}

/* =============================================================================================
   ChronosExtra's own pieces in the Mostrador world
   ============================================================================================= */

/* The page area: exactly the space between the two bars (app.css gave it the whole window). */
.fundo-app {
    min-height: 0;
}

/* The grids (Relatório de Horas, Total por Obra, Recibos, Auditoria…): the ChronosWeb tables. A neutral header on the
   recess grey with secondary ink, white rows with faint stripes, marked grid lines, a blued-steel hover and the totals
   in vivid blue. The colours of the column groups (Dias, Horas, Ajustes, Sábado, Domingo, Subsídio…) carry meaning
   and keep their hues, a little softer than app.css's to sit with the silver frame (asked 2026-10-21: "demasiado
   garridas"; not back to the near-whites refused on 2026-09-27). */
:root {
    --tb-dias-cab: #dde8fb;
    --tb-horas-cab: #d0eed9;     --tb-horas-cel: #ebf7ee;
    --tb-ajustes-cab: #f9dcc2;
    --tb-desconto-cab: #f7d6df;  --tb-desconto-cel: #fbebef;
    --tb-acum-cel: #fcf4d6;
    --tb-sabado-cab: #ffdfb0;    --tb-sabado-cel: #fff3df;
    --tb-domingo-cab: #fdd0d0;   --tb-domingo-cel: #fdeaea;
    --tb-subsidio-cab: #c9e9ef;  --tb-subsidio-cel: #e3f4f7;

    --tb-fundo: #ffffff;
    --tb-zebra: #fafbfc;
    --tb-zebra-sombra: rgba(16, 24, 40, 0.04);
    --tb-linha: var(--grelha);
    --tb-coluna: var(--grelha);
    --tb-cab-fundo: #f5f6f8;
    --tb-cab-texto: var(--cr-text-2);
    --tb-cab-linha: var(--grelha-forte);
    --tb-cab-coluna: var(--grelha);
    --tb-hover: #eef2f9;
    --tb-total-fundo: #e8effd;
    --tb-total-texto: #0f3fe8;
    --tb-selecionada: var(--cr-blue-100);
}

/* Small label over a title (only "Sem ligação à base de dados" on /ligacao): a state line, in sentence case. */
.eyebrow-conta {
    font-family: var(--cr-font);
    font-size: .84rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cr-danger);
}

/* Toast and session warning: white sheets with the semantic edge, as the ChronosWeb dialogs. */
.toast-atualizacao,
.aviso-sessao {
    border-radius: var(--cr-radius);
}

/* ---- The filter bars as the ChronosWeb criteria bars (chronos.css, user's requests 2026-10-16/20 there) ---- */

/* «Horas» inside its own segmented pill: the label and the choices in one frame, the label on its own darker shade. */
.barra-filtros .controlo:has(> .controlo-rotulo + .segmentado) {
    gap: 0;
    padding: 3px;
    border-radius: 8px;
    background: var(--barra-recesso);
    box-shadow: inset 0 0 0 1px var(--barra-recesso-borda);
}

    .barra-filtros .controlo:has(> .controlo-rotulo + .segmentado) > .controlo-rotulo {
        align-self: stretch;
        display: inline-flex;
        align-items: center;
        margin-right: 3px;
        padding: 0 .6rem;
        border-radius: 6px;
        background: var(--cr-line);
        color: var(--cr-text);
    }

    .barra-filtros .controlo:has(> .controlo-rotulo + .segmentado) > .segmentado {
        padding: 0;
        background: none;
        box-shadow: none;
    }

    /* Selecionar (Todos / Nenhum) are actions, not a choice: greyed out when there is nothing to do. */
    .barra-filtros .segmentado button:disabled {
        opacity: .45;
        cursor: default;
    }

/* Every control of a bar as tall as the pills (2rem): the action buttons (Reprocessar, Fechar período, Anular
   pagamento, Apagar), the lists beside a label (Ação) and the segmented pills themselves. */
.barra-filtros > .btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    height: 2rem;
}

.barra-filtros .controlo > .form-select,
.barra-filtros .controlo:has(> .controlo-rotulo + .segmentado) {
    height: 2rem;
}

/* A list button with its name inside (Unidade: 4 de 5 ▾, Linhas por página: Todas ▾). */
.btn-filtro > .controlo-rotulo {
    flex: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cr-text-2);
}

    .btn-filtro > .controlo-rotulo::after {
        content: ":";
    }

.barra-filtros .btn-filtro {
    gap: .35rem;
    max-width: 19rem;
}

/* Rows per page (Shared/LinhasPorPagina): the list of the pill has no frame of its own; the pill takes the focus ring. */
.linhas-pagina {
    padding-right: .35rem;
    cursor: pointer;
}

    .linhas-pagina select.form-select {
        width: auto;
        min-height: 0;
        height: 1.8rem;
        padding: 0 1.7rem 0 .1rem;
        border: 0;
        background-color: transparent;
        background-position: right .3rem center;
        box-shadow: none;
        font-size: inherit;
        font-weight: 500;
        color: var(--cr-text);
        cursor: pointer;
    }

        .linhas-pagina select.form-select:focus {
            box-shadow: none;
        }

    .linhas-pagina:has(select:focus-visible) {
        box-shadow: var(--cr-glow);
    }

/* A tick option: its name, then the box, in its own small card like the list buttons beside it; no shading when
   ticked (the tick says it). */
.barra-filtros > .alternar {
    flex-direction: row-reverse;
    gap: .45rem;
    height: 2rem;
    padding: 0 .65rem 0 .75rem;
    border: 1px solid var(--cr-line-strong);
    border-radius: var(--cr-radius-sm);
    background: var(--barra-campo, #fff);
    box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
    font-size: .86rem;
    font-weight: 500;
    color: var(--cr-text-2);
    cursor: pointer;
}

    .barra-filtros > .alternar:hover {
        border-color: #aab2bd;
        background: var(--cr-surface-2);
    }

    .barra-filtros > .alternar:has(input:checked) {
        border-color: var(--cr-line-strong);
        background: var(--barra-campo, #fff);
        color: var(--cr-text-2);
    }

/* Changing menu: a grid whose data come within a moment shows no skeleton at all (it flashed for a few hundredths of a
   second and the card changed size). The card stays out of sight for the first 400 ms of a load; only a slower load
   shows the skeleton. step-end keeps it hidden for the whole delay (visibility would otherwise switch at once). */
.grelha-cartao:has(.esqueleto-tabela) {
    animation: esqueleto-espera 400ms step-end;
}

@keyframes esqueleto-espera {
    from { visibility: hidden; }
}

/* Tables change data smoothly, as in ChronosWeb (listagens.css there, commit 9dfb6ef): while a grid loads (.a-carregar
   on its area) the old data fade from .12s on, so a quick answer hardly fades; when the new data are in, the area comes
   in from there with a 3 px rise, so the swap reads as one movement (also after the first load, when the hidden skeleton
   gives way to the data). The skeleton itself does not fade. */
.grelha-cartao > [data-linhas-auto].a-carregar:not(:has(.esqueleto-tabela)) {
    opacity: 1;     /* app.css dims it to .6 at once (its transition is off here): the fade starts from full */
    animation: consulta-esbater .25s ease-out .12s forwards;
}

.grelha-cartao > [data-linhas-auto]:not(.a-carregar) {
    animation: tabela-entrar .22s ease-out both;
}

@keyframes consulta-esbater {
    to { opacity: .45; }
}

@keyframes tabela-entrar {
    from { opacity: .45; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .grelha-cartao > [data-linhas-auto].a-carregar:not(:has(.esqueleto-tabela)) { animation: consulta-esbater 0s linear .3s forwards; }
    .grelha-cartao > [data-linhas-auto]:not(.a-carregar) { animation: none; }
}

/* The same outside the grids. Every .a-carregar fades late and smoothly (app.css dims it at once, its transition being
   off here); .suave areas (panels, calendar, the dashboard) come in with the grids' rise when their data are in. */
.a-carregar:not(:has(.esqueleto-tabela)) {
    opacity: 1;
    animation: consulta-esbater .25s ease-out .12s forwards;
}

@media (prefers-reduced-motion: reduce) {
    /* app.css stops every animation: the old data are dimmed at once, without motion. */
    .a-carregar:not(:has(.esqueleto-tabela)) { opacity: .6; }
}

.suave:not(.a-carregar) {
    animation: tabela-entrar .22s ease-out both;
}

/* A placeholder never shows for a quick load (it flashed for a moment and the panel changed size): hidden for 400 ms. */
.esqueleto {
    animation: esqueleto-espera 400ms step-end, esqueleto 1.4s ease-in-out infinite;
}

/* A form or list whose values are still being read stays out of sight (it showed zeros or an empty table first). */
.a-preparar {
    visibility: hidden;
}

/* Dialogs come in softly; one still reading its data (the day detail) waits out of sight up to 400 ms, so it opens
   complete instead of growing. */
.modal-chronos {
    animation: modal-fundo .15s ease-out both;
}

    .modal-chronos .modal-content {
        animation: modal-entrar .18s ease-out both;
    }

.modal-chronos:has(.esqueleto) {
    animation: esqueleto-espera 400ms step-end;
}

    .modal-chronos:has(.esqueleto) .modal-content {
        animation: none;
    }

@keyframes modal-fundo {
    from { opacity: 0; }
}

@keyframes modal-entrar {
    from { opacity: 0; transform: translateY(6px) scale(.985); }
}

/* Warnings that arrive after the page (Início) fade in instead of popping. */
.aviso-picagens {
    animation: tabela-entrar .22s ease-out both;
}

/* The totals of a grid in its foot, left of the legend and the pages, one short pill each (as the ChronosWeb tables:
   no cards above the table). */
.paginacao {
    background: #fff;
}

/* The colour legend anchored on the right of the foot, the totals on the left. */
.paginacao-extra:has(> .legenda-cores) {
    flex: 1;
}

    .paginacao-extra > .legenda-cores {
        margin-left: auto;
    }

.paginacao-extra > .kpis {
    gap: .35rem;
}

    .paginacao-extra > .kpis .kpi {
        flex-direction: row;
        align-items: baseline;
        gap: .4rem;
        min-width: 0;
        padding: .2rem .65rem;
        border: 1px solid var(--cr-line);
        border-radius: 999px;
        background: #fff;
        box-shadow: none;
        color: var(--cr-text);
    }

    .paginacao-extra > .kpis .kpi.destaque {
        border-color: #cfdcfb;
        background: var(--cr-blue-100);
    }

    .paginacao-extra > .kpis .kpi-rotulo {
        font-size: .78rem;
    }

    .paginacao-extra > .kpis .kpi-valor {
        font-size: .9rem;
    }

@media print {
    .barra-topo, .barra-estado, .fundo-app > .mostrador, .toast-atualizacao, .aviso-sessao {
        display: none !important;
    }

    /* The totals moved to the table's foot: printed, without the legend and the page buttons. */
    .grelha-cartao .paginacao:has(.kpis) {
        display: flex !important;
        padding: .3rem 0 !important;
        border: 0 !important;
    }

    .grelha-cartao .paginacao > :not(.paginacao-extra),
    .grelha-cartao .paginacao-extra > :not(.kpis) {
        display: none !important;
    }
}
