/* =====================================================================
   Visual do app. Para mudar as cores, edite só as variáveis em :root.
   Pensado para uso no celular, ao ar livre: contraste alto e alvos de
   toque grandes (48px). Cor só indica status ou ação principal.
   ===================================================================== */

/* Fontes locais (static/fonts). Nenhuma requisição externa. */
@font-face {
  font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
}

:root {
  --bg: #eef1ec;            /* fundo da página */
  --surface: #ffffff;       /* painéis e campos */
  --hover: #f5f8f3;
  --ink: #12301f;           /* texto (verde de cerca-viva, quase preto) */
  --muted: #4d5d53;
  --line: #d5dcd2;
  --line-strong: #8fa093;
  --marker: #f4c430;        /* etiqueta amarela de canteiro: ação principal e "em andamento" */
  --on-marker: #12301f;
  --marker-hover: #e6b619;
  --ok: #2f7d46;            /* concluído */
  --on-ok: #ffffff;
  --late: #a8324a;          /* atrasado, erro, excluir */
  --link: #1f6a38;
  --focus: #1f6a38;
  --series: var(--link);    /* cor das barras de horas nos gráficos (acompanha a paleta e o modo escuro) */
  --mast-bg: #12301f;
  --mast-ink: #f2f6f1;
  --mast-muted: #b5c8ba;

  --display: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
  --text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1611; --surface: #16211a; --hover: #1b2920;
    --ink: #e7efe8; --muted: #a3b3a8; --line: #26352c; --line-strong: #4f6557;
    --ok: #4caf6d; --on-ok: #0e1611; --late: #ff8fa3;
    --link: #7fd39a; --focus: #7fd39a;
    --mast-bg: #0a110d;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--text);
}
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2 { font-family: var(--display); line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.4rem); font-weight: 800; letter-spacing: -0.015em; }
h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.005em; margin-bottom: .6rem; }
.form-section {
  font-size: 1.05rem; margin: .4rem 0 -.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
}
.stack > .form-section:first-of-type { padding-top: 0; border-top: none; margin-top: 0; }
p { margin: 0 0 .75rem; }
b, strong, dd { font-weight: 700; }
.sub { color: var(--muted); margin: .3rem 0 0; max-width: 60ch; }
.hint { color: var(--muted); font-weight: 400; font-size: .92rem; }
.pre { white-space: pre-wrap; margin: 0; }
.crumb { margin: 0 0 .25rem; font-size: .95rem; }
.crumb a { display: inline-block; padding: .55rem 0; }

/* ---------- Topo ---------- */
.masthead { background: var(--mast-bg); color: var(--mast-ink); }
.masthead-inner { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }
.masthead :focus-visible { outline-color: var(--marker); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem 0 .1rem; }
.brand {
  display: flex; align-items: center; gap: .55rem; color: var(--mast-ink);
  text-decoration: none; font: 800 1.2rem/1.2 var(--display); letter-spacing: -0.01em;
}
.brand svg { color: var(--marker); flex: none; }
.brand { min-width: 0; overflow-wrap: anywhere; }
.brand.brand-long { font-size: 1rem; line-height: 1.15; }  /* nome comprido: letra um pouco menor no topo */
/* Celular estreito: com o balão das mensagens e o sininho, um nome comprido ficava espremido a ponto de
   quebrar no meio da palavra. Aqui o nome fica numa linha só dele e os ícones descem pra linha de baixo. */
