/* NossaTerra v1. Mobile first; larger screens get a centered column.
   Palette "Herança Natural" (Flavia's briefing): olive, deep green, sand, ivory, soft gold. One font: Inter.
   Older users first: large text and targets, high contrast, a text-size control (html[data-size]). */

/* Inter, self-hosted (Google Fonts v20, variable 100 to 900: one file per subset covers every weight).
   Latin covers Portuguese; latin-ext loads only if a page shows a character from its range. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --olive: #526747;
  --green-deep: #293F32;
  --sand: #E9DFCD;
  --ivory: #FAF7F0;
  --gold: #B49A67;
  --ink: #1F2B24;
  --muted: #5E6559;
  --card: #FFFDF8;
  --line: #DCD1BC;
  --in: #526747;          /* money in */
  --out: #B49A67;         /* money out */
  --alert: #8A3B2E;
  --stripe: #EEEDEA;      /* every other table row (light gray) */
  --radius: 18px;
  --topbar: 60px;
  --chatbar: 76px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { font-size: 18px; -webkit-text-size-adjust: 100%; }
html[data-size="1"] { font-size: 16px; }
html[data-size="3"] { font-size: 20px; }
html[data-size="4"] { font-size: 22px; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.45;
}
a { color: var(--olive); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.icon { width: 1.4em; height: 1.4em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- TOP BAR (fixed) ----
   iOS 26+ draws a "Liquid Glass" blur over the top of a home-screen web app (strong on iOS 27). It
   paints the status bar in this bar's color instead only when the page stays out of the status bar
   area, so the pages' viewport meta has no viewport-fit=cover (WebKit: no obscured top inset, no
   color extension view, blur stays). Pages are pushed down by the bar's height (.topbar ~ main). */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0 14px;
  background: var(--green-deep); color: var(--ivory);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; flex: 1; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand .name { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.2px; white-space: nowrap; }
.version {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 10px; background: var(--gold); color: var(--green-deep);
}
.menu-button {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border: none; border-radius: 14px; background: transparent; color: var(--ivory);
}
.menu-button .icon { width: 30px; height: 30px; }

/* ---- MENU (hamburger) ---- */
.menu {
  position: fixed; z-index: 29; left: 0; right: 0;
  top: calc(var(--topbar) + env(safe-area-inset-top));
  max-height: calc(100dvh - var(--topbar) - env(safe-area-inset-top));
  overflow-y: auto; padding: 8px 12px 16px;
  background: var(--ivory); border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(31, 43, 36, 0.18);
  display: none;
}
.menu.open { display: block; }
.menu-backdrop {
  position: fixed; z-index: 28; left: 0; right: 0; bottom: 0;
  top: calc(var(--topbar) + env(safe-area-inset-top));
  background: rgba(31, 43, 36, 0.25); display: none;
}
.menu-backdrop.open { display: block; }
.menu a, .menu .row {
  display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 0 12px; border-radius: 14px;
  color: var(--green-deep); text-decoration: none; font-weight: 600; font-size: 1.05rem;
}
.menu a .icon { color: var(--olive); }
.menu a.current { background: var(--sand); }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 8px 0; }
.menu .row { justify-content: space-between; font-weight: 500; color: var(--muted); }
.size-buttons { display: flex; gap: 8px; }
.size-buttons button {
  min-width: 52px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--green-deep); font-weight: 700;
}

/* ---- PAGE ---- */
main {
  max-width: 960px; margin: 0 auto;
  padding: 18px 16px calc(var(--chatbar) + 28px + env(safe-area-inset-bottom));
}
.topbar ~ main { padding-top: calc(18px + var(--topbar) + env(safe-area-inset-top)); }
.page-title { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.page-title .icon { width: 34px; height: 34px; color: var(--olive); }
.page-title h1 { margin: 0; font-size: 1.65rem; font-weight: 800; color: var(--green-deep); line-height: 1.15; letter-spacing: -0.3px; }
h2 { font-size: 1.15rem; color: var(--green-deep); margin: 26px 0 10px; }
.muted { color: var(--muted); }
.note { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; }
.warn { color: var(--alert); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}

/* ---- HOME ---- */
.welcome { background: var(--green-deep); color: var(--ivory); border: none; padding: 20px; }
.welcome h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.3px; }
.welcome p { margin: 0; opacity: 0.9; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 132px; padding: 14px 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--green-deep); text-decoration: none; font-weight: 600; font-size: 1.1rem; text-align: center;
}
.tile .icon { width: 40px; height: 40px; color: var(--olive); }
.tile:active, .tile:hover { border-color: var(--olive); background: #F6F1E6; }
.tile small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); margin-top: -6px; }

