/* ==========================================================================
   Catenária design system · v1.0
   Fonte: canvas "Catenária" (boards DS-01 a DS-10).
   - Primitivas --cat-{família}-{passo}: nunca usar direto em componentes.
   - Semânticas --{papel}-{variante}: bg, text, border, action, status, chart.
   - Componentes: classes .btn, .field, .badge, .tabs, .modal, .toast…
   O Tailwind (static/js/tailwind.config.js) aponta para estes mesmos valores.
   ========================================================================== */

:root {
  /* ---- Primitivas · Ink (grafite frio, matiz 210°) ---- */
  --cat-ink-950: #0B141B;
  --cat-ink-900: #15212B;
  --cat-ink-800: #1E2B36;
  --cat-ink-700: #34414D;
  --cat-ink-600: #4A5763;
  --cat-ink-500: #5E6B77;
  --cat-ink-400: #8A96A1;
  --cat-ink-300: #9AA6B1;
  --cat-ink-200: #D3D9DE;
  --cat-ink-100: #E4E8EB;
  --cat-ink-50:  #EEF1F3;
  --cat-ink-25:  #F5F6F7;
  --cat-ink-0:   #FFFFFF;

  /* ---- Primitivas · Steel (ações, seleção, rampa de avanço) ---- */
  --cat-steel-50:  #EAF1F8;
  --cat-steel-100: #D2E2F1;
  --cat-steel-200: #A9C7E4;
  --cat-steel-300: #7AA6D3;
  --cat-steel-400: #4C84BF;
  --cat-steel-500: #2D6AAB;
  --cat-steel-600: #1F5592;
  --cat-steel-700: #184474;
  --cat-steel-800: #123356;
  --cat-steel-900: #0C2239;

  /* ---- Primitivas · Signal (marca, “olhe aqui”: semana atual, foco) ---- */
  --cat-signal-50:  #FDF1E7;
  --cat-signal-100: #FADDC4;
  --cat-signal-500: #EA6A12;
  --cat-signal-600: #C2530A;
  --cat-signal-700: #9A4108;

  /* ---- Primitivas · Status ---- */
  --cat-ok-600: #1D7A4A;     --cat-ok-200: #C4E4D1;     --cat-ok-50: #E6F4EC;
  --cat-warn-600: #A86A00;   --cat-warn-700: #8A5600;   --cat-warn-200: #F0DDB0;   --cat-warn-50: #FBF2DD;
  --cat-danger-600: #B8352A; --cat-danger-700: #9C2B22; --cat-danger-200: #F2CBC6; --cat-danger-50: #FBEAE8;

  /* ---- Semânticas · superfícies ---- */
  --bg-canvas:   var(--cat-ink-25);
  --bg-surface:  var(--cat-ink-0);
  --bg-subtle:   var(--cat-ink-50);
  --bg-selected: var(--cat-steel-50);
  --bg-inverse:  var(--cat-ink-950);
  --bg-inverse-raised: var(--cat-ink-900);
  --bg-inverse-active: var(--cat-ink-800);
  --bg-dim: rgb(11 20 27 / 0.55);

  /* ---- Semânticas · bordas ---- */
  --border-default: var(--cat-ink-100);
  --border-strong:  var(--cat-ink-200);
  --border-inverse: #273541;
  --border-inverse-subtle: #1E2B36;
  --border-focus:   var(--cat-signal-500);

  /* ---- Semânticas · texto ---- */
  --text-primary:   var(--cat-ink-900);
  --text-secondary: var(--cat-ink-700);
  --text-muted:     var(--cat-ink-500);
  --text-disabled:  var(--cat-ink-400);
  --text-link:      var(--cat-steel-600);
  --text-link-hover: var(--cat-steel-800);
  --text-inverse:   #FFFFFF;
  --text-inverse-muted: #9AA6B1;
  --text-inverse-nav: #B8C2CB;
  --text-accent:    var(--cat-signal-600);

  /* ---- Semânticas · ações ---- */
  --action-primary:         var(--cat-steel-600);
  --action-primary-hover:   var(--cat-steel-700);
  --action-primary-pressed: var(--cat-steel-800);
  --action-danger:          var(--cat-danger-600);
  --action-danger-hover:    var(--cat-danger-700);
  --accent:                 var(--cat-signal-500);

  /* ---- Semânticas · status ---- */
  --status-ok: var(--cat-ok-600);         --status-ok-bg: var(--cat-ok-50);         --status-ok-border: var(--cat-ok-200);
  --status-warn: var(--cat-warn-600);     --status-warn-text: var(--cat-warn-700);  --status-warn-bg: var(--cat-warn-50); --status-warn-border: var(--cat-warn-200);
  --status-danger: var(--cat-danger-600); --status-danger-bg: var(--cat-danger-50); --status-danger-border: var(--cat-danger-200);
  --status-admin: #D9A441;

  /* ---- Semânticas · gráficos e domínio (tela e impressão) ---- */
  --chart-executado: var(--cat-steel-600);          /* linha 3px, barras executadas */
  --chart-planejado: var(--cat-ink-700);            /* linha 1.75px */
  --chart-original:  var(--cat-signal-600);         /* linha 1.75px tracejada 5 4 */
  --chart-planejado-bar: var(--cat-steel-300);      /* barras planejadas (mobilização) */
  --chart-pendente:  var(--cat-ink-100);
  --chart-nao-executado: var(--cat-ink-400);        /* hachura 135° */
  --chart-semana-atual: var(--cat-signal-500);
  --chart-semana-atual-bg: var(--cat-signal-50);
  --chart-grid: var(--cat-ink-100);
  --chart-axis: var(--cat-ink-200);
  --chart-label: var(--cat-ink-500);
  /* rampa de avanço por torre · 6 passos */
  --chart-ramp-0:   #FFFFFF;               /* 0%, borda ink-200 */
  --chart-ramp-1:   var(--cat-steel-100);  /* 1–25 */
  --chart-ramp-2:   var(--cat-steel-300);  /* 26–50 */
  --chart-ramp-3:   var(--cat-steel-500);  /* 51–75 */
  --chart-ramp-4:   var(--cat-steel-700);  /* 76–99 */
  --chart-ramp-5:   var(--cat-steel-900);  /* 100 */

  /* ---- Tipografia ---- */
  --font-sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* ---- Espaçamento · base 4 px ---- */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;

  /* ---- Forma e elevação ---- */
  --radius-sm: 4px;    /* badges */
  --radius-md: 6px;    /* controles */
  --radius-lg: 10px;   /* cards, modais */
  --radius-full: 999px;
  --shadow-e0: none;                                  /* cards: só borda */
  --shadow-e1: 0 1px 2px rgb(11 20 27 / 0.08);        /* botões */
  --shadow-e2: 0 8px 24px rgb(11 20 27 / 0.12);       /* menus, popovers */
  --shadow-e3: 0 24px 48px rgb(11 20 27 / 0.20);      /* modais */

  /* ---- Densidade (padrão = escritório) ---- */
  --row-h: 40px;
  --control-h: 36px;

  /* ---- Shell ---- */
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --content-max: 1280px;
}
[data-density="field"]   { --row-h: 48px; --control-h: 44px; }
[data-density="compact"] { --row-h: 32px; --control-h: 28px; }


