/* SAP-KB Base Styles */

:root {
  /* Colors - semantic & state tokens */
  --color-bg: #07131f;
  --color-surface: #0e2030;
  --color-fg: #dce8f3;
  --color-muted: #9eb5c7;
  --color-border: #293d4d;
  --color-link: #59d8ef;
  --color-link-visited: #8fe3f3;
  --color-accent: #59d8ef;
  --color-accent-soft: rgba(89, 216, 239, .13);
  --color-highlight: #efbd71;
  --color-sidebar-bg: #081521;
  --color-sidebar-hover: rgba(89, 216, 239, .08);
  --color-active: #59d8ef;
  --color-error: #ffa1a4;
  --color-badge-public: #68dabd;
  --color-badge-client: #efbd71;
  --color-grafo-sap-help: #b49cf0;
  --color-grafo-fontes: #9aa5b1;
  --color-grafo-virtual: #ff9a62;

  /* Light "paper" of the Word-style editor (views/editar.js): chosen on purpose, the only light surface. */
  --color-folha: #fbfcfd; --color-folha-codigo: #eef3f7; --color-folha-bloco: #f2f5f8;
  --color-folha-html: #fff7e0; --color-folha-bruto: #f6f8fa;

  /* Typographic - font family */
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: Consolas, "Cascadia Mono", "Monaco", "Menlo", monospace;
  
  /* Font sizes: ONE scale of 8 sizes for the whole app (Bruno 2026-11-08: "as páginas têm de ter fonts em comum").
     Use these names; the old numbered steps below are aliases kept so existing rules land on the same 8 sizes. */
  --fs-micro: 0.6875rem;   /* 11px - badges, tiny labels */
  --fs-small: 0.75rem;     /* 12px - captions, meta, table headers */
  --fs-compact: 0.8125rem; /* 13px - dense lists, secondary text */
  --fs-base: 0.875rem;     /* 14px - body text of the app, buttons, inputs */
  --fs-reading: 1rem;      /* 16px - document reading text */
  --fs-h3: 1.125rem;       /* 18px - section titles */
  --fs-h2: 1.5rem;         /* 24px - page titles, KPI values */
  --fs-h1: 2rem;           /* 32px - large figures */
  --fs-1: var(--fs-micro); --fs-2: var(--fs-micro); --fs-3: var(--fs-micro); --fs-4: var(--fs-micro);
  --fs-5: var(--fs-small); --fs-6: var(--fs-compact); --fs-7: var(--fs-base); --fs-8: var(--fs-base);
  --fs-9: var(--fs-reading); --fs-10: var(--fs-reading);
  --fs-11: var(--fs-h3); --fs-12: var(--fs-h3); --fs-13: var(--fs-h3); --fs-14: var(--fs-h3);
  --fs-15: var(--fs-h2); --fs-16: var(--fs-h2); --fs-17: var(--fs-h2); --fs-18: var(--fs-h1);
  --fs-19: 5rem;           /* 80px - display only (hero) */

  /* Spacing tokens */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Border radius tokens */
  --radius-1: 4px;       /* sharp corners */
  --radius-2: 0.25rem;   /* 4px rounded (px-based) */
  --radius-3: 8px;       /* medium rounded */
  --radius-4: 6px;       /* slightly rounded */
  --radius-5: 0.5rem;    /* 8px rounded (rem-based) */
  --radius-xs: 0.3rem;   /* 4.8px */
  --radius-sm: 0.4rem;   /* 6.4px */
  --radius-tiny: 3px;    /* tiny borders */
  --radius-md: 9px;      /* medium */
  --radius-lg: 10px;     /* large */
  --radius-lg0: 14px;    /* extra large */
  --radius-lg1: 16px;    /* extra large 2 */
  --radius-lg2: 18px;    /* extra large 3 */
  --radius-xl: 1rem;     /* 16px rem-based */
  --radius-round: 20px;  /* very rounded */
  --radius-circle: 50%;  /* circle */
  --radius-pill: 999px;  /* fully rounded pills */
  
  /* Shadow tokens */
  --shadow-1: 0 0 0 2px rgba(89, 216, 239, .28);     /* focus outline */
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);      /* dropdown/modal shadow */
  

  /* Midnight Precision + Prism (approved direction; gallery baseline 3f8221a).
     Extra tokens used by the retokened view stylesheets. */
  --color-th: #0a1b28;
  --color-line-strong: #315268;
  --color-on-accent: #04202a;
  --color-ok-solid: #68dabd;
  --color-warn-solid: #efbd71;
  --color-danger-solid: #ffa1a4;
  --color-app: #07131f;
  --color-cy2: #36d5ec;
  --color-focus: #59d8ef;
  --topbar-h: 54px;
  --sidebar-w: 264px;
  --rail-w: 60px;
  --drawer-w: 280px;
  --footer-h: 26px;

  /* Breakpoints */
  --bp-mobile: 360px;
  --bp-tablet: 900px;
}

/* Option A (Enterprise Command Center) design tokens.
   Additive on purpose: existing --color-* tokens keep their meaning because many
   view stylesheets use them as neutral panel colours. */
:root {
  --color-title: #f1f7fc;
  --color-subtle: #7998ad;
  --color-panel-soft: #0b1a28;
  --color-border-soft: #203242;
  --color-nav-bg: #081521;
  --color-nav-text: #dce8f3;
  --color-nav-muted: #7998ad;
  --color-nav-hover: rgba(89, 216, 239, .08);
  --color-nav-active: rgba(89, 216, 239, .14);
  --color-ok-bg: rgba(104, 218, 189, .13);
  --color-ok-fg: #68dabd;
  --color-ok: var(--color-ok-fg);  /* "all good" text and marks; many views already ask for it */
  --color-warn-bg: rgba(239, 189, 113, .13);
  --color-warn-fg: #efbd71;
  --color-danger-bg: rgba(255, 161, 164, .12);
  --color-danger-fg: #ffa1a4;
  --color-danger-border: rgba(255, 161, 164, .55);
  --color-info-bg: rgba(89, 216, 239, .12);
  --color-info-fg: #59d8ef;
  --radius-card: 8px;
  --radius-panel: 8px;
  --shadow-panel: 0 1px 2px rgba(0, 0, 0, .35);
}

.link-partido {
  color: var(--color-muted);
  text-decoration: underline dotted;
}

/* Reusable subtitle: always rendered directly below the page title. */
.page-description {
  color: var(--color-subtle);
  font-size: var(--fs-8);
  margin: 0.35rem 0 0;
  max-width: 72ch;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

/* Form controls take the page font (browsers default them to 13.33px and their own family). */
button, input, select, textarea { font-family: inherit; font-size: inherit; }
/* Element defaults on the same scale (browsers use relative sizes that land between steps). Components override. */
h1 { font-size: var(--fs-h2); }
h2 { font-size: var(--fs-h3); }
h3 { font-size: var(--fs-reading); }
h4, h5, h6 { font-size: var(--fs-base); }
small { font-size: var(--fs-small); }

html {
  font-size: var(--fs-reading); /* rem base: the scale above is in rem */
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-system);
  font-size: var(--fs-base);
  background-color: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.6;
}

/* Shared title hierarchy. Per-view stylesheets load later and may override
   size/colour for specific headers. */
.content h1 {
  color: var(--color-title);
  letter-spacing: -.03em;
  line-height: 1.15;
}

.content h2,
.content h3 {
  color: var(--color-title);
  letter-spacing: -.015em;
}

/* Top Bar */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background-color: var(--color-surface);
  color: var(--color-fg);
  border-bottom: 1px solid var(--color-border-soft);
  box-shadow: none;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--color-fg);
  font-size: var(--fs-16);
  cursor: pointer;
  padding: var(--spacing-sm);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-btn:hover {
  opacity: 0.8;
}

@media (min-width: 900px) {
  .menu-btn {
    display: none;
  }
}

.topbar-title {
  margin: 0;
  font-size: var(--fs-16);
  font-weight: 600;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.topbar-brand img {
  height: 36px;
  width: auto;
}

.topbar-nav {
  display: flex;
  gap: var(--spacing-md);
  flex-shrink: 0;
}

.nav-link {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 12px;
  transition: background-color 0.2s;
}

.nav-link:hover {
  background-color: var(--color-sidebar-hover);
}

.nav-link.active {
  background: var(--color-accent);
  color: var(--color-surface);
  font-weight: 600;
  border-radius: 12px;
}

a.nav-link.active:visited {
  color: var(--color-surface);
}

/* Main Container */
.main-container {
  display: flex;
  min-height: calc(100vh - 88px);
  gap: 0;
}

/* Sidebar */
.sidebar {
  display: none;
  position: fixed;
  /* Below the real (possibly wrapped) topbar; --topbar-live-h is measured in app.js. */
  top: var(--topbar-live-h, var(--topbar-h));
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-nav-bg);
  border-right: 1px solid var(--color-nav-bg);
  overflow-y: auto;
  z-index: 90;
  padding: var(--spacing-md);
  /* Dark rail: re-scope text tokens so existing sidebar rules adapt. */
  --color-fg: var(--color-nav-text);
  --color-muted: var(--color-nav-muted);
  --color-accent: #ffffff;
  --color-link: var(--color-nav-text);
  --color-link-visited: var(--color-nav-text);
  --color-sidebar-hover: var(--color-nav-hover);
  --color-accent-soft: var(--color-nav-active);
  --color-border: rgba(255, 255, 255, .14);
  color: var(--color-nav-text);
}

.sidebar.open {
  display: block;
}

@media (min-width: 900px) {
  .sidebar {
    display: block;
    position: relative;
    top: 0;
    bottom: auto;
    width: var(--sidebar-w);
    height: auto;
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-lg);
    overflow: auto;
  }
  
  .sidebar.open {
    display: block;
  }
}

/* Content Area */
.content {
  flex: 1;
  padding: var(--spacing-lg) 24px;
  overflow-y: auto;
  min-width: 0;
}

@media (max-width: 899px) {
  .content {
    padding: var(--spacing-md);
  }
  
  .sidebar.open ~ .content {
    display: none;
  }
}

/* Tree Navigation */
.tree-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tree-section {
  margin-bottom: 2px;
}

.tree-section:has(> .collapsible-body:not([hidden])) {
  margin-bottom: var(--spacing-sm);
}

