/* O visual do GPro (S-144, docs/MELHORIAS_BACKLOG.md): a mesma identidade do app — petróleo, cobre,
   fundo quente, Manrope e Source Serif (GPro.App/Resources/Styles/Colors.xaml). As fontes vêm do
   próprio site (CSP font-src 'self'), com a licença em fonts/licencas.
   As cores são tokens: tudo abaixo usa var(--…), e o escuro só troca os tokens. O tema é o do sistema,
   ou o escolhido em Configurações (data-theme, S-132). */
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
    color-scheme: light dark;
    --font-sans: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --font-display: "Source Serif 4", Georgia, serif;

    --bg: #F5F4F0;
    --surface: #FFFFFF;
    --surface-muted: #ECEDE8;
    --field: #FFFFFF;
    --text: #172322;
    --muted: #5D6A67;
    --stroke: #DDE0DA;
    --stroke-strong: #C5CBC4;
    --accent: #1B5260;
    --accent-hover: #123E49;
    --on-accent: #FFFFFF;
    --accent-soft: #D3E7E8;
    --on-accent-soft: #0F3640;
    --copper: #A9673C;
    --copper-soft: #F4E6DA;
    --on-copper-soft: #6E3F1F;
    --danger: #B43C3A;
    --danger-soft: #F7E1E0;
    --on-danger-soft: #7E2524;
    --success: #28745A;
    --warning: #94601F;

    --radius-sm: 8px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgb(23 35 34 / 0.06), 0 1px 1px rgb(23 35 34 / 0.04);
    --shadow-md: 0 4px 14px rgb(23 35 34 / 0.08), 0 1px 3px rgb(23 35 34 / 0.06);
    --shadow-lg: 0 18px 48px rgb(23 35 34 / 0.18), 0 4px 12px rgb(23 35 34 / 0.08);
    --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* O escuro do app: o fundo quase preto esverdeado e o petróleo claro. Do sistema (sem escolha de
   claro), ou escolhido em Configurações. Os dois blocos têm de ficar iguais. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) {
        --bg: #111918;
        --surface: #192222;
        --surface-muted: #141D1C;
        --field: #1F2928;
        --text: #F0F3F0;
        --muted: #A9B6B1;
        --stroke: #2E3936;
        --stroke-strong: #3F4C48;
        --accent: #86C8C5;
        --accent-hover: #B2E6E1;
        --on-accent: #0E1716;
        --accent-soft: #1E4A52;
        --on-accent-soft: #CDEDEA;
        --copper: #E0A57B;
        --copper-soft: #3D2A1D;
        --on-copper-soft: #F1CDB1;
        --danger: #EE8983;
        --danger-soft: #4A2322;
        --on-danger-soft: #F8C9C6;
        --success: #70BE98;
        --warning: #DDB268;
        --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
        --shadow-md: 0 4px 14px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.3);
        --shadow-lg: 0 18px 48px rgb(0 0 0 / 0.5), 0 4px 12px rgb(0 0 0 / 0.35);
    }
}
:root[data-theme=dark] {
    --bg: #111918;
    --surface: #192222;
    --surface-muted: #141D1C;
    --field: #1F2928;
    --text: #F0F3F0;
    --muted: #A9B6B1;
    --stroke: #2E3936;
    --stroke-strong: #3F4C48;
    --accent: #86C8C5;
    --accent-hover: #B2E6E1;
    --on-accent: #0E1716;
    --accent-soft: #1E4A52;
    --on-accent-soft: #CDEDEA;
    --copper: #E0A57B;
    --copper-soft: #3D2A1D;
    --on-copper-soft: #F1CDB1;
    --danger: #EE8983;
    --danger-soft: #4A2322;
    --on-danger-soft: #F8C9C6;
    --success: #70BE98;
    --warning: #DDB268;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 14px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 18px 48px rgb(0 0 0 / 0.5), 0 4px 12px rgb(0 0 0 / 0.35);
}

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 1rem; }
h2 { font-weight: 700; letter-spacing: -0.01em; }
h1:focus { outline: none; }
.muted { color: var(--muted); }
::selection { background: var(--accent-soft); color: var(--on-accent-soft); }

/* Os campos, iguais em todo o site: fundo próprio, canto arredondado e o anel de foco do petróleo. */
:where(input:not([type=checkbox], [type=radio], [type=range], [type=color]), select, textarea) {
    font: inherit;
    color: var(--text);
    background-color: var(--field);
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
:where(input:not([type=checkbox], [type=radio]), select, textarea):hover { border-color: var(--muted); }
:where(input:not([type=checkbox], [type=radio]), select, textarea):focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
:where(input, textarea)::placeholder { color: var(--muted); opacity: 0.8; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1rem; height: 1rem; }
:focus-visible { outline-color: var(--accent); }

/* Menu à esquerda e conteúdo à direita; no celular, o menu sobe para baixo do topo. O quadro
   (S-127) precisa da largura toda, por isso o menu é estreito. */
.shell {
    display: grid;
    grid-template-columns: 13rem 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

.topbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--stroke);
}

.brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0.75rem;
    background: var(--surface);
    border-right: 1px solid var(--stroke);
}

.sidebar a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
}

.sidebar a.active {
    background: var(--bg);
    font-weight: 600;
}

.page { padding: 1.5rem; min-width: 0; }

@media (max-width: 720px) {
    .shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
    .sidebar { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--stroke); }
    .page { padding: 1rem; }
}