/* ==========================================================================
   Base
   ========================================================================== */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font-family: inherit; }
code, kbd, samp, .mono { font-family: var(--font-mono); }

/* Foco: anel Signal de 2 px com 2 px de afastamento, em toda superfície */
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }

::selection { background: var(--cat-steel-100); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-disabled); }

/* Escala tipográfica */
.ds-display  { font-size: 32px; line-height: 38px; font-weight: 650; font-stretch: 112%; letter-spacing: -0.015em; }
.ds-title-1  { font-size: 24px; line-height: 30px; font-weight: 600; font-stretch: 108%; letter-spacing: -0.01em; }
.ds-title-2  { font-size: 18px; line-height: 24px; font-weight: 600; }
.ds-title-3  { font-size: 15px; line-height: 20px; font-weight: 600; }
.ds-body     { font-size: 14px; line-height: 20px; }
.ds-body-sm  { font-size: 13px; line-height: 18px; }
.ds-label    { font-size: 13px; line-height: 16px; font-weight: 500; }
.ds-caption  { font-size: 12px; line-height: 16px; color: var(--text-muted); }
.ds-overline { font-size: 11px; line-height: 14px; font-weight: 600; font-stretch: 90%; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.ds-metric   { font-size: 28px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ds-code     { font: 500 12.5px/1.3 var(--font-mono); }
.ds-empty    { color: var(--text-muted); } /* valor vazio: en dash “–” */


/* ==========================================================================
   Botões (DS-04) · uma ação primária por superfície
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-h); padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; }

.btn-primary { background: var(--action-primary); color: #FFFFFF; box-shadow: var(--shadow-e1); }
.btn-primary:hover { background: var(--action-primary-hover); }
.btn-primary:active { background: var(--action-primary-pressed); }
.btn-primary:disabled { background: var(--border-default); color: var(--text-disabled); box-shadow: none; }

.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--text-disabled); }
.btn-secondary:disabled { background: var(--bg-canvas); color: var(--text-disabled); border-color: var(--border-default); }

.btn-ghost { height: 32px; padding: 0 8px; gap: 6px; background: transparent; color: var(--text-link); }
.btn-ghost:hover { background: var(--bg-selected); color: var(--action-primary-hover); }
.btn-ghost:disabled { background: transparent; color: var(--text-disabled); }

/* Perigo: contorno no 1º clique; sólido só dentro do diálogo de confirmação */
.btn-danger { background: var(--bg-surface); color: var(--action-danger); border-color: var(--status-danger-border); }
.btn-danger:hover { background: var(--status-danger-bg); border-color: var(--action-danger); color: var(--action-danger-hover); }
.btn-danger-solid { background: var(--action-danger); color: #FFFFFF; }
.btn-danger-solid:hover { background: var(--action-danger-hover); }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }   /* campo */
.btn-icon { width: var(--control-h); padding: 0; background: var(--bg-surface); color: var(--text-secondary); border-color: var(--border-strong); }
.btn-icon:hover { background: var(--bg-subtle); }
.btn-icon.btn-bare { background: transparent; border-color: transparent; }
.btn-icon svg { width: 18px; height: 18px; }
.btn-loading svg { animation: ds-spin .8s linear infinite; }
@keyframes ds-spin { to { transform: rotate(360deg); } }


/* ==========================================================================
   Campos (DS-04) · rótulo acima, sempre visível
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.field-label .req { font-weight: 400; color: var(--text-muted); }   /* “obrigatório” */
.field-hint { font-size: 12px; color: var(--text-muted); }
.field-error { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--status-danger); }
.field-error svg { width: 14px; height: 14px; flex-shrink: 0; }

.input, .select, .textarea {
  width: 100%; box-sizing: border-box;
  height: var(--control-h); padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--bg-surface); color: var(--text-primary);
  font-size: 14px;
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.select { padding-right: 32px; }
.input::placeholder, .textarea::placeholder { color: var(--text-disabled); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--action-primary); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border: 1.5px solid var(--status-danger); }
.input[readonly], .textarea[readonly] { border-style: dashed; background: var(--bg-canvas); color: var(--text-secondary); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--bg-canvas); color: var(--text-disabled); }
.input-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Número + unidade (ex.: 45,1 km) */
.input-unit { display: flex; height: var(--control-h); border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-surface); }
.input-unit:focus-within { border-color: var(--action-primary); outline: 2px solid var(--border-focus); outline-offset: 1px; }
.input-unit input { flex: 1; min-width: 0; border: 0; padding: 0 12px; font-size: 14px; text-align: right; background: transparent; outline: none; }
.input-unit .unit { display: flex; align-items: center; padding: 0 12px; background: var(--bg-canvas); border-left: 1px solid var(--border-strong); font-size: 13px; color: var(--text-muted); }