/* ---- PERIOD (Ano / Mês + navigator) ---- */
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.segmented { display: inline-flex; background: var(--sand); border-radius: 14px; padding: 4px; }
.segmented button {
  min-width: 62px; padding: 0 12px; height: 46px; border: none; border-radius: 11px; background: transparent;
  color: var(--green-deep); font-weight: 600;
}
.segmented button[aria-pressed="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.segmented.small { border-radius: 12px; padding: 3px; }
.segmented.small button { min-width: 46px; height: 38px; padding: 0 10px; border-radius: 9px; font-size: 0.9rem; }
.unit-switch { margin-left: auto; align-self: center; }
.unit-switch + .unit-switch { margin-left: 0; } /* ha | alq next to R$ | US$ */
.stepper { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.stepper button {
  width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  color: var(--green-deep); display: flex; align-items: center; justify-content: center;
}
.stepper button:disabled { opacity: 0.35; }
.stepper .label { min-width: 92px; text-align: center; font-weight: 700; font-size: 1.1rem; color: var(--green-deep); }

/* ---- KPIs ---- */
.kpis { display: grid; grid-template-columns: 1fr; gap: 8px; }
.kpi {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
}
.kpi .value { text-align: right; }
.kpi .note { grid-column: 1 / -1; text-align: right; margin-top: 0; }
.kpi .label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 1.35rem; font-weight: 700; color: var(--green-deep); margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .value.in { color: var(--in); }
.kpi .value.out { color: #8C7445; }
.kpi .value.neg { color: var(--alert); }

/* ---- CHART + BAR LISTS ---- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { display: flex; gap: 16px; font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.chart .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.bars li:last-child { border-bottom: none; }
.bars .top { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.bars .top span:first-child, .bars .sub { min-width: 0; overflow-wrap: anywhere; } /* long names never widen the page */
.bars .top span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars .bar { height: 8px; border-radius: 4px; background: var(--sand); margin-top: 6px; overflow: hidden; }
.bars .bar i { display: block; height: 100%; border-radius: 4px; background: var(--out); }
.bars.in .bar i { background: var(--in); }
.bars .sub { font-size: 0.8rem; color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.88rem; }
table.data th, table.data td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
/* one look for every table (pages and chat answers): rows alternate blank and light gray, none bold or highlighted */
table.data tr:nth-child(odd) td, .msg.assistant tr:nth-child(odd) td { background: var(--stripe); }
.scroll-x { overflow-x: auto; }

/* ---- DATA COVERAGE (Santa Maria · Cobertura dos dados, and on top of a section with gaps): a year per row, a month per column ---- */
.coverage h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--green-deep); }
.coverage-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; font-size: 0.7rem; }
.coverage-grid th { color: var(--muted); font-weight: 600; text-align: center; padding: 0 2px; }
.coverage-grid tr > th:first-child { width: 3.2em; text-align: right; padding-right: 6px; }
/* the months share the card's width; taller cells on wider screens */
.coverage-grid td { height: clamp(18px, 3.2vw, 30px); border-radius: 4px; background: var(--stripe); }
.coverage-grid td.have { background: var(--olive); }
.coverage-grid td.gap { background: transparent; box-shadow: inset 0 0 0 2px var(--alert); }
.coverage-grid td.off { background: transparent; box-shadow: inset 0 0 0 1px var(--line); } /* entressafra */
.coverage .intro { margin: 2px 0 8px; font-size: 0.9rem; }
.coverage .sub { font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; }