/* Quem está logado, no topo. */
.who {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.who-name { font-weight: 600; }
/* Nome de escritório longo não empurra o "Sair" para fora da tela no celular. */
.who-tenant {
    color: var(--muted);
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.logout { margin: 0; }

/* Login e escolha de escritório. */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    box-sizing: border-box;
}

.login-card {
    width: 100%;
    max-width: 24rem;
    padding: 2rem;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
}

.login-form, .tenant-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-form input {
    padding: 0.5rem 0.6rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
}

.login-form label { margin-top: 0.5rem; font-weight: 600; }
.login-form fluent-button { margin-top: 1rem; }

.tenant-option {
    padding: 0.75rem 1rem;
    font: inherit;
    text-align: left;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

button.tenant-option:hover, button.tenant-option:focus-visible { border-color: var(--accent); }
.tenant-option.current { cursor: default; font-weight: 600; }

.validation-message, .form-error { color: var(--danger); margin: 0.25rem 0 0; }




/* ---------- Quadro (S-127) ---------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.board-header { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.board-readonly { color: var(--muted); font-size: 0.9rem; }

.board-message {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: max-content;
    max-width: calc(100vw - 2rem);
    box-sizing: border-box;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background: var(--surface);
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.2);
}

.board-message-close {
    font: inherit;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
}

/* O quadro como no Trello (S-142): a página com quadro tem a altura da tela, o quadro ocupa o que
   sobra abaixo do cabeçalho e dos filtros, e quem rola é cada coluna, por dentro. A coluna desenhada
   tem a altura dos cards dela, então o "+ Adicionar tarefa" fica logo abaixo do último card, à vista.
   A section continua ocupando a altura toda, transparente: soltar abaixo dos cards ainda é soltar
   na coluna. Cabeçalho alto demais (projeto com descrição longa): a página rola, e o quadro guarda
   uma altura mínima. */
.shell:has(.board) { height: 100vh; height: 100dvh; }
.shell:has(.board) .page { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }

.board {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 20rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.board-column {
    flex: 0 0 17rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: var(--radius);
}

.board-column-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--stroke);
    max-height: 100%;
    min-height: 0;
}

.board-column.closed { flex-basis: 15rem; }
.board-column.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }

.board-column-header { display: flex; align-items: center; gap: 0.5rem; }
.board-column-header h2 { font-size: 0.95rem; margin: 0; }
.board-count { color: var(--muted); font-size: 0.85rem; }

.board-toggle {
    margin-left: auto;
    font: inherit;
    font-size: 0.85rem;
    color: var(--accent);
    background: none;
    border: 0;
    cursor: pointer;
}

.board-cards { flex: 0 1 auto; list-style: none; margin: 0; padding: 2px; display: flex; flex-direction: column; gap: 0.5rem; min-height: 1rem; overflow-y: auto; }

.board-card {
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--stroke);
    cursor: default;
}

.board-card[draggable="true"] { cursor: grab; }
.board-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.board-card.dragging { opacity: 0.4; }
.board-card.cancelled { opacity: 0.6; }
.board-card.cancelled .board-card-title { text-decoration: line-through; }

.board-card-title { overflow-wrap: anywhere; }

.board-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.4rem;
    font-size: 0.8rem;
}

.board-card-meta:empty { display: none; }

/* O selo de prazo da T2-D9: vermelho quando passou, âmbar quando está perto. */
.deadline { padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); font-weight: 600; }
.deadline.late { color: var(--on-danger-soft); background: var(--danger-soft); }
.deadline.soon { color: var(--on-copper-soft); background: var(--copper-soft); }