.tree-section-title {
  font-size: var(--fs-7);
  font-weight: 400;
  color: var(--color-fg);
  padding: 8px 8px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-admin-badge {
  display: inline-block;
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--color-highlight);
  color: var(--color-nav-bg);
  border-radius: 3px;
  padding: 0 4px;
  margin-left: auto;
  white-space: nowrap;
}

.tree-module-header {
  font-size: var(--fs-6);
  font-weight: 500;
  color: var(--color-muted);
  padding: 4px 8px 4px 16px;
  margin: 4px 0 0 0;
  opacity: 0.85;
}


.tree-items {
  list-style: none;
  padding: 0 0 0 12px;
  margin: 0;
}

.collapsible-body > .tree-items { padding-left: 12px; }
.tree-module-header { margin-left: -12px; }

.tree-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.tree-item-row {
  display: flex;
  align-items: center;
}

.tree-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 5px 8px;
  text-decoration: none;
  color: var(--color-fg);
  cursor: pointer;
  min-height: 32px;
  border-radius: 12px;
  font-size: var(--fs-7);
  transition: background-color 0.2s;
}

.tree-link:hover {
  background-color: var(--color-sidebar-hover);
}

.tree-count {
  margin-left: auto;
  color: var(--color-muted);
  font-size: var(--fs-8);
}

.tree-icon {
  flex-shrink: 0;
  width: 1.2rem;
  text-align: center;
}

.collapsible-heading {
  margin: 0;
}

.collapsible-toggle {
  width: 100%;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tree-section-title .collapsible-toggle {
  text-transform: inherit;
  letter-spacing: inherit;
  font-weight: inherit;
}

/* Secção que abre a tabela em vez de listar as páginas. */
.tree-section-link {
  text-decoration: none;
}

.dashboard-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  color: var(--color-fg);
  text-decoration: none;
  font-size: var(--fs-6);
  font-weight: 500;
  margin-bottom: 8px;
  border-radius: 12px;
  transition: background-color 120ms;
}

.dashboard-link:hover {
  background-color: var(--color-sidebar-hover);
  color: var(--color-accent);
}

.collapsible-count {
  margin-left: auto;
}

.collapsible-chevron {
  display: inline-block;
  flex: 0 0 auto;
  transition: transform 120ms;
}

.collapsible-chevron::before {
  content: '▸';
}

[aria-expanded="true"] > .collapsible-chevron,
[aria-expanded="true"] .collapsible-chevron {
  transform: rotate(90deg);
}

.tree-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 24px;
  min-width: 24px;
  height: 32px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: var(--fs-7);
}

.collapsible-toggle:hover,
.tree-toggle:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-fg);
}

.collapsible-toggle:focus-visible,
.tree-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.tree-children {
  list-style: none;
  padding: 0 0 0 16px;
  margin: 0;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .collapsible-chevron { transition: none; }
}

@media (max-width: 899px) {
  .tree-toggle,
  .collapsible-toggle {
    min-width: 44px;
    min-height: 44px;
  }
  .tree-toggle {
    width: 44px;
  }
}

/* Rodapé */
.app-footer { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-md); padding: 4px var(--spacing-md); border-top: 1px solid var(--color-border-soft); color: var(--color-muted); font-size: var(--fs-2); background: var(--color-surface); position: relative; }
.app-footer-left, .app-footer-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-footer-ver { border: 0; background: var(--color-accent-soft); color: var(--color-accent); border-radius: var(--radius-sm); padding: 2px 6px; cursor: pointer; font: inherit; }
.app-footer-index { display: inline-flex; align-items: center; gap: 4px; color: var(--color-badge-public); }
.app-footer-index i { font-style: normal; }
.app-footer-index.is-indexing { color: var(--color-highlight); }
.app-footer-index.is-error { color: var(--color-error); }
.app-footer-pop { position: absolute; z-index: 100; right: 12px; bottom: 32px; width: min(420px, calc(100vw - 24px)); padding: 12px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-2); }
.app-footer-pop-row { display: flex; gap: 12px; padding: 4px 0; }
.app-footer-pop-row b { flex: 0 0 130px; }
.app-footer-pop-row span { overflow-wrap: anywhere; }
.app-footer-copy { margin-top: 8px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-fg); padding: 5px 8px; border-radius: var(--radius-sm); cursor: pointer; }
@media (max-width: 700px) { .app-footer-text { display: none; } }

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: var(--fs-7);
  font-weight: 600;
  margin-left: var(--spacing-sm);
}

.badge-public {
  background-color: var(--color-ok-bg);
  color: var(--color-ok-fg);
}

.badge-client {
  background-color: var(--color-warn-bg);
  color: var(--color-warn-fg);
}

/* Page Content */
.page-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border-soft);
}

.page-title {
  margin: 0 0 var(--spacing-md) 0;
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--color-title);
  letter-spacing: -.03em;
}

/* Option A shared surfaces. Opt-in building blocks for any view:
   .page-shell > .page-header-row (title + description + actions), then
   .kpi-grid / .panel / .panel-grid, .status-pill, .empty-state.
   They only use tokens, so views stay data-driven and theme-able. */
.page-shell {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.page-header-row > :first-child {
  min-width: 0;
}

.page-header-row .page-description {
  margin-top: 6px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 18px;
  padding: 15px;
  box-shadow: var(--shadow-panel);
  min-width: 0;
}

.kpi-card .kpi-value {
  font-size: var(--fs-16);
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--color-title);
}

.kpi-card .kpi-label {
  color: var(--color-subtle);
  font-size: var(--fs-5);
}

/* Main workspace + optional side/context panel; stacks on narrow screens. */
.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 292px);
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-panel);
  padding: 16px;
  box-shadow: var(--shadow-panel);
  min-width: 0;
}

.panel-soft {
  background: var(--color-panel-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  padding: 12px;
}

.panel-title {
  margin: 0 0 10px;
  font-size: var(--fs-9);
  font-weight: 700;
  color: var(--color-title);
}

/* Table inside a panel: the wrapper scrolls, so tables never widen the page. */
.panel .table-wrap,
.table-panel .table-wrap {
  margin: 0;
  border-radius: var(--radius-card);
  border-color: var(--color-border-soft);
}

@media (max-width: 899px) {
  .panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-5);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--color-info-bg);
  color: var(--color-info-fg);
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.is-ok { background: var(--color-ok-bg); color: var(--color-ok-fg); }
.status-pill.is-warn { background: var(--color-warn-bg); color: var(--color-warn-fg); }
.status-pill.is-error { background: var(--color-danger-bg); color: var(--color-danger-fg); }

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-subtle);
  background: var(--color-panel-soft);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-panel);
}

.empty-state h2,
.empty-state h3 {
  margin: 0 0 6px;
  color: var(--color-title);
}

.empty-state p {
  margin: 0 auto;
  max-width: 52ch;
}

.page-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-md);
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Buttons — the one button system (docs/ui/buttons.md). Defined only here.
   Frame shared with the Assistant composer controls: 32px high, 1px border,
   6px radius, 5px 12px padding, 13px label, 6px gap between icon and label.
     default  .btn, .btn-secondary, bare <button>       surface + border
     primary  .btn-primary, button.primary              solid accent; one per form/dialog/panel
     danger   .btn-danger                               outlined, danger text
     quiet    .btn-ghost                                borderless, muted text
     icon     .btn-icon                                 square; keep aria-label/title
     small    .btn-sm / .btn-small                      26px, 12px label (table rows, dense bars)
   The Assistant's .assistente-botao maps onto default (assistente.css), and
   .assistente-botao.assistente-primario onto primary (here).
   a.btn*:link/:visited keep the button colour (a:visited would otherwise win).
   Touch screens (pointer: coarse) get 44px targets (small: 36px). */

/* Bare <button>: the default kind's frame, without forcing a layout, so the
   many component buttons that restyle it keep their own display/wrapping. */
button {
  box-sizing: border-box;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-4);
  background-color: var(--color-surface);
  color: var(--color-fg);
  cursor: pointer;
  font-family: var(--font-system);
  font-size: var(--fs-6);
  transition: background-color .15s, border-color .15s, color .15s;
}

button:hover {
  background-color: var(--color-th);
  border-color: var(--color-line-strong);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost,
.btn-icon {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-4);
  background-color: var(--color-surface);
  color: var(--color-fg);
  cursor: pointer;
  font-family: var(--font-system);
  font-size: var(--fs-6);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}

.btn svg,
.btn-primary svg,
.btn-secondary svg,
.btn-danger svg,
.btn-ghost svg,
.btn-icon svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

a.btn:link, a.btn:visited, a.btn:hover,
a.btn-secondary:link, a.btn-secondary:visited, a.btn-secondary:hover,
a.btn-icon:link, a.btn-icon:visited, a.btn-icon:hover {
  color: var(--color-fg);
  text-decoration: none;
}

.btn:hover,
.btn-secondary:hover,
.btn-icon:hover {
  background-color: var(--color-th);
  border-color: var(--color-line-strong);
}

/* Primary: the single main action of a form, dialog or panel. */
.btn-primary,
button.primary,
.assistente-botao.assistente-primario {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

a.btn-primary:link, a.btn-primary:visited, a.btn-primary:hover {
  color: var(--color-on-accent);
  text-decoration: none;
}

.btn-primary:hover,
button.primary:hover,
.assistente-botao.assistente-primario:hover {
  background-color: var(--color-cy2);
  border-color: var(--color-cy2);
}

/* Button group: related buttons joined into one rounded piece with thin separators.
   Pattern only. Children drop their own radius and border; the group owns the outline.
   shortcut: the group itself is CSS-only; arrow keys (roving tabindex) live in cliente_objectos.js. Move them into a shared helper when a second group needs arrow keys. */
.btn-grupo {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  overflow-x: auto; /* narrow screens scroll the group; it never wraps mid-group */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-4);
  background-color: var(--color-surface);
}
/* Reset is (0,2,0) so it also beats the later .aparencia-editar border and the .admin-btn
   (admin.css, loaded after this file, (0,1,0)); the separator below is declared after it at
   the same specificity, so the 1px line is not overridden. */
