/*
 * Atividades — identidade SIMPLE
 * Paleta do manual de marca: laranja assinatura #F15A24, grafite #333333,
 * cinza claro #D1D3D4, branco. Tipografia: Lato (a mesma do site simple.com.br).
 * O laranja puro é usado em destaques; em fundos de botão com texto branco usa-se
 * um tom mais escuro para manter o contraste acessível (4.8:1).
 */
:root {
    --orange: #F15A24;          /* assinatura: marcas, barras, foco */
    --orange-action: #C94616;   /* fundo de botões (texto branco legível) */
    --orange-deep: #B93F12;     /* links e hover */
    --orange-wash: #FEF0EA;     /* fundo suave de destaque */
    --graphite: #333333;
    --ash: #5F6264;             /* texto secundário */
    --mist: #D1D3D4;            /* linhas e bordas */
    --mist-soft: #E8E9EA;
    --canvas: #F4F5F5;          /* fundo da aplicação */
    --paper: #FFFFFF;
    --success: #1E7F55;
    --success-wash: #E8F5EE;
    --danger: #B3261E;
    --danger-wash: #FDECEA;
    --radius: 3px;
    --sidebar: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--graphite);
    background: var(--canvas);
    font-variant-numeric: tabular-nums;
}
a { color: var(--orange-deep); text-underline-offset: 2px; }
a:hover { color: var(--graphite); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

/* Separador da marca: a barra laranja do slogan "Estratégia | Gestão | Operação" */
.sep { display: inline-block; width: 1.5px; height: .95em; background: var(--orange); margin: 0 .6em; vertical-align: -.12em; }

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

.sidebar {
    width: var(--sidebar);
    flex-shrink: 0;
    background: var(--paper);
    border-right: 1px solid var(--mist);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-logo { display: block; padding: 28px 24px 20px; }
.sidebar-logo img { display: block; width: 188px; }

.tenant-switcher { margin: 0 24px 8px; }
.tenant-switcher-label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 400; color: var(--ash); }
.tenant-switcher-row { display: flex; gap: 6px; }
.tenant-switcher select { flex: 1; min-width: 0; width: 100%; max-width: none; padding: 7px 10px; font-weight: 700; }
.btn-icon { padding: 6px 9px; display: inline-flex; align-items: center; }

.nav { flex: 1; padding: 8px 0 16px; }
.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 24px 9px 21px;
    border-left: 3px solid transparent;
    color: var(--graphite);
    text-decoration: none;
}
.nav a:hover { background: var(--canvas); color: var(--graphite); }
.nav a.active { border-left-color: var(--orange); background: var(--orange-wash); font-weight: 700; }
.nav-icon { flex: none; width: 18px; height: 18px; color: var(--graphite); }
.nav a.active .nav-icon { color: var(--orange); }
.inline-icon { width: 15px; height: 15px; vertical-align: -2px; }
.form-mark { color: var(--ash); margin-left: 4px; }
.nav-group { margin: 20px 24px 6px; font-size: 13px; color: var(--ash); }