/* Campo com ícone (busca, data) */
.input-icon { position: relative; display: flex; }
.input-icon > svg { position: absolute; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.input-icon > svg:first-child { left: 11px; }
.input-icon > svg:last-child:not(:first-child) { right: 10px; }
.input-icon > svg:first-child ~ .input { padding-left: 34px; }

/* Checkbox e rádio nativos na cor da marca */
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--action-primary); }
.check:has(input:disabled) { color: var(--text-disabled); cursor: not-allowed; }

/* Switch (checkbox estilizado) */
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; width: 36px; height: 20px; border-radius: var(--radius-full); background: var(--border-strong); position: relative; cursor: pointer; transition: background-color .15s; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--radius-full); background: #FFFFFF; box-shadow: var(--shadow-e1); transition: left .15s; }
.switch input:checked { background: var(--action-primary); }
.switch input:checked::after { left: 18px; }

/* Controle segmentado */
.segmented { display: inline-flex; width: max-content; max-width: 100%; padding: 3px; gap: 2px; background: var(--bg-subtle); border-radius: 8px; }
.segmented > button, .segmented > label { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; }
.segmented > [aria-pressed="true"], .segmented > label:has(input:checked) { background: var(--bg-surface); color: var(--text-primary); font-weight: 600; box-shadow: 0 1px 2px rgb(11 20 27 / 0.1); }
.segmented > label input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* Chips de filtro */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: var(--bg-surface); color: var(--text-secondary); font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--bg-subtle); }
.chip[aria-pressed="true"] { border-color: var(--action-primary); background: var(--bg-selected); color: var(--cat-steel-700); font-weight: 600; }


/* ==========================================================================
   Badges, abas, avatar (DS-04)
   ========================================================================== */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; white-space: nowrap; box-sizing: border-box; }