.btn-grupo > :nth-child(n),
.btn-grupo > .aparencia-editar {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.btn-grupo > :not(:first-child) { border-left: 1px solid var(--color-border); }
/* (0,3,0) so it beats the later .btn:focus-visible (0,2,0) reset of outline-offset. */
.btn-grupo > :nth-child(n):focus-visible {
  position: relative; /* lift the focused child above its siblings so the ring is not clipped */
  z-index: 1;
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}
/* Segmented (single-select): the selected child is the accent-filled one. */
.btn-grupo--segmentado > [aria-pressed="true"],
.btn-grupo--segmentado > [aria-current="true"],
.btn-grupo--segmentado > [aria-selected="true"] {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}
.btn-grupo--segmentado > [aria-pressed="true"]:hover,
.btn-grupo--segmentado > [aria-current="true"]:hover,
.btn-grupo--segmentado > [aria-selected="true"]:hover {
  background-color: var(--color-cy2);
}
@media (prefers-reduced-motion: reduce) {
  .btn-grupo > :nth-child(n) { transition: none; }
}

/* Danger: destructive actions. */
.btn-danger {
  background-color: transparent;
  border-color: var(--color-danger-border);
  color: var(--color-danger-fg);
}

a.btn-danger:link, a.btn-danger:visited, a.btn-danger:hover {
  color: var(--color-danger-fg);
  text-decoration: none;
}

.btn-danger:hover {
  background-color: var(--color-danger-bg);
  border-color: var(--color-danger-border);
}

/* Quiet: low-weight inline actions ("View in 2D", "Show more"). */
.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--color-muted);
}

a.btn-ghost:link, a.btn-ghost:visited {
  color: var(--color-muted);
  text-decoration: none;
}

.btn-ghost:hover,
a.btn-ghost:hover {
  background-color: var(--color-accent-soft);
  border-color: transparent;
  color: var(--color-fg);
}

/* Icon-only: square. */
.btn-icon {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

/* Small: size only, combines with any kind. */
.btn-small,
.btn-sm {
  min-height: 26px;
  padding: 3px 9px;
  font-size: var(--fs-5);
}

.btn-icon.btn-small,
.btn-icon.btn-sm {
  width: 26px;
  min-width: 26px;
  padding: 0;
}

button:focus-visible,
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.btn-ghost:focus-visible,
.btn-icon:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Disabled: dimmed, and hover changes nothing. The :disabled:hover rules
   repeat each kind's resting colours so they outrank every :hover rule. */
button:disabled,
.btn:disabled, .btn[aria-disabled="true"],
.btn-primary:disabled, .btn-primary[aria-disabled="true"],
.btn-secondary:disabled, .btn-secondary[aria-disabled="true"],
.btn-danger:disabled, .btn-danger[aria-disabled="true"],
.btn-ghost:disabled, .btn-ghost[aria-disabled="true"],
.btn-icon:disabled, .btn-icon[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
}

button:disabled:hover,
.btn:disabled:hover, .btn[aria-disabled="true"]:hover,
.btn-secondary:disabled:hover, .btn-secondary[aria-disabled="true"]:hover,
.btn-icon:disabled:hover, .btn-icon[aria-disabled="true"]:hover {
  background-color: var(--color-surface);
  border-color: var(--color-border);
}

.btn-primary:disabled:hover, .btn-primary[aria-disabled="true"]:hover,
button.primary:disabled:hover,
.assistente-botao.assistente-primario:disabled:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-danger:disabled:hover, .btn-danger[aria-disabled="true"]:hover {
  background-color: transparent;
  border-color: var(--color-danger-border);
}

.btn-ghost:disabled:hover, .btn-ghost[aria-disabled="true"]:hover {
  background-color: transparent;
  border-color: transparent;
  color: var(--color-muted);
}

@media (pointer: coarse) {
  button,
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-ghost,
  .btn-icon {
    min-height: 44px;
  }

  .btn-small,
  .btn-sm {
    min-height: 36px;
  }

  .btn-icon {
    width: 44px;
    min-width: 44px;
  }

  .btn-icon.btn-small,
  .btn-icon.btn-sm {
    width: 36px;
    min-width: 36px;
  }
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: var(--spacing-lg) 0;
  border: 1px solid var(--color-border-soft);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

th, td {
  padding: var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background-color: var(--color-sidebar-bg);
  font-weight: 600;
  color: var(--color-accent);
}

tr:hover {
  background-color: var(--color-sidebar-hover);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:visited {
  color: var(--color-link-visited);
}

a:hover {
  text-decoration: underline;
}

a.broken {
  color: var(--color-error);
  text-decoration: line-through;
}

/* Code */
code {
  background-color: var(--color-accent-soft);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: var(--fs-7);
}

pre {
  background-color: var(--color-accent-soft);
  padding: var(--spacing-md);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-7);
  line-height: 1.4;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Loading / Error States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--color-accent);
}

/* Orbital indicator: ::before = outer arc (CW, slow), ::after = inner arc (CCW, fast).
   Flex items, not absolute: ::after overlaps ::before via negative margin so both share a centre,
   and the text follows after the outer ring. Size comes from --ob (22px default). */
.loading::before,
.loading::after,
.adt-loading::before,
.adt-loading::after,
.home-loading::before,
.home-loading::after,
.rag-status-loading::before,
.rag-status-loading::after {
  content: "";
  flex: 0 0 auto;
  box-sizing: border-box;
  border-style: solid;
  border-radius: 50%;
  border-color: var(--color-accent-soft);
}

.loading::before,
.adt-loading::before,
.home-loading::before,
.rag-status-loading::before {
  order: -2; /* rings precede the text node (::after would otherwise follow it) */
  width: var(--ob, 22px);
  height: var(--ob, 22px);
  border-width: calc(var(--ob, 22px) * .09);
  border-top-color: var(--color-accent);
  animation: orbital-spin 1.2s linear infinite;
}

.loading::after,
.adt-loading::after,
.home-loading::after,
.rag-status-loading::after {
  order: -1;
  width: calc(var(--ob, 22px) * .64);
  height: calc(var(--ob, 22px) * .64);
  border-width: calc(var(--ob, 22px) * .09);
  border-bottom-color: color-mix(in srgb, var(--color-accent) 55%, transparent);
  /* Left edge sits at 18% of the outer ring: centres match; right edge leaves 8px before the text. */
  margin: 0 calc(var(--ob, 22px) * .18 + .5rem) 0 calc(var(--ob, 22px) * -.82);
  animation: orbital-spin-rev .7s linear infinite;
}

/* Small inline contexts: 14px orbital indicator, no 200px min-height. */
#form-messages .loading,
td .loading,
th .loading,
.home-loading {
  --ob: 14px;
  min-height: 0;
}

@keyframes orbital-spin { to { transform: rotate(360deg); } }
@keyframes orbital-spin-rev { to { transform: rotate(-360deg); } }

@media (prefers-reduced-motion: reduce) {
  .loading::before, .loading::after,
  .adt-loading::before, .adt-loading::after,
  .home-loading::before, .home-loading::after,
  .rag-status-loading::before, .rag-status-loading::after {
    animation: none;
  }
}

.error {
  padding: var(--spacing-lg);
  background-color: var(--color-danger-bg);
  color: var(--color-error);
  border-radius: 4px;
  border-left: 4px solid var(--color-error);
}


/* User menu */
.user-menu { position: relative; margin-left: auto; }
.user-pill { display: inline-flex; align-items: center; gap: .5rem; height: 36px; padding: 0 .5rem 0 .3rem; box-sizing: border-box; border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); color: var(--color-fg); font: inherit; cursor: pointer; }
.user-pill:hover { background: var(--color-nav-hover); }
.user-pill:focus-visible { outline: none; box-shadow: var(--shadow-1); }
.user-pill[aria-expanded="true"] { background: var(--color-nav-active); border-color: var(--color-accent); }
.user-chevron { display: inline-flex; color: var(--color-muted); transition: transform .15s ease; }
.user-pill[aria-expanded="true"] .user-chevron { transform: rotate(180deg); }
.user-menu .nav-glyph { width: 16px; height: 16px; flex: none; }
.user-menu .nav-glyph svg { width: 100%; height: 100%; display: block; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--color-accent); color: var(--color-on-accent); font-size: var(--fs-5); font-weight: 700; overflow: hidden; flex: none; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar.retrato-grande { width: 96px; height: 96px; font-size: var(--fs-h1); }
.retrato-acoes { display: flex; gap: var(--space-2, 8px); flex-wrap: wrap; margin-top: var(--space-2, 8px); }
.user-dropdown { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 240px; max-width: calc(100vw - 1rem); padding: .4rem; box-sizing: border-box; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-panel); box-shadow: var(--shadow-2); z-index: 200; }
.user-dropdown a, .user-dropdown button { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 40px; padding: .5rem .6rem; box-sizing: border-box; border: 0; border-radius: var(--radius-3); background: none; color: var(--color-fg); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--color-nav-hover); }
.user-dropdown a:focus-visible, .user-dropdown button:focus-visible { outline: none; box-shadow: var(--shadow-1); }
.user-dropdown a > span, .user-dropdown button > span { flex: 1; min-width: 0; }
.user-dropdown .nav-glyph { flex: none; color: var(--color-muted); }
.user-dropdown .user-ext { flex: none; margin-left: auto; color: var(--color-muted); }
.user-dropdown .user-logout:hover { color: var(--color-error); }
/* Page tabs of the Administration (abas_pagina.js): same look as the Home Overview/Coverage tabs. */
.abas-pagina { display: flex; flex-wrap: wrap; gap: var(--spacing-sm); border-bottom: 1px solid var(--color-border-soft); margin: 0 0 var(--spacing-md); }
.abas-pagina-aba { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--color-subtle, var(--color-muted)); font: inherit; font-weight: 600; padding: var(--spacing-sm) var(--spacing-md); cursor: pointer; }
.abas-pagina-aba[aria-selected="true"] { color: var(--color-title); border-bottom-color: var(--color-highlight, var(--color-accent)); }
.abas-pagina-aba:focus-visible { outline: 2px solid var(--color-highlight, var(--color-accent)); outline-offset: 2px; }
.aba-oculta { display: none !important; }
/* Menu button (menu_botao.js): one trigger + a list of actions, styled like the user menu.
   (0,2,1) items beat .btn-secondary and the .aparencia-editar look/opacity of buttons placed in it. */