/* Os chips das labels: a mesma paleta fechada do app (T2-D11), texto na cor e fundo tonal. */
.label-chip {
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    color: var(--ink);
    background: color-mix(in srgb, var(--ink) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
}

.label-0 { --ink: #5F6368; }
.label-1 { --ink: #C5221F; }
.label-2 { --ink: #B45309; }
.label-3 { --ink: #8A6D00; }
.label-4 { --ink: #137333; }
.label-5 { --ink: #00796B; }
.label-6 { --ink: #1A63C7; }
.label-7 { --ink: #4338CA; }
.label-8 { --ink: #7E22CE; }
.label-9 { --ink: #BE185D; }

.subtasks { color: var(--muted); }

.avatar {
    margin-left: auto;
    width: 1.6rem;
    height: 1.6rem;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--surface);
    background: var(--muted);
}

.board-add input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.6rem;
    font: inherit;
    color: var(--text);
    background: transparent;
    border: 1px dashed var(--stroke);
    border-radius: var(--radius-sm);
}

.board-add input:focus { border-style: solid; border-color: var(--accent); outline: none; }

/* Escuro do sistema, quando ninguém escolheu claro; e escuro escolhido em Configurações (S-132). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) .label-0 { --ink: #BDC1C6; }
    :root:not([data-theme=light]) .label-1 { --ink: #F28B82; }
    :root:not([data-theme=light]) .label-2 { --ink: #FDBA74; }
    :root:not([data-theme=light]) .label-3 { --ink: #FDD663; }
    :root:not([data-theme=light]) .label-4 { --ink: #81C995; }
    :root:not([data-theme=light]) .label-5 { --ink: #78D9CC; }
    :root:not([data-theme=light]) .label-6 { --ink: #8AB4F8; }
    :root:not([data-theme=light]) .label-7 { --ink: #A5B4FC; }
    :root:not([data-theme=light]) .label-8 { --ink: #D8B4FE; }
    :root:not([data-theme=light]) .label-9 { --ink: #F9A8D4; }
    :root:not([data-theme=light]) .label-chip { background: color-mix(in srgb, var(--ink) 20%, transparent); }
}
:root[data-theme=dark] .label-0 { --ink: #BDC1C6; }
:root[data-theme=dark] .label-1 { --ink: #F28B82; }
:root[data-theme=dark] .label-2 { --ink: #FDBA74; }
:root[data-theme=dark] .label-3 { --ink: #FDD663; }
:root[data-theme=dark] .label-4 { --ink: #81C995; }
:root[data-theme=dark] .label-5 { --ink: #78D9CC; }
:root[data-theme=dark] .label-6 { --ink: #8AB4F8; }
:root[data-theme=dark] .label-7 { --ink: #A5B4FC; }
:root[data-theme=dark] .label-8 { --ink: #D8B4FE; }
:root[data-theme=dark] .label-9 { --ink: #F9A8D4; }
:root[data-theme=dark] .label-chip { background: color-mix(in srgb, var(--ink) 20%, transparent); }


/* Lista de projetos na Início. */
.project-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.project-list a {
    display: block;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}
.project-list a:hover, .project-list a:focus-visible { border-color: var(--accent); }

/* ---------- Detalhe do card (S-128) ---------- */

.board-card { cursor: pointer; }

.task-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    width: min(30rem, 100vw);
    box-sizing: border-box;
    overflow-y: auto;
    padding: 1rem 1.25rem 2rem;
    background: var(--surface);
    border-left: 1px solid var(--stroke);
    box-shadow: -8px 0 24px rgb(0 0 0 / 0.18);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.task-panel-header h2 { margin: 0; font-size: 1.2rem; }
.task-panel-parent { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.9rem; }

.task-panel-close {
    font: inherit;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
}

button.link {
    padding: 0;
    font: inherit;
    color: var(--accent);
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
}

.task-form { display: flex; flex-direction: column; gap: 0.35rem; }
.task-form label, .task-form legend { margin-top: 0.5rem; font-weight: 600; }

.task-form input:not([type]), .task-form input[type="text"], .task-form input[type="date"], .task-form textarea, .task-form select,
.task-new-label input {
    padding: 0.45rem 0.6rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
}

.task-form textarea { resize: vertical; }
.task-form :disabled { opacity: 0.75; }

.task-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.task-form-row > div { display: flex; flex-direction: column; gap: 0.35rem; }

.task-stages { margin-top: 0.5rem; }
.task-stages summary { cursor: pointer; font-weight: 600; }
.task-stage-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: center;
    gap: 0.4rem 0.75rem;
    margin-top: 0.5rem;
}

.task-stage-grid label { margin: 0; font-weight: 400; }

.task-labels { border: 0; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.task-labels legend { padding: 0; margin-bottom: 0.4rem; font-size: 1rem; float: none; width: auto; }
.label-toggle { font: inherit; font-size: 0.85rem; cursor: pointer; }
.label-toggle:not(.on) { background: transparent; }
.label-toggle.on { font-weight: 600; }

.task-new-label { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.task-new-label input { flex: 1 1 10rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.swatch {
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    border-radius: 50%;
    background: var(--ink);
    border: 2px solid transparent;
    cursor: pointer;
}

.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }

.deadline-line { margin: 0.25rem 0 0; font-size: 0.85rem; }

.task-panel-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

.task-delete-confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--stroke);
}

.task-conflict {
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--danger);
}

.task-conflict h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.task-conflict table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.task-conflict th, .task-conflict td { padding: 0.3rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--stroke); overflow-wrap: anywhere; }

.task-subtasks h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.task-subtasks ul { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.task-subtasks li { display: flex; align-items: center; gap: 0.5rem; }
.task-subtasks li .muted { margin-left: auto; font-size: 0.8rem; }
.task-subtasks li.cancelled button { text-decoration: line-through; }

@media (max-width: 720px) {
    .task-form-row { grid-template-columns: 1fr; }
}

/* ---------- Filtros e "Minhas tarefas" (S-129) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; }
.filter-bar input[type=search], .filter-bar select {
    font: inherit;
    padding: 0.3rem 0.5rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
}
.filter-search { min-width: 12rem; flex: 0 1 16rem; }
.filter-bar .label-toggle { cursor: pointer; font: inherit; font-size: 0.85rem; }
.filter-count { color: var(--muted); font-size: 0.9rem; }

.board-card-context { display: flex; flex-wrap: wrap; gap: 0.5rem; color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }
.small { font-size: 0.85rem; }

.view-toggle { display: inline-flex; margin-left: auto; border: 1px solid var(--stroke); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle button { font: inherit; padding: 0.3rem 0.8rem; border: 0; color: var(--text); background: var(--surface); cursor: pointer; }
.view-toggle button[aria-pressed=true] { color: var(--on-accent); background: var(--accent); }

.task-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); }
.task-table th, .task-table td { padding: 0.5rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--stroke); overflow-wrap: anywhere; }
.task-table th button.link { font-weight: 600; color: var(--text); }
.due-by-project { max-width: 40rem; }
.due-summary a.late { color: var(--danger); font-weight: 600; }

/* ---------- Projetos (S-130) ---------- */
.button-link, .button-secondary, .button-danger, .button-danger-outline {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    font: inherit;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    text-decoration: none;
    cursor: pointer;
}
.button-link { color: var(--on-accent); background: var(--accent); }
.button-secondary { color: var(--accent); background: transparent; }
.button-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button-danger-outline { color: var(--danger); background: transparent; border-color: var(--danger); }
.button-link:focus-visible, .button-secondary:focus-visible, .button-danger:focus-visible, .button-danger-outline:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
button:disabled { opacity: 0.6; cursor: default; }
.board-header .button-link { margin-left: auto; }

.check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 400; }

.status-chip { font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--stroke); color: var(--muted); }
.badge-inactive { font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 999px; color: var(--surface); background: var(--muted); }

.project-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.project-card { padding: 0.8rem 1rem; border-radius: var(--radius); border: 1px solid var(--stroke); background: var(--surface); display: flex; flex-direction: column; gap: 0.35rem; }
.project-card.inactive { opacity: 0.75; border-style: dashed; }
.project-card-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.project-card-title { font-weight: 600; margin-right: auto; overflow-wrap: anywhere; }
.progress-line { display: flex; align-items: center; gap: 0.5rem; }
progress { width: 8rem; height: 0.6rem; accent-color: var(--accent); }

.pager { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }

.project-summary { margin: 0 0 0.75rem; padding: 0.75rem 1rem; border-radius: var(--radius); border: 1px solid var(--stroke); background: var(--surface); }
.project-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.5rem 1rem; margin: 0; }
.project-facts dt { font-size: 0.8rem; color: var(--muted); }
.project-facts dd { margin: 0; overflow-wrap: anywhere; }
.project-description { margin: 0.6rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.project-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.project-actions:empty { display: none; }
.confirm { margin-top: 0.6rem; padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); border: 1px solid var(--danger); display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.confirm p { margin: 0; flex-basis: 100%; }

.project-form { max-width: 44rem; }
.project-links { max-width: 44rem; border: 1px solid var(--stroke); border-radius: var(--radius); padding: 0.6rem 1rem; margin: 1rem 0 0; background: var(--surface); }
.project-links legend { font-weight: 600; padding: 0 0.3rem; float: none; width: auto; font-size: 1rem; }
.project-links ul { list-style: none; margin: 0.4rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.project-links li { display: flex; align-items: center; gap: 0.6rem; }
.project-links .chosen li span { font-weight: 600; }
.project-links input[type=search] {
    font: inherit; width: 100%; box-sizing: border-box; margin-top: 0.3rem; padding: 0.4rem 0.6rem;
    color: var(--text); background: var(--bg); border: 1px solid var(--stroke); border-radius: var(--radius-sm);
}
.project-form ~ .task-panel-actions { margin-top: 1rem; max-width: 44rem; }
.task-form [aria-invalid=true] { border-color: var(--danger); }

/* ---------- Clientes (S-131) ---------- */
.client-table tr.inactive td { color: var(--muted); }
.client-table td .badge-inactive { margin-left: 0.4rem; }
.project-facts .wide { grid-column: 1 / -1; }
.client-address { display: flex; flex-direction: column; gap: 0.35rem; }
.client-address label { margin-top: 0.4rem; font-weight: 600; }
.cep-row { display: flex; align-items: flex-end; gap: 0.6rem; flex-wrap: wrap; }
.cep-row > div { display: flex; flex-direction: column; gap: 0.35rem; }
.client-address input, .project-form input[type=tel], .project-form input[type=email] {
    padding: 0.45rem 0.6rem; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--stroke); border-radius: var(--radius-sm);
}
.client-address [aria-invalid=true] { border-color: var(--danger); }
.confirm .check { flex-basis: 100%; }

/* No celular, a tabela de clientes vira um bloco por cliente, com o rótulo de cada dado. */
@media (max-width: 720px) {
    .client-table thead { display: none; }
    .client-table tr { display: block; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--stroke); }
    .client-table td { display: block; border: 0; padding: 0.1rem 0; }
    .client-table td[data-label]:not(:empty)::before { content: attr(data-label) ": "; color: var(--muted); }
}

/* ---------- Fora do login (S-132) ---------- */
.login-links { margin: 1rem 0 0; font-size: 0.9rem; text-align: center; line-height: 1.8; }
.login-notice { margin: 0.75rem 0 0; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--accent); }
.login-form.resend { margin-top: 0.5rem; }
.privacy { max-width: 46rem; }
.privacy h2 { font-size: 1.05rem; margin: 1.2rem 0 0.3rem; }
.privacy p { margin: 0 0 0.6rem; line-height: 1.5; }

/* O tema escolhido em Configurações (S-132) vale também para os controles nativos. */
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }
.theme-options { border: 0; padding: 0; margin: 0.5rem 0 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.label-new, .label-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0 0 1rem; }
.label-editor input[type=text] { font: inherit; padding: 0.35rem 0.6rem; color: var(--text); background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.label-editor .validation-message { flex-basis: 100%; margin: 0; }
.label-catalog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; max-width: 44rem; }
.label-catalog li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.label-actions { margin-left: auto; display: inline-flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
button.link.danger { color: var(--danger); }
.confirm-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.team-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; max-width: 52rem; }
.team-list > li { padding: 0.7rem 0.9rem; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); }
.team-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.team-head .avatar { margin-left: 0; }
.team-edit { margin-left: auto; }
.team-permissions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.permission-checks { border: 0; padding: 0; margin: 0.6rem 0; display: flex; flex-direction: column; gap: 0.4rem; }
.permission-checks legend, .role-options legend { font-weight: 600; padding: 0; float: none; width: auto; font-size: 1rem; }
.role-options { border: 0; padding: 0; margin: 0.6rem 0; display: flex; flex-direction: column; gap: 0.4rem; }
.check { align-items: flex-start; }
.invite-form { max-width: 44rem; margin-bottom: 1rem; }
.invite-form input[type=email] { font: inherit; width: 100%; box-sizing: border-box; padding: 0.45rem 0.6rem; color: var(--text); background: var(--bg); border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.invite-form h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }

/* O aviso de reconexão (ReconnectModal.razor, S-133). O Blazor troca as classes do <dialog>; cada
   parágrafo aparece só no estado dele. Modal de verdade: enquanto não há servidor, a tela por trás
   não recebe clique nem arrasto. */
.reconnect {
    max-width: 26rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
}
.reconnect::backdrop { background: rgb(0 0 0 / 0.35); }
.reconnect h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.reconnect p { margin: 0 0 0.75rem; }
.reconnect .reconnect-first, .reconnect .reconnect-retrying, .reconnect .reconnect-failed { display: none; }
/* O Blazor deixa o "show" junto do "retrying" e do "failed": o primeiro texto é só o da primeira tentativa. */
.reconnect.components-reconnect-show:not(.components-reconnect-retrying, .components-reconnect-failed) .reconnect-first,
.reconnect.components-reconnect-retrying:not(.components-reconnect-failed) .reconnect-retrying,
.reconnect.components-reconnect-failed .reconnect-failed { display: block; }
.reconnect.components-reconnect-failed button.reconnect-failed { display: inline-block; }

/* As abas do detalhe do card e a atividade (S-134). */
.task-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--stroke); margin-bottom: 0.75rem; }
.task-tabs button { font: inherit; padding: 0.4rem 0.8rem; background: none; color: var(--muted); border: none; border-bottom: 2px solid transparent; cursor: pointer; }
.task-tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.task-tabs button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.task-activity-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.task-activity-list li { display: flex; flex-direction: column; gap: 0.1rem; padding-left: 0.6rem; border-left: 2px solid var(--stroke); }