/* ---- CONTRACTS ---- */
.group-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin: 22px 0 8px; }
.contract h3 { margin: 0 0 6px; font-size: 1.15rem; color: var(--green-deep); }
.contract dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; }
.contract dt { color: var(--muted); font-size: 0.9rem; }
.contract dd { margin: 0; font-weight: 600; }
.contract .summary { margin: 10px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.button, .button-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border-radius: 14px; font-weight: 600; text-decoration: none;
}
.button { border: 1px solid var(--line); background: var(--card); color: var(--green-deep); }
.button-primary { border: none; background: var(--olive); color: var(--ivory); }
.amendments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.amendments summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; color: var(--olive); cursor: pointer; }
.amendment { padding: 12px 0; border-top: 1px solid var(--line); }
.amendment:first-of-type { border-top: none; }
.amendment h4 { margin: 0 0 4px; font-size: 1rem; color: var(--green-deep); }

/* ---- FUTURE / UNDER CONSTRUCTION ---- */
.future { text-align: center; padding: 40px 12px; }
.future .icon { width: 72px; height: 72px; color: var(--gold); }
.future h2 { font-size: 1.4rem; font-weight: 800; margin: 12px 0 6px; }

/* ---- CHAT: bar on every page, sheet when open, inline on the Assistente page ---- */
.chatbar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(250, 247, 240, 0.97); border-top: 1px solid var(--line);
}
.chat-form { display: flex; gap: 10px; max-width: 960px; margin: 0 auto; align-items: flex-end; }
.chat-form textarea {
  flex: 1; min-height: 54px; max-height: 160px; resize: none;
  padding: 14px 18px; border-radius: 27px; border: 1px solid var(--line); background: var(--card);
  font-size: 1rem; line-height: 1.35;
}
.chat-form textarea:focus { outline: 2px solid var(--olive); outline-offset: 0; }
.chat-form button {
  width: 54px; height: 54px; flex: none; border: none; border-radius: 50%;
  background: var(--olive); color: var(--ivory); display: flex; align-items: center; justify-content: center;
}
.chat-form button:disabled { opacity: 0.4; }
.chat-sheet {
  position: fixed; z-index: 40; inset: 0; display: none; flex-direction: column; background: var(--ivory);
}
.chat-sheet.open { display: flex; }
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 8px 8px 16px;
  background: var(--green-deep); color: var(--ivory);
}
.chat-head .icon { color: var(--gold); }
.chat-title { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.chat-title strong { font-size: 1.05rem; }
.chat-title span { font-size: 0.8rem; opacity: 0.8; }
.chat-head button { width: 52px; height: 52px; border: none; background: transparent; color: var(--ivory); display: flex; align-items: center; justify-content: center; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-width: 960px; width: 100%; margin: 0 auto; }
.chat-sheet .chat-form { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); width: 100%; }
.msg { max-width: 92%; padding: 12px 16px; border-radius: 18px; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--olive); color: var(--ivory); border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.assistant p { margin: 0 0 8px; }
.msg.assistant p:last-child { margin-bottom: 0; }
.msg.assistant ul, .msg.assistant ol { margin: 4px 0 8px; padding-left: 22px; }
.msg.assistant table { border-collapse: collapse; margin: 6px 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.msg.assistant th, .msg.assistant td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
.msg .meta { font-size: 0.75rem; color: var(--muted); margin-top: 8px; }
.msg .docs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg .docs a { font-size: 0.8rem; padding: 4px 10px; border-radius: 12px; background: var(--sand); color: var(--green-deep); text-decoration: none; }
.msg.thinking { color: var(--muted); font-style: italic; }
.msg.error { border-color: var(--alert); color: var(--alert); }
.chat-intro { margin: 0; }
.assistant-page .chat-log { padding: 0 0 16px; min-height: 40vh; }
.msg.user .meta { color: var(--ivory); opacity: 0.75; margin-top: 4px; }
.chat-tools { display: flex; justify-content: flex-end; }
.chat-tools button, .chat-more .new {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 22px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 0.9rem;
}
.chat-tools .icon, .chat-more .new .icon { width: 18px; height: 18px; }
.chat-day { align-self: center; font-size: 0.8rem; color: var(--muted); padding: 2px 10px; border-radius: 10px; background: var(--sand); }
.chat-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; }
.chat-divider::before, .chat-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.chat-more { display: flex; flex-direction: column; margin-top: 4px; }
.chat-more .new { align-self: center; }

