/* Workspace foundations. Font asset and license: fonts/README.md. */
@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #202a29;
  --line: #e0e7e3;
  --radius: 10px;
  --accent: #19675c;
  --accent-ink: #19675c;
  --on-accent: #fff;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss01";
  /* Buttons and blocks (request of 04/10/2026): one space between buttons, one between blocks (tables, rows of
     buttons and titles) and one height per place, on every screen. Nothing else sets these sizes. */
  --space-buttons: 8px;
  --space-blocks: 16px;
  --button-height: 44px;
  --button-height-compact: 34px;
}

/* Shared shell and controls retain the existing light theme surfaces. */
.sidebar { padding: 24px 16px 16px; }
.brand { gap: 11px; padding: 0 4px 32px; }
.brand-mark { width: 36px; height: 38px; flex: 0 0 auto; border-radius: 10px; font-size: 19px; font-weight: 650; }
.brand-copy { gap: 5px; }
.brand-copy strong { white-space: normal; overflow-wrap: anywhere; font-size: 12px; line-height: 1.45; font-weight: 600; }
.brand-copy small { font-size: 12px; }
.nav-label { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: .015em; color: var(--muted); padding-bottom: 8px; }
.nav-group { gap: 4px; }
.nav-group a { min-height: 40px; padding: 10px 12px; font-size: 13px; font-weight: 500; gap: 11px; }
.nav-group a[aria-current="page"] { font-weight: 600; }
.desktop-nav { gap: 28px; }
.logout { padding: 17px 0 0; gap: 9px; }
.account-avatar { flex: 0 0 auto; width: 31px; height: 31px; border: 1px solid var(--line); background: #fff; }
.account strong { font-size: 12px; font-weight: 600; }
.account small { font-size: 12px; margin-top: 4px; }
.link-button { font-size: 12px; min-height: 36px; text-decoration: none; }
.content { padding-top: 38px; }
.workspace-header { margin-bottom: 30px; gap: var(--space-blocks); }
/* The buttons of a header keep one line while they fit (request of 04/10/2026): the title gives way first; without room
   beside it, the buttons take a line of their own, still on the right. On the phone the header is a column. */
@media (min-width: 761px) {
  .workspace-header, .record-header { flex-wrap: wrap; }
  .workspace-header > :first-child, .record-header > :first-child { flex: 1 1 18rem; min-width: 0; }
  .header-actions { flex: 0 1 auto; max-width: 100%; margin-left: auto; }
  .workspace-header > .button, .record-header > .button { margin-left: auto; }
}
.workspace-header h1, .record-header h1 { font-weight: 600; font-size: clamp(28px, 2.5vw, 34px); line-height: 1.2; letter-spacing: -.045em; margin: 0 0 8px; overflow-wrap: anywhere; }
.workspace-header .muted { font-size: 14px; }
.eyebrow { text-transform: none; letter-spacing: .01em; font-weight: 500; font-size: 12px; margin-bottom: 8px; }
/* A button has a fixed size (request of 04/10/2026): the width of its text, on one line, and the height of its place:
   44 px, the height of the fields, or 34 px inside tables and line editors. It never stretches or shrinks with the
   window, in a row, a grid or a column. */
.button { flex: 0 0 auto; width: max-content; height: var(--button-height); min-height: var(--button-height); padding: 0 14px; font-size: 12px; font-weight: 600; white-space: nowrap; border-radius: 7px; transition: background-color 140ms, box-shadow 140ms; }
:where(td, .editor-cards) .button { height: var(--button-height-compact); min-height: var(--button-height-compact); padding: 0 10px; }
/* A row of buttons: in their order from the left edge of the group, 8 px apart; what does not fit goes to the next line,
   with the same size and space. A group inside another joins its line. Groups placed on the right (page and section
   headers, form footers) keep their place and follow the rule inside. */
.button-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: var(--space-buttons); }
.button-row > .button-row { display: contents; }
/* 16 px between blocks: two tables, a table and a row of buttons, a row of buttons and a title. */
:is(.table-fit, .editor-cards, .button-row) + :is(.table-fit, .editor-cards, .button-row, h2, h3, .section-heading),
:is(h2, h3, .section-heading) + .button-row { margin-top: var(--space-blocks); }
/* Collapsible blocks (decisions of 05/10/2026): every screen with two or more blocks shows them collapsed, each a card
   whose whole title line opens and closes it, with the title, a short summary, the buttons of the block and the arrow
   on the right (down when closed, up when open). A block inside another one is a lighter card. No animation. */