/* Comentários (S-135): na mesma linha do tempo, com a borda da cor de destaque para não se confundir
   com o histórico. O texto é o que a pessoa digitou: quebra de linha respeitada, palavra longa quebrada. */
.task-activity-list li.task-comment { border-left-color: var(--accent); gap: 0.2rem; }
.task-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.task-comment-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-size: 0.875rem; }
.mention { color: var(--accent); font-weight: 600; }
.comment-box { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.75rem; }
.comment-box textarea { font: inherit; width: 100%; box-sizing: border-box; padding: 0.5rem; resize: vertical; color: var(--text); background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.comment-box textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.comment-box-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.75rem; }
.comment-box-actions > :first-child { margin-right: auto; }
.mention-suggestions { list-style: none; margin: 0; padding: 0.25rem 0; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--surface); max-height: 12rem; overflow-y: auto; }
.mention-suggestions li { padding: 0.15rem 0.6rem; }

/* Avisos (S-136): o sino no topo e a lista em /avisos. */
.bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: inherit;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}
.bell:hover, .bell:focus-visible { color: var(--accent); }
.bell-count {
    position: absolute;
    top: -0.3rem;
    right: -0.45rem;
    min-width: 1.15rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
}
.notification-list { list-style: none; padding: 0; margin: 0 0 1rem; max-width: 46rem; }
.notification { border-left: 3px solid transparent; }
.notification a {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem 0.75rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--stroke);
}
.notification a:hover, .notification a:focus-visible { background: rgba(127, 127, 127, 0.08); }
.notification.unread { border-left-color: var(--accent); }
.notification.unread .notification-text { font-weight: 600; }