/* ---- LOGIN ---- */
.login-body { display: flex; min-height: 100dvh; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 380px; text-align: center; }
.login img { border-radius: 20px; }
.wordmark { font-weight: 800; font-size: 2.2rem; letter-spacing: -0.5px; color: var(--green-deep); margin: 14px 0 2px; }
.signature { margin: 0; color: var(--olive); font-weight: 600; letter-spacing: 0.4px; }
.tagline { color: var(--muted); font-size: 0.95rem; margin: 6px 0 24px; }
.login form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--green-deep); }
.login input { height: 54px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 1.05rem; }
.login input:focus { outline: 2px solid var(--olive); }
.login .button-primary { width: 100%; font-size: 1.1rem; margin-top: 6px; border: none; }
.login-fail { margin: 0; color: var(--alert); font-weight: 600; }

/* ---- LARGER SCREENS ---- */
@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .kpi { display: block; }
  .kpi .value, .kpi .note { text-align: left; }
  .tile { min-height: 150px; }
  main { padding-left: 24px; padding-right: 24px; }
}

/* ---- CHAT: attach a file (the same intake as dados@) ---- */
.chat-form .attach {
  width: 54px; height: 54px; flex: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--card); color: var(--olive);
}
.chat-form .attach .icon { width: 26px; height: 26px; }

