/*
 * The one look of tabs, windows, buttons and fields (block 13, slice 13.6, chosen by Hobert on 2026-11-18). Loaded last:
 * the screens keep their class names, and what they share is decided here. Selectors repeat a class on purpose, to win
 * over the size each screen had set for itself.
 */
:root {
  --janela-pequena: 560px;
  --janela-media: 760px;
  --janela-grande: 960px;
  --janela-margem: 32px;
  --janela-respiro: 28px;
  --janela-fundo: #0e242b66;
  --letra-controle: 13px;
  --altura-controle: 42px;
  --altura-compacta: 36px;
}

/* Tabs: a tray with the current tab in white, which cannot be taken for an action button. */
.cp-tabs,
.fu-kind-tabs,
.biz-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  background: var(--surface-3);
  border-radius: 14px;
  overflow: visible;
}
.cp-tabs .cp-tab,
.fu-kind-tabs button,
.biz-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--altura-compacta);
  padding: 7px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: var(--letra-controle);
  font-weight: 600;
  white-space: nowrap;
}
.cp-tabs .cp-tab:hover,
.fu-kind-tabs button:hover,
.biz-tabs button:hover {
  color: var(--ink);
}
.cp-tabs .cp-tab[aria-current='page'],
.fu-kind-tabs button[aria-pressed='true'],
.biz-tabs button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* Buttons: two sizes. */
.button.button.button {
  min-height: var(--altura-controle);
  padding-block: 0;
  font-size: var(--letra-controle);
}
.button.button.button.small {
  min-height: var(--altura-compacta);
  padding-inline: 13px;
}
.icon-button {
  width: 36px;
  height: 36px;
}
@media (max-width: 760px) {
  /* Below this width the buttons of a screen heading are icons alone, except on the agenda and the follow-ups. */
  .heading-actions .button.button.button:not(.cp-workspace .button, .fu-workspace .button) {
    min-height: 39px;
    font-size: 0;
  }
  .cp-workspace .page-heading .heading-actions .button.button {
    font-size: var(--letra-controle);
  }
}

/* Fields: one height and one size of letter, in the forms and in the filters of the screens. */
.field input,
.field select,
.biz-field input,
.biz-field select,
.biz-lot-controls input,
.cp-field input:not([type='checkbox'], [type='radio']),
.cp-field select,
.cp-controls input,
.cp-controls select,
.fu-filters > label:not(.fu-search) select,
.wt-date input,
.biz-toolbar > select,
.biz-directory-view .biz-toolbar > select,
.biz-inline-filter select,
.biz-period input,
.biz-period select,
.biz-private-filter select,
.biz-directory-filters input,
.biz-directory-filters select {
  box-sizing: border-box;
  height: var(--altura-controle);
  min-height: var(--altura-controle);
  padding-block: 0;
  border-radius: 12px;
  font-size: var(--letra-controle);
  line-height: 20px;
}
.biz-directory-filters input,
.biz-directory-filters select,
.biz-directory-filters > .button.button.button {
  height: var(--altura-controle);
  min-height: var(--altura-controle);
  max-height: var(--altura-controle);
}
.biz-directory-footer select {
  height: var(--altura-compacta);
  min-height: var(--altura-compacta);
  font-size: var(--letra-controle);
}
.cp-field input[type='file'] {
  padding-block: 9px;
}
.field textarea,
.biz-field textarea,
.cp-field textarea {
  border-radius: 12px;
  font-size: var(--letra-controle);
  line-height: 20px;
}
.fu-search input {
  font-size: var(--letra-controle);
}
.field,
.biz-field,
.biz-directory-filters .biz-field,
.biz-price-row .biz-field,
.cp-field > span {
  font-size: 12px;
}

/* Windows: three sizes, picked by janelas.js from what each one holds. */
html dialog[open]::backdrop {
  background: var(--janela-fundo);
  backdrop-filter: blur(4px);
}
dialog[open]:not(.drawer) {
  border-radius: 24px;
}
dialog[data-janela='pequena'],
dialog.modal {
  width: min(var(--janela-pequena), calc(100vw - var(--janela-margem)));
  max-width: none;
}
dialog[data-janela='media'] {
  width: min(var(--janela-media), calc(100vw - var(--janela-margem)));
  max-width: none;
}
dialog[data-janela='grande'] {
  width: min(var(--janela-grande), calc(100vw - var(--janela-margem)));
  max-width: none;
}
/* The consultation being written keeps the history beside it, and needs all of its width. */
dialog.cp-record.cp-record-wide {
  width: min(1240px, calc(100vw - var(--janela-margem)));
}
dialog[open] .biz-form > header,
dialog[open] .cp-record-head,
dialog[open] .fu-dialog-head {
  align-items: flex-start;
  padding: 22px var(--janela-respiro);
}
dialog[open] .biz-form > header h2,
dialog[open] .cp-record-head h2,
dialog[open] .fu-dialog-head h2,
dialog[open] .dialog-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}
dialog[open] .biz-form > header .eyebrow {
  margin-bottom: 9px;
}
dialog[open] .cp-record-head .icon-button {
  background: transparent;
}
dialog[open] .biz-dialog-body,
dialog[open] .cp-action-body,
dialog[open] .cp-record-body,
dialog[open] .fu-detail-body,
dialog[open] .fu-action-body {
  padding: 24px var(--janela-respiro);
}
dialog[open] .biz-form > footer,
dialog[open] .cp-action-footer,
dialog[open] .fu-dialog-footer {
  gap: 10px;
  padding: 16px var(--janela-respiro);
}
@media (max-width: 700px) {
  :root {
    --janela-margem: 16px;
    --janela-respiro: 18px;
  }
  dialog[open]:not(.drawer) {
    border-radius: 18px;
  }
  dialog[open] .biz-form > header h2,
  dialog[open] .cp-record-head h2,
  dialog[open] .fu-dialog-head h2 {
    font-size: 19px;
  }
}

/* The door of an instance with its own login (21/11/2026). */
.entrada {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px max(16px, env(safe-area-inset-left, 0px));
  overflow: auto;
  background: var(--canvas);
}
.entrada-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.entrada-brand {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent-ink);
}
.entrada-card h1 {
  margin: 0;
  font-size: 22px;
}
.entrada-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.entrada-card form {
  display: grid;
  gap: 14px;
}
.entrada-card .entrada-error {
  min-height: 1em;
  color: var(--danger);
}
.entrada-card .entrada-error:empty {
  display: none;
}
.entrada-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.entrada-card form > .button {
  width: 100%;
}