.menu-botao { position: relative; display: inline-flex; }
.menu-botao[hidden] { display: none; }
.menu-botao-gatilho { display: inline-flex; align-items: center; gap: .35rem; }
.menu-botao-gatilho[aria-expanded="true"] .nav-glyph { transform: rotate(180deg); }
.menu-botao-lista { position: fixed; min-width: 220px; max-width: calc(100vw - 1rem); padding: .4rem; box-sizing: border-box; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-panel); box-shadow: var(--shadow-2); z-index: 200; display: flex; flex-direction: column; }
.menu-botao-lista[hidden] { display: none; }
.menu-botao .menu-botao-lista > [role="menuitem"] { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 38px; margin: 0; padding: .45rem .6rem; box-sizing: border-box; border: 0; border-radius: var(--radius-3); background: none; box-shadow: none; color: var(--color-fg); font: inherit; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; opacity: 1; }
.menu-botao .menu-botao-lista > [role="menuitem"]:hover, .menu-botao .menu-botao-lista > [role="menuitem"]:focus-visible { background: var(--color-nav-hover); outline: none; }
.user-dropdown-sep { height: 1px; margin: .35rem 0; background: var(--color-border-soft); }
.user-dropdown-header { display: flex; align-items: center; gap: .6rem; padding: .6rem; } .user-dropdown-header .user-avatar { width: 36px; height: 36px; } .user-dropdown-header strong { display: block; color: var(--color-fg); } .user-dropdown-header small { display: block; color: var(--color-muted); }
.users-heading { display: flex; justify-content: space-between; align-items: center; } .role-pill { padding: .2rem .6rem; border-radius: 999px; font-size: var(--fs-7); } .role-admin { background: var(--color-accent); color: var(--color-on-accent); } .role-editor { background: var(--color-accent-soft); color: var(--color-accent); } .role-leitor { background: var(--color-th); color: var(--color-muted); } .user-inactive { color: var(--color-muted); } .user-inactive .username { text-decoration: line-through; } .users-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.modal-overlay { position: fixed; inset: 0; background: rgba(2,8,14,.72); display: flex; align-items: center; justify-content: center; z-index: 300; } .modal { background: var(--color-surface); padding: var(--spacing-lg); max-width: 480px; width: calc(100% - 2rem); border-radius: 8px; } .modal-error { color: var(--color-error); margin: .5rem 0; }
/* Narrow screens: the pill is too close to the right edge for a 240px panel, so the panel spans the topbar instead. */
@media (max-width: 600px) { .user-name { display: none; } .user-menu { position: static; } .user-dropdown { left: .5rem; right: .5rem; } }

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
}

/* Form inputs */
input[type=text],
input[type=password],
input[type=url],
input[type=number],
input[type=email],
input:not([type]),
select,
textarea {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--color-bg);
  font: inherit;
  color: var(--color-fg);
  width: 100%;
  box-sizing: border-box;
}

input[type=text]:focus,
input[type=password]:focus,
input[type=url]:focus,
input[type=number]:focus,
input[type=email]:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--color-accent-soft);
  border-color: var(--color-accent);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-system);
  font-size: var(--fs-9);
  background-color: var(--color-bg);
  color: var(--color-fg);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-link);
  box-shadow: var(--shadow-1);
}

/* Overlay for sidebar on mobile */
@media (max-width: 899px) {
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 80;
  }
  
  .sidebar-overlay.open {
    display: block;
  }
}


/* Modal Overlay and Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 8, 14, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .55);
}

.modal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: var(--fs-14);
  color: var(--color-fg);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal .form-group label {
  font-size: var(--fs-7);
  font-weight: 500;
  color: var(--color-fg);
}

.modal .form-group small {
  font-size: var(--fs-7);
  color: var(--color-muted);
  margin-top: 4px;
}

.modal .modal-error {
  color: var(--color-error);
  font-size: var(--fs-7);
  min-height: 20px;
  text-align: center;
}

.modal button {
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-fg);
  cursor: pointer;
  font-size: var(--fs-8);
  transition: all 0.2s;
}

.modal button:hover {
  background: var(--color-sidebar-hover);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.modal-actions button {
  width: auto;
  display: inline-block;
}

.modal button.primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-color: var(--color-accent);
}

.modal button.primary:hover {
  opacity: 0.9;
}

.modal .modal-cancel {
  order: -1;
}

.modal form > :last-child {
  order: 0;
}

/* Role Selector */
.role-selector {
  display: flex;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px;
  background: var(--color-bg);
  position: relative;
}

.role-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--color-fg);
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--fs-7);
  transition: all 0.2s;
  font-weight: 500;
}

.role-btn:hover {
  background: var(--color-accent-soft);
}

.role-btn.selected {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
}

.role-selector input[type="hidden"] {
  display: none;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsiveness */
@media (max-width: 899px) {
  .topbar {
    flex-wrap: wrap;
  }
  
  .topbar-brand {
    order: 2;
    flex-basis: calc(100% - 44px - var(--spacing-md));
  }
  
  .menu-btn {
    order: 1;
  }
  
  .topbar-brand img { height: 30px; }

  .topbar-nav {
    order: 4;
    flex-basis: 100%;
    margin-top: var(--spacing-sm);
  }
  
  .content {
    width: 100%;
  }
}

/* Separadores de código (Source) */
.codigo-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--color-border);
  margin: 1rem 0;
}

.codigo-tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--color-muted);
  transition: all 0.2s;
  margin-bottom: -2px;
}

.codigo-tab:hover {
  color: var(--color-fg);
  background: var(--color-sidebar-hover);
}

.codigo-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.codigo-fonte {
  margin: 1rem 0;
}

.codigo-fonte h3 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: var(--fs-h3);
  color: var(--color-fg);
}

.codigo-fonte h3:first-child {
  margin-top: 0;
}