/* O botão de envio de fora do login (S-139): o Enter envia, e enquanto envia ele trava e gira. */
.button-submit { padding: 0.55rem 1rem; font-weight: 600; }
.button-submit[aria-busy=true] { cursor: progress; opacity: 0.85; }
.button-submit[aria-busy=true]::before {
    content: "";
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-right: 0.5em;
    vertical-align: -0.1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-spin 0.8s linear infinite;
}
@keyframes button-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .button-submit[aria-busy=true]::before { animation: none; } }

/* Labels sem poluir a tela (S-141): no card, até três e "+N", nome longo cortado; no filtro, uma lista
   com busca, e na barra só as marcadas. */
.card-label { display: inline-block; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.label-more { font-size: 0.8rem; color: var(--muted); padding: 0.1rem 0.35rem; border: 1px solid var(--stroke); border-radius: 999px; }

.label-picker { position: relative; }
.label-picker > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.9rem;
    user-select: none;
}
.label-picker > summary::-webkit-details-marker { display: none; }
.label-picker > summary::after { content: " ▾"; color: var(--muted); }
.label-picker[open] > summary { border-color: var(--accent); }
.label-picker.align-right .label-picker-panel { left: auto; right: 0; }
.label-picker-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.25rem);
    left: 0;
    width: 16rem;
    max-height: 20rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.label-picker-search { padding: 0.35rem 0.5rem; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.label-picker-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.label-picker-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.3rem 0.35rem;
    font: inherit;
    font-size: 0.85rem;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
}
.label-picker-option:hover, .label-picker-option:focus-visible { background: var(--bg); }
.label-picker-check { width: 1rem; color: var(--accent); font-weight: 700; }
.label-picker-option .card-label { max-width: 12rem; }

/* ======================================================================================
   S-144 · O visual do GPro. Esta camada vem por último de propósito: dá a cara nova aos
   componentes de antes sem mexer na marcação de cada tela. Tokens no começo do arquivo.
   ====================================================================================== */

/* ---------- Moldura: topo e menu ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    padding: 0.6rem 1.25rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--stroke);
}
.brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.45rem;
    letter-spacing: -0.01em;
    color: var(--accent);
}
.brand:hover { color: var(--accent-hover); }

.who { gap: 0.6rem; }
.who-avatar {
    width: 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--on-accent-soft);
    background: var(--accent-soft);
}
.who-text { display: flex; flex-direction: column; line-height: 1.2; }
.who-name { font-weight: 600; font-size: 0.9rem; }
.who-tenant { font-size: 0.8rem; text-decoration: none; }
.who-tenant:hover { color: var(--accent); text-decoration: underline; }

.sidebar {
    gap: 0.15rem;
    padding: 1rem 0.75rem;
    background: transparent;
    border-right: 1px solid var(--stroke);
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 0.15s, color 0.15s;
}
.sidebar a:hover { color: var(--text); background: var(--surface-muted); }
.sidebar a.active { color: var(--on-accent-soft); background: var(--accent-soft); font-weight: 700; }
.sidebar a .icon { flex: none; }

.page { padding: 1.75rem 2rem; }

@media (max-width: 720px) {
    .topbar { padding: 0.5rem 0.9rem; }
    .who-text, .logout .button-ghost span { display: none; }
    .sidebar { gap: 0.25rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--stroke); background: var(--surface); }
    .sidebar a { white-space: nowrap; padding: 0.45rem 0.7rem; }
    .page { padding: 1.1rem 1rem; }
}

/* ---------- Botões ---------- */
.button-link, .button-secondary, .button-danger, .button-danger-outline, .button-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.25;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.button-link { color: var(--on-accent); background: var(--accent); box-shadow: var(--shadow-sm); }
.button-link:hover { color: var(--on-accent); background: var(--accent-hover); }
.button-secondary { color: var(--text); background: var(--surface); border-color: var(--stroke-strong); }
.button-secondary:hover { color: var(--text); border-color: var(--muted); background: var(--surface-muted); }
.button-danger { color: var(--surface); background: var(--danger); }
.button-danger-outline { color: var(--danger); background: transparent; border-color: var(--danger); }
.button-danger-outline:hover { background: var(--danger-soft); }
.button-ghost { color: var(--muted); background: transparent; padding: 0.45rem 0.6rem; }
.button-ghost:hover { color: var(--text); background: var(--surface-muted); }
.button-link:active, .button-secondary:active, .button-danger:active, .button-ghost:active { transform: translateY(1px); }
.button-link:focus-visible, .button-secondary:focus-visible, .button-danger:focus-visible, .button-danger-outline:focus-visible, .button-ghost:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}
button:disabled, .button-link[disabled], .button-secondary[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
button.link { color: var(--accent); font-weight: 600; text-decoration: none; }
button.link:hover { text-decoration: underline; }

/* ---------- Login e as telas de fora ---------- */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background:
        radial-gradient(60rem 30rem at 15% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
        radial-gradient(50rem 30rem at 110% 110%, color-mix(in srgb, var(--copper) 12%, transparent), transparent 60%),
        var(--bg);
}
.login-mark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2.4rem;
    letter-spacing: -0.02em;
    color: var(--accent);
    text-decoration: none;
}
.login-tagline { margin: 0; font-size: 0.85rem; color: var(--muted); }
.login-card {
    max-width: 25rem;
    padding: 2rem 2rem 1.75rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 1.35rem; margin-bottom: 0.25rem; }