.badge svg { width: 12px; height: 12px; }
.badge-executado   { background: var(--bg-selected); color: var(--cat-steel-700); }
.badge-pendente    { background: var(--bg-subtle); color: var(--text-secondary); }
.badge-nao-exec    { border: 1px dashed var(--text-disabled); color: var(--text-muted); }
.badge-escopo      { background: var(--bg-canvas); border: 1px solid var(--border-strong); color: var(--text-secondary); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.badge-equipamento { background: var(--bg-selected); color: var(--cat-steel-700); }
.badge-pessoal     { background: var(--cat-signal-50); color: var(--cat-signal-700); }
.badge-admin       { background: var(--status-warn-bg); color: var(--status-warn-text); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.badge-off         { background: var(--bg-subtle); color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.badge-ok          { background: var(--status-ok-bg); color: var(--status-ok); }
.badge-danger      { background: var(--status-danger-bg); color: var(--status-danger); }
.pill              { border-radius: var(--radius-full); }
.pill-dot::before  { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }

/* linha de base desenhada por sombra interna: o sublinhado ativo (2 px) cobre
   a linha sem margem negativa, então o overflow-x não gera barra vertical */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--border-strong); overflow-x: auto; overflow-y: hidden; }
.tab { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-muted); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--text-primary); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--text-primary); font-weight: 600; border-bottom-color: var(--action-primary); }
.tab .count { font-size: 12px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .count, .tab[aria-current="page"] .count { color: var(--action-primary); }

.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--cat-steel-700); color: #FFFFFF; font-size: 13px; font-weight: 600; }
.avatar-lg { width: 40px; height: 40px; font-size: 15px; }
.avatar-soft { background: var(--cat-steel-100); color: var(--cat-steel-800); }
.avatar-off { background: var(--bg-subtle); color: var(--text-disabled); }


/* ==========================================================================
   Superfícies e tabela (DS-02, DS-05)
   ========================================================================== */
.card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-e0); }
.card-pad { padding: var(--space-6); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 11px; font-weight: 600; font-stretch: 90%; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 0 12px; height: 36px; background: var(--bg-canvas); border-bottom: 1px solid var(--border-strong); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table td { padding: 0 12px; height: var(--row-h); border-bottom: 1px solid var(--border-default); white-space: nowrap; color: var(--text-primary); }
.table tbody tr:hover td { background: #F5F8FB; }
.table tbody tr[aria-selected="true"] td { background: var(--bg-selected); }
.table .n { text-align: right; }
.table .mut { color: var(--text-muted); }
.table tbody tr:last-child td { border-bottom: 0; }


/* ==========================================================================
   Overlays e feedback (DS-06)
   ========================================================================== */
/* Fundo plano (sem blur: engasga em tablets de campo) */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: var(--bg-dim);
  justify-content: center; align-items: flex-start;
  padding: 6vh 1rem 2rem; overflow-y: auto;
}
.modal-backdrop.active { display: flex; animation: ds-fade-in .15s ease-out; }
.modal-backdrop.active > div { animation: ds-pop-in .18s cubic-bezier(.16, 1, .3, 1); }
@keyframes ds-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ds-pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.modal { width: 560px; max-width: 100%; background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-e3); display: flex; flex-direction: column; }
.modal-sm { width: 440px; }   /* confirmações */
.modal-lg { width: 720px; }   /* execução por torre */
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--border-default); }
.modal-title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border-default); background: var(--bg-canvas); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 640px) {
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { width: 100%; border-radius: 0; min-height: 100%; }
  .modal-foot { position: sticky; bottom: 0; border-radius: 0; margin-top: auto; }
}
/* Confirmação destrutiva */
.confirm-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--status-danger-bg); color: var(--status-danger); display: inline-flex; align-items: center; justify-content: center; }
.confirm-icon svg { width: 18px; height: 18px; }