.block { min-width: 0; margin: 0 0 var(--space-blocks); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.block > .block-head { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 18px; border-radius: var(--radius); cursor: pointer; list-style: none; }
.block > .block-head::-webkit-details-marker { display: none; }
.block > .block-head:hover { background: var(--hover); }
.block[open] > .block-head { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.block-heading { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; min-width: 0; }
.block-title { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.015em; overflow-wrap: anywhere; }
/* A title that opens a page of its own (`link`, decision of 05/10/2026): the rest of the line opens and closes. */
.block-link { color: inherit; text-decoration: none; }
.block-link:hover, .block-link:focus-visible { color: var(--accent-ink); text-decoration: underline; }
.block-note { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.block-actions { flex: 0 0 auto; }
.block-arrow { flex: 0 0 auto; width: 9px; height: 9px; margin: -5px 4px 0 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.block[open] > .block-head > .block-arrow { margin-top: 5px; transform: rotate(-135deg); }
.block > .block-body { min-width: 0; padding: 4px 18px 20px; }
.block-description { max-width: 90ch; margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.block .block { margin: var(--space-blocks) 0 0; background: var(--canvas); }
.block .block > .block-head { min-height: 48px; padding: 6px 14px; }
.block .block .block-title { font-size: 14px; }
.block .block > .block-body { padding: 2px 14px 14px; }
.block-body > :last-child, .block-body > .field:last-child { margin-bottom: 0; }
/* Request of 05/10/2026: a problem without a field of its own marks the block it belongs to, with the message on top. */
.block.block-error { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger); }
.block.block-pending { border-color: var(--warning); box-shadow: inset 4px 0 0 var(--warning); }
.block-messages { margin-bottom: 14px; font-size: 13px; }
/* "Abrir todos / Recolher todos", drawn by app.js above the first block of a screen with two or more. */
.blocks-toggle { justify-content: flex-end; margin: 0 0 var(--space-blocks); }
.button.secondary { border-color: var(--strong-line); color: var(--ink); }
.button.secondary:hover, .button.ghost:hover { background: var(--soft); filter: none; }
.button:active { transform: none; }
.panel, .card { box-shadow: 0 2px 4px color-mix(in srgb,var(--ink) 2.5%,transparent); }
.panel h2, .recent-panel h2 { font-weight: 600; font-size: 16px; letter-spacing: -.025em; margin: 0; }
.panel-header { align-items: flex-start; }
.panel-header a { font-weight: 500; }
.control { border-color: var(--control-border); border-radius: 7px; font-size: 13px; min-height: 40px; }
.control::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.status, .priority { font-size: 12px; line-height: 1.6; font-weight: 500; padding: 3px 8px; }
.priority-normal, .priority-low { color: var(--muted); background: var(--canvas); }
.status-open, .status-doing { background: var(--soft); color: var(--accent-ink); }
.record-title { color: var(--ink); font-size: 14px; font-weight: 550; line-height: 1.55; text-decoration: none; overflow-wrap: anywhere; }
.record-title:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.text-action { color: var(--accent-ink); font-size: 12px; font-weight: 550; text-decoration: none; white-space: nowrap; padding: 4px 0; }
.text-action:hover { text-decoration: underline; }
.workspace-kicker { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; color: var(--muted); font-size: 12px; }
.workspace-kicker time { text-transform: capitalize; }
.section-description { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; padding: 1px 7px; margin-left: 6px; background: var(--soft); border-radius: 5px; color: var(--accent-ink); font-size: 12px; font-weight: 550; vertical-align: middle; font-variant-numeric: tabular-nums; }

/* Meu dia: compact overview, with natural-height work and context columns. */
.day-header { margin-bottom: 28px; }
.day-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 36px; padding: 20px 0; }
.day-stat { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: center; padding: 0 24px; color: var(--ink); text-decoration: none; border-left: 1px solid var(--line); min-width: 0; }
.day-stat:first-child { border-left: 0; padding-left: 0; }
.day-stat:last-child { padding-right: 0; }
.day-stat .stat-label { font-size: 12px; font-weight: 550; }
.day-stat strong { grid-column: 2; grid-row: 1 / 3; font-size: 32px; line-height: 1; font-weight: 500; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.day-stat small { color: var(--muted); font-size: 12px; }
.day-stat:hover .stat-label { color: var(--accent-ink); text-decoration: underline; }
.day-stat.needs-attention strong, .day-stat.needs-attention .stat-label { color: var(--danger); }
.day-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(275px, 1fr); align-items: start; gap: 32px; }
.focus-panel { padding: 22px 24px 0; overflow: hidden; }
.focus-panel .panel-header { margin-bottom: 22px; }
.focus-list { list-style: none; margin: 0; padding: 0; }
.focus-list li { display: flex; gap: 14px; align-items: flex-start; padding: 20px 0; border-top: 1px solid var(--line); }
.sequence-number { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); padding-top: 4px; }
.focus-task { flex: 1; min-width: 0; }
.task-context { color: var(--muted); font-size: 12px; margin: 5px 0 10px; overflow-wrap: anywhere; }
.task-signals { display: flex; flex-wrap: wrap; gap: 6px; }
.task-date { flex: 0 0 auto; display: grid; justify-items: end; gap: 5px; padding-top: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.task-date small { color: var(--muted); font-size: 11px; }
.is-overdue, .is-overdue small { color: var(--danger); }
.panel-footnote { margin: 0 -24px; padding: 12px 24px; background: var(--canvas); border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.recent-panel { min-width: 0; padding: 2px 0; }
.recent-panel .panel-header { margin-bottom: 12px; }
.recent-cases { list-style: none; margin: 0; padding: 0; }
.recent-cases li { padding: 17px 0; border-bottom: 1px solid var(--line); }
.recent-cases li:last-child { border-bottom: 0; }
.recent-cases .record-title { font-size: 13px; display: block; }
.recent-cases p { margin: 5px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.case-reference { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.case-state { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; background: var(--muted); border-radius: 50%; flex: 0 0 auto; }
.status-dot-open { background: var(--accent); }
.calm-empty { padding: 24px 0 30px; }
.calm-empty .empty-label { font-size: 12px; color: var(--accent-ink); }
.calm-empty h3, .calm-empty h2 { margin: 10px 0 6px; font-weight: 550; font-size: 20px; letter-spacing: -.035em; }
.calm-empty p { margin: 0 0 18px; color: var(--muted); font-size: 13px; max-width: 46ch; }

/* Tarefas: one surface for scope, filtering, results and pagination. */
.task-workspace { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; min-width: 0; }
.list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.view-switch { display: flex; gap: 24px; }
.view-switch a { padding: 16px 2px 14px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; }
.view-switch a[aria-current] { border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.result-count { margin: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.task-filters { padding: 18px 20px 12px; }
/* Filter bars (request of 03/10/2026): one grid of columns of the same width, as many as fit with at least 160 px
   (200 px up to 760 px; a narrower space, as a table cell, gets one column as wide as it), so boxes of a column
   share the left edge and boxes of a row share the top, on any screen. The label sits on top of each box; the
   search box takes the whole first row; "Limpar filtros" (and "Filtrar" without JavaScript) take the next cell,
   at the base of the boxes. Boxes have the height of the form fields. */
.record-filters { padding: 0; margin: 0 0 14px; }
.primary-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); align-items: end; gap: 12px; }
.search-field { grid-column: 1 / -1; }
.inline-filter { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
.inline-filter label { font-size: 12px; color: var(--muted); }
.inline-filter :is(select, input, .ts-wrapper) { width: 100%; min-width: 0; }
.inline-filter :is(select, input:not([type=checkbox]):not([type=radio])) { height: var(--field-height, 44px); min-height: var(--field-height, 44px); }
.primary-filters > [data-filter-region="clear"], .primary-filters > noscript { display: flex; align-items: center; min-height: var(--field-height, 44px); }
.primary-filters > [data-filter-region="clear"]:empty { display: none; }
.primary-filters > .button { height: var(--button-height); min-height: var(--button-height); }
.advanced-filters { margin-top: 8px; }
.advanced-filters summary { padding: 8px 0; width: fit-content; cursor: pointer; font-size: 12px; color: var(--muted); }
.advanced-filters summary::marker { color: var(--accent-ink); font-size: 9px; }
.advanced-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 12px; align-items: end; padding: 14px 0 8px; border-top: 1px solid var(--line); margin-top: 6px; }
.advanced-filter-grid label { font-size: 12px; color: var(--muted); font-weight: 500; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 20px 16px; }
.filter-chip { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; padding: 5px 9px; border: 1px solid var(--strong-line); background: var(--soft); color: var(--accent-ink); border-radius: 5px; font-size: 12px; text-decoration: none; overflow-wrap: anywhere; }
.filter-chip span { font-size: 16px; line-height: 1; flex-shrink: 0; }
.filter-chip:hover { border-color: var(--accent); }
.clear-filters { font-size: 12px; padding: 5px 2px; }
.task-table-wrap { border: 0; border-radius: 0 0 10px 10px; }
.task-table { table-layout: fixed; }
.task-table th { background: var(--canvas); padding: 11px 14px; border-top: 1px solid var(--line); text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 500; }
.task-table th:first-child { width: 37%; padding-left: 20px; }
.task-table th:nth-child(2) { width: 20%; }
.task-table th:nth-child(3) { width: 16%; }
.task-table th:nth-child(4) { width: 12%; }
.task-table th:last-child { width: 15%; padding-right: 20px; }
.task-table td { padding: 18px 14px; font-size: 12px; overflow-wrap: anywhere; }
.task-table td:first-child { padding-left: 20px; }
.task-table td:last-child { padding-right: 20px; }
.task-table tbody tr { transition: background-color 140ms; }
.task-table tbody tr:hover, .task-table tbody tr:focus-within { background: var(--canvas); }
.task-table .record-title { font-size: 13px; }
.table-context { margin-top: 5px; font-size: 12px; color: var(--muted); }
.table-context a { color: var(--muted); text-decoration: none; }
.table-context a:hover { color: var(--accent-ink); text-decoration: underline; }
.assignee { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.assignee .avatar { width: 25px; height: 25px; flex-shrink: 0; font-size: 11px; font-weight: 500; }
.date-cell { font-variant-numeric: tabular-nums; }
.date-cell time { white-space: nowrap; font-size: 12px; }
.date-cell small { display: block; font-size: 11px; margin-top: 4px; }
.task-workspace .pagination { border-top: 1px solid var(--line); padding: 14px 20px; margin: 0; }
.task-workspace .pagination p { font-size: 12px; }
.task-empty { padding: 36px 24px 42px; }

@media (max-width: 1200px) {
  .day-columns { grid-template-columns: minmax(0, 1.25fr) minmax(250px, 1fr); gap: 24px; }
  .content { padding-inline: 28px; }
  .task-table th, .task-table td { padding-inline: 10px; }
  .assignee .avatar { display: none; }
  .case-reference { flex-wrap: wrap; gap: 4px 12px; }
}

@media (max-width: 980px) {
  .day-columns { grid-template-columns: 1fr; }
  .recent-cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  .day-stat { padding-inline: 16px; }
  .day-stat strong { font-size: 26px; }
  .advanced-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-table th:first-child { width: 34%; }
  .task-table th:nth-child(2) { width: 18%; }
  .task-table th:nth-child(3) { width: 18%; }
  .task-table th:nth-child(4) { width: 13%; }
  .task-table th:last-child { width: 17%; }
}

@media (max-width: 760px) {
  .sidebar { padding: 16px; }
  .brand { padding: 0 0 16px; }
  .brand-copy strong { font-size: 13px; }
  .logout { margin-top: 8px; padding-top: 12px; }
  .content { padding: 26px 18px 38px; }
  .workspace-kicker { flex-wrap: wrap; gap: 6px; margin-bottom: 20px; font-size: 11px; }
  .workspace-header { margin-bottom: 24px; }
  .workspace-header h1 { font-size: 29px; }
  .workspace-header .muted { font-size: 13px; }
  .header-actions { width: auto; }
  /* As the page header, the header of a section puts its buttons under the title on the phone. */
  .section-heading { flex-direction: column; align-items: flex-start; }
  /* On the phone, the summary of a block goes under its title, and the buttons of the block under them. */
  .block > .block-head { flex-wrap: wrap; padding: 8px 14px; }
  .block-heading { flex: 1 1 0; }
  .block-note { margin-left: 0; text-align: left; flex-basis: 100%; }
  .block-actions { order: 3; flex-basis: 100%; }
  .block > .block-body { padding: 4px 14px 16px; }
  .blocks-toggle { justify-content: flex-start; }
  .day-summary { margin-bottom: 28px; padding-block: 16px; }
  .day-stat { grid-template-columns: 1fr; padding-inline: 12px; gap: 8px; }
  .day-stat strong { grid-column: 1; grid-row: 2; font-size: 27px; }
  .day-stat .stat-label { font-size: 12px; }
  .day-stat small { font-size: 11px; }
  .focus-panel { padding: 18px 16px 0; }
  .panel-footnote { margin-inline: -16px; padding-inline: 16px; }
  .focus-list li { gap: 10px; flex-wrap: wrap; }
  .focus-task { flex-basis: calc(100% - 30px); }
  .task-date { margin-left: 24px; display: flex; gap: 8px; align-items: center; }
  .task-date small { font-size: 12px; }
  .recent-cases { grid-template-columns: 1fr; }
  .case-reference { flex-wrap: nowrap; }
  .list-heading { padding-inline: 16px; }
  .result-count span { display: none; }
  .view-switch { gap: 18px; }
  .task-filters { padding: 16px 14px 8px; }
  .primary-filters { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 10px; }
  .advanced-filter-grid { gap: 14px 10px; }
  .active-filters { padding-inline: 14px; }
  .task-table-wrap { background: transparent; padding: 0 12px 12px; }
  .task-table tr { margin: 0 0 12px; border-radius: 7px; padding: 0 0 7px; }
  .task-table tr:last-child { margin-bottom: 0; }
  .task-table td, .task-table td:first-child, .task-table td:last-child { padding: 7px 12px; font-size: 12px; grid-template-columns: 96px minmax(0, 1fr); }
  .task-table td::before { font-size: 12px; font-weight: 500; }
  .task-table td:first-child { display: block; padding: 14px 12px; margin-bottom: 7px; border-bottom: 1px solid var(--line); }
  .task-table td:first-child::before { display: none; }
  .task-table .record-title { font-size: 13px; }
  .task-table .status, .task-table .priority { justify-self: start; }
  .task-table .date-cell small { grid-column: 2; }
  .task-table .assignee .avatar { display: grid; }
  .assignee { font-size: 12px; }
}

@media (max-width: 380px) {
  .content { padding-inline: 14px; }
  .day-stat { padding-inline: 9px; }
  .day-stat small { font-size: 11px; }
  .advanced-filter-grid { grid-template-columns: 1fr; }
  .case-reference { flex-wrap: wrap; }
}

/* Resultado (venda menos custo real, decisões de 05/10/2026): positivo na cor da empresa, negativo em vermelho, em
   qualquer tela (execução, "Orçado × executado", contratos, painel). */
.result-positive { color: var(--accent-ink); }
.result-negative { color: var(--danger); }

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