.codigo-abap {
  background: var(--color-th);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

.codigo-linha {
  display: flex;
  min-height: 1.5em;
}

.codigo-num {
  display: inline-block;
  width: 3.5em;
  padding: 0 0.5em;
  text-align: right;
  color: var(--color-subtle);
  background: var(--color-panel-soft);
  border-right: 1px solid var(--color-border);
  user-select: none;
  flex-shrink: 0;
}

.codigo-linha code {
  padding: 0 0.5em;
  flex: 1;
  white-space: pre;
}

.codigo-linha:hover {
  background: var(--color-warn-bg);
}

.codigo-linha-destaque {
  background: var(--color-warn-bg);
  outline: 2px solid var(--color-warn-fg);
}

/* --- Option A page polish: shared page title / description / table head ----
   Module stylesheets reuse these tokens; nothing here changes layout logic. */
.page-title,
.page-header-row h1 {
  margin: 0;
  color: var(--color-title);
  font-size: var(--fs-17);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.page-description {
  max-width: 70ch;
  color: var(--color-subtle);
  line-height: 1.5;
}

.table-wrap th,
.panel th {
  background: var(--color-panel-soft);
  color: var(--color-subtle);
  font-size: var(--fs-5);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.table-wrap tr:last-child td { border-bottom: 0; }

@media (max-width: 600px) {
  .page-title,
  .page-header-row h1 { font-size: var(--fs-15); }
}


/* ==========================================================================
   Midnight Precision + Prism: shared shell overrides (approved direction;
   gallery baseline 3f8221a). Tokens live in :root above and are consumed by
   the per-view sheets. Keep this block last so it wins over legacy rules. */
html { color-scheme: dark; }
body { background: var(--color-app); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
::selection { background: rgba(89, 216, 239, .28); color: #fff; }
code, pre, kbd, samp { font-family: var(--font-mono); }

/* Top bar: 54px, Prism lockup left, search centre, nav + user right. */
.topbar { min-height: var(--topbar-h); padding: 0 16px; gap: 12px; background: var(--color-bg); border-bottom: 1px solid var(--color-border-soft); box-shadow: none; }
/* Workspace shortcut next to Tools; the search trigger sits in the middle of the whole bar on wide screens
   (absolute, so the left group and the user menu keep their places). */
.topbar-atalho { color: var(--color-fg); text-decoration: none; }
.topbar-atalho[hidden] { display: none; }
.topbar-atalho .ic { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.topbar-atalho .ic-ext { width: 12px; height: 12px; color: var(--color-muted); }
.topbar-atalho[aria-current="page"] { color: var(--color-accent); }
@media (min-width: 1100px) {
  .topbar .btn-abrir-pagina { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
}
.topbar-brand img { height: 26px; width: auto; }
.menu-btn:hover { background: var(--color-sidebar-hover); }
.nav-link { font-weight: 600; }
.nav-link.active, a.nav-link.active:visited { background: var(--color-accent-soft); color: var(--color-accent); box-shadow: inset 0 -2px var(--color-accent); }

/* Sidebar: dense rows, cyan active marker. */
.sidebar { border-right: 1px solid var(--color-border-soft); }
.tree-admin-badge { background: transparent; color: var(--color-highlight); border: 1px solid rgba(239, 189, 113, .45); }

/* Footer. */
.app-footer { background: var(--color-bg); border-top: 1px solid var(--color-border-soft); color: var(--color-subtle); }

/* Forms. */
input[type=text], input[type=password], input[type=url], input[type=number], input[type=email], input[type=search], input:not([type]), select, textarea { background: var(--color-panel-soft); color: var(--color-fg); border-color: var(--color-line-strong); }
input::placeholder, textarea::placeholder { color: var(--color-subtle); }

/* Tables: dense heads on the th token. */
th { background-color: var(--color-th); color: var(--color-subtle); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Shell contract: 26px footer row; narrow top bar keeps menu, brand and user on one row. */
.app-footer { min-height: var(--footer-h); padding: 2px var(--spacing-md); line-height: 1.3; font-size: var(--fs-small); }
.app-footer-ver, .app-footer-copy { min-height: 0; line-height: 1.3; }
@media (max-width: 899px) {
  .topbar { padding: 6px 12px; row-gap: 8px; }
  .topbar-brand { flex: 1 1 0; min-width: 0; order: 2; }
  .topbar-brand img { height: 32px; width: auto; max-width: 100%; }
  .user-menu { order: 3; margin-left: 0; }
  .btn-abrir-pagina { order: 4; }
  .topbar-nav { order: 6; margin-top: 0; overflow-x: auto; }
}

/* Media slot contract (docs/architecture/midnight-prism-implementation.md).
   A slot paints --media-image under a Midnight overlay and falls back to the plain surface when unset;
   the media backend (successor card) only has to set these custom properties on the slot element. */
.media-slot {
  position: relative;
  isolation: isolate;
  background-color: var(--color-surface);
  background-image: var(--media-image, none);
  background-size: cover;
  background-position: var(--media-focus-x, 50%) var(--media-focus-y, 50%);
}
.media-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-bg);
  opacity: var(--media-overlay, 0.72);
  pointer-events: none;
}

/* Midnight Prism photo-header: the page header/hero keeps its text readable on top of the media overlay. */
.page-hero {
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-panel);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.page-hero > * { position: relative; }
.page-hero h1, .page-hero .page-description { text-shadow: none; }

.tree-empty {
  display: block;
  padding: 5px 8px;
  color: var(--color-muted);
  font-size: var(--fs-7);
  opacity: 0.75;
}

/* On-page appearance editor (admin only). Buttons live in the normal flow of their host so they
   can never overlap the logo or the title, even at narrow widths. */
.aparencia-editar { opacity: 0; align-self: flex-start; margin: 0; padding: .25rem .6rem; font: inherit; font-size: var(--fs-7); color: var(--color-fg); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; transition: opacity .12s; }
[data-aparencia-alvo]:hover .aparencia-editar,
[data-aparencia-alvo]:focus-within .aparencia-editar,
.cliente-topo:hover .aparencia-editar-logo,
.cliente-topo:focus-within .aparencia-editar-logo,
.aparencia-editar:focus-visible,
.aparencia-edicao .aparencia-editar { opacity: 1; }
@media (hover: none) { .aparencia-editar { opacity: 1; } }
.btn-grupo > .aparencia-editar { align-self: stretch; }
.aparencia-editar:focus-visible, .aparencia-toggle:focus-visible, .aparencia-painel :focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.aparencia-toggle { position: fixed; left: .75rem; bottom: .75rem; z-index: 250; padding: .35rem .8rem; font: inherit; font-size: var(--fs-7); color: var(--color-fg); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; cursor: pointer; box-shadow: var(--shadow-2); }
.aparencia-toggle[aria-pressed="true"] { border-color: var(--color-accent); background: var(--color-accent-soft); }
/* Never float over the navigation: sit beside the rail (compact or expanded) on desktop, and step aside
   while the mobile drawer is open so it cannot intercept clicks on the rows underneath. */
@media (min-width: 900px) {
  .aparencia-toggle { left: calc(var(--rail-w) + .75rem); }
  body:has(.sidebar[data-rail="open"]) .aparencia-toggle { left: calc(var(--sidebar-w) + .75rem); }
}
@media (max-width: 899px) {
  body:has(.sidebar.open) .aparencia-toggle { visibility: hidden; }
}
[data-aparencia-previa] { outline: 2px dashed var(--color-accent); outline-offset: -2px; }
.aparencia-painel { position: fixed; z-index: 260; right: .75rem; bottom: .75rem; width: min(26rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 1.5rem); overflow: auto; display: flex; flex-direction: column; gap: .6rem; padding: 1rem; color: var(--color-fg); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-panel); box-shadow: var(--shadow-panel); }
.aparencia-painel h2 { margin: 0; font-size: var(--fs-reading); flex: 1; }
.ap-cab { display: flex; align-items: center; gap: .5rem; }
.ap-fechar { background: none; border: 0; color: var(--color-fg); font-size: var(--fs-h2); cursor: pointer; line-height: 1; }
.ap-previa { padding: .1rem .5rem; border-radius: 999px; font-size: var(--fs-7); color: var(--color-bg); background: var(--color-accent); }
.ap-contexto, .ap-nota { margin: 0; color: var(--color-muted); font-size: var(--fs-7); }
.ap-modos { display: flex; flex-direction: column; gap: .4rem; border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); padding: .5rem .7rem; }
.ap-modos label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.ap-modos .ap-nota { flex-basis: 100%; padding-left: 1.4rem; }
.ap-biblio { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .4rem; max-height: 11rem; overflow: auto; }
.ap-item { display: flex; flex-direction: column; gap: .2rem; padding: .25rem; font: inherit; font-size: var(--fs-7); color: var(--color-fg); background: none; border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); cursor: pointer; min-width: 0; }
.ap-item[aria-pressed="true"] { border-color: var(--color-accent); background: var(--color-accent-soft); }
.ap-item img { width: 100%; height: 3.2rem; object-fit: cover; border-radius: 4px; }
.ap-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-upload, #ap-meta, #ap-avancados { display: flex; flex-direction: column; gap: .4rem; }
#ap-avancados { border: 0; padding: 0; margin: 0; }
.ap-linha { display: flex; gap: .4rem; align-items: center; }
.ap-erro { margin: 0; color: var(--color-error); }
.ap-info { margin: 0; color: var(--color-accent); }
.ap-rodape { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.ap-acoes { display: flex; flex-wrap: wrap; gap: .4rem; }
.ap-rodape button:disabled { opacity: .5; cursor: not-allowed; }
/* Client: logo + page background consumers */
.cliente-logo { flex: 0 0 auto; max-width: 8rem; max-height: 3.5rem; }
.cliente-logo.vazio { display: none; }
.cliente-logo-img { display: block; max-width: 100%; max-height: 3.5rem; object-fit: contain; }
.cliente-topo { flex-wrap: wrap; align-items: center; row-gap: .4rem; }
.cliente-actions { flex-wrap: wrap; row-gap: .4rem; }
.cliente-container.media-slot { border-radius: var(--radius-panel); }

/* 3D scenes in appearance slots (cena_slot.js). The layer sits under the content; without WebGL / with 3D off it is a CSS poster. */
.cena-camada { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background:
  radial-gradient(120px 70px at 74% 50%, rgba(220, 232, 243, .5), transparent 70%),
  radial-gradient(300px 120px at 74% 50%, rgba(89, 216, 239, .26), transparent 70%),
  radial-gradient(1px 1px at 20% 30%, #fff, transparent), #071523; }
.cena-camada > .palco-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.com-cena-banner { position: relative; isolation: isolate; background: #071523; min-height: 200px; }
@media (max-width: 900px) { .com-cena-banner { min-height: 170px; } }
.com-cena-banner > :not(.cena-camada) { z-index: 1; }
.com-cena-banner::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 14, 24, .92) 0%, rgba(5, 14, 24, .72) 38%, rgba(5, 14, 24, .15) 70%, rgba(5, 14, 24, 0) 100%); }
.com-cena-banner :where(h1, .page-description, .home-subtitle, .cliente-badge) { text-shadow: 0 1px 8px rgba(4, 11, 20, .9); }
.home-header.com-cena { align-items: flex-start; }
.home-header.com-cena .home-refresh { position: absolute; right: 16px; bottom: 14px; z-index: 3; margin-left: 0; background: rgba(4, 11, 20, .75); }
.com-cena-fundo { position: relative; isolation: isolate; }
.com-cena-fundo > .cena-camada { position: fixed; inset: var(--topbar-live-h, var(--topbar-h)) 0 0 0; z-index: -1; opacity: .7; }
.com-cena-fundo > .cena-camada::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4, 11, 20, .1), rgba(4, 11, 20, .45)); }
.ap-cenas { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .4rem; }
.ap-cena { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: .45rem .55rem; font: inherit; text-align: left; color: var(--color-fg); background: transparent; border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; }
.ap-cena[aria-pressed="true"] { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.ap-cena span { font-size: var(--fs-7); color: var(--color-fg-muted, inherit); opacity: .8; }
.ap-cena-cor { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.ap-aviso { color: var(--color-highlight); }

/* ---------------------------------------------------------------------------
   Aligned sidebar (Knowledge / Tools tabs).
   Count, ADMIN badge and expand button share one right-side row and never
   wrap onto their own lines; long labels wrap inside the label area. Indents
   and the active row live in the "Inline menu" block below.
   --------------------------------------------------------------------------- */
.menu-sec-btn:focus-visible,
.tools-link:focus-visible,
.tree-link:focus-visible,
.tree-section-link:focus-visible,
.dashboard-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.tools-nav { display: flex; flex-direction: column; gap: 2px; }
.tools-link {
  display: block;
  padding: 7px 8px;
  min-height: 32px;
  border-radius: 12px;
  color: var(--color-fg);
  font-size: var(--fs-7);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 0.2s;
}
.tools-link:hover { background-color: var(--color-sidebar-hover); }
.tools-link.active {
  background-color: var(--color-accent-soft);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 var(--color-highlight);
}

/* Common left edge: no gutters, no cumulative nested indent. */
.tree-items,
.collapsible-body > .tree-items,
.tree-children { padding: 0; margin: 0; }
.tree-module-header { margin-left: 0; padding: 4px 8px; }
.tree-items,
.tree-children,
.collapsible-body {
  margin: 2px 0 4px;
  border-radius: 8px;
  box-shadow: inset 2px 0 rgba(255, 255, 255, .10);
}

/* Link rows: label area grows and wraps, metadata stays on the right. */
.tree-item-row { align-items: flex-start; gap: 2px; }
.tree-item-row > .tree-link { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.tree-item-row > .tree-count {
  flex: 0 0 auto;
  margin-left: 0;
  align-self: center;
  padding: 0 2px;
  font-variant-numeric: tabular-nums;
}
.tree-toggle { flex: 0 0 auto; width: 28px; min-width: 28px; border-radius: 8px; }

/* Section headings (links and disclosure buttons): one nowrap row. */
.tree-section-title {
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px 8px;
}
.tree-section-title .collapsible-toggle { flex-wrap: nowrap; min-width: 0; }
.tree-section-title .collapsible-label,
.tree-section-link > span:first-child { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.tree-section-title .collapsible-count,
.tree-section-link > .collapsible-count {
  flex: 0 0 auto;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.tree-section-link { display: flex; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0; padding: 4px 0; }
.collapsible-toggle .collapsible-chevron { order: 3; }
.collapsible-toggle .collapsible-count { order: 2; }
.tree-admin-badge { flex: 0 0 auto; margin-left: 0; align-self: center; }
.tree-section-title > .tree-admin-badge { margin-left: 0; }

@media (max-width: 899px) {
  .tree-toggle { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .menu-sec-btn { min-height: 44px; }
  .tools-link { padding: 12px 8px; min-height: 44px; }
}

/* ---------------------------------------------------------------------------
   Navigation rail (approved expandable design).
   Desktop: 60px compact rail, 264px when expanded (pinned or opened by hand).
   Mobile (<900px): 280px drawer with scrim. The top-level sections are the
   "Inline menu" block below. Visibility of items is still decided by the server.
   --------------------------------------------------------------------------- */
.sidebar {
  padding: 0;
  overflow-x: hidden;
  flex-direction: column;
}
.sidebar .ic { width: 20px; height: 20px; flex: 0 0 20px; stroke: currentColor; fill: none; }
.rail-top { display: flex; align-items: center; gap: 4px; padding: 8px 8px 4px; flex: 0 0 auto; }
.rail-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; min-width: 32px; flex: 0 0 32px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--color-nav-muted); cursor: pointer; font: inherit;
}
.rail-btn .ic { width: 18px; height: 18px; flex: 0 0 18px; }
.rail-btn:hover { background: var(--color-nav-hover); color: var(--color-nav-text); }
/* Pinned: same size as its neighbour, only the icon colour and a faint background change. */
.rail-btn[aria-pressed="true"] { color: var(--color-highlight); background: color-mix(in srgb, var(--color-highlight) 12%, transparent); }
.rail-btn:focus-visible { outline: 2px solid #59d8ef; outline-offset: 2px; }
.rail-pin { margin-left: auto; }
.rail-close { display: none; }
.rail-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 0 var(--spacing-lg); }

/* Tooltips (compact desktop rail only). */
.rail-tip {
  display: none;
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  padding: 4px 8px; border-radius: 8px; white-space: nowrap; pointer-events: none;
  background: var(--color-surface-2, #12293b); color: #dce8f3; border: 1px solid rgba(255, 255, 255, .14);
  font-size: var(--fs-7); font-weight: 500; z-index: 140;
  opacity: 0; visibility: hidden; transition: opacity 120ms;
}

.sidebar-scrim { display: none; }

/* Unpinned expanded rail floats over the content: the layout keeps reserving 60px. */
@media (min-width: 900px) {
  .sidebar { position: relative; z-index: 90; }
  .sidebar[data-rail="open"][data-pinned="false"] {
    margin-right: calc(var(--rail-w) - var(--sidebar-w));
    box-shadow: 12px 0 32px rgba(0, 0, 0, .45);
  }
}

@media (min-width: 900px) {
  .sidebar { display: flex; width: var(--rail-w); flex: 0 0 auto; transition: width 160ms; }
  .sidebar[data-rail="open"] { width: var(--sidebar-w); }
  .sidebar[data-rail="open"] .rail-top { padding-left: 8px; }
  .sidebar[data-rail="compact"] { overflow: visible; }
  .sidebar[data-rail="compact"] .rail-body { overflow: visible; padding: 4px 0; }
  .sidebar[data-rail="compact"] .rail-pin { display: none; }
  .sidebar[data-rail="compact"] .rail-top { justify-content: center; padding: 8px 0 4px; }
  .sidebar[data-rail="compact"] .rail-btn:hover .rail-tip,
  .sidebar[data-rail="compact"] .rail-btn:focus-visible .rail-tip { display: block; opacity: 1; visibility: visible; }
}

@media (max-width: 899px) {
  .sidebar {
    width: var(--drawer-w); max-width: 100vw;
    box-shadow: 12px 0 40px rgba(0, 0, 0, .5);
    display: none;
  }
  .sidebar.open { display: flex; }
  .sidebar.open ~ .content { display: block; }
  .sidebar-scrim {
    position: fixed; left: 0; right: 0; bottom: 0;
    top: var(--topbar-live-h, var(--topbar-h));
    background: rgba(2, 8, 14, .6); z-index: 89;
  }
  .sidebar-scrim:not([hidden]) { display: block; }
  .rail-toggle, #rail-toggle, .rail-pin { display: none; }
  .rail-close { display: inline-flex; margin-left: auto; }
  .rail-top { padding: 8px 8px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .rail-tip { transition: none; }
}

/* Shared rules moved from the retired perguntar.css / prevenda.css: muted text, toast, capture form (views/capturas*.js) */
.muted {
  color: var(--color-muted, #5b6b7b);
  font-size: var(--fs-small);
}
.capture-form label{display:block;margin:.7rem 0}
.capture-form input,.capture-form select,.capture-form textarea{display:block;width:100%;padding:.5rem;margin-top:.25rem}
.capture-preview{max-width:100%;max-height:180px;display:block}
.toast{position:fixed;right:1rem;bottom:1rem;padding:.8rem 1rem;background:var(--color-fg);color:white;border-radius: var(--radius-4);z-index:400}
.toast a{color:white}
.capture-modal{max-height:90vh;overflow-y:auto}
.capture-modal .capture-form{display:grid;gap:.6rem}
.capture-modal .capture-form label{display:grid;gap:.25rem}
.capture-modal .capture-form input,.capture-modal .capture-form select,.capture-modal .capture-form textarea{width:100%;box-sizing:border-box}
.capture-thumb{width:72px;height:48px;object-fit:cover;cursor:pointer}

/* Upload guard banner (counts only) and admin badge */
.guarda-aviso { position: fixed; right: 1rem; bottom: 1rem; z-index: 1000; display: flex; gap: .75rem; align-items: center;
  max-width: 26rem; padding: .6rem .9rem; border-radius: 8px; border: 1px solid var(--border, #c9a227);
  background: var(--surface, #fff8e1); color: var(--text, #222); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.guarda-aviso-fechar { background: none; border: 0; font-size: var(--fs-h3); cursor: pointer; color: inherit; }
.guarda-emblema { display: inline-block; padding: .2rem .6rem; border-radius: 999px; }
.guarda-emblema-ok { background: #e6f4ea; color: #1e6b34; }
.guarda-emblema-alerta { background: #fdecea; color: #a1261b; }

/* Shared hover/focus description (static/js/dica.js): inverse of the page colours, so it reads on any surface */
.dica {
  position: fixed; z-index: 2000; max-width: min(320px, calc(100vw - 12px)); width: max-content;
  padding: .45rem .7rem; border-radius: var(--radius-md);
  background: var(--color-fg); color: var(--color-bg);
  font-size: var(--fs-7); line-height: 1.35; box-shadow: var(--shadow-2); pointer-events: none;
}
.dica-titulo { display: block; font-weight: 650; }
.dica-detalhe { display: block; font-weight: 400; }
.dica-teclado { outline: 2px solid var(--color-accent); }
.dica::before {
  content: ""; position: absolute; left: var(--dica-seta, 50%); transform: translateX(-50%);
  border: 6px solid transparent;
}
.dica[data-lado="abaixo"]::before { top: -6px; border-top: 0; border-bottom-color: var(--color-fg); }
.dica[data-lado="acima"]::before { bottom: -6px; border-top-color: var(--color-fg); border-bottom: 0; }

/* Code highlighting (vendored Prism, js/realce_codigo.js): the single token colour block,
   mapped to Midnight variables. Token spans set colour only, never a background, so the
   diff add/del row backgrounds stay visible underneath. */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--color-muted); font-style: italic; }
.token.keyword, .token.selector, .token.important, .token.atrule { color: var(--color-accent); font-weight: 600; }
.token.string, .token.char, .token.attr-value, .token.template-string, .token.regex { color: var(--color-badge-public); }
.token.number, .token.boolean, .token.constant { color: var(--color-grafo-virtual); }
.token.builtin, .token.annotation, .token.variable, .token.function { color: var(--color-grafo-sap-help); }
.token.class-name, .token.property, .token.attr-name, .token.tag { color: var(--color-badge-client); }
.token.operator, .token.punctuation, .token.entity { color: var(--color-subtle); }
.token.deleted { color: var(--color-danger-fg); }
.token.inserted { color: var(--color-ok-fg); }
.codigo-diff-marca { color: var(--color-subtle); user-select: none; }
.codigo-bloco { position: relative; }
.codigo-copiar {
  position: absolute; top: .3rem; right: .3rem; padding: .1rem .45rem; font-size: var(--fs-7);
  background: var(--color-surface); color: var(--color-muted); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer; opacity: .75;
}
.codigo-copiar:hover, .codigo-copiar:focus-visible { opacity: 1; color: var(--color-fg); }

/* Global notification island (notificacoes.js): top centre, just below the app header, one at a time */
.notif-regiao { position: fixed; left: 50%; top: calc(var(--topbar-live-h, var(--topbar-h)) + .6rem); z-index: 1100;
  transform: translateX(-50%); width: max-content; max-width: min(560px, 92vw); display: flex; justify-content: center;
  pointer-events: none; }
.notif { pointer-events: auto; box-sizing: border-box; display: flex; align-items: center; gap: .6rem; max-width: min(560px, 92vw);
  padding: .5rem .5rem .5rem .75rem; border-radius: 999px; border: 1px solid var(--color-border);
  background: var(--color-nav-bg); color: var(--color-nav-text); font-size: var(--fs-7); font-weight: 600;
  box-shadow: var(--shadow-2); overflow: hidden;
  transition: width .4s cubic-bezier(.2, .8, .2, 1), border-radius .3s;
  animation: notif-entra .55s linear(0, .25 7%, .85 18%, 1.08 28%, 1.02 40%, .99 55%, 1) both; }
.notif-longo { border-radius: 16px; align-items: flex-start; font-weight: 500; }
.notif-texto { min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-longo .notif-texto { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
.notif-troca { animation: notif-texto .25s ease both; }
.notif-icone { flex: none; width: 1.25rem; height: 1.25rem; box-sizing: border-box; border-radius: 50%; border: 2px solid currentColor;
  display: grid; place-items: center; font-size: var(--fs-micro); line-height: 1; font-weight: 700; }
.notif-sucesso .notif-icone { color: var(--color-ok-solid); }
.notif-sucesso .notif-icone::before { content: "\2713"; }
.notif-erro .notif-icone { color: var(--color-error); }
.notif-erro .notif-icone::before { content: "!"; }
.notif-aviso .notif-icone { color: var(--color-warn-solid); }
.notif-aviso .notif-icone::before { content: "!"; }
.notif-info .notif-icone { color: var(--color-accent); }
.notif-info .notif-icone::before { content: "i"; }
.notif-curso .notif-icone::before { content: none; }
.notif-curso .notif-icone { border-top-color: transparent; animation: notif-gira .8s linear infinite; }
.notif-fechar { flex: none; background: none; border: 0; padding: 0 .35rem; font-size: var(--fs-h3); line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.notif-fechar:hover, .notif-fechar:focus-visible { opacity: 1; }
.notif-contador { flex: none; border: 1px solid var(--color-border); border-radius: 999px; padding: 0 .45rem; font: inherit; font-size: var(--fs-7);
  background: transparent; color: inherit; cursor: pointer; }
.notif-contador[hidden] { display: none; }
@keyframes notif-entra { from { transform: translateY(-1.5rem) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes notif-texto { from { opacity: 0; } to { opacity: 1; } }
@keyframes notif-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .notif { animation: notif-texto .2s ease both; transition: none; }
  .notif-troca { animation: none; }
  .notif-curso .notif-icone { animation-duration: 2.4s; }
}

/* Model badge of an AI place (modelo_sitio.js) */
.modelo-sitio { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-xs); position: relative; font-size: var(--fs-base); }
.modelo-sitio-chip { padding: 2px 10px; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface); color: var(--color-fg); font: inherit; }
button.modelo-sitio-chip { cursor: pointer; }
.modelo-sitio-aviso .modelo-sitio-chip { border-color: var(--color-warn-solid); background: var(--color-warn-bg); color: var(--color-warn-fg); }
.modelo-sitio-nota, .modelo-sitio-bloqueio { color: var(--color-muted); }
.modelo-sitio-erro { color: var(--color-error); }
.modelo-sitio-menu { position: absolute; top: 100%; left: 0; z-index: 20; margin: 2px 0 0; padding: var(--spacing-xs); min-width: 16rem; list-style: none; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); }
.modelo-sitio-opcao { width: 100%; text-align: left; padding: 4px 8px; border: 0; background: none; color: var(--color-fg); font: inherit; cursor: pointer; }
.modelo-sitio-opcao[aria-current="true"] { font-weight: 600; }
.modelo-sitio-opcao:disabled { color: var(--color-muted); cursor: not-allowed; }

/* ---------------------------------------------------------------------------
   NAV-G: multi-level collapsible menu (pattern only, no vendored code).
   Icon per level, right-aligned chevron that rotates, one indent step per
   level, smooth expand/collapse.
   --------------------------------------------------------------------------- */
.tree-nav .tree-link { min-height: 36px; border-radius: 10px; }
.tree-nav .tree-link:hover,
.tree-nav .tree-section-link:hover { background-color: var(--color-nav-hover); }
.tree-nav .tree-link:focus-visible,
.tree-nav .tree-section-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; border-radius: 10px; }
.tree-nav .tree-toggle { border-radius: 10px; }
.tree-nav .tree-count { color: var(--color-nav-muted); }

/* One indent step per level, with a faint guide line. */
.tree-nav .collapsible-body,
.tree-nav .tree-children {
  margin: 2px 0 4px 14px;
  border-radius: 0;
  box-shadow: none;
  border-left: 1px solid rgba(255, 255, 255, .10);
}

/* Chevron: the existing glyph rotates 90deg on expand; slightly longer ease. */
.collapsible-chevron { transition: transform 180ms ease; }

/* Smooth expand/collapse: height (auto <-> 0) is interpolated by the browser,
   no JS measuring. `hidden` stays the source of truth (a11y, tests); while it is
   set the body is only visually collapsed and `visibility:hidden` keeps its content
   out of the tab order and the accessibility tree. Without interpolate-size support
   the toggle stays instant. */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .tree-nav .collapsible-body,
  .tree-nav .tree-children,
  .admin-menu .collapsible-body {
    overflow: hidden;
    height: auto;
    opacity: 1;
    transition: height 200ms ease, opacity 200ms ease, margin 200ms ease, visibility 0s;
  }
  .tree-nav .collapsible-body[hidden],
  .tree-nav .tree-children[hidden],
  .admin-menu .collapsible-body[hidden] {
    display: block !important;
    height: 0;
    opacity: 0;
    visibility: hidden;
    margin-top: 0;
    margin-bottom: 0;
    transition: height 200ms ease, opacity 200ms ease, margin 200ms ease, visibility 0s linear 200ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tree-nav .collapsible-body,
  .tree-nav .collapsible-body[hidden],
  .tree-nav .tree-children,
  .tree-nav .tree-children[hidden],
  .admin-menu .collapsible-body,
  .admin-menu .collapsible-body[hidden],
  .collapsible-chevron { transition: none !important; }
}

/* ---------------------------------------------------------------------------
   Inline menu (approved mockup, Ant Design "inline menu" style).
   Top-level rows (Dashboard, Knowledge, Clients, SPRO): icon + label + count +
   chevron. An open section shows its items indented on a darker band, with grey
   group titles. The current item (aria-current="page") gets the soft accent pill
   and its section label turns accent. Compact desktop rail: icons only; hovering
   or focusing a section opens its items as a flyout (Escape closes it, app.js).
   --------------------------------------------------------------------------- */
.tree-nav > .dashboard-link,
.tree-nav .menu-sec-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px; margin: 0; padding: 0 16px;
  border: 0; border-radius: 0; background: transparent;
  color: var(--color-nav-text); font-size: var(--fs-7); font-weight: 500;
}
.tree-nav > .dashboard-link:hover,
.tree-nav .menu-sec-btn:hover { color: #ffffff; background: var(--color-nav-hover); }
.tree-nav > .dashboard-link:focus-visible,
.tree-nav .menu-sec-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.tree-nav .menu-sec-btn .collapsible-label { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.tree-nav > .dashboard-link .nav-rotulo,
.tree-nav .menu-sec-btn .nav-rotulo { gap: 12px; }
.tree-nav > .dashboard-link .nav-rotulo > .nav-glyph,
.tree-nav .menu-sec-btn .nav-rotulo > .nav-glyph { width: 18px; height: 18px; }
.tree-nav .menu-sec-btn .collapsible-chevron { color: var(--color-nav-muted); }
.tree-nav .collapsible-count,
.tree-nav .tree-count { font-size: var(--fs-5); font-weight: 400; color: var(--color-nav-muted); font-variant-numeric: tabular-nums; }
.menu-sec:has([aria-current="page"]) > .menu-sec-btn { color: var(--color-active); }

/* Open section: darker band, items indented under the section label. */
.tree-nav .menu-sec-body {
  margin: 0; padding: 4px 0 6px; border-radius: 0; box-shadow: none;
  border: 0; border-block: 1px solid var(--color-border-soft);
  background: rgba(0, 0, 0, .22);
}
.tree-nav .menu-sec-body[hidden] { padding-block: 0; border-block-width: 0; }
.menu-grp { padding: 10px 16px 4px 28px; font-size: var(--fs-5); color: var(--color-nav-muted); }
.menu-fly-titulo { display: none; }
.tree-nav .menu-sec-body .tree-items { box-shadow: none; }
.menu-sec-body .tree-section-title,
.menu-sec-body .tree-item-row { margin: 1px 6px; padding: 0; gap: 4px; }
.menu-sec-body li > .tree-link { margin: 1px 6px; }
.menu-sec-body .tree-section-title > .tree-section-link,
.menu-sec-body .tree-section-title > .collapsible-toggle,
.menu-sec-body .tree-link {
  min-height: 38px; padding: 4px 12px 4px 34px; gap: 10px;
  border-radius: 8px; font-size: var(--fs-7); color: var(--color-nav-text);
}
.menu-sec-body .nav-rotulo { gap: 10px; }
.menu-sec-body .nav-glyph { width: 16px; height: 16px; color: var(--color-nav-muted); }
/* Deeper levels: one indent step with a faint guide line under the parent icon. */
.tree-nav .menu-sec-body .collapsible-body,
.tree-nav .menu-sec-body .tree-children { margin-left: 40px; }
.tree-nav .menu-sec-body :is(.collapsible-body, .tree-children) :is(.collapsible-body, .tree-children) { margin-left: 20px; }
.menu-sec-body :is(.collapsible-body, .tree-children) :is(.tree-link, .tree-section-title > .collapsible-toggle) { padding-left: 12px; }

/* Current item: soft accent pill and accent text (icon and count follow). */
.tree-nav [aria-current="page"],
.tree-nav [aria-current="page"] .nav-glyph,
.tree-nav [aria-current="page"] .collapsible-count { color: var(--color-active); }
.tree-nav [aria-current="page"] { background-color: var(--color-nav-active); font-weight: 500; }

@media (min-width: 900px) {
  .sidebar[data-rail="compact"] .tree-nav > .dashboard-link,
  .sidebar[data-rail="compact"] .tree-nav .menu-sec-btn {
    position: relative; width: 44px; margin: 2px auto; padding: 0; justify-content: center; border-radius: 12px;
  }
  .sidebar[data-rail="compact"] .menu-sec-btn :is(.collapsible-count, .collapsible-chevron) { display: none; }
  .sidebar[data-rail="compact"] .menu-sec-btn .collapsible-label { flex: 0 0 auto; }
  /* Labels leave the rail visually but stay in the accessible name. */
  .sidebar[data-rail="compact"] :is(.dashboard-link, .menu-sec-btn) .nav-rotulo > span:not(.nav-glyph) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  /* Dashboard has no items: its label shows as a tooltip instead of a flyout. */
  .sidebar[data-rail="compact"] .dashboard-link:is(:hover, :focus-visible) .nav-rotulo > span:not(.nav-glyph) {
    left: calc(100% + 10px); top: 50%; transform: translateY(-50%); width: auto; height: auto; clip-path: none;
    padding: 4px 8px; border-radius: 8px; background: var(--color-surface); border: 1px solid var(--color-line-strong);
    color: var(--color-nav-text); font-size: var(--fs-7); z-index: 140;
  }
  .sidebar[data-rail="compact"] .menu-sec:has([aria-current="page"]) > .menu-sec-btn { background: var(--color-nav-active); }
  .sidebar[data-rail="compact"] .menu-sec { position: relative; }
  /* Invisible bridge so the pointer can cross the gap between the icon and the flyout. */
  .sidebar[data-rail="compact"] .menu-sec::after { content: ''; position: absolute; left: 100%; top: 0; width: 10px; height: 100%; }
  .sidebar[data-rail="compact"] .tree-nav .menu-sec > .menu-sec-body { display: none !important; }
  .sidebar[data-rail="compact"] .tree-nav .menu-sec:is(:hover, :focus-within):not(.fly-fechado) > .menu-sec-body {
    display: block !important; position: absolute; left: calc(100% + 8px); top: 0; z-index: 140;
    width: 248px; height: auto; max-height: 70vh; overflow-y: auto; opacity: 1; visibility: visible;
    margin: 0; padding: 4px 0 6px; border: 1px solid var(--color-line-strong); border-radius: 10px;
    background: var(--color-surface); box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  }
  .sidebar[data-rail="compact"] .menu-fly-titulo { display: block; }
  .sidebar[data-rail="compact"] .menu-sec-body .tree-section-title > :is(.tree-section-link, .collapsible-toggle),
  .sidebar[data-rail="compact"] .menu-sec-body .tree-link { padding-left: 12px; }
  .sidebar[data-rail="compact"] .menu-grp { padding-left: 16px; }
}

/* Every checkbox is drawn as a switch (21st.dev bysages "Switch"): still a native checkbox for keyboard, forms and
   screen readers. The size is fixed with !important because several local rules set `width: auto` on checkboxes. */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 20px !important;
  margin: 0 .35rem 0 0;
  padding: 0 !important;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-panel-soft, var(--color-surface));
  vertical-align: middle;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}

input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-muted);
  transition: transform .18s ease, background-color .18s ease;
}

input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

input[type="checkbox"]:checked::before {
  transform: translateX(16px);
  background: var(--color-bg);
}

input[type="checkbox"]:indeterminate::before {
  transform: translateX(8px);
  background: var(--color-accent);
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-accent-soft);
  outline-offset: 2px;
}

input[type="checkbox"]:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"], input[type="checkbox"]::before { transition: none; }
}

/* Before / after card of a code change (21st.dev "AI Prompt Diff"). */
.diff-cartao {
  margin: 8px 0 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-surface);
}

.diff-cartao-cab {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}

.diff-cartao-icone {
  display: inline-flex;
  padding: 5px;
  border-radius: 6px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.diff-cartao-titulo { font-weight: 600; font-family: var(--font-mono); font-size: var(--fs-base); }
.diff-cartao-mais { color: var(--color-ok-fg); font-size: var(--fs-compact); font-family: var(--font-mono); }
.diff-cartao-menos { color: var(--color-danger-fg); font-size: var(--fs-compact); font-family: var(--font-mono); }

.diff-cartao-modos {
  margin-left: auto;
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.diff-cartao-modo,
.diff-cartao-copiar {
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font: inherit;
  font-size: var(--fs-compact);
  padding: 4px 10px;
  cursor: pointer;
}

.diff-cartao-modo[aria-pressed="true"] { background: var(--color-panel-soft, var(--color-bg)); color: var(--color-fg); }
.diff-cartao-copiar:hover, .diff-cartao-modo:hover { color: var(--color-fg); }

/* Unified view: the highlighted <pre>; old / new line numbers from data-a / data-n (never part of the text). */
.diff-cartao > pre.diff-cartao-unificado { margin: 0; border-radius: 0; }
.diff-cartao > pre.diff-cartao-unificado > span { position: relative; padding-left: 9ch; }
.diff-cartao > pre.diff-cartao-unificado > span::before,
.diff-cartao > pre.diff-cartao-unificado > span::after {
  position: absolute;
  top: 0;
  width: 3.5ch;
  text-align: right;
  color: var(--color-subtle, var(--color-muted));
  user-select: none;
}
.diff-cartao > pre.diff-cartao-unificado > span::before { content: attr(data-a); left: 0; }
.diff-cartao > pre.diff-cartao-unificado > span::after { content: attr(data-n); left: 4ch; }

/* Split view: old on the left, new on the right. */
.diff-cartao-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-family: var(--font-mono);
  font-size: var(--fs-compact);
  max-height: 480px;
  overflow: auto;
  background: var(--color-info-bg);
}
.diff-cartao-celula { display: flex; white-space: pre; min-width: 0; overflow: hidden; }
.diff-cartao-celula + .diff-cartao-celula { border-left: 1px solid var(--color-border); }
.diff-cartao-n { flex: none; width: 4ch; padding-right: 1ch; text-align: right; color: var(--color-subtle, var(--color-muted)); user-select: none; }
.diff-cartao-txt { overflow: hidden; text-overflow: ellipsis; }
.diff-cartao-del { background: var(--color-danger-bg); color: var(--color-danger-fg); }
.diff-cartao-add { background: var(--color-ok-bg); color: var(--color-ok-fg); }
.diff-cartao-hunk { grid-column: 1 / -1; color: var(--color-muted); padding: 2px 10px; }

/* Large footer at the end of each page (rodape.js renderGrande): brand blurb + link columns, a closing line with
   dashed rule and corner brackets that also carries the status (index, version), and a short note. The thin status
   bar (.app-footer) only shows where the large footer does not: logged out, full-screen routes, or switched off. */
.rodape-grande { margin: var(--spacing-lg) var(--spacing-lg) 0; border-top: 1px solid var(--color-border-soft); color: var(--color-muted); }
.rodape-grande[hidden], body.rota-login .rodape-grande,
body[data-rota="editar"] .rodape-grande, body[data-rota="grafo"] .rodape-grande, body[data-rota="assistente"] .rodape-grande { display: none; }
body.com-rodape-grande:not(.rota-login):not([data-rota="editar"]):not([data-rota="grafo"]):not([data-rota="assistente"]) .app-footer { display: none; }
.rodape-grande-topo { padding: 32px 32px 36px; }
.rodape-grande-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--color-accent); }
.rodape-grande-logo span { color: var(--color-title); font-weight: 700; letter-spacing: .14em; font-size: var(--fs-8); }
.rodape-grande-marca p { margin: 12px 0 0; max-width: 18rem; font-size: var(--fs-6); line-height: 1.5; }
.rodape-grande-base > span { font-family: var(--font-mono); font-size: var(--fs-4); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); }
.rodape-grande-base > span.rodape-grande-texto { text-transform: none; } /* the right-hand text is shown as written (e.g. a domain) */
.rodape-grande-base { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 18px 32px; border-top: 1px dashed var(--color-line-strong, var(--color-border)); border-bottom: 1px dashed var(--color-line-strong, var(--color-border)); }
.rodape-grande-base::before, .rodape-grande-base::after { content: ''; position: absolute; top: -1px; bottom: -1px; width: 10px; border: 1px solid var(--color-line-strong, var(--color-border)); border-right: 0; }
.rodape-grande-base::before { left: 0; }
.rodape-grande-base::after { right: 0; transform: scaleX(-1); }
.rodape-grande-estado { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px 14px; }
.rodape-grande-estado .app-footer-index, .rodape-grande-estado .app-footer-ver { font-family: var(--font-system); letter-spacing: 0; text-transform: none; font-size: var(--fs-small); }
.rodape-grande-base .app-footer-pop { bottom: calc(100% + 6px); font-size: var(--fs-small); text-transform: none; letter-spacing: 0; font-family: var(--font-system); text-align: left; }
.rodape-grande-simbolo { display: inline-flex; color: var(--color-fg); }
.rodape-grande-nota { margin: 0; padding: 16px 0 22px; text-align: center; font-size: var(--fs-6); }
@media (max-width: 899px) {
  .rodape-grande { margin: var(--spacing-md) var(--spacing-md) 0; }
  .rodape-grande-topo { padding: 24px 8px 28px; }
  .rodape-grande-base { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 16px; }
  .rodape-grande-estado { justify-content: center; }
}

/* Tools > Fiori mockups */
.mockups-fiori { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--spacing-md); align-items: start; }
.mockups-lista ul { list-style: none; margin: 8px 0 0; padding: 0; }
.mockups-lista li { padding: 4px 0; border-bottom: 1px solid var(--color-border-soft); font-size: var(--fs-compact); }
.mockups-lista a[aria-current="page"] { color: var(--color-accent); font-weight: 600; }
.mockups-barra { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.mockups-barra input, .mockups-barra select { width: auto; min-width: 0; height: 26px; padding: 0 8px; font-size: var(--fs-small); }
.mockups-titulo { flex: 1 1 200px; }
.mockups-larguras { display: inline-flex; gap: 2px; }
.mockups-larguras [aria-pressed="true"] { border-color: var(--color-accent); color: var(--color-accent); }
.mockups-grelha { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.mockups-grelha label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-small); color: var(--color-muted); }
.mockups-xml, .mockups-dados { min-height: 220px; font-family: var(--font-mono); font-size: var(--fs-small); }
.mockups-moldura { border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); background: #fff; overflow: auto; }
.mockups-frame { display: block; height: 70vh; border: 0; margin: 0 auto; max-width: 100%; }
@media (max-width: 900px) { .mockups-fiori { grid-template-columns: 1fr; } .mockups-grelha { grid-template-columns: 1fr; } }

/* Tools > Fiori projects */
.projetos-fiori-linha { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.projetos-fiori-linha input:not([type="file"]), .projetos-fiori-linha select { width: auto; min-width: 0; height: 26px; padding: 0 8px; font-size: var(--fs-small); }
.projetos-fiori-linha input:first-child:not([type="file"]) { flex: 1 1 280px; }
.monitor-cartao { margin-top: 12px; }
.monitor-tabela tr.monitor-linha { cursor: pointer; }
.monitor-tabela tr.monitor-linha:hover td, .monitor-tabela tr.monitor-linha:focus td { background: var(--color-surface); }
.monitor-detalhe { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 8px; }
.monitor-detalhe h4 { margin: 0 0 6px; }
.monitor-pre { max-height: 260px; overflow: auto; margin: 2px 0 8px; padding: 6px 8px; font-family: var(--font-mono); font-size: var(--fs-small); white-space: pre-wrap; background: var(--color-surface); border-radius: 6px; }
.traducoes-passos { margin: 0 0 12px 18px; color: var(--color-text-muted); }
.traducoes-tabela td { vertical-align: top; }
.traducoes-tabela input { width: 100%; min-width: 180px; height: 26px; padding: 0 6px; font-size: var(--fs-small); }
.traducoes-tabela tr.traducoes-aviso td { background: var(--color-warn-bg); }