/* Toasts · canto superior direito, máx. 3; sucesso some em 5 s, erro fica */
.toast-stack { position: fixed; z-index: 60; top: 16px; left: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 640px) { .toast-stack { left: auto; top: 20px; right: 20px; width: 380px; } }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px rgb(11 20 27 / 0.2); animation: ds-toast-in .25s cubic-bezier(.16, 1, .3, 1); }
.toast.hide { animation: ds-toast-out .3s ease forwards; }
.toast > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-msg { flex: 1; min-width: 0; }
.toast-close { border: 0; background: transparent; padding: 0; cursor: pointer; color: inherit; opacity: .7; display: inline-flex; }
.toast-close:hover { opacity: 1; }
.toast-close svg { width: 16px; height: 16px; }
.toast-info { background: var(--bg-inverse); color: var(--cat-ink-100); }
.toast-info > svg { color: #6FCF97; }
.toast-action { border: 0; background: transparent; padding: 0; color: #F4A261; font-size: 13px; font-weight: 600; cursor: pointer; }
.toast-error { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--status-danger-border); box-shadow: var(--shadow-e2); }
.toast-error > svg { color: var(--status-danger); }
.toast-error .toast-close { color: var(--text-muted); }
@keyframes ds-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ds-toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* Banners inline */
.banner { display: flex; gap: 10px; border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.5; border: 1px solid; }
.banner > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.banner a { font-weight: 600; color: inherit; }
.banner-warn    { background: var(--status-warn-bg); border-color: var(--status-warn-border); color: #4A3300; }
.banner-neutral { background: var(--bg-subtle); border-color: var(--border-strong); color: var(--text-secondary); }
.banner-info    { background: var(--bg-selected); border-color: var(--cat-steel-100); color: var(--cat-steel-800); }
.banner-danger  { background: var(--status-danger-bg); border-color: var(--status-danger-border); color: var(--action-danger-hover); }

/* Tooltip escuro (diagrama, gráficos) */
.tooltip { background: var(--bg-inverse); color: var(--cat-ink-100); border-radius: 8px; padding: 12px 14px; font-size: 12px; line-height: 1.6; box-shadow: 0 8px 24px rgb(11 20 27 / 0.25); }
.tooltip b, .tooltip strong { color: #FFFFFF; }
.tooltip .k { color: var(--text-inverse-muted); }

/* Esqueleto de carregamento */
.skeleton { display: block; height: 12px; border-radius: 3px; background: var(--bg-subtle); }

/* Barra de alterações não salvas (fica no rodapé de formulários longos) */
.unsaved-bar { position: sticky; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 12px; background: var(--bg-inverse-raised); color: var(--cat-ink-100); border-radius: 8px; padding: 10px 12px 10px 16px; font-size: 13px; box-shadow: var(--shadow-e2); }
.unsaved-bar::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--accent); flex-shrink: 0; }
.unsaved-bar .btn { height: 32px; }
.unsaved-bar .btn-discard { background: transparent; color: var(--cat-ink-100); border-color: var(--cat-ink-700); }
.unsaved-bar .btn-save { background: #FFFFFF; color: var(--text-primary); }


/* ==========================================================================
   Shell (DS-07) · sidebar ink-950, barra superior com trilha
   ========================================================================== */
.app-sidebar { background: var(--bg-inverse); color: #C9D1D8; width: var(--sidebar-w); }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #FFFFFF; text-decoration: none; }
.sb-brand-name { font-size: 16px; font-weight: 650; font-stretch: 112%; line-height: 1.15; }
.sb-brand-sub { font-size: 11px; color: var(--text-inverse-muted); }
.sb-section { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-disabled); }
.sb-section a { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-inverse-muted); text-decoration: none; }
.sb-section a:hover { color: #FFFFFF; }
.sb-section-admin { color: var(--status-admin); padding: 0 10px 6px; }
.sb-divider { border-top: 1px solid var(--border-inverse-subtle); }
.sb-obra { width: 100%; padding: 8px 32px 8px 10px; border: 1px solid var(--border-inverse); border-radius: 8px; background: var(--bg-inverse-raised); color: #FFFFFF; font-size: 14px; font-weight: 600; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA6B1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.sb-obra option { color: var(--text-primary); background: #FFFFFF; }
.sb-link { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--radius-md); text-decoration: none; font-size: 14px; font-weight: 500; color: var(--text-inverse-nav); transition: background-color .12s, color .12s; }
.sb-link svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-disabled); }
.sb-link:hover { background: rgb(255 255 255 / 0.05); color: #FFFFFF; }
.sb-link[aria-current="page"] { background: var(--bg-inverse-active); color: #FFFFFF; font-weight: 600; }
.sb-link[aria-current="page"] svg { color: var(--accent); }
.sb-link-off, .sb-link-off:hover { color: #5E6B77; background: transparent; cursor: not-allowed; }
.sb-link-off svg { color: #4A5763; }
.sb-foot { font-size: 11px; color: var(--text-inverse-muted); }

.app-topbar { height: var(--topbar-h); background: rgb(255 255 255 / 0.92); border-bottom: 1px solid var(--border-default); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--text-muted); }
.crumbs a { color: var(--text-muted); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { color: var(--text-primary); }
.crumbs .sep { color: var(--border-strong); }
.crumbs .here { color: var(--text-primary); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: var(--bg-canvas); font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: pointer; }
.user-btn .avatar { width: 28px; height: 28px; font-size: 12px; }
.menu { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-e2); padding: 6px; }
.menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--border-default); margin-bottom: 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: var(--radius-md); background: transparent; text-decoration: none; color: var(--text-primary); font-size: 14px; cursor: pointer; text-align: left; }
.menu-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.menu-item:hover { background: var(--bg-subtle); }

/* Utilidades de arraste (Torres, Cronograma) */
.drag-handle { cursor: grab; user-select: none; color: var(--border-strong); transition: color .15s; }
.drag-handle:hover { color: var(--text-muted); }
.sortable-ghost { opacity: 0.4; background: var(--bg-selected); }
.sortable-chosen { background: var(--bg-canvas); }

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


/* ==========================================================================
   Página · cabeçalho e seções
   ========================================================================== */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; font-stretch: 108%; letter-spacing: -0.01em; }