.login-form { gap: 0.4rem; }
.login-form label { margin-top: 0.75rem; font-size: 0.85rem; font-weight: 600; }
.login-form input { padding: 0.65rem 0.8rem; background: var(--field); }
.login-form .button-submit { margin-top: 1.25rem; padding: 0.7rem 1rem; }
.login-links { font-size: 0.85rem; }
.tenant-option { background: var(--field); border-radius: var(--radius); padding: 0.85rem 1rem; transition: border-color 0.15s, box-shadow 0.15s; }
button.tenant-option:hover { box-shadow: var(--shadow-sm); }

/* ---------- Quadro ---------- */
.board-header { align-items: center; margin-bottom: 0.25rem; }
.board-header h1 { margin-bottom: 0.5rem; }
.board { gap: 1rem; }
.board-column { flex-basis: 18rem; }
.board-column-body {
    gap: 0.6rem;
    padding: 0.75rem 0.65rem 0.65rem;
    background: var(--surface-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
}
.board-column.drop-target { outline: none; }
.board-column.drop-target .board-column-body { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface-muted)); }
.board-column-header { padding: 0 0.3rem; }
.board-column-header h2 { font-size: 0.88rem; font-weight: 700; letter-spacing: 0; }
.board-count {
    min-width: 1.4rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    color: var(--muted);
    background: var(--surface);
}
.status-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: none; background: var(--muted); }
.status-0 { background: #8A9592; }
.status-1 { background: var(--accent); }
.status-2 { background: var(--success); }
.status-3 { background: #6D5BB5; }
.status-4 { background: var(--copper); }
.status-5 { background: var(--danger); }

.board-cards { gap: 0.55rem; padding: 2px 2px 4px; }
.board-card {
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.board-card:hover { border-color: var(--stroke-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.board-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.board-card.dragging { opacity: 0.45; transform: rotate(1.5deg); }
.board-card-title { font-weight: 600; font-size: 0.92rem; line-height: 1.35; }
.board-card-context { margin-top: 0.25rem; }
.board-card-meta { gap: 0.35rem; margin-top: 0.55rem; font-size: 0.75rem; }
.deadline { padding: 0.12rem 0.45rem; border-radius: 6px; font-weight: 600; }
.label-chip { padding: 0.1rem 0.5rem; border-radius: 6px; font-weight: 600; font-size: 0.75rem; border-color: transparent; }
.label-more { border-radius: 6px; font-size: 0.72rem; font-weight: 600; }
.avatar { width: 1.6rem; height: 1.6rem; color: var(--on-accent-soft); background: var(--accent-soft); font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }
.subtasks { font-weight: 600; }

.board-add input {
    padding: 0.5rem 0.65rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.88rem;
}
.board-add input::placeholder { color: var(--muted); opacity: 1; }
.board-add input:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); border-color: transparent; }
.board-add input:focus { color: var(--text); background: var(--surface); border-style: solid; border-color: var(--accent); box-shadow: var(--focus); }

/* ---------- Filtros ---------- */
.filter-bar { gap: 0.5rem; margin-bottom: 1rem; }
.filter-bar input[type=search], .filter-bar select, .label-picker > summary {
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
}
.label-picker > summary { font-weight: 600; color: var(--text); }
.label-picker-panel { border-radius: var(--radius); box-shadow: var(--shadow-lg); border-color: var(--stroke); }
.filter-count { font-weight: 600; }
.view-toggle { border-radius: var(--radius-sm); border-color: var(--stroke); background: var(--surface); padding: 2px; gap: 2px; }
.view-toggle button { border-radius: 6px; font-weight: 600; font-size: 0.85rem; background: transparent; }
.view-toggle button[aria-pressed=true] { color: var(--on-accent-soft); background: var(--accent-soft); }

/* ---------- Painel do card ---------- */
.task-panel {
    width: min(32rem, 100vw);
    padding: 1.25rem 1.5rem 2rem;
    border-left: 1px solid var(--stroke);
    box-shadow: var(--shadow-lg);
}
.task-panel-header h2 { font-size: 1.25rem; }
.task-panel-close { width: 2rem; height: 2rem; border-radius: var(--radius-sm); font-size: 1.4rem; }
.task-panel-close:hover { background: var(--surface-muted); color: var(--text); }
.task-form label, .task-form legend { font-size: 0.85rem; color: var(--text); }
.task-form input:not([type]), .task-form input[type="text"], .task-form input[type="date"], .task-form textarea, .task-form select,
.task-new-label input, .client-address input, .project-form input[type=tel], .project-form input[type=email],
.project-links input[type=search], .invite-form input[type=email], .label-editor input[type=text], .label-picker-search, .comment-box textarea {
    padding: 0.55rem 0.75rem;
    background: var(--field);
    border-color: var(--stroke-strong);
    border-radius: var(--radius-sm);
}
.task-tabs { gap: 0.25rem; border-bottom-color: var(--stroke); }
.task-tabs button { font-weight: 600; padding: 0.5rem 0.85rem; }
.task-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.task-conflict { border-color: var(--danger); background: var(--danger-soft); }
.task-delete-confirm, .confirm { border-color: var(--danger); background: var(--danger-soft); border-radius: var(--radius); }
.task-subtasks-board a { font-weight: 600; text-decoration: none; }
.task-subtasks-board a:hover { text-decoration: underline; }

/* ---------- Listas, cards de projeto e tabelas ---------- */
.project-list a, .project-card, .project-summary, .label-catalog li, .team-list > li, .project-links {
    border-color: var(--stroke);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.project-list a { font-weight: 600; padding: 1rem 1.15rem; transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s; }
.project-list a:hover, .project-list a:focus-visible { border-color: var(--stroke-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.project-card { padding: 1rem 1.15rem; }
.project-card-title { font-weight: 700; }
.project-summary { padding: 1rem 1.25rem; }
.project-facts dt { font-weight: 600; font-size: 0.75rem; }
progress { appearance: none; height: 0.45rem; border: 0; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-muted); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

.task-table, .client-table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}
.task-table th, .client-table th {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-muted);
    padding: 0.6rem 0.75rem;
}
.task-table td, .client-table td { padding: 0.7rem 0.75rem; }
.task-table tbody tr:hover, .client-table tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 30%, transparent); }
.task-table tr:last-child td, .client-table tr:last-child td { border-bottom: 0; }

.status-chip { font-weight: 600; border-color: var(--stroke-strong); }
.badge-inactive { font-weight: 600; }

/* ---------- Avisos, mensagens e o resto ---------- */
.bell { padding: 0.4rem; border-radius: var(--radius-sm); color: var(--muted); }
.bell:hover { background: var(--surface-muted); color: var(--text); }
.bell-count { background: var(--copper); color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.notification-list { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.notification a { padding: 0.85rem 1rem; border-bottom-color: var(--stroke); }
.notification:last-child a { border-bottom: 0; }
.notification.unread { border-left-color: var(--copper); background: color-mix(in srgb, var(--copper-soft) 40%, transparent); }
.board-message { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.reconnect { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); background: var(--surface); }
.login-notice { border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--on-accent-soft); border-color: transparent; }
.mention { color: var(--accent); background: var(--accent-soft); padding: 0 0.25rem; border-radius: 4px; }
.task-activity-list li.task-comment { border-left-color: var(--copper); }

@media (prefers-reduced-motion: reduce) {
    .board-card, .project-list a, .button-link, .button-secondary { transition: none; }
    .board-card:hover, .project-list a:hover { transform: none; }
}

/* Barras de rolagem finas, na cor da borda (o quadro e o menu do celular rolam para o lado). */
* { scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent; }
@media (max-width: 720px) { .sidebar { scrollbar-width: none; } }
h2 { font-size: 1.25rem; }
.page > h2, .page section > h2 { margin: 1.75rem 0 0.75rem; }
.subtask-board-back { margin: 0 0 0.25rem; }
.subtask-board-back a { text-decoration: none; font-weight: 600; }

/* O selo de prazo com o relógio, para não se confundir com as labels (S-144, pedido do Gustavo). */
.deadline { display: inline-flex; align-items: center; gap: 0.25rem; }
.deadline .icon { flex: none; }

/* No detalhe do card, a label desmarcada continua com cara de botão: borda na cor dela. */
.label-toggle { border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent); }
.label-toggle.on { background: color-mix(in srgb, var(--ink) 16%, transparent); border-color: transparent; }
.label-toggle:hover { border-color: var(--ink); }

/* O reboot.css do Fluent lê a fonte de --body-font, que o próprio Fluent define no :root pelo JS. Com
   html:root (mais específico) a fonte do site vale em todo texto, inclusive p, li e td. */
html:root { --body-font: var(--font-sans); }

/* ======================================================================================
   S-145 · Ajustes do Gustavo depois do visual novo.
   ====================================================================================== */

/* ---------- Login sem rolagem: a altura que se vê no celular (sem a barra do navegador) ---------- */
.login-page { min-height: 100vh; min-height: 100dvh; padding: 1.25rem 1rem; }
@media (max-width: 720px), (max-height: 760px) {
    .login-page { gap: 0.75rem; justify-content: flex-start; padding-top: max(1rem, 6vh); }
    .login-mark { font-size: 1.9rem; }
    .login-card { padding: 1.4rem 1.25rem 1.25rem; box-shadow: var(--shadow-md); }
    .login-form label { margin-top: 0.5rem; }
    .login-form .button-submit { margin-top: 0.9rem; }
    .login-links { margin-top: 0.75rem; }
    .login-tagline { display: none; }
}

/* ---------- Menu: lateral no computador, gaveta no celular ---------- */
.menu-toggle, .menu-backdrop { display: none; }
@media (max-width: 720px) {
    .shell { grid-template-rows: auto 1fr; }
    .menu-toggle {
        display: inline-grid;
        place-items: center;
        width: 2.5rem;
        height: 2.5rem;
        margin-left: -0.4rem;
        padding: 0;
        color: var(--text);
        background: transparent;
        border: 0;
        border-radius: var(--radius-sm);
        cursor: pointer;
    }
    .menu-toggle:hover { background: var(--surface-muted); }
    .menu-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
    .topbar { gap: 0.5rem; }

    .sidebar {
        position: fixed;
        z-index: 30;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(17rem, 85vw);
        flex-direction: column;
        gap: 0.2rem;
        padding: 1rem 0.75rem;
        overflow-y: auto;
        background: var(--surface);
        border-right: 1px solid var(--stroke);
        border-bottom: 0;
        box-shadow: var(--shadow-lg);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        scrollbar-width: thin;
    }
    .sidebar a { padding: 0.7rem 0.8rem; font-size: 0.98rem; }
    .menu-open .sidebar { transform: none; }
    .menu-open .menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 25;
        background: rgb(0 0 0 / 0.35);
    }
    .menu-open, .menu-open body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- Projeto: o quadro em primeiro, o detalhe abre e fecha ---------- */
.project-header { justify-content: space-between; align-items: flex-start; gap: 0.75rem 1rem; margin-bottom: 0.75rem; }
.project-heading { min-width: 0; }
.project-heading h1 { margin: 0 0 0.35rem; overflow-wrap: anywhere; }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; font-size: 0.85rem; color: var(--muted); }
.project-meta-progress { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.project-meta-progress progress { width: 5rem; }
.project-details-toggle { flex: none; }
#project-details .project-summary { margin-bottom: 1rem; }

/* ---------- Quadros sem rolagem vertical ----------
   A página com quadro tem a altura exata da tela: o quadro fica com o que sobra e a barra de rolagem
   para o lado fica sempre à vista, no rodapé (a arquiteta não achava o resto das colunas). Quem rola
   para baixo é cada coluna. Com o detalhe do projeto aberto, aí sim a página rola. */
.shell:has(.board) .page { overflow: hidden; }
.shell:has(#project-details) .page { overflow-y: auto; }
.board { min-height: 0; }
.shell:has(#project-details) .board { min-height: 22rem; }
.board { scrollbar-width: auto; scrollbar-color: var(--stroke-strong) transparent; padding-bottom: 0.75rem; }
@media (max-width: 720px) {
    .filter-bar { gap: 0.4rem; }
    .filter-search { flex: 1 1 100%; min-width: 0; }
    .board-column { flex-basis: 82vw; }
}

/* ======================================================================================
   S-146 · Perfil, e o card de cliente no celular.
   ====================================================================================== */
a.who-avatar { text-decoration: none; transition: box-shadow 0.15s; }
a.who-avatar:hover, a.who-avatar:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
a.who-name { color: var(--text); text-decoration: none; }
a.who-name:hover { color: var(--accent); text-decoration: underline; }

.profile-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.profile-header h1 { margin: 0; }
.profile-header p { margin: 0.15rem 0 0; }
.profile-avatar {
    flex: none;
    width: 4rem;
    height: 4rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--on-accent-soft);
    background: var(--accent-soft);
}
.profile-tenant { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; max-width: 60rem; }
.profile-card { padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.profile-card h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.profile-card input[readonly] { color: var(--muted); background: var(--surface-muted); }
.profile-card .task-panel-actions { margin-top: 0.75rem; }

/* No celular, cada cliente é um cartão compacto: o nome em cima e os dados logo abaixo, sem o
   espaço de célula de tabela (o pedido do Gustavo no print). */
@media (max-width: 720px) {
    .client-table { border-radius: var(--radius-lg); }
    .client-table tr { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--stroke); }
    .client-table tr:last-child { border-bottom: 0; }
    .client-table td { padding: 0.1rem 0; font-size: 0.9rem; }
    .client-table td:first-child { padding-bottom: 0.25rem; font-weight: 700; font-size: 1rem; }
    .client-table td:first-child a { text-decoration: none; }
    .client-table tbody tr:hover { background: transparent; }
    .profile-header { gap: 0.75rem; }
    .profile-avatar { width: 3.25rem; height: 3.25rem; font-size: 1.1rem; }
}

/* Os campos de telefone, e-mail e senha dos formulários com o mesmo visual dos de texto. */
.task-form input[type=tel], .task-form input[type=email], .task-form input[type=password], .task-form input[type=search], .task-form input[type=number] {
    padding: 0.55rem 0.75rem;
    background: var(--field);
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius-sm);
}
.page .profile-card > h2 { margin: 0 0 0.5rem; }

/* A janela de confirmação (S-147: sair). O <dialog> é o fundo; a caixa de dentro é o conteúdo, e um
   clique fora dela (no fundo) fecha. */
.confirm-dialog { padding: 0; border: 0; background: transparent; max-width: min(24rem, calc(100vw - 2rem)); color: var(--text); }
.confirm-dialog::backdrop { background: rgb(0 0 0 / 0.4); }
.confirm-dialog-box { padding: 1.4rem 1.5rem 1.25rem; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.confirm-dialog-box h2 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.confirm-dialog-box p { margin: 0 0 1.1rem; font-size: 0.92rem; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* O card (ou a linha) inteiro abre o item (S-148), como no app. O link continua sendo o nome — com
   ele vêm o Ctrl+clique para outra aba, o Tab e o leitor de tela —, e o ::after dele cobre o card
   todo. Só CSS, sem JavaScript. */
.client-table tbody tr, .project-card { position: relative; }
.row-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.row-link:focus-visible { outline: none; }
.row-link:focus-visible::after { box-shadow: var(--focus); }
.client-table tbody tr:has(.row-link) { cursor: pointer; }
.client-table tbody tr:has(.row-link):hover { background: color-mix(in srgb, var(--accent-soft) 30%, transparent); }
.client-table tbody tr:has(.row-link):hover .row-link { color: var(--accent-hover); }
.project-card { transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s; }
.project-card:has(.row-link):hover { border-color: var(--stroke-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.project-card-title { color: var(--text); text-decoration: none; }
.project-card:hover .project-card-title { color: var(--accent); }
@media (max-width: 720px) {
    .client-table tbody tr:has(.row-link):hover { background: color-mix(in srgb, var(--accent-soft) 30%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .project-card { transition: none; } .project-card:hover { transform: none; } }