/* ---- VIEWER: PDFs and photos inside the app ---- */
.viewer { position: fixed; z-index: 50; inset: 0; display: flex; flex-direction: column; background: #3B4A40; }
.viewer-head {
  display: flex; align-items: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: var(--green-deep); color: var(--ivory);
}
.viewer-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.95rem; }
.viewer-close {
  display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 16px 0 12px;
  border: none; border-radius: 14px; background: var(--gold); color: var(--green-deep); font-weight: 700;
}
.viewer-body {
  flex: 1; overflow: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 8px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.viewer-body canvas, .viewer-body img { width: 100%; max-width: 900px; height: auto; background: #fff; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.viewer-body p { color: var(--ivory); }
.viewer-text { width: 100%; max-width: 900px; margin: 0; padding: 16px; background: #fff; color: var(--ink); border-radius: 4px; white-space: pre-wrap; font: 0.95rem/1.5 var(--font); }

/* ---- ALERTS (Início): one line each, ⓘ opens the detail ---- */
.alerts { margin-top: 14px; padding-bottom: 8px; }
.alerts h2 { margin: 0 0 4px; }
.alert { border-top: 1px solid var(--line); }
.alert:first-of-type { border-top: none; }
.alert-line {
  display: flex; align-items: center; gap: 12px; min-height: 52px; width: 100%; padding: 0;
  border: none; background: transparent; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.alert-line > .icon { color: var(--olive); }
.alert.level-warn .alert-line > .icon { color: #8C7445; }
.alert-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--green-deep); }
.alert-info {
  width: 44px; height: 44px; flex: none; border: none; border-radius: 50%; background: transparent; color: var(--olive);
  display: flex; align-items: center; justify-content: center;
}
.alert-line[aria-expanded="true"] .alert-info { background: var(--sand); }
.alert-detail { padding: 0 0 12px 38px; }
.alert-detail p { margin: 0 0 10px; color: var(--ink); }
.alert-detail .button { min-height: 44px; }

/* ---- BUSINESS PAGE: its sections, in the Avisos layout; a section's way back ---- */
.sections { padding-top: 4px; padding-bottom: 4px; }
.section-line {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 0;
  border-top: 1px solid var(--line); text-decoration: none; color: var(--green-deep); -webkit-tap-highlight-color: transparent;
}
.section-line:first-child { border-top: none; }
.section-line > .icon { color: var(--olive); flex: none; }
.section-line .go { color: var(--muted); flex: none; }
.section-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.section-text strong { font-weight: 600; }
.section-text small { font-size: 0.85rem; color: var(--muted); }
.section-line:active, .section-line:hover { background: #F6F1E6; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-top: -4px;
  color: var(--olive); font-weight: 600; text-decoration: none;
}
.back-link .icon { width: 20px; height: 20px; }
/* missing data on the Santa Maria list and on a grid's title: darker than "em breve" */
.gap-chip { font-size: 0.7rem; font-weight: 600; color: var(--ink); background: var(--gold); border-radius: 8px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; white-space: nowrap; }
.soon { font-size: 0.7rem; font-weight: 600; color: var(--muted); background: var(--sand); border-radius: 8px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
.people, .docs { list-style: none; margin: 0; padding: 0; }
/* lists of people and documents */
.people li, .docs li { padding: 10px 0; border-top: 1px solid var(--line); }
.people li:first-child, .docs li:first-child { border-top: none; }
.docs li { display: flex; align-items: center; gap: 12px; }
.docs .doc-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.people .who, .docs .who { font-weight: 600; color: var(--green-deep); }
.people .what, .docs .what { font-size: 0.9rem; color: var(--ink); }
.people .since, .docs .since { font-size: 0.85rem; color: var(--muted); }

/* ---- EXPORT + PRINT (PDF) ---- */
.export-bar { margin: 0 0 14px; }
.export-bar .button { min-height: 44px; }
.print-only { display: none; }
@media print {
  .topbar, .menu, .chatbar, .chat-sheet, .viewer, .period, .export-bar, .back-link { display: none !important; }
  body { background: #fff; }
  main, .topbar ~ main { padding: 0; max-width: none; }
  .print-only { display: block; margin-bottom: 10px; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  h2 { break-after: avoid; }
}

/* ---- FEATURE REQUESTS: the "Pedir nova funcionalidade" card (Início) and the admin list (nossaterraDOC) ---- */
.idea { margin-top: 14px; }
.idea h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.15rem; color: var(--green-deep); }
.idea h2 .icon { color: var(--gold); width: 1.5em; height: 1.5em; }
.idea > p { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; }
.idea-form { display: flex; gap: 10px; align-items: flex-end; }
.idea-form .attach {
  width: 50px; height: 50px; flex: none; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--olive); cursor: pointer;
}
.idea-form textarea {
  flex: 1; min-height: 50px; max-height: 160px; resize: none;
  padding: 12px 16px; border-radius: 25px; border: 1px solid var(--line); background: var(--card); font-size: 1rem; line-height: 1.35;
}
.idea-form textarea:focus { outline: 2px solid var(--olive); outline-offset: 0; }
.idea-form button {
  width: 50px; height: 50px; flex: none; border: none; border-radius: 50%;
  background: var(--olive); color: var(--ivory); display: flex; align-items: center; justify-content: center;
}
.idea-form button:disabled { opacity: 0.4; }
.idea .idea-hint { font-size: 0.8rem; color: var(--muted); margin: 6px 0 0; }
.idea .file-name, .idea .idea-status { font-size: 0.85rem; color: var(--muted); margin: 8px 0 0; min-height: 0; }
.idea .idea-status:empty { display: none; }
.requests { list-style: none; margin: 10px 0 0; padding: 0; }
.requests li { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.requests .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.85rem; }
.requests .text { margin-top: 4px; }
.status { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 9px; border-radius: 10px; background: var(--sand); color: var(--green-deep); }
.status.planned { background: var(--gold); color: var(--green-deep); }
.status.done { background: var(--olive); color: var(--ivory); }
.status.declined { background: #EADFD9; color: var(--alert); }
.req-note {
  width: 100%; margin-top: 10px; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 0.95rem;
}
@media print { .idea { display: none !important; } }

/* ---- INFORMAÇÕES PENDENTES ---- */
.pend .answer { margin-top: 10px; padding: 10px 12px; background: var(--sand); border-radius: 12px; }
.pend-form { margin-top: 8px; }
.pend .pend-status:empty { display: none; }
/* what the assistant changed on the list after an answer (lib/triage.js) */
.triage { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--olive); background: var(--ivory); border-radius: 0 12px 12px 0; font-size: 0.92rem; }
.triage svg { width: 16px; height: 16px; vertical-align: -3px; color: var(--olive); }
.triage ul { margin: 6px 0 0; padding-left: 18px; }
.card.triage { margin-bottom: 12px; }