.page-head p { margin: 6px 0 0; font-size: 14px; color: var(--text-muted); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 16px; }
.sec-head h2 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; }
.sec-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.stack-y { display: flex; flex-direction: column; gap: 20px; }
.empty { padding: 32px 16px; text-align: center; font-size: 14px; color: var(--text-muted); }
.empty svg { width: 28px; height: 28px; color: var(--text-disabled); margin: 0 auto 8px; display: block; }
.empty b { display: block; color: var(--text-primary); font-size: 15px; margin-bottom: 2px; }

/* Faixa de fatos (dados da obra no relatório) */
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.facts > div { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border-default); border-bottom: 1px solid var(--border-default); margin: 0 -1px -1px 0; min-width: 0; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .facts { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.facts dt { font-size: 12px; color: var(--text-muted); }
.facts dd { margin: 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Medidor (execução física, tempo decorrido) */
.meter-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.meter-card .k { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--text-muted); }
.meter-card .k small { font-size: 12px; }
.meter-card .v { font-size: 30px; line-height: 34px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.meter-card .v small { font-size: 15px; font-weight: 600; }
.meter { position: relative; height: 8px; border-radius: var(--radius-full); background: var(--chart-pendente); }
.meter > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-full); background: var(--chart-executado); }
.meter > span.time { background: var(--chart-semana-atual); }
.meter > i { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text-primary); }
.delta-neg { color: var(--status-danger); }
.delta-pos { color: var(--status-ok); }


/* ==========================================================================
   Gráficos (DS-08)
   ========================================================================== */