.sidebar-user { border-top: 1px solid var(--mist); padding: 16px 24px 20px; font-size: 14px; }
.sidebar-user-name { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--graphite); text-decoration: none; }
.sidebar-user-name:hover { color: var(--orange-deep); }
.sidebar-user-meta { display: block; color: var(--ash); margin: 2px 0 10px; }
.sidebar-user-meta, .sidebar-user form { padding-left: 30px; } /* alinha com o nome, depois do ícone */
.link-button { background: none; border: 0; padding: 0; color: var(--orange-deep); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { background: none; color: var(--graphite); }

.content { flex: 1; min-width: 0; padding: 32px 40px 48px; max-width: 1280px; }

.mobile-bar { display: none; }

@media (max-width: 860px) {
    .mobile-bar {
        display: flex; align-items: center; justify-content: space-between;
        position: sticky; top: 0; z-index: 20;
        background: var(--paper); border-bottom: 1px solid var(--mist); padding: 10px 16px;
    }
    .mobile-brand { display: flex; align-items: center; gap: 10px; color: var(--graphite); text-decoration: none; font-weight: 700; }
    .menu-toggle { background: var(--paper); color: var(--graphite); border: 1px solid var(--mist); }
    .menu-toggle:hover, .menu-toggle:focus { background: var(--canvas); color: var(--graphite); border-color: #B7BABB; }
    .shell { display: block; }
    .sidebar { display: none; position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--mist); }
    .menu-open .sidebar { display: flex; }
    .sidebar-logo { display: none; }
    .content { padding: 20px 16px 40px; }
}

/* ---------- Tipografia ---------- */
h1, h2, h3 { color: var(--graphite); line-height: 1.2; }
h1 { font-size: 30px; font-weight: 900; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: 19px; font-weight: 700; margin: 0 0 12px; }
.muted { color: var(--ash); }
.hint { color: var(--ash); font-size: 13px; margin: 6px 0 0; }
.text-danger { color: var(--danger); }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header p { margin: 6px 0 0; }

/* ---------- Superfícies ---------- */
.card { background: var(--paper); border: 1px solid var(--mist); border-radius: var(--radius); padding: 24px; }
.card + .card { margin-top: 16px; }
.empty { color: var(--ash); padding: 32px 8px; text-align: center; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; border-left: 3px solid; }
.alert-success { background: var(--success-wash); color: var(--success); border-color: var(--success); }
.alert-error { background: var(--danger-wash); color: var(--danger); border-color: var(--danger); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--mist-soft); vertical-align: middle; }
thead th { font-size: 13px; font-weight: 700; color: var(--ash); border-bottom: 1px solid var(--mist); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFAFA; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
/* Ordenação e busca (public/js/tables.js) */
.table-tools { position: sticky; left: 0; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.table-tools input[type=search] {
    width: 100%; max-width: 320px; padding: 8px 12px;
    border: 1px solid var(--mist); border-radius: var(--radius); font: inherit; font-size: 14px; color: var(--graphite); background: var(--paper);
}
.table-tools .table-count { font-size: 13px; white-space: nowrap; }
th.sortable { padding-top: 0; padding-bottom: 0; }
button.sort-button {
    min-height: 40px; padding: 0; gap: 6px; justify-content: flex-start;
    background: none; border: 0; border-radius: 0;
    color: inherit; font: inherit; text-align: left; white-space: nowrap;
}
button.sort-button:hover { background: none; color: var(--graphite); }
.sort-indicator { display: inline-block; width: 8px; font-size: 10px; line-height: 1; color: var(--mist); }
.sort-indicator::after { content: "\2195"; } /* ↕ */
th.sortable:hover .sort-indicator { color: var(--ash); }
th[aria-sort] { color: var(--graphite); }
th[aria-sort] .sort-indicator, th[aria-sort]:hover .sort-indicator { color: var(--orange); }
th[aria-sort=ascending] .sort-indicator::after { content: "\25B2"; }  /* ▲ */
th[aria-sort=descending] .sort-indicator::after { content: "\25BC"; } /* ▼ */

.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* Executar / Não se aplica (Minhas tarefas): botões de mesma largura, sempre alinhados */
.run-actions { display: flex; gap: 8px; justify-content: flex-end; }
.run-actions form { margin: 0; }
.run-actions button { width: 120px; white-space: nowrap; }
@media (max-width: 700px) { .run-actions { flex-direction: column; align-items: stretch; } }
.actions form { margin: 0; }

/* Ações dentro de tabelas: links compactos numa linha, separados pela barra da marca */
td .actions { flex-wrap: nowrap; gap: 0; align-items: center; }
td .actions > * + * { border-left: 1.5px solid var(--orange); margin-left: 10px; padding-left: 10px; }
td .actions .btn-sm, td .actions button.btn-sm {
    min-height: 0; padding: 2px 0; background: none; border: 0; border-radius: 0;
    color: var(--orange-deep); font-weight: 700; white-space: nowrap;
}
td .actions .btn-sm:hover, td .actions button.btn-sm:hover { background: none; color: var(--graphite); text-decoration: underline; text-underline-offset: 3px; }
td .actions .btn-danger, td .actions button.btn-danger { color: var(--danger); }
td .actions .btn-danger:hover, td .actions button.btn-danger:hover { color: var(--danger); background: none; }
td .actions .badge { margin: 0; }
/* Ação principal da linha (ex.: Executar) continua sendo botão */
td .actions button.btn-solid { min-height: 34px; padding: 4px 14px; background: var(--orange-action); color: #fff; border: 1px solid var(--orange-action); border-radius: 2px; }
td .actions button.btn-solid:hover { background: var(--orange-deep); color: #fff; text-decoration: none; }
td .actions > .muted { font-size: 13px; }

/* ---------- Formulários ---------- */
label { display: block; margin: 16px 0 6px; font-weight: 700; font-size: 14px; }
label.check, label[style*="font-weight:normal"] { font-weight: 400; display: flex; align-items: center; gap: 8px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=month], input[type=file], select, textarea {
    width: 100%; max-width: 520px;
    padding: 10px 12px;
    border: 1px solid var(--mist);
    border-radius: var(--radius);
    font: inherit;
    color: var(--graphite);
    background: var(--paper);
}
input:hover, select:hover, textarea:hover { border-color: #B7BABB; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(241, 90, 36, .18); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--orange-action); }
select[multiple] { min-height: 150px; }
.template-summary { background: var(--canvas); border-radius: 6px; padding: 12px 16px; margin-bottom: 8px; }
.template-summary p { margin: 0 0 6px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 4px 0; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain:disabled input { background: var(--canvas); color: var(--ash); }
.form-section { font-size: 18px; margin: 28px 0 4px; padding-top: 20px; border-top: 1px solid var(--mist); }
.field-error { color: var(--danger); font-size: 13px; margin-top: 6px; }
.form-actions { margin-top: 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.filter-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-inline label { margin: 0; }
.filter-inline select { width: auto; max-width: 100%; }
.access-table select { margin: 0; min-width: 140px; }
.access-table td { vertical-align: middle; }
.access-table .check { margin: 0; justify-content: center; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 16px; }
.filter-grid label { margin-top: 0; }
.filter-grid select, .filter-grid input { max-width: none; }

/* ---------- Botões ---------- */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: 8px 18px;
    background: var(--orange-action); color: #fff;
    border: 1px solid var(--orange-action); border-radius: 2px;
    font: inherit; font-weight: 700; font-size: 14px;
    text-decoration: none; cursor: pointer;
}
button:hover, .btn:hover { background: var(--orange-deep); border-color: var(--orange-deep); color: #fff; }
.btn-secondary, button.btn-secondary { background: var(--paper); color: var(--graphite); border-color: var(--mist); }
.btn-secondary:hover, button.btn-secondary:hover { background: var(--canvas); color: var(--graphite); border-color: #B7BABB; }
.btn-danger, button.btn-danger { background: var(--paper); color: var(--danger); border-color: #E7B7B3; }
.btn-danger:hover, button.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm, button.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
button:disabled:hover { background: var(--orange-action); border-color: var(--orange-action); }
button.btn-secondary:disabled:hover { background: var(--paper); border-color: var(--mist); }

/* ---------- Selos ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--mist-soft); color: var(--graphite); white-space: nowrap; }
.badge-success { background: var(--success-wash); color: var(--success); }
.badge-muted { background: var(--mist-soft); color: var(--ash); }
.badge-danger { background: var(--danger-wash); color: var(--danger); }
.badge-warning { background: var(--orange-wash); color: var(--orange-deep); }

/* ---------- Página inicial ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--paper); border: 1px solid var(--mist); border-radius: var(--radius);
    padding: 20px 24px; text-decoration: none; color: var(--graphite);
}
.stat:hover { border-color: var(--orange); color: var(--graphite); }
.stat strong { font-size: 40px; font-weight: 900; line-height: 1.1; }
.stat.is-late strong { color: var(--orange-action); }
.home-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.home-grid .card + .card { margin-top: 0; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: 1fr; } }
.mural-card { display: flex; flex-direction: column; }
/* Quadro baixo (≈3 avisos) com rolagem; no computador acompanha a altura do gráfico ao lado */
.mural-list { list-style: none; margin: 0; padding: 0 8px 0 0; height: 210px; overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 1001px) { .mural-list { flex: 1 1 0; height: auto; min-height: 180px; } }
.pin-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; color: var(--orange); }
.pin-badge .pin-icon { width: 12px; height: 12px; color: currentColor; }
.mural-item { padding: 12px 0; border-bottom: 1px solid var(--mist-soft); }
.mural-item:first-child { padding-top: 0; }
.mural-item:last-child { border-bottom: 0; }
.mural-item .muted { font-size: 13px; margin-bottom: 2px; }
.mural-heading { display: block; font-weight: 700; overflow-wrap: anywhere; }
.mural-item .link-button { font-size: 14px; margin-top: 2px; }
/* Lista da tela Mural: título + até 2 linhas do texto; o completo abre na janela */
.mural-excerpt { white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.mural-more { font-size: 14px; margin-top: 2px; }
.mural-more[hidden] { display: none; }

/* ---------- Janela (modal) ---------- */
.modal {
    width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
    padding: 0; border: 1px solid var(--mist); border-top: 3px solid var(--orange);
    border-radius: var(--radius); color: var(--graphite); background: var(--paper);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
}
.modal::backdrop { background: rgba(51, 51, 51, .55); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 12px; border-bottom: 1px solid var(--mist-soft); }
.modal-head h2 { margin: 2px 0 0; overflow-wrap: anywhere; }
.modal-head .muted { font-size: 13px; }
.modal-body { padding: 16px 24px 24px; white-space: pre-line; overflow-wrap: anywhere; }
/* Janela com uma página dentro (execução aberta pelo diário) */
.modal-frame { width: min(860px, calc(100vw - 32px)); height: min(820px, calc(100vh - 48px)); }
.modal-frame[open] { display: flex; flex-direction: column; }
.modal-frame .modal-head { align-items: center; padding: 12px 16px 12px 24px; }
.modal-frame .modal-head h2 { font-size: 16px; margin: 0; }
.modal-frame iframe { flex: 1; width: 100%; border: 0; background: var(--paper); }
@media (max-width: 700px) {
    .modal-frame { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-top: 3px solid var(--orange); border-radius: 0; }
}
.in-window { max-width: none; padding: 20px 24px 32px; }
.in-window .page-header .btn-secondary { display: none; } /* "Voltar": a janela tem o próprio Fechar */
@media (max-width: 700px) { .in-window { padding: 16px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.field-help { margin: 4px 0 0; font-size: 13px; }

/* ---------- Gráfico de rosca ---------- */
.donut-wrap { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.donut-hole { width: 112px; height: 112px; border-radius: 50%; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-hole strong { font-size: 24px; font-weight: 900; }
.donut-hole span { font-size: 12px; color: var(--ash); }
/* Gráfico de linhas (partials/line-chart) */
.line-chart { position: relative; margin: 0 0 12px; }
.line-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.line-chart svg:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.lc-grid { stroke: #e9ebed; stroke-width: 1; }
.lc-axis { font-size: 11px; fill: var(--ash); }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { stroke: var(--paper); stroke-width: 2; }
.lc-label { font-size: 12px; fill: var(--graphite); }
.lc-cross { stroke: var(--graphite); stroke-width: 1; opacity: .5; }
.lc-hit { fill: transparent; cursor: crosshair; }
.lc-tooltip { position: absolute; pointer-events: none; background: var(--paper); border: 1px solid var(--mist); border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: 8px 10px; font-size: 13px; min-width: 150px; z-index: 5; }
.lc-tip-title { color: var(--ash); margin-bottom: 4px; }
.lc-tip-row { display: flex; align-items: center; gap: 8px; }
.lc-tip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.lc-tip-name { color: var(--ash); }
.lc-legend { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--graphite); }
.lc-legend li { display: flex; align-items: center; gap: 6px; }
.lc-key { width: 14px; height: 2px; border-radius: 1px; display: inline-block; }

/* Visão da rede */
.network-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.network-grid .card + .card { margin-top: 0; }
.network-card h2 { margin: 0; }
.network-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.network-card > .muted { margin: 0 0 10px; font-size: 13px; text-align: right; }
.network-rate { font-size: 32px; font-weight: 900; line-height: 1; }
.stacked-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #e4e7eb; margin-bottom: 14px; }
.stacked-bar span { display: block; height: 100%; }
.network-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0 0 16px; }
.network-numbers dt { font-size: 13px; color: var(--ash); }
.network-numbers dd { margin: 0; font-size: 20px; font-weight: 700; }
.network-numbers .is-late dd { color: var(--orange-action); }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend li strong { margin-left: auto; padding-left: 16px; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; flex-shrink: 0; }

/* ---------- Diário ---------- */
.diary-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.diary-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.diary-nav .btn { gap: 4px; }
.segmented { display: inline-flex; }
.segmented button { border-radius: 0; margin-left: -1px; }
.segmented button:first-child { border-radius: 2px 0 0 2px; margin-left: 0; }
.segmented button:last-child { border-radius: 0 2px 2px 0; }
.segmented button[aria-pressed=true] { background: var(--graphite); border-color: var(--graphite); color: #fff; position: relative; }
.diary-legend { font-size: 12px; gap: 4px 14px; margin-bottom: 10px; color: var(--ash); }
.diary-legend .swatch { width: 10px; height: 10px; }

.diary-scroll { overscroll-behavior-x: contain; }
table.diary { --day-w: 24px; --task-w: 220px; width: max-content; border-collapse: separate; border-spacing: 3px; }
table.diary th, table.diary td { padding: 0; border: 0; text-align: center; font-size: 12px; }
table.diary thead th { color: var(--ash); font-weight: 400; }
table.diary th.day, table.diary td.cell { width: var(--day-w); min-width: var(--day-w); max-width: var(--day-w); }
table.diary th.day { line-height: 1.2; padding: 2px 0 4px; }
table.diary th.day .dow { display: block; font-size: 10px; color: #8A8D8F; }
table.diary th.weekend { background: var(--canvas); border-radius: 2px; }
/* Hoje: coluna contínua em laranja suave (a sombra preenche o espaçamento entre células) */
table.diary { --today-wash: #FBDDCF; }
table.diary th.day.today, table.diary td.cell.today { box-shadow: 0 0 0 3px var(--today-wash); }
table.diary th.day.today { background: var(--today-wash); color: var(--orange-deep); font-weight: 900; }
table.diary th.today .dow { color: var(--orange-deep); }
table.diary th.today .dom { display: inline-block; min-width: 16px; background: var(--orange); color: #fff; border-radius: 2px; padding: 0 2px; }
table.diary.is-dense th.day.today, table.diary.is-dense td.cell.today { box-shadow: 0 0 0 2px var(--today-wash); }
table.diary.is-dense { border-spacing: 2px; }
table.diary.is-dense th.day { font-size: 10px; }
table.diary.is-dense th.day .dow { display: none; }
table.diary.is-tiny th.day:not(.mark):not(.today) .dom { visibility: hidden; }
table.diary.is-tiny th.day .dom { display: block; width: var(--day-w); overflow: visible; white-space: nowrap; }
table.diary .diary-months th { text-align: left; font-weight: 700; color: var(--graphite); font-size: 12px; text-transform: capitalize; border-left: 1px solid var(--mist); padding: 0 0 2px 6px; white-space: nowrap; }
table.diary .diary-months th.diary-task { border-left: 0; padding: 0; vertical-align: bottom; }
table.diary .diary-months th span { position: sticky; left: calc(var(--task-w) + 12px); }
/* Sem o destaque genérico de linha (que apagava as células); só o nome da tarefa realça */
table.diary tbody tr:hover td.diary-section { background: none; }
table.diary tbody tr:hover .diary-task { color: var(--orange-deep); }
table.diary .diary-task {
    width: var(--task-w); min-width: var(--task-w); max-width: var(--task-w);
    text-align: left; padding: 4px 12px 4px 0; font-size: 14px; font-weight: 400; color: var(--graphite);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    position: sticky; left: 0; z-index: 2; background: var(--paper);
    box-shadow: -4px 0 0 var(--paper), 4px 0 0 var(--paper), 6px 0 6px -4px rgba(0,0,0,.12);
}
table.diary thead .diary-task { color: var(--ash); font-size: 13px; }
/* Faixa de cada frequência: rótulo com marcador laranja e linha fina em toda a largura */
table.diary .diary-section { text-align: left; font-weight: 700; padding: 18px 0 6px; border-bottom: 1px solid var(--mist); }
table.diary .diary-section span {
    position: sticky; left: 0; display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--graphite);
}
table.diary .diary-section span::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--orange); }
/* Zebra muito leve nos nomes, para seguir a linha até as células */
table.diary tbody tr.zebra .diary-task { background: #F8F8F8; box-shadow: -4px 0 0 #F8F8F8, 4px 0 0 #F8F8F8, 6px 0 6px -4px rgba(0,0,0,.12); }
table.diary .cell { height: 26px; background: var(--mist-soft); border-radius: 2px; }
table.diary .cell.weekend { background: #DCDEDF; }
table.diary .cell a { display: block; width: 100%; height: 26px; border-radius: 2px; }
table.diary .cell a:hover, table.diary .cell a:focus-visible { box-shadow: inset 0 0 0 2px var(--graphite); outline: none; }
@media (max-width: 700px) {
    table.diary { --task-w: 120px; }
    table.diary .diary-task { font-size: 13px; white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }
    .diary-toolbar { justify-content: flex-start; }
    .diary-toolbar .segmented { width: 100%; }
    .diary-toolbar .segmented button { flex: 1; }
    .diary-nav .wide-only { display: none; }
}

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--paper); }
.login-brand {
    position: relative; overflow: hidden;
    background: var(--graphite);
    display: flex; align-items: flex-end;
    padding: 48px;
}
.login-symbol {
    position: absolute; width: 118%; max-width: none;
    right: -38%; top: -12%;
    opacity: .92;
}
.login-tagline {
    position: relative; margin: 0;
    color: #fff; font-weight: 300; font-size: clamp(13px, 1.45vw, 19px); letter-spacing: .22em;
    white-space: nowrap;
}
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 88px); max-width: 560px; }
.login-logo { width: 220px; margin-bottom: 36px; }
.login-panel h1 { font-size: 26px; margin-bottom: 8px; }
.login-panel input { max-width: none; }
.login-single { grid-template-columns: 1fr; place-items: center; background: var(--canvas); }
.login-single .login-panel { background: var(--paper); border: 1px solid var(--mist); border-radius: var(--radius); margin: 24px 16px; }
@media (max-width: 860px) {
    .login { grid-template-columns: 1fr; }
    .login-brand { min-height: 180px; padding: 24px; }
    .login-symbol { width: 70%; right: -18%; top: -40%; }
    .login-tagline { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Páginas de erro ---------- */
.error-page { max-width: 520px; margin: 14vh auto 0; padding: 0 16px; text-align: center; }
.error-page h1 { margin: 4px 0 12px; }
.error-code { color: var(--orange-deep); font-weight: 700; margin: 20px 0 0; }