@media (max-width: 27rem) {
  .bar { flex-wrap: wrap; }
  .brand { flex: 1 1 100%; min-width: 7rem; }
  .bar-actions { margin-left: auto; gap: .35rem; }
}
/* Logo escolhido em Conta → Aparência. Logo escuro num topo escuro ganha um fundinho claro. */
.brand-logo { display: block; height: 2.4rem; width: auto; max-width: 10rem; object-fit: contain; flex: none; border-radius: 6px; }
.brand-logo.chip-l-light { background: #fff; padding: .2rem .4rem; }
.brand-logo.chip-l-dark { background: #1b1f1c; padding: .2rem .4rem; }
@media (prefers-color-scheme: dark) {
  .brand-logo.chip-l-light, .brand-logo.chip-l-dark { background: none; padding: 0; }
  .brand-logo.chip-d-light { background: #fff; padding: .2rem .4rem; }
  .brand-logo.chip-d-dark { background: #1b1f1c; padding: .2rem .4rem; }
}
.bar-actions { display: flex; align-items: center; gap: .6rem; flex: none; }
.bar-actions form { margin: 0; }
.linkish {
  display: inline-flex; align-items: center;
  background: none; border: 0; color: var(--mast-muted); font: inherit; font-weight: 700;
  text-decoration: underline; min-height: 44px; padding: 0 .25rem; cursor: pointer;
}
.bar-actions a[aria-current="page"] { color: var(--mast-ink); }
.linkish { white-space: nowrap; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; color: var(--mast-muted); }
.bell svg { width: 24px; height: 24px; }
.badge { position: absolute; top: 3px; right: 0; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem;
  border-radius: 999px; background: var(--marker); color: var(--on-marker);
  font-size: .75rem; font-weight: 700; line-height: 1.2rem; text-align: center; }

/* Lista de avisos */
.notice { display: grid; gap: .2rem; padding: .95rem 1.15rem; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; }
.notice:last-child { border-bottom: 0; }
a.notice:hover { background: var(--hover); }
.notice.unread { box-shadow: inset 5px 0 0 var(--marker); }
.notice-title { font-weight: 700; }
.notice-body, .notice-time { color: var(--muted); }
.notice-time { font-size: .85rem; }
.tabs { position: relative; display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; margin: 0 -.5rem; padding: 0 .5rem; }
.tabs::-webkit-scrollbar { display: none; }
/* Quando há abas escondidas de um lado, aquele lado esmaece (o script no base.html liga/desliga as classes). */
.tabs.more, .tabs.less {
  --fade-l: 0rem; --fade-r: 0rem;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
}
.tabs.less { --fade-l: 2rem; }
.tabs.more { --fade-r: 2.5rem; }
.tabs a {
  flex: none; padding: .75rem .8rem .65rem; color: var(--mast-muted); text-decoration: none;
  font-weight: 700; border-bottom: 3px solid transparent;
}
.tabs a.active { color: var(--mast-ink); border-bottom-color: var(--marker); }

/* ---------- Estrutura da página ---------- */
.container { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .75rem 1rem; margin: 0 0 1.4rem; }
.block { margin: 0 0 1.75rem; }
.count { font: 400 .95rem var(--text); color: var(--muted); margin-left: .35rem; }
.is-late h2 { color: var(--late); }
.stack { display: grid; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 34rem) { .grid-2 { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.sheet .actions, .stack .actions { margin-bottom: 0; }
/* listas com "Mostrar mais": o item escondido some mesmo quando a classe dele define o display */
[data-more] > [hidden] { display: none !important; }
.more-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: -.4rem 0 1rem; }
.sheet + .more-bar { margin-top: -.4rem; }

/* Painel: fundo branco com borda fina; as linhas internas são separadas por filete */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
.block > .sheet:last-child { margin-bottom: 0; }
.sheet.pad { padding: 1.1rem 1.15rem; }
.empty { padding: 1.1rem 1.15rem; color: var(--muted); margin: 0; }

.callout {
  background: var(--surface); border-left: 6px solid var(--marker); border-radius: 0 8px 8px 0;
  padding: .85rem 1.1rem; margin: 0 0 1.5rem;
}
.callout p { margin: .25rem 0 0; }
.callout.internal { border-left-color: var(--line-strong); }
.callout .hint { display: block; margin: .1rem 0 .35rem; }
.nowrap { white-space: nowrap; }

.flash {
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--line-strong);
  border-radius: 8px; padding: .8rem 1rem; margin: 0 0 1rem; font-weight: 700;
}
.flash-ok { border-left-color: var(--ok); }
.flash-error { border-left-color: var(--late); }
.flash-info { border-left-color: var(--marker); }

/* ---------- Linhas da agenda ---------- */
.job {
  display: grid; grid-template-columns: 4.4rem 1fr; gap: 0 1rem; padding: 1rem 1.15rem;
  color: inherit; text-decoration: none;
}
.job-row { display: flex; align-items: stretch; }
.job-row > .job { flex: 1 1 auto; min-width: 0; }
.job-row + .job-row, .member + .member { border-top: 1px solid var(--line); }
.job-row:hover, .member:hover { background: var(--hover); }
/* Véspera: o botão do lembrete pro cliente, à direita da linha */
.job-side { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: .6rem 1rem .6rem 0; }
.job-side .remind { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.job-side .remind svg { width: 1.15rem; height: 1.15rem; flex: none; }
.job-side .remind-sms { font-size: .85rem; min-height: 1.6rem; }
.job-side .remind-done { white-space: nowrap; }
.job-side .remind-why { font-size: .82rem; text-align: center; max-width: 7.5rem; }
.job-date { display: flex; flex-direction: column; align-items: flex-start; }
.dnum { font: 800 2.2rem/1 var(--display); letter-spacing: -0.03em; }
.dmeta { font-size: .88rem; color: var(--muted); margin-top: .15rem; }
.dtime {
  margin-top: .45rem; padding: .05rem .45rem; border-radius: 4px; font-weight: 700; font-size: .92rem;
  background: var(--marker); color: var(--on-marker);
}
.job-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
/* o número do trabalho no dia (1, 2, 3...), discreto; o próximo a fazer fica na cor de destaque */
.job-seq { display: inline-flex; align-items: center; justify-content: center; min-width: 1.45rem; height: 1.45rem;
  margin-right: .45rem; padding: 0 .3rem; border: 1.5px solid var(--line-strong); border-radius: 999px; color: var(--muted);
  font: 700 .78rem/1 var(--text); font-variant-numeric: tabular-nums; vertical-align: .12em; }
.job-seq.next { background: var(--marker); border-color: var(--marker); color: var(--on-marker); }
.job-client { font-weight: 700; font-size: 1.1rem; }
.job-where { color: var(--muted); font-size: .93rem; }
.job-status { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; margin-top: .45rem; }
.late { color: var(--late); font-weight: 700; font-size: .92rem; }
.who { color: var(--muted); font-size: .92rem; }
.who.none { color: var(--late); font-weight: 700; }

/* Estado do trabalho */
.pill {
  display: inline-block; padding: .1rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 700;
  border: 1.5px solid var(--line-strong); color: var(--muted); background: transparent; white-space: nowrap;
}
.pill-in_progress { background: var(--marker); border-color: var(--marker); color: var(--on-marker); }
.pill-done { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.pill-cancelled { text-decoration: line-through; }
.pill-share { border-color: var(--link); color: var(--link); }  /* trabalho com várias pessoas */

/* Status e categoria do cliente */
.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 0; }
.pill-active { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.pill-inactive { background: var(--line); border-color: var(--line-strong); color: var(--muted); }
.pill-tier-prata { background: #6b7a70; border-color: #6b7a70; color: #ffffff; }
.pill-tier-ouro { background: var(--marker); border-color: var(--marker); color: var(--on-marker); }
.pill-tier-platina { background: #7d8fa3; border-color: #7d8fa3; color: #ffffff; }
.pill-tier-diamante { background: #2f6b86; border-color: #2f6b86; color: #ffffff; }
/* Empresa com cor escolhida (Clientes → Empresas): a etiqueta e a bolinha usam a cor dela */
.pill-company[style] { background: var(--co); border-color: var(--co); color: #ffffff; }
.co-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; background: var(--co); vertical-align: -.02rem; margin-right: .3rem; }
.portal-nav[style] a.on { background: var(--co); border-color: var(--co); color: #ffffff; }
/* A paleta da empresa: bolinhas de cor pra escolher (co-, pra não misturar com as paletas de Aparência) */
.palette { display: grid; gap: .5rem; }
.co-swatches { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.co-swatch { position: relative; display: inline-flex; flex-direction: row; align-items: center; gap: .35rem; cursor: pointer; font-weight: 400; }
.co-swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.co-swatch span { display: block; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--sw, transparent); border: 2px solid var(--line-strong); box-sizing: border-box; }
.co-swatch.none span { background: repeating-linear-gradient(45deg, var(--line) 0 4px, transparent 4px 8px); }
.co-swatch input:checked + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.co-swatch input:focus-visible + span { outline: 3px solid var(--link); outline-offset: 2px; }

/* Barra em segmentos: cada segmento é uma tarefa (como as fileiras de um canteiro) */
.rows {
  --gap: 3px; position: relative; display: block; height: 8px; margin-top: .6rem; background: var(--line);
  border-radius: 2px; overflow: hidden;
  /* Os vãos entre os segmentos são recortados por uma máscara (funcionam em qualquer fundo).
     A máscara é 'gap' mais larga que a barra: o último vão cai para fora e some, e a barra termina rente. */
  -webkit-mask: repeating-linear-gradient(to right, #000 0, #000 calc(100% / var(--n) - var(--gap)),
    transparent calc(100% / var(--n) - var(--gap)), transparent calc(100% / var(--n))) 0 0 / calc(100% + var(--gap)) 100% no-repeat;
  mask: repeating-linear-gradient(to right, #000 0, #000 calc(100% / var(--n) - var(--gap)),
    transparent calc(100% / var(--n) - var(--gap)), transparent calc(100% / var(--n))) 0 0 / calc(100% + var(--gap)) 100% no-repeat;
}
.rows i { position: absolute; inset: 0 auto 0 0; width: calc(var(--d) / var(--n) * 100%); background: var(--ok); }

/* Fotos: Antes e Depois de cada trabalho, e a galeria do cliente */
.photo-set + .photo-set { border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: 1.1rem; }
.photo-set h3 { font: 700 1.12rem/1.2 var(--display); margin: 0 0 .75rem; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.photos-empty { color: var(--muted); margin: 0 0 .9rem; }
.photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.removing { opacity: .35; }
.photo form[data-delete] { position: absolute; top: .3rem; right: .3rem; margin: 0; }
.photo .del {
  width: 2.2rem; height: 2.2rem; min-height: 0; padding: 0; border-radius: 50%; border: none;
  background: rgba(18, 48, 31, .72); color: #fff; font-size: 1.2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.photo-upload { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.photo-pick { position: relative; overflow: hidden; flex-direction: row; gap: .5rem; flex: 1 1 9rem; }
.photo-pick svg { width: 1.35rem; height: 1.35rem; flex: none; }
.photo-pick input[type="file"] { position: absolute; inset: 0; width: 100%; min-height: 0; opacity: 0; cursor: pointer; }
.photo-pick:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.js-photos [data-nojs], .js-diary [data-nojs] { display: none; }
.photos-full { margin: 0; }
.upload-status {
  display: grid; gap: .6rem; margin-top: .9rem; padding: .75rem .95rem; background: var(--hover);
  border: 1px solid var(--line); border-left: 6px solid var(--line-strong); border-radius: 8px;
}
.upload-status p { margin: 0; font-weight: 700; }
.upload-status.ok { border-left-color: var(--ok); }
.upload-status.error { border-left-color: var(--late); }
.upload-status.info, .upload-status.busy { border-left-color: var(--marker); }
.upload-status .btn { justify-self: start; }
.upload-bar { display: block; height: .5rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.upload-bar i {
  display: block; height: 100%; width: var(--p, 8%); border-radius: inherit; transition: width .35s ease;
  background: repeating-linear-gradient(-45deg, transparent 0 .5rem, rgba(255, 255, 255, .28) .5rem 1rem) var(--ok);
  background-size: 1.42rem 100%; animation: upload-move .8s linear infinite;
}
@keyframes upload-move { to { background-position: 1.42rem 0; } }
@media (prefers-reduced-motion: reduce) { .upload-bar i { animation: none; } }

/* Listas de clientes e equipe */
.member { display: grid; gap: .1rem; padding: 1rem 1.15rem; color: inherit; text-decoration: none; }
.member-name { font-weight: 700; font-size: 1.1rem; }
.member-meta { color: var(--muted); font-size: .95rem; }
.member-jobs { font-size: .92rem; font-weight: 700; margin-top: .2rem; }
.member.off { opacity: .65; }

/* Dados do trabalho / cliente */
.facts { display: grid; gap: .8rem; margin: 0 0 1.25rem; }
.facts > div { display: grid; grid-template-columns: minmax(6.5rem, 9rem) 1fr; gap: .25rem 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Formulários ---------- */
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; }
label .hint, label > .hint { font-weight: 400; }
input, select, textarea {
  font: 400 1rem/1.4 var(--text); color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: 8px; padding: .7rem .8rem; min-height: 3rem; width: 100%;
}
textarea { min-height: 6rem; resize: vertical; }
/* iPhone: os campos de data e hora do Safari encolhem pro tamanho do texto e ficam mais baixos que os outros */
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0;
  text-align: left; box-sizing: border-box; -webkit-min-logical-width: calc(100% - 1.6rem); }
input::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
/* texto do rótulo e o "(opcional)" na mesma linha (o label empilha cada filho) */
.label-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .4rem; }
.label-line .hint { white-space: nowrap; }
input.short { max-width: 14rem; }
/* telefone: bandeira e +código num seletor curto, o número ao lado */
.phone-row { display: flex; gap: .5rem; }
.phone-row select { width: auto; flex: none; min-width: 0; padding-right: 1.9rem; }
.phone-row input { flex: 1 1 auto; min-width: 0; }
.planned { color: var(--muted); font-size: .9rem; white-space: nowrap; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
.search { display: flex; gap: .6rem; margin: 0 0 1rem; }
.search .btn { flex: none; }
.filters .search { margin: 0; }
.client-search input[type="search"] { flex: 1 1 auto; min-width: 0; }
.search-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 3rem; }
.search-btn svg { width: 1.35rem; height: 1.35rem; flex: none; }
.search-note { margin: -.3rem 0 0; }
.list-filter { margin: 0 0 .75rem; }
.change-callout { border-left-color: var(--marker); }
.change-callout .actions { margin: .6rem 0 0; }
/* Serviços extras (extras.py): o cartão de cada pedido */
.report { padding: 1rem 1.15rem; display: grid; gap: .6rem; }
.report + .report { border-top: 1px solid var(--line); }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; flex-wrap: wrap; }
.report-meta { margin: .15rem 0 0; color: var(--muted); font-size: .93rem; }
.report-tasks li { padding: .25rem 0; }
.report-tasks li + li { border-top: 0; }
.report-notes { margin: 0; color: var(--muted); }
.report-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.report-reject { display: flex; gap: .5rem; flex: 1 1 16rem; }
.report-reject input { min-width: 0; flex: 1 1 auto; min-height: 2.6rem; padding: .3rem .7rem; }
.pill-pending { background: var(--marker); border-color: var(--marker); color: var(--on-marker); }
.pill-failed { background: var(--late); border-color: var(--late); color: #fff; }
.extras-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-decoration: none; color: inherit; border-left-color: var(--marker); }
/* A janelinha "Você tem certeza?" */
.confirm-box { border: 0; border-radius: 14px; padding: 1.25rem 1.3rem; width: min(24rem, calc(100vw - 2rem));
  background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.confirm-box::backdrop { background: rgba(0, 0, 0, .45); }
.confirm-box h2 { margin: 0; font-size: 1.25rem; }
.confirm-box p { margin: 0; color: var(--muted); }
.confirm-box .actions { margin: .35rem 0 0; justify-content: flex-end; }
.confirm-box[open] { animation: pop-in .15s ease-out; }
@keyframes pop-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Horas feitas (worked.py): o campo no trabalho, a diferença pro previsto e a janela "As horas mudaram" */
.hours-field { display: grid; gap: .35rem; margin: 0; }
.hours-label { font-weight: 700; }
.hours-label .hint { font-weight: 400; }
.hours-inputs { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.hours-part { flex-direction: row; align-items: center; gap: .45rem; }
.hours-part input { width: 4.6rem; text-align: center; font-variant-numeric: tabular-nums; }
.hours-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.hours-diff { font-weight: 700; white-space: nowrap; }
.hours-diff.up { color: var(--late); }
.hours-diff.down { color: var(--link); }
.pill-hours { border-color: var(--late); color: var(--late); }
.hours-box { width: min(27rem, calc(100vw - 2rem)); }
.hours-box h2 { display: flex; align-items: center; gap: .45rem; }
.hours-box .hours-changes { list-style: none; margin: 0; padding: .75rem .85rem; display: grid; gap: .4rem;
  border-radius: 10px; background: var(--bg); font-size: 1.05rem; }
.hours-box .hours-changes b { color: var(--ink); }
.hours-sub { margin: 1rem 0 .5rem; font-size: 1rem; }
.row-act-side { display: flex; gap: .5rem; align-items: center; flex: none; }
.row-act-side form { margin: 0; }
.list-filter .search-btn { pointer-events: none; }
[id] > [hidden].row-act, .sheet > [hidden] { display: none !important; }
.filters { display: grid; gap: .9rem; margin: 0 0 1.1rem; }
.seg { display: flex; flex-wrap: wrap; gap: .45rem; }
.seg a {
  padding: .45rem .9rem; border: 1.5px solid var(--line-strong); border-radius: 999px; color: var(--ink);
  text-decoration: none; font-weight: 700; font-size: .95rem; background: var(--surface);
}
.seg a.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.seg button { padding: .45rem .9rem; min-height: 2.6rem; border: 1.5px solid var(--line-strong); border-radius: 999px;
  color: var(--ink); background: var(--surface); font: 700 .95rem var(--text); cursor: pointer; }
.seg button.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
label.inline { flex-direction: row; align-items: center; gap: .7rem; }
label.inline select { width: auto; min-width: 12rem; }
.repeat { display: grid; gap: .75rem; }
.repeat .pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.repeat .btn { justify-self: start; }

/* Checklist com caixas grandes (fácil de tocar de luva) */
.check { flex-direction: row; align-items: flex-start; gap: .9rem; padding: .7rem 0; min-height: 3rem; font-weight: 400; cursor: pointer; }
.check + .check { border-top: 1px solid var(--line); }
.check input {
  -webkit-appearance: none; appearance: none; flex: none; display: grid; place-content: center;
  width: 1.75rem; height: 1.75rem; min-height: 0; padding: 0; margin: .05rem 0 0;
  border: 2px solid var(--ink); border-radius: 6px; background: var(--surface);
}
.check input::after {
  content: ""; width: .9rem; height: .5rem; border-left: 4px solid var(--on-marker); border-bottom: 4px solid var(--on-marker);
  transform: translateY(-2px) rotate(-45deg) scale(0); transition: transform .12s ease-out;
}
.check input:checked { background: var(--marker); border-color: var(--marker); }
.check input:checked::after { transform: translateY(-2px) rotate(-45deg) scale(1); }
.check input:checked + span { color: var(--muted); text-decoration: line-through; }
.check.plain input:checked + span { color: inherit; text-decoration: none; }
.check input:disabled { cursor: default; }
.check:has(input:disabled) { cursor: default; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.15rem;
  border: 2px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--ink);
  font: 700 1rem var(--text); text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--marker); border-color: var(--marker); color: var(--on-marker); }
.btn.primary:hover { background: var(--marker-hover); border-color: var(--marker-hover); }
.btn.danger { border-color: var(--late); color: var(--late); }
.btn.small { min-height: 2.6rem; padding: 0 .9rem; font-size: .95rem; }
.btn.block { width: 100%; margin: 0; }  /* 'block' também é a classe das seções: sem a margem delas */
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-icon { gap: .5rem; }  /* botão com ícone e nome (ex.: Ver semana no Painel) */
.btn-icon svg { width: 1.25rem; height: 1.25rem; flex: none; }

/* ---------- Painel: avisos do topo (só o que pede atenção), o resumo de hoje e a barrinha do dia ---------- */
.alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; margin: 0 0 1.6rem; }
.alert { --tone: var(--marker); display: flex; flex-direction: column; gap: .2rem; padding: .75rem .85rem .8rem;
  border: 1px solid var(--line); border-top: 4px solid var(--tone); border-radius: 12px; background: var(--surface);
  color: var(--ink); text-decoration: none; line-height: 1.3; }
.alert:hover { background: var(--hover); }
.alert-ok { --tone: var(--ok); }
.alert-bad { --tone: var(--late); }
.alert-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .25rem; }
.alert-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
  border-radius: 50%; color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, var(--surface)); }
.alert-todo .alert-icon { color: var(--ink); background: color-mix(in srgb, var(--marker) 38%, var(--surface)); }
.alert-icon svg { width: 1.3rem; height: 1.3rem; }
.alert-value { font: 800 1.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.alert-bad .alert-value { color: var(--late); }
.alert-label { font-weight: 700; }
.alert-note { font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.alert-bad .alert-note { color: var(--late); font-weight: 700; }
.day-status { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: -.2rem 0 .5rem; font-size: .95rem; }
.ds { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; }
.ds::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: var(--line-strong); }
.ds-done::before { background: var(--ok); }
.ds-doing::before { background: var(--marker); }
.ds-todo::before { background: transparent; box-shadow: inset 0 0 0 2px var(--line-strong); }
.day-bar { display: flex; gap: 3px; height: .45rem; margin: 0 0 .75rem; border-radius: 99px; overflow: hidden; }
.day-bar > span { flex-basis: 0; min-width: 0; }
.db-done { background: var(--ok); }
.db-doing { background: var(--marker); }
.db-todo { background: var(--line); }

/* ---------- Mapa em janela (map.js): o alfinete ao lado dos endereços e a janela com o mapa ---------- */
.map-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2.75rem; height: 2.75rem;
  border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--link);
  text-decoration: none; cursor: pointer; }
.map-btn:hover { background: var(--hover); border-color: var(--link); }
.map-btn svg { width: 1.35rem; height: 1.35rem; }
.with-map { display: flex; align-items: center; justify-content: space-between; gap: .4rem .75rem; }
.with-map .map-btn { width: 2.5rem; height: 2.5rem; }
.member-row { display: flex; align-items: stretch; }
.member-row > .member { flex: 1 1 auto; min-width: 0; }
.member-row + .member-row { border-top: 1px solid var(--line); }
.member-row:hover { background: var(--hover); }
.member-side { flex: none; display: flex; align-items: center; padding: .6rem 1rem .6rem 0; }
.map-box { border: 0; border-radius: 14px; padding: 0; width: min(46rem, calc(100vw - 1rem)); max-height: calc(100vh - 1rem);
  background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); overflow: hidden; }
.map-box[open] { display: flex; flex-direction: column; animation: pop-in .15s ease-out; }
.map-box::backdrop { background: rgba(0, 0, 0, .5); }
.map-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .9rem 1rem .7rem; }
.map-head-text { min-width: 0; }
.map-head h2 { margin: 0; font-size: 1.2rem; }
.map-where { margin: .15rem 0 0; color: var(--muted); font-size: .93rem; overflow-wrap: anywhere; }
.map-close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem;
  padding: 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink);
  font: 400 1.6rem/1 var(--text); cursor: pointer; }
.map-canvas { flex: 1 1 auto; height: min(60vh, 30rem); min-height: 15rem; background: var(--line); }
.map-canvas[hidden] { display: none; }
.map-status { margin: 0; padding: .65rem 1rem 0; font-size: .93rem; color: var(--muted); }
.map-status:empty { display: none; }
.map-status.is-warn { color: var(--late); font-weight: 700; }
.map-actions { display: flex; flex-wrap: wrap; gap: .6rem; padding: .7rem 1rem 1rem; }
.map-actions [hidden] { display: none; }
.map-pin { background: none; border: 0; }
.map-pin svg { width: 34px; height: 44px; overflow: visible; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.map-pin path { fill: #d93025; stroke: #ffffff; stroke-width: 2; }
.map-pin circle { fill: #ffffff; }
.map-box .leaflet-container { font: inherit; }
@media print { .map-btn, .map-box { display: none !important; } }

/* ---------- Previsão do tempo em janela (weather.js): amanhã (e hoje), o resumo pro jardim e hora a hora ---------- */
.wx-box { border: 0; border-radius: 14px; padding: 0 0 .9rem; width: min(34rem, calc(100vw - 1rem)); max-height: calc(100vh - 1rem);
  background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); overflow: auto; }
.wx-box[open] { animation: pop-in .15s ease-out; }
.wx-box::backdrop { background: rgba(0, 0, 0, .5); }
.wx-days { padding: 0 1rem .5rem; }
.wx-status { margin: 0; padding: .3rem 1rem 0; font-size: .92rem; color: var(--muted); }
.wx-status:empty { display: none; }
.wx-status.is-warn { color: var(--late); font-weight: 700; }
.wx-body { display: grid; gap: .85rem; padding: .5rem 1rem 0; }
.wx-body:empty { display: none; }
.wx-now { display: flex; align-items: center; gap: 1rem; }
.wx-icon svg { display: block; width: 2.3rem; height: 2.3rem; }
.wx-big svg { width: 5.2rem; height: 5.2rem; }
.wx-now-text { display: grid; gap: .15rem; min-width: 0; }
.wx-temp { font: 800 2.6rem/1 var(--display); letter-spacing: -.02em; }
.wx-temp small { font: 700 1.35rem var(--display); color: var(--muted); letter-spacing: 0; }
.wx-cond { font-weight: 700; font-size: 1.08rem; }
.wx-meta { color: var(--muted); font-size: .93rem; }
.wx-hints { list-style: none; margin: 0; padding: .65rem .85rem; display: grid; gap: .35rem; border-radius: 10px;
  background: var(--bg); font-size: .95rem; }
.wx-hint { display: flex; align-items: baseline; gap: .5rem; }
.wx-hint::before { content: ""; flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: var(--line-strong); transform: translateY(-.05em); }
.wx-hint-dry::before { background: var(--ok); }
.wx-hint-rain::before, .wx-hint-showers::before { background: #4a90e2; }
.wx-hint-wind::before { background: var(--muted); }
.wx-hint-frost::before { background: #8eb8e8; }
.wx-hint-hot::before { background: #e8833a; }
.wx-hours { list-style: none; margin: 0; padding: .1rem 0 .3rem; display: flex; gap: .15rem; overflow-x: auto;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.wx-h { flex: 0 0 3.35rem; display: grid; justify-items: center; align-content: start; gap: .3rem; padding: .35rem .1rem;
  scroll-snap-align: start; text-align: center; }
.wx-hh { font-size: .95rem; }
.wx-pp { min-height: 1.15em; font-size: .85rem; font-weight: 700; color: #3a7bd5; }
.wx-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.wx-unit { margin-top: -.25rem; font-size: .72rem; color: var(--muted); }
.wx-dir { display: inline-flex; color: var(--muted); }
.wx-dir svg { width: 1.2rem; height: 1.2rem; }
.wx-empty { margin: .4rem 0; color: var(--muted); }
.wx-source { margin: .7rem 1rem 0; font-size: .8rem; color: var(--muted); }
/* o crédito do Google, do jeito que o Google pede: Roboto (ou a sans-serif do aparelho), 12 a 16 px, cinza #5E5E5E
   no claro e branco no escuro, e "Google Maps" sem quebrar a linha */
.wx-google { font: 400 12.5px/1.45 Roboto, sans-serif; color: #5e5e5e; }
.wx-gm { white-space: nowrap; }
.wx-bbc { margin-top: .9rem; }  /* Conta → Previsão do tempo: a nota da BBC, depois do passo a passo */
@media (prefers-color-scheme: dark) { .wx-pp { color: #8ab8f5; } .wx-google { color: #ffffff; } }
@media print { .wx-box { display: none !important; } }

/* ---------- Voltar ao topo: aparece depois de rolar um pouco (base.html), em todas as telas ---------- */
.to-top { position: fixed; z-index: 50; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; padding: 0;
  border: 0; border-radius: 50%; background: var(--ink); color: var(--surface); cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28); opacity: 0; transform: translateY(.6rem); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top[hidden] { display: none; }
main h1[tabindex="-1"]:focus { outline: none; }  /* o voltar ao topo leva o foco pro título */
.to-top svg { width: 1.4rem; height: 1.4rem; }
.to-top:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
@media print { .to-top { display: none !important; } }

/* ---------- Login e primeiro acesso ---------- */
.auth { max-width: 26rem; margin: 1.5rem auto 0; }
.auth h1 { margin-bottom: .8rem; }
.auth .sheet { margin-top: 1.1rem; }
.auth .hint { margin-top: .5rem; }

@media (max-width: 34rem) {
  .sheet .actions .btn { flex: 1 1 100%; }
  .sheet .actions > form { flex: 1 1 100%; display: flex; }  /* botão dentro de formulário também ocupa a linha toda */
}
@media (max-width: 24rem) {
  .brand { font-size: 1.05rem; }   /* celulares estreitos: o nome cabe em uma linha */
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* Gráficos: as barras crescem quando a página abre (o base.html escalona cada barra e faz os números contarem) */
@keyframes grow-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-right { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.vbar-fill, .hc-fill { transform-origin: bottom; animation: grow-up .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--delay, 0ms); }
.hbar-fill, .stackbar, .dl-bar { transform-origin: left; animation: grow-right .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--delay, 0ms); }
.vbar .val, .hc-val { animation: fade-in .4s ease-out both; animation-delay: calc(var(--delay, 0ms) + .35s); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Tarefas: o dono escolhe da lista padrão; o funcionário marca feita / não feita (+ motivo opcional) */
.task-pick { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: .3rem; }
.task-pick legend { font-weight: 700; padding: 0; margin-bottom: .15rem; }
.task-pick .hint { margin: 0; }
.people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .1rem 1rem; }
.people-pick legend .pill { margin-left: .4rem; vertical-align: 1px; }
.table-note { margin: 0; padding: .75rem 1.15rem; border-top: 1px solid var(--line); }
.pick-tools { display: flex; gap: 1.4rem; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; font-weight: 700;
  color: var(--link); text-decoration: underline; cursor: pointer; }
.tasks .task { display: grid; gap: .55rem; padding: .9rem 0; }
.tasks .task:first-child { padding-top: 0; }
.tasks .task + .task { border-top: 1px solid var(--line); }
.task-text { margin: 0; }
/* Lista de tarefas recolhida: "Ver tarefas" abre; o mesmo botão (ou salvar) recolhe */
.fold { border: 1px solid var(--line); border-radius: 8px; }
.fold summary { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .2rem .9rem; cursor: pointer;
  font-weight: 700; color: var(--link); list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; width: .55rem; height: .55rem; margin-left: auto; border: solid currentColor;
  border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
.fold[open] summary::after { transform: rotate(-135deg); }
.fold[open] summary { border-bottom: 1px solid var(--line); }
.fold .fold-close, .fold[open] .fold-open { display: none; }
.fold[open] .fold-close { display: inline; }
.fold > .tasks, .fold > .task-results { padding: .9rem .9rem 0; }
.fold > .task-results { padding-bottom: .3rem; }
.fold-section { background: var(--surface); }
.fold-section > summary { min-height: 3.2rem; flex-wrap: wrap; }
.fold-section > summary > .hint { margin-left: .25rem; font-weight: 400; }
.fold > .fold-body { padding: .9rem; display: grid; gap: .9rem; }
.fold > .fold-body > .sheet { margin-bottom: 0; }
.fold > .fold-body > .block-hint { margin: 0; }
.task-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.choice { position: relative; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice > span { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 3rem;
  padding: 0 .6rem; border: 1.5px solid var(--line-strong); border-radius: 8px; }
.choice-done input:checked + span { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.choice-skip input:checked + span { border-color: var(--late); color: var(--late); box-shadow: inset 0 0 0 1.5px var(--late); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.task-note { display: none; }
.task:has(input[value="not_done"]:checked) .task-note { display: block; }
.task-results { list-style: none; margin: 0; padding: 0; }
.task-results li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .5rem; padding: .6rem 0; }
.task-results li:first-child { padding-top: 0; }
.task-results li + li { border-top: 1px solid var(--line); }
.res-mark { font-weight: 700; text-align: center; }
.res-done .res-mark { color: var(--ok); }
.res-skip .res-mark { color: var(--late); }
.res-pending { color: var(--muted); }
.res-note { display: block; color: var(--muted); font-size: .92rem; margin-top: .15rem; }
.template-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.rows b { position: absolute; top: 0; bottom: 0; left: calc(var(--d) / var(--n) * 100%);
  width: calc(var(--s, 0) / var(--n) * 100%); background: var(--late); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Dinheiro recebido do cliente */
.money-input { display: flex; align-items: center; gap: .55rem; }
.money-input > span { font-weight: 700; font-size: 1.2rem; }
.money-input input { max-width: 11rem; }

/* Relatório da empresa */
.report-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.stepper { display: flex; gap: .5rem; }
.stepper .arrow { min-width: 3rem; padding: 0; font-size: 1.4rem; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 48rem) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { display: grid; align-content: start; gap: .15rem; padding: 1rem 1.1rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; }
.stat b { font-family: var(--display); font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat span { font-weight: 700; }
.stat small { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th, .report-table td { padding: .7rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.report-table thead th { color: var(--muted); font-size: .85rem; }
.report-table tfoot th, .report-table tfoot td { font-weight: 700; border-bottom: 0; }
.report-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tier-counts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.cash-row { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1.15rem; border-bottom: 1px solid var(--line); }
.cash-row:last-child { border-bottom: 0; }
.cash-row.total { font-weight: 700; }

/* Dinheiro com a equipe: botão Recebi */
.pay-person { display: flex; justify-content: space-between; gap: 1rem; padding: .95rem 1.15rem .2rem; border-top: 1px solid var(--line); }
.pay-person:first-child { border-top: 0; }
.pay-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .8rem 1.15rem; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-person + .pay-row { padding-top: .45rem; }
.pay-info { display: grid; gap: .15rem; min-width: 0; }
.pay-side { display: grid; justify-items: end; gap: .35rem; text-align: right; }
.pay-side form { margin: 0; }
.pay-side b { font-variant-numeric: tabular-nums; }
.pay-row.received .pay-side b { color: var(--muted); }
.pay-status { color: var(--ok); font-weight: 700; font-size: .92rem; }
.report-table .due { font-weight: 700; }

/* Gráficos do relatório (HTML/CSS: leves e no tema claro/escuro) */
.chart { margin: 0; padding: 1rem 1.15rem 1.05rem; }
.chart figcaption { font-weight: 700; margin-bottom: .85rem; }
.chart + .sheet { margin-top: .75rem; }
.vbars { display: flex; align-items: flex-end; gap: 5px; height: 160px; padding-top: 1.4rem; border-bottom: 1.5px solid var(--line-strong); }
.vbars.dense { gap: 2px; padding-top: .4rem; }
.vbar { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
a.vbar { color: inherit; text-decoration: none; }
a.vbar:hover .vbar-fill, a.vbar:focus-visible .vbar-fill { filter: brightness(1.15); }
/* 'vbar-fill' e não 'bar': .bar já é o cabeçalho do app, e o estilo dele deixava as barras com largura zero */
.vbar-fill { height: var(--h); display: flex; flex-direction: column; border-radius: 5px 5px 0 0; overflow: hidden;
  width: 100%; max-width: 24px; align-self: center; }  /* barra fina: no máximo 24px, o resto é respiro */
.vbars.dense .vbar-fill { border-radius: 2px 2px 0 0; }
.vbar .val { position: absolute; left: 0; right: 0; bottom: calc(var(--h) + .2rem); text-align: center;
  font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.vbars.dense .val { display: none; }
.seg-done, .c-done, .c-received { background: var(--ok); }
.seg-open, .c-open, .c-unmarked { background: var(--line-strong); }
.c-skip { background: var(--late); }
.c-pending { background: var(--marker); }
.vlabels { display: flex; gap: 5px; margin-top: .4rem; }
.vlabels.dense { gap: 2px; }
.vlabels span { flex: 1 1 0; min-width: 0; text-align: center; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.hbars { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) auto; align-items: center; gap: .65rem .8rem; }
.hbars .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { display: block; height: .95rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.hbar-fill { display: block; height: 100%; min-width: .95rem; border-radius: 999px; background: var(--series); }
.hbars .val { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stackbar { display: flex; height: 1.1rem; border-radius: 999px; overflow: hidden; background: var(--line); }
.stackbar span { display: block; min-width: 4px; }
.space-line { margin: 0; }
.space-ok span { background: var(--ok); }
.space-high span { background: var(--marker); }
.space-full span { background: var(--late); }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: .75rem 0 0; color: var(--muted); font-size: .92rem; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .4rem; vertical-align: -.05rem; }
.legend b { color: var(--ink); }

/* Finanças */
.c-transfer { background: #2f6b86; }
.c-cash { background: var(--ok); }
.pill-transfer { background: #2f6b86; border-color: #2f6b86; color: #ffffff; }
.pill-cash { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.vbars.novals { padding-top: .4rem; }
.add-transfer { margin-bottom: 1.25rem; }
.add-transfer > summary { display: flex; align-items: center; gap: .65rem; min-height: 3.2rem; padding: .8rem 1.15rem;
  font-weight: 700; cursor: pointer; list-style: none; }
.add-transfer > summary::-webkit-details-marker { display: none; }
.add-transfer > summary::before { content: "+"; flex: none; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem;
  border-radius: 50%; background: var(--marker); color: var(--on-marker); font-weight: 800; }
.add-transfer[open] > summary::before { content: "\2212"; }
.add-transfer > form { padding: 0 1.15rem 1.15rem; }
.add-transfer .hint { margin: 0; }
.entry-client { font-weight: 700; }
.entry-kind { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .25rem; }
.client-total { display: grid; gap: .15rem; min-width: 0; }
.client-total .hint { font-size: .9rem; }

/* Cargo Gerente: acessos escolhidos pelo dono */
.perms { padding-top: .3rem; }
.pill-sensitive { background: transparent; border-color: var(--late); color: var(--late); font-size: .72rem;
  padding: .05rem .45rem; margin-left: .3rem; vertical-align: .1rem; }

/* O atributo hidden sempre esconde, mesmo em elementos com display próprio (ex.: .task-pick é grid).
   Sem isso, as caixinhas do gerente e o quadro de tarefas do trabalho apareciam quando deviam sumir. */
[hidden] { display: none !important; }

/* ---------- Conta → Aparência ---------- */
.look-logo-row { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: .2rem 0 .3rem; }
.look-logo-current { display: inline-flex; align-items: center; justify-content: center; min-width: 3.4rem; height: 3.4rem;
  padding: .35rem; border-radius: 10px; background: var(--mast-bg); color: var(--marker); }
.look-logo-current img { max-height: 2.7rem; max-width: 8rem; display: block; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); gap: .5rem; margin-top: .3rem; }
.swatch { position: relative; display: flex; flex-direction: row; align-items: center; gap: .45rem; padding: .55rem .6rem;
  border: 1.5px solid var(--line); border-radius: 10px; font-weight: 700; font-size: .95rem; cursor: pointer; min-height: 3rem; }
.swatch input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.swatch > span:last-child { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.swatch:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatch-dots { display: inline-flex; flex: none; }
.swatch-dots i { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch-dots i + i { margin-left: -.3rem; }
.look-custom { margin-top: .6rem; }
.look-warn { margin: .7rem 0 0; padding: .55rem .75rem; border-left: 5px solid var(--late); border-radius: 0 8px 8px 0;
  background: var(--hover); font-size: .92rem; }
.color-field input[type="color"] { width: 100%; height: 3rem; padding: .2rem; border-radius: 8px; border: 1.5px solid var(--line-strong);
  background: var(--surface); cursor: pointer; }
.look-previews { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 34rem) { .look-previews { grid-template-columns: 1fr; } }
.look-preview-label { font-size: .85rem; font-weight: 700; color: var(--muted); margin: 0 0 .3rem; }
.lp { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: .92rem; }
.lp-head { background: var(--mast-bg); color: var(--mast-ink); display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem;
  font: 800 1rem/1.2 var(--display); }
.lp-logo { display: inline-flex; color: var(--marker); }
.lp-logo img { height: 1.7rem; width: auto; max-width: 6rem; display: block; }
.lp-body { padding: .7rem; }
.lp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .75rem; display: grid; gap: .35rem; }
.lp-muted { color: var(--muted); }
.lp-pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.lp-pill { border-radius: 999px; padding: .05rem .6rem; font-size: .8rem; font-weight: 700; }
.lp-busy { background: var(--marker); color: var(--on-marker); }
.lp-ok { background: var(--ok); color: var(--on-ok); }
.lp-link { color: var(--link); text-decoration: underline; font-weight: 700; }
.lp-btn { background: var(--marker); color: var(--on-marker); border-radius: 7px; padding: .5rem .7rem; font-weight: 700; text-align: center; }

/* ---------- Cotações (telas da equipe) ---------- */
.qrow {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.15rem;
  color: inherit; text-decoration: none;
}
.qrow + .qrow { border-top: 1px solid var(--line); }
.qrow:hover { background: var(--hover); }
.qrow-main { display: grid; gap: .15rem; min-width: 0; }
.qrow-main b { font-size: 1.08rem; }
.qrow-side { display: grid; justify-items: end; gap: .4rem; white-space: nowrap; }
.pill-q-sent { border-color: var(--link); color: var(--link); }
.pill-q-viewed { background: var(--marker); border-color: var(--marker); color: var(--on-marker); }
.pill-q-accepted { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.pill-q-declined { border-color: var(--late); color: var(--late); }
.pill-q-expired, .pill-q-cancelled { text-decoration: line-through; }
.qitems { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: .5rem; }
.qitems legend { font-weight: 700; padding: 0; margin-bottom: .15rem; }
.qitems .hint { margin: 0; }
.qitem { display: grid; gap: .5rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.qitem:first-child { border-top: 0; padding-top: .2rem; }
.qitem-nums { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 1rem; }
.qitem-nums label { font-weight: 400; font-size: .92rem; color: var(--muted); }
.qitem-nums input[name="item_qty"] { width: 5rem; }
.qitem-nums .money-input input { width: 7.5rem; }
.danger-link { color: var(--late); margin-left: auto; }
.qitems-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin: .2rem 0 0; }
.qitems-total { font-weight: 700; font-size: 1.1rem; }
.link-copy { display: flex; gap: .5rem; align-items: stretch; }
.link-copy input { flex: 1; min-width: 0; font-size: .95rem; }
.qtimeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.qtimeline li { padding-left: 1.4rem; position: relative; }
.qtimeline li::before { content: "○"; position: absolute; left: 0; color: var(--muted); }
.qtimeline li.done::before { content: "●"; color: var(--ok); }
.qtimeline li.todo { color: var(--muted); }
.callout-ok { border-left-color: var(--ok); }
.callout-late { border-left-color: var(--late); }
.callout-action { margin-top: .7rem; }
.block-hint { margin: -.3rem 0 .7rem; }
.quote-photos { display: grid; gap: 1.4rem; margin-bottom: 1rem; }
.photo.photo-captioned { aspect-ratio: auto; overflow: visible; background: none; border-radius: 0; display: grid; gap: .7rem; }
.photo-captioned > a { display: block; border-radius: 8px; overflow: hidden; background: var(--line); }
.photo-captioned img { width: 100%; height: auto; max-height: 26rem; object-fit: cover; }
.photo-captioned form[data-delete] { top: .45rem; right: .45rem; }
.caption-form { display: grid; gap: .35rem; }
.caption-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; min-height: 1.3rem; }
.caption-foot .hint { margin: 0; }

/* ---------- Página da cotação (o que o cliente vê pelo link, sem login) ---------- */
.qp-head { background: var(--mast-bg); color: var(--mast-ink); }
.qp-head-inner { max-width: 46rem; margin: 0 auto; padding: 1.2rem 1rem; display: flex; align-items: center; gap: .9rem; }
.qp-logo { height: 3.2rem; max-width: 8rem; }
.qp-company { font: 800 1.4rem/1.2 var(--display); margin: 0; }
.qp-contact { margin: .3rem 0 0; color: var(--mast-muted); font-size: .95rem; }
.qp-contact a { color: inherit; }
.qp-ref { color: var(--muted); font-weight: 700; font-size: .95rem; margin: 0 0 .4rem; }
.qp h1 { margin-bottom: .35rem; }
.qp .sub { margin-bottom: 1.4rem; }
.qp-banner { margin-bottom: 1.4rem; }
.qp-intro { margin-bottom: 1.75rem; }
.qp-photo { margin: 0 0 1.1rem; }
.qp-photo img { display: block; width: 100%; height: auto; }
.qp-photo figcaption { padding: .9rem 1.15rem 1rem; }
.qline { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .9rem 1.15rem; }
.qline + .qline { border-top: 1px solid var(--line); }
.qline > div { display: grid; gap: .1rem; }
.qline > b { white-space: nowrap; }
.qline-total { background: var(--hover); font-size: 1.1rem; }
.qline-total b { font-size: 1.3rem; }
.qp-freq { margin: -.4rem 0 .4rem; }
.qp-decline { margin-top: 1rem; }
.qp-decline summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: .7rem 0; }
.qp-decline form { margin-top: .5rem; }
.qp-help { display: grid; gap: .7rem; }
.qp-foot { text-align: center; color: var(--muted); font-size: .9rem; padding: 0 1rem 2.5rem; }
.qp-foot p { margin: 0; }
/* ---------- Lembrete pro cliente (véspera) ---------- */
.options { display: grid; gap: .5rem; margin-top: .3rem; }
.option { position: relative; display: grid; gap: .15rem; padding: .75rem .9rem .75rem 2.9rem; border: 1.5px solid var(--line);
  border-radius: 10px; cursor: pointer; }
.option input { position: absolute; left: .95rem; top: .95rem; width: 1.2rem; height: 1.2rem; min-height: 0; margin: 0; padding: 0;
  border: 0; accent-color: var(--ink); }
.option small { color: var(--muted); font-size: .92rem; font-weight: 400; }
.option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.rem-preview { display: grid; gap: .35rem; }
.bubble { margin: 0; padding: .7rem .85rem; border-radius: 12px 12px 12px 4px; background: var(--bg); border: 1px solid var(--line);
  white-space: pre-wrap; overflow-wrap: anywhere; }
.reminders-note { margin: -.4rem 0 1.1rem; }
.pill-failed { border-color: var(--late); color: var(--late); }
.rem { display: grid; gap: .55rem; padding: .95rem 1.15rem; }
.rem + .rem { border-top: 1px solid var(--line); }
.rem-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.rem-who { display: grid; gap: .1rem; min-width: 0; }
.rem-name { font-weight: 700; color: inherit; }
.rem-state .pill { white-space: nowrap; }
.rem-error { margin: 0; color: var(--late); font-size: .92rem; }
.rem-text summary { cursor: pointer; color: var(--link); font-weight: 700; font-size: .92rem; }
.rem-text .bubble { margin-top: .45rem; }
.rem-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; }
.rem-actions form { margin: 0; }
.reminder-card { display: grid; gap: .2rem; margin: 0 0 1.75rem; color: inherit; text-decoration: none; }
.reminder-card:hover { background: var(--hover); }
.reminder-card .late { color: var(--late); font-weight: 700; }

/* ---------- Minha conta: um assunto por linha, cada um abre a sua página ---------- */
.me { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.me h1 { overflow-wrap: anywhere; }
.me-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 3.3rem; height: 3.3rem;
  border-radius: 50%; background: var(--ink); color: var(--surface); font: 800 1.4rem/1 var(--display); }  /* contrasta no claro e no escuro */
.menu { display: block; overflow: hidden; }
/* Botão que abre um painel (Gerenciar, na página do trabalho): o painel cai abaixo, alinhado à direita */
.head-side { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.popmenu { position: relative; }
.popmenu > summary { list-style: none; display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.popmenu > summary::-webkit-details-marker { display: none; }
.popmenu > summary svg { width: 1.2rem; height: 1.2rem; flex: none; }
.popmenu[open] > summary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.popmenu-panel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 20; width: min(22rem, calc(100vw - 2rem));
  margin: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.popmenu-panel .repeat .pair { grid-template-columns: 1fr 1fr; }
/* Celular: o painel deixa de flutuar e abre abaixo dos botões, na largura toda */
@media (max-width: 34rem) {
  .popmenu { flex: 1 1 100%; display: flex; flex-direction: column; align-items: flex-end; }
  .popmenu-panel { position: static; width: 100%; margin-top: .5rem; box-shadow: none; }
}
.menu-row { display: flex; align-items: center; gap: .85rem; min-height: 4rem; padding: .7rem 1rem .7rem 1.05rem;
  color: inherit; text-decoration: none; }
.menu-row + .menu-row { border-top: 1px solid var(--line); }
.menu-row:hover { background: var(--hover); }
.menu-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
  border-radius: 10px; background: var(--bg); color: var(--link); }
.menu-icon svg { width: 1.35rem; height: 1.35rem; }
.menu-text { flex: 1 1 auto; min-width: 0; display: grid; gap: .1rem; }
.menu-text b { font-weight: 700; }
.menu-text small { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-chevron { flex: none; color: var(--muted); font-size: 1.5rem; line-height: 1; }
.account-logout .btn { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.account-logout .btn svg { width: 1.2rem; height: 1.2rem; flex: none; }

/* ---------- Minhas horas (só consulta) ---------- */
.hours-note { margin: -.4rem 0 1.1rem; }
.hours-callout { margin-bottom: 1rem; }
.plain-list { margin: .45rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
/* colunas: horas por dia ou por mês */
.hchart { position: relative; }
.hc { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 150px; margin-top: 1.5rem;
  border-bottom: 1.5px solid var(--line-strong); }
.hc.dense { gap: 2px; }
.hc.has-grid, .hc-labels.has-grid { padding-left: 2.4rem; }
.hc-grid { position: absolute; left: 0; right: 0; bottom: var(--y); border-top: 1px solid var(--line); pointer-events: none; }
.hc-grid em { position: absolute; left: 0; bottom: .2rem; font-style: normal; font-size: .75rem; line-height: 1; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.hc-bar { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; color: inherit; text-decoration: none; }
.hc-fill { display: block; width: 100%; max-width: 24px; height: var(--h); background: var(--series); border-radius: 4px 4px 0 0; }
.hc.dense .hc-fill { border-radius: 2px 2px 0 0; }
.hc-bar:hover .hc-fill { opacity: .72; }
.hc-val { position: absolute; left: -6px; right: -6px; bottom: calc(var(--h) + .25rem); text-align: center; font-size: .8rem;
  font-weight: 700; color: var(--ink); white-space: nowrap; }
.hc-labels { display: flex; gap: 6px; margin-top: .4rem; }
.hc-labels.dense { gap: 2px; }
.hc-labels span { flex: 1 1 0; min-width: 0; text-align: center; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.hc-labels span.today { color: var(--ink); font-weight: 700; }
.hc-hint { margin: .7rem 0 0; }
.hc-tip { position: absolute; z-index: 3; transform: translate(-50%, -100%); display: grid; gap: .05rem; padding: .4rem .65rem;
  border-radius: 8px; background: var(--ink); color: var(--surface); font-size: .85rem; line-height: 1.3; white-space: nowrap;
  pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.hc-tip b { font-size: 1.05rem; }
/* o dia em linha do tempo */
.dayline figcaption { margin-bottom: .4rem; }
.dl-row { display: grid; gap: .3rem; padding: .6rem 0; color: inherit; text-decoration: none; }
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.dl-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.dl-dur { white-space: nowrap; }
.dl-time { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.dl-track { position: relative; display: block; height: .9rem; border-radius: 4px; background-color: var(--bg);
  background-image: repeating-linear-gradient(to right, var(--line-strong) 0 1px, transparent 1px var(--tick));
  background-position: -1px 0; background-repeat: no-repeat; }  /* marcas de hora; a da ponta esquerda fica de fora */
.dl-bar { position: absolute; top: 0; bottom: 0; min-width: 6px; border-radius: 4px; background: var(--series); }
.dl-row:hover .dl-bar { opacity: .72; }
.dl-axis { position: relative; height: 1.2rem; margin-top: .2rem; }
.dl-axis span { position: absolute; top: 0; transform: translateX(-50%); font-size: .75rem; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-axis span:first-child { transform: none; }
.dl-axis span:last-child { transform: translateX(-100%); }
/* trabalhos do período, com as horas de cada um */
.hrow { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1.15rem; color: inherit;
  text-decoration: none; }
.hrow + .hrow { border-top: 1px solid var(--line); }
.hrow:hover { background: var(--hover); }
.hrow-main { display: grid; gap: .1rem; min-width: 0; }
.hrow-client { font-weight: 700; }
.hrow-when { color: var(--muted); font-size: .92rem; }
.hrow-dur { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hours-more > summary { display: flex; align-items: center; min-height: 44px; margin-bottom: .5rem; cursor: pointer; font-weight: 700;
  color: var(--link); }
.hours-table tr.current th, .hours-table tr.current td { font-weight: 700; }

/* ---------- Área da empresa (e a conversa com ela na página do trabalho) ---------- */
.portal-nav { margin: 0 0 1.2rem; }
.preview-note { margin-bottom: 1rem; border-left-color: var(--link); }
.day-jump { display: flex; gap: .5rem; align-items: center; }
.day-jump input { width: auto; min-width: 0; }
.portal-stats { margin-bottom: 1rem; }
.replies { margin-bottom: 1.25rem; }
.pill-new { background: var(--marker); border-color: var(--marker); color: var(--on-marker); }
.pill-company { border-color: var(--link); color: var(--link); }
.svc { display: grid; gap: .5rem; padding: 1rem 1.15rem 1.05rem; }
.svc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem .75rem; }
.svc-title { min-width: 0; }
.svc-title h2 { font-size: 1.25rem; margin: 0; overflow-wrap: anywhere; }
.svc-title h2 a { color: inherit; text-decoration: none; }
.svc-title h2 a:hover { text-decoration: underline; }
.svc-where { margin: .15rem 0 0; color: var(--muted); font-size: .93rem; }
.svc-when { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.svc-what { margin: 0; color: var(--muted); }
.svc-facts { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.svc-done span { color: var(--ok); font-weight: 700; }
.svc-skip { color: var(--late); }
.svc-materials { margin: 0; overflow-wrap: anywhere; }
.strip { display: grid; gap: .3rem; margin-top: .15rem; }
.strip-label { font-weight: 700; font-size: .9rem; }
.strip-label .count { font-size: .85rem; margin-left: .2rem; }
.strip-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.strip-row a { position: relative; display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--line); }
.strip-row img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-more span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); color: #fff; font: 800 1.35rem/1 var(--display); }
.svc-foot { display: flex; justify-content: space-between; align-items: center; gap: 0 1rem; flex-wrap: wrap; }
.svc-link, .svc-comments { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; font-weight: 700; }
.pager { justify-content: space-between; }
/* A conversa rola dentro da própria caixa (como num app de mensagens), pra última mensagem e a caixa de
   escrever ficarem juntas na tela mesmo com muitos comentários; o base.html abre a caixa já no fim. */
.thread { list-style: none; margin: 0; padding: 0 .25rem 0 0; display: grid; gap: .8rem;
  max-height: min(60vh, 32rem); overflow-y: auto; overscroll-behavior: contain; }
.msg { max-width: 88%; display: grid; gap: .25rem; }
.msg-theirs { justify-self: start; }
.msg-mine { justify-self: end; }
.msg-meta { margin: 0; font-size: .85rem; color: var(--muted); }
.msg-mine .msg-meta, .msg-mine form { text-align: right; }
.msg-body { margin: 0; padding: .7rem .85rem; border-radius: 12px 12px 12px 4px; background: var(--bg); border: 1px solid var(--line);
  overflow-wrap: anywhere; }
.msg-mine .msg-body { border-radius: 12px 12px 4px 12px; border-color: var(--line-strong); background: var(--hover);
  background: color-mix(in srgb, var(--link) 11%, var(--surface)); }
.msg-new .msg-body { box-shadow: inset 4px 0 0 var(--marker); }
.msg form { margin: 0; }
.msg .linkbtn { min-height: 2rem; font-size: .85rem; }
.comment-form textarea { min-height: 5.5rem; }
/* anexos no comentário: a escolha antes de enviar, e as fotos e documentos na conversa */
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.attach .attach-pick { flex: 0 1 auto; }
.attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.attach-item { position: relative; display: flex; flex-direction: column; justify-content: center; gap: .15rem; width: 5.4rem;
  height: 5.4rem; padding: .45rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden;
  font-size: .78rem; line-height: 1.25; }
.attach-item.is-photo { padding: 0; }
.attach-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-name { font-weight: 700; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.attach-item small { color: var(--muted); }
.attach-del { position: absolute; top: .2rem; right: .2rem; display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .62);
  color: #fff; font: 700 1.1rem/1 var(--text); cursor: pointer; }
.attach-status { margin: 0; }
.msg-files { display: flex; flex-wrap: wrap; gap: .4rem; }
.msg-mine .msg-files { justify-content: flex-end; }
.msg-photo { display: block; width: 6.2rem; height: 6.2rem; border-radius: 10px; overflow: hidden; background: var(--line); }
.msg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-doc { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 .6rem; align-items: center; max-width: 17rem;
  padding: .55rem .75rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: inherit;
  text-decoration: none; }
.msg-doc:hover { background: var(--hover); }
.msg-doc-icon { grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem;
  border-radius: 7px; color: #fff; font: 800 .72rem/1 var(--text); letter-spacing: .02em; }
.doc-pdf { background: #b3261e; }
.doc-doc { background: #2b579a; }
.doc-xls { background: #1d6f42; }
.msg-doc-name { font-weight: 700; overflow-wrap: anywhere; }
.msg-doc small { color: var(--muted); }
/* dono: empresas, jardins e quem acessa */
.head-buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.row-act { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; padding: .9rem 1.15rem; }
.row-act + .row-act { border-top: 1px solid var(--line); }
.row-act-main { display: grid; gap: .1rem; min-width: 0; flex: 1 1 14rem; }
.row-act-main a.member-name { color: inherit; }
.row-act-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.row-act form { margin: 0; }
.login-row.off .row-act-main { opacity: .65; }
.add-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.add-row label { flex: 1 1 14rem; }
.how { margin: 0; padding-left: 1.3rem; display: grid; gap: .45rem; }
.daily-status p { margin: 0 0 .25rem; }
.mail-preview summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--link); }
.mail { margin-top: .35rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.mail-subject { margin: 0; padding: .7rem .9rem; border-bottom: 1px solid var(--line); font-weight: 700; overflow-wrap: anywhere; }
.mail-body { margin: 0; padding: .8rem .9rem; font-size: .95rem; line-height: 1.55; overflow-wrap: anywhere; }
.secret { font: 700 1.15rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; overflow-wrap: anywhere; }

/* Semana em grade (jobs.week_view): colunas por dia, linhas de meia hora, um bloco por trabalho */
.container.wide, .masthead-inner.wide { max-width: 72rem; }  /* a grade da semana precisa de espaço pros 7 dias */
.week-wrap { overflow-x: auto; margin: 0 -1rem 1rem; padding: 0 1rem; }
.week { display: grid; grid-template-columns: 3.4rem repeat(7, minmax(8.5rem, 1fr)); min-width: 64rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.week-corner, .week-day { border-bottom: 1px solid var(--line-strong); padding: .5rem .4rem; background: var(--hover); }
.week-day { display: grid; text-align: center; font-size: .9rem; }
.week-day b { font-weight: 800; }
.week-day span { color: var(--muted); font-size: .82rem; }
.week-day.today b { color: var(--link); }
.week-times { display: grid; grid-template-rows: repeat(var(--rows), 2.2rem); }
.week-times span { font-size: .75rem; color: var(--muted); padding: .15rem .3rem 0 0; text-align: right; border-top: 1px solid var(--line); }
.week-times span.half { color: transparent; border-top-color: transparent; }
.week-col { position: relative; display: grid; grid-template-rows: repeat(var(--rows), 2.2rem);
  grid-template-columns: repeat(var(--lanes), minmax(0, 1fr)); border-left: 1px solid var(--line); }
.week-col.today { background: color-mix(in srgb, var(--marker) 7%, var(--surface)); }
.week-slot { grid-row: var(--row); grid-column: 1 / -1; border-top: 1px solid var(--line); }
.week-slot.half { border-top-color: color-mix(in srgb, var(--line) 50%, transparent); }
.week-block { grid-row: var(--row) / span var(--span); grid-column: calc(var(--lane) + 1); margin: 1px 2px; padding: .3rem .4rem;
  border-radius: 6px; background: var(--co, var(--line-strong)); color: #fff; text-decoration: none; overflow: hidden;
  display: flex; flex-direction: column; gap: .05rem; font-size: .8rem; line-height: 1.25; min-width: 0; }
.week-block b { font-weight: 700; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-block span, .week-block small { opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-block.done { opacity: .55; }
.week-block.running { outline: 2px solid var(--marker); outline-offset: -2px; }
.week-block:hover { filter: brightness(1.08); }
.week-dots { display: flex; gap: 3px; margin-top: auto; }
.week-dots i { display: block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--co); border: 1px solid rgba(255,255,255,.7); }
.week-unscheduled { margin: .75rem 0 0; padding: .8rem 1rem; border: 1px dashed var(--line-strong); border-radius: 10px; }
.week-unscheduled ul { margin: .35rem 0 0; }
.week-block.movable { cursor: grab; touch-action: pan-y; }
.week-block.dragging { opacity: .35; }
.week-ghost { position: fixed; z-index: 60; pointer-events: none; opacity: .92; box-shadow: 0 8px 24px rgba(0,0,0,.3); cursor: grabbing; }
.week-drop { grid-row: var(--row) / span var(--span); grid-column: 1 / -1; margin: 1px 2px; border: 2px dashed var(--link);
  border-radius: 6px; background: color-mix(in srgb, var(--link) 12%, transparent); pointer-events: none; z-index: 1;
  display: flex; align-items: flex-start; padding: .25rem .4rem; font-size: .8rem; font-weight: 700; color: var(--link); }
body.week-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.week-drag-hint { margin: -.5rem 0 .75rem; }
.week-status { margin: 0 0 .75rem; }
.week-moves { margin: 0 0 1rem; background: var(--surface); }
.week-moves-list { margin: 0; padding: .3rem .9rem; }
.week-moves .more-bar { padding: 0 .9rem .7rem; }
.week-move { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; padding: .45rem 0; }
.week-move + .week-move { border-top: 1px solid var(--line); }
.week-move.undone .week-move-text { color: var(--muted); }
.week-move-text { flex: 1 1 18rem; min-width: 0; }
.week-legend i { border-radius: 50%; }
.week-legend-none { background: var(--line-strong); }
.week-print-head { display: none; }
/* Pedido de cotação (quote_requests.py): fotos e vídeo em cima, os dados embaixo */
.qreq-media { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.qreq-media .attach-list { flex-basis: 100%; }
.qreq-pick { flex: 0 1 auto; }
.attach-item.is-video { background: var(--ink); color: #fff; }
.attach-item.is-video .attach-name, .attach-item.is-video small { color: #fff; }
.attach-play { font-size: 1.1rem; line-height: 1; }
.qreq-files { display: flex; flex-wrap: wrap; gap: .5rem; }
.qreq-photo { width: 7.4rem; height: 7.4rem; }
.qreq-video { flex-basis: 100%; max-height: 24rem; width: 100%; border-radius: 10px; background: #000; }
.qreq-dl { margin: 0; }
.qreq-dl dd.pre { white-space: pre-wrap; }
.qreq-row { align-items: center; gap: .75rem; flex-wrap: wrap; }
.qreq-row .qrow-main { flex: 1 1 10rem; }
.qreq-row .qrow-main > span:not(.hint) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qreq-row .qrow-side { flex: none; margin-left: auto; }
.qreq-thumb { width: 3.4rem; height: 3.4rem; flex: none; border-radius: 8px; object-fit: cover; background: var(--line); }
.qreq-thumb-none { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.1rem; }
.qreq-delete { margin-top: 1rem; }

@media print {
  .week-wrap { overflow: visible; margin: 0; padding: 0; }
  .week { min-width: 0; font-size: .7rem; }
  .week-block { color: #000; border: 1px solid #333; background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .week-block::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--co, #999); }
  .week-block { position: relative; padding-left: .6rem; }
  .week-print-head { display: block; margin: 0 0 .6rem; font-size: 1.1rem; }
  @page { size: landscape; margin: 10mm; }
  :root { --bg: #fff; --surface: #fff; --hover: #f3f3f3; --ink: #111; --muted: #444; --line: #ccc; --line-strong: #999;
          --mast-bg: #fff; --mast-ink: #111; --mast-muted: #444; --link: #111; }
  body { background: #fff; }
  .no-print, .masthead { display: none !important; }
  .qp-head { border-bottom: 2px solid #111; }
  .qp-photo, .qline { break-inside: avoid; }
  .sheet { border-color: #ccc; }
}


/* Mensagens internas (messages.py): a lista de conversas e a conversa em si.
   A conversa reaproveita .thread/.msg/.attach-* da conversa do trabalho; aqui só o que é novo. */
.conv { position: relative; display: grid; gap: .2rem; padding: .95rem 3.2rem .95rem 1.15rem;
  border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.conv:last-child { border-bottom: 0; }
.conv:hover { background: var(--hover); }
.conv.unread { box-shadow: inset 5px 0 0 var(--marker); }
.conv-name { font-weight: 700; }
.conv-preview { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { color: var(--muted); font-size: .85rem; }
.conv-badge { position: absolute; top: 50%; right: 1.15rem; transform: translateY(-50%); }
.msg-thread { max-height: min(62vh, 34rem); }
.msg-people { margin: -.9rem 0 1.1rem; }
.msg-video { flex-basis: 100%; max-height: 18rem; width: 100%; border-radius: 10px; background: #000; }
.msg-empty { max-width: none; padding: 1.1rem 0; }
.msg-form textarea { min-height: 4.5rem; }

/* Postcode pelo endereço (postcode.js): o botão, o aviso e a marca de sugestão no campo. */
.pc-find { font-size: .8rem; justify-self: start; align-self: start; width: max-content; margin-top: .15rem; }
.pc-note { margin-top: .15rem; }
.pc-note.is-ok { color: var(--ok); }
.pc-note.is-none, .pc-note.is-busy { color: var(--muted); }
input.pc-guess { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
/* Diário da chefe (diary.py): a foto da página do lado dos rascunhos de trabalho. */
.diary-split { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 60rem) { .diary-split { grid-template-columns: minmax(0, 28rem) minmax(0, 1fr); } }
.diary-photo img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
@media (min-width: 60rem) { .diary-photo { position: sticky; top: 1rem; } }
.diary-photo .hint { margin: .5rem 0 0; }
.diary-entry.is-unsure { box-shadow: inset 5px 0 0 var(--marker); }
.diary-entry.is-scheduled { box-shadow: inset 5px 0 0 var(--ok); }
.diary-entry.is-discarded { opacity: .6; }
.diary-written { margin: 0; color: var(--muted); }
.diary-unsure-note { margin: -.4rem 0 0; }
.diary-discard { margin: -.9rem 0 0; padding: 0 1rem; text-align: right; }
.diary-entries .steps, .steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; }
/* Campo de cliente: digita o nome e a lista aparece embaixo (diary.js). Acha por nome e por endereço. */
.pick { display: grid; gap: .35rem; }
.pick-top { position: relative; }
.pick.is-missing .pick-field { border-color: var(--marker); }
.pick-list { list-style: none; margin: .2rem 0 0; padding: .25rem; position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18); max-height: 16rem; overflow-y: auto; }
.pick-item { display: grid; gap: .1rem; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: .6rem .7rem; border-radius: 8px; color: inherit; font: inherit; min-height: 3rem; }
.pick-item:hover, .pick-item:focus { background: var(--hover); outline: none; }
.pick-item small { color: var(--muted); }
.pick-none { margin: 0; color: var(--muted); }
.pick-none .linkbtn { font-weight: 700; }
/* A janelinha do cadastro rápido é a mesma do "Você tem certeza?", só que mais larga por causa do formulário */
.quick-box { width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; }
.quick-box h2 { margin: 0 0 .2rem; }
.quick-box .actions { justify-content: flex-start; }
.pill-marker { background: var(--marker); border-color: var(--marker); color: var(--on-marker); }
.pill-late { border-color: var(--late); color: var(--late); }

/* Demonstração pública (DEMO=1, demo.py): a faixa no topo e os botões de entrada por papel */
.demo-ribbon { background: var(--marker); color: var(--on-marker); text-align: center; font-size: .85rem;
  font-weight: 700; padding: .35rem 1rem; }
.demo-entry { margin-top: 1rem; }