.chart-keys { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text-secondary); }
.chart-key { display: inline-flex; align-items: center; gap: 8px; }
.chart-swatch { width: 14px; height: 10px; border-radius: 2px; flex-shrink: 0; box-sizing: border-box; display: inline-block; }
.chart-svg { font-family: var(--font-sans); overflow: visible; }
.chart-tip { position: absolute; z-index: 10; width: 220px; pointer-events: none; font-variant-numeric: tabular-nums; }
.chart-empty { padding: 40px 0; text-align: center; font-size: 14px; color: var(--text-muted); }
.chart-note { font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.table tr.is-current td { background: var(--chart-semana-atual-bg); }

/* Não será executado: hachura 135° (lê em cinza e sem cor) */
.hatch { background: repeating-linear-gradient(135deg, #FFFFFF 0 2px, var(--chart-nao-executado) 2px 3px); }
.sw-exec { background: var(--chart-executado); }
.sw-pend { background: var(--chart-pendente); }
.sw-hatch { border: 1px solid var(--chart-nao-executado); }
.sw-plan { background: #FFFFFF; border: 1.5px solid var(--chart-planejado-bar); }
.sw-mob { background: var(--cat-steel-700); }

/* B · barra 100% empilhada (executado | pendente | não será) */
.stackbar { display: flex; height: 16px; border-radius: 3px; overflow: hidden; background: var(--chart-pendente); min-width: 120px; }
.stackbar > .ex { background: var(--chart-executado); }
.stackbar > .gap { flex: 1; }

/* C · barras pareadas: contorno = planejado, preenchimento = mobilizado */
.paired { display: grid; grid-template-columns: minmax(72px, min(160px, 35%)) minmax(80px, 1fr) auto; align-items: center; gap: 12px; font-size: 13px; }
.paired > .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paired-bar { position: relative; height: 18px; }
.paired-bar > .p { position: absolute; left: 0; top: 0; height: 18px; border: 1.5px solid var(--chart-planejado-bar); border-radius: 3px; box-sizing: border-box; background: #FFFFFF; }
.paired-bar > .m { position: absolute; left: 0; top: 4px; height: 10px; background: var(--cat-steel-700); border-radius: 2px; }
.paired > .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paired > .v span { color: var(--text-muted); }

/* Saldo (atraso): barra divergente em torno do zero */
.diverge { position: relative; display: block; height: 12px; min-width: 120px; }
.diverge::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--text-disabled); }
.diverge > span { position: absolute; top: 2px; height: 8px; border-radius: 2px; }
.diverge > .neg { background: var(--status-danger); }
.diverge > .pos { background: var(--status-ok); }

/* D · peça do diagrama: preenchimento = rampa Steel de 6 passos; ícone = fase */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, 56px); gap: 8px; padding: 4px 2px; }
.tile { position: relative; width: 56px; height: 56px; border-radius: 8px; box-sizing: border-box; color: var(--text-primary); background: var(--chart-ramp-0); border: 1px dashed var(--text-disabled); text-decoration: none; cursor: pointer; display: block; padding: 0; font: inherit; text-align: left; }
.tile .n { position: absolute; left: 5px; top: 3px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; max-width: 34px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile .ph { position: absolute; left: 17px; top: 23px; width: 22px; height: 22px; }
.tile .veg { position: absolute; right: 4px; top: 4px; width: 11px; height: 11px; }
.tile .cp { position: absolute; right: 4px; bottom: 4px; width: 11px; height: 11px; }
.tile .x { position: absolute; right: -14px; top: 50%; transform: translateY(-50%); z-index: 2; width: 20px; height: 20px; border-radius: var(--radius-full); background: #FFFFFF; border: 1.5px solid var(--text-primary); display: inline-flex; align-items: center; justify-content: center; color: var(--text-primary); }
.tile .x svg { width: 11px; height: 11px; }
.tile[data-r="1"] { background: var(--chart-ramp-1); border: 0; }
.tile[data-r="2"] { background: var(--chart-ramp-2); border: 0; }
.tile[data-r="3"] { background: var(--chart-ramp-3); border: 0; color: #FFFFFF; }
.tile[data-r="4"] { background: var(--chart-ramp-4); border: 0; color: #FFFFFF; }
.tile[data-r="5"] { background: var(--chart-ramp-5); border: 0; color: #FFFFFF; }
.tile[data-r="0"] { color: var(--text-muted); }
.tile:hover { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--cat-steel-300); }
.tile[aria-pressed="true"] { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--accent); }
.tile.dim { opacity: .25; }
.ramp-key { display: inline-flex; gap: 2px; }
.ramp-key > span { width: 18px; height: 12px; border-radius: 2px; box-sizing: border-box; }

/* Barra de etapas de uma torre (uma célula por etapa) */
.segbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; height: 12px; }
.segbar > span { border-radius: 2px; background: var(--chart-pendente); }
.segbar > span.ex { background: var(--chart-executado); }
.segbar > span.ne { background: repeating-linear-gradient(135deg, #FFFFFF 0 2px, var(--chart-nao-executado) 2px 3px); }


/* ==========================================================================
   Impressão (DS-09) · documento do cliente, neutro e sem a marca
   ========================================================================== */
@media print {
  :root { --row-h: 26px; }
  .table th { height: 28px; }
  .card { border-color: var(--border-strong); }
  .facts { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .table-wrap, .overflow-x-auto { overflow: visible !important; }
  .stack-y { display: block; }
  .stack-y > * + * { margin-top: 14px; }
  .chart-unit.card { padding: 10px 14px !important; gap: 6px !important; }
  .chart-svg { max-height: 56mm; width: auto; max-width: 100%; margin: 0 auto; }
  .chart-unit, figure, .facts, .meter-card, tr { break-inside: avoid; }
  .sec-head { break-after: avoid; }
  .tiles { grid-template-columns: repeat(auto-fill, 48px); gap: 6px; }
  .tile { width: 48px; height: 48px; }
  .tile .ph { left: 13px; top: 19px; }
  .tile .x { right: -12px; width: 18px; height: 18px; }
}


/* Menu de ações da linha (⋯) · <details class="row-menu"> */
.row-actions { display: inline-flex; align-items: center; gap: 2px; justify-content: flex-end; }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 168px; }
.row-menu .menu-item.danger, .row-menu .menu-item.danger svg { color: var(--action-danger); }
.btn-row { width: 32px; height: 32px; padding: 0; background: transparent; border: 0; color: var(--text-muted); border-radius: var(--radius-md); }
.btn-row:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-row svg { width: 16px; height: 16px; }

/* Barra de ferramentas da tabela (busca + chips + densidade) */
.dt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-default); }
.dt-toolbar .input-icon { flex: 0 1 260px; }
.dt-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border-default); font-size: 12px; color: var(--text-muted); }
.dt-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.dt-card .table-wrap { border: 0; border-radius: 0; max-height: calc(100vh - 260px); overflow: auto; }
.table .tag-new { display: inline-flex; margin-left: 6px; height: 18px; padding: 0 6px; align-items: center; border-radius: var(--radius-sm); background: var(--cat-signal-50); color: var(--cat-signal-700); font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.table td.mono, .table .mono { font-family: var(--font-mono); font-size: 12.5px; }
.table .sticky-end { position: sticky; right: 0; background: var(--bg-surface); box-shadow: -1px 0 0 var(--border-default); }
.table th.sticky-end { background: var(--bg-canvas); z-index: 2; }
.table tbody tr:hover td.sticky-end { background: #F5F8FB; }
.modal fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.modal fieldset + fieldset { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-default); }
.modal legend { float: left; width: 100%; padding: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--text-secondary); grid-column: 1 / -1; }


/* Campo de data dd/mm/aaaa (assets/js/datefield.js) */
.date-br { position: relative; display: inline-flex; width: 100%; vertical-align: middle; }
.date-br > input[type=text] { width: 100%; padding-right: 38px; font-variant-numeric: tabular-nums; }
.date-br-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-muted); cursor: pointer; }
.date-br-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.date-br-btn:disabled { display: none; }
.date-br-pick { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }


/* Seletor de obra do menu (Tela-04): nome + EPS · torres, lista ao abrir */
.sb-switch { position: relative; }
.sb-switch > summary { list-style: none; }
.sb-switch > summary::-webkit-details-marker { display: none; }
.sb-obra-btn { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border-inverse); border-radius: 8px; background: var(--bg-inverse-raised); color: #FFFFFF; cursor: pointer; }
.sb-obra-btn:hover { border-color: #34414D; }
.sb-obra-btn svg { color: var(--text-inverse-muted); flex-shrink: 0; }
.sb-obra-btn.is-empty { background: transparent; border-style: dashed; border-color: #34414D; color: var(--text-inverse-nav); font-size: 14px; padding: 10px; }
.sb-obra-name { font-size: 14px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-obra-meta { font-size: 11px; color: var(--text-inverse-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-obra-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--bg-inverse-raised); border: 1px solid var(--border-inverse); border-radius: 8px; padding: 4px; box-shadow: var(--shadow-e2); max-height: 60vh; overflow-y: auto; }
.sb-obra-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-inverse-nav); font-size: 13px; text-align: left; cursor: pointer; text-decoration: none; }
.sb-obra-opt small { font-size: 11px; color: var(--text-inverse-muted); }
.sb-obra-opt:hover { background: rgb(255 255 255 / 0.06); color: #FFFFFF; }
.sb-obra-opt[aria-selected="true"] { color: #FFFFFF; font-weight: 600; }
.sb-obra-opt[aria-selected="true"] svg { color: var(--accent); }
.sb-obra-all { margin-top: 4px; border-top: 1px solid var(--border-inverse-subtle); border-radius: 0 0 6px 6px; color: var(--text-inverse-muted); font-size: 12px; }

/* Semana atual: rodapé do menu e pílula da barra superior */
/* versão (abre /novidades) logo acima da semana, no pé do menu */
.sb-version { margin-top: auto; padding: 0 10px 8px; font-size: 11px; color: var(--text-inverse-muted); text-decoration: none; font-variant-numeric: tabular-nums; align-self: flex-start; border-radius: var(--radius-sm); }
.sb-version:hover, .sb-version[aria-current="page"] { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
.sb-version + .sb-week { margin-top: 0; }
.sb-week { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--border-inverse-subtle); flex-direction: column; gap: 6px; font-size: 11px; color: var(--text-inverse-muted); }
.sb-week-bar { height: 4px; border-radius: var(--radius-full); background: var(--border-inverse-subtle); overflow: hidden; }
.sb-week-bar > span { display: block; height: 100%; border-radius: var(--radius-full); background: var(--accent); }
.week-pill { align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: var(--radius-full); background: var(--cat-signal-50); color: var(--cat-signal-700); font-size: 12px; font-weight: 600; white-space: nowrap; }
.week-pill::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--accent); }

/* Paginação da tabela */
.dt-pages { display: flex; gap: 4px; align-items: center; }
.dt-page { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-secondary); font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.dt-page:hover { background: var(--bg-subtle); }
.dt-page[aria-current="page"] { border-color: var(--action-primary); background: var(--bg-selected); color: var(--cat-steel-700); font-weight: 600; }
.dt-gap { padding: 0 4px; color: var(--text-muted); }
.dt-cols > .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; max-height: 60vh; overflow-y: auto; }
.dt-cols > .menu .menu-item { height: 32px; font-size: 13px; }

/* Exportar (assets/js/export.js): menu Excel/CSV; .x-only = coluna só na exportação */
.x-only { display: none !important; }
.export-menu { position: relative; display: inline-block; }
.export-menu > summary { list-style: none; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu > .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 210px; }
.export-menu .menu-item { height: 34px; font-size: 13px; }
@media print { .export-menu { display: none !important; } }
