/* ==================================================================
   LIGHT THEME — fonte de verdade (branding só sobrescreve acento/chrome)
   ================================================================== */
:root,
[data-ec-theme="light"] {
  /* ── Cor base / textos ── */
  --ec-primary:         #1c1917;
  --ec-primary-strong:  #0c0a09;
  --ec-primary-rgb:     28, 25, 23;
  --ec-text:            var(--ec-primary);
  --ec-text-2:          #44403c;
  --ec-text-muted:      #57534e;
  --ec-muted:           var(--ec-text-muted);
  --ec-text-subtle:     #a8a29e;
  --ec-text-on-accent:  #ffffff;
  --ec-text-inverse:    #ffffff;

  /* ── Acento / marca (defaults Eletro Coelho — branding em page-start.ejs) ── */
  --ec-brand-primary:       #263a84;
  --ec-brand-secondary:     #cd2027;
  --ec-ui-accent:           #263a84;
  --ec-ui-accent-strong:    #1d2d6b;
  --ec-ui-accent-rgb:       38, 58, 132;
  --ec-ui-secondary:        #cd2027;
  --ec-ui-secondary-rgb:    205, 32, 39;
  --ec-ui-secondary-strong: #a81820;
  --ec-ui-accent-muted:        rgba(38, 58, 132, 0.08);
  --ec-ui-accent-muted-hover:  rgba(38, 58, 132, 0.13);
  --ec-ui-accent-muted-active: rgba(38, 58, 132, 0.20);
  --ec-btn-on-accent: #ffffff;

  /* ── Superfícies (cinza quente ligeiramente mais fria para contrastar com o azul) ── */
  --ec-bg:                #f4f5f7;
  --ec-main-canvas:       #f4f5f7;
  --ec-surface:           #ffffff;
  --ec-surface-2:         #f9fafb;
  --ec-surface-3:         #eef0f4;
  --ec-surface-raised:    #ffffff;
  --ec-fill-subtle:       #eceef3;
  --ec-fill-subtle-hover: #e2e5ed;

  /* ── Bordas ── */
  --ec-border:          rgba(0, 0, 0, 0.10);
  --ec-border-strong:   rgba(0, 0, 0, 0.18);
  --ec-border-2:        var(--ec-border-strong);
  --ec-border-input:    rgba(0, 0, 0, 0.14);
  --ec-divider:         rgba(0, 0, 0, 0.07);

  /* ── Tabela ── */
  --ec-table-header-bg:   #f3f4f6;
  --ec-table-header-text: var(--ec-text-muted);
  --ec-table-row-hover:   #f9fafb;
  --ec-table-border:      rgba(0, 0, 0, 0.08);
  --ec-table-stripe:      rgba(0, 0, 0, 0.025);

  /* ── Sidebar (sobrescrito pelo branding) ── */
  --ec-sidebar-bg:     #1d2d6b;
  --ec-sidebar-text:   #e8ecf8;
  --ec-sidebar-muted:  #8fa3d4;
  --ec-nav-hover-bg:   rgba(255, 255, 255, 0.08);
  --ec-nav-active-bg:  rgba(205, 32, 39, 0.18);
  --ec-nav-active-text: var(--ec-ui-secondary);
  --ec-nav-active-border: var(--ec-ui-secondary);
  --ec-surface-nav-active-bg: rgba(var(--ec-ui-secondary-rgb), 0.08);
  --ec-surface-nav-active-text: var(--ec-ui-secondary);
  --ec-surface-nav-active-border: var(--ec-ui-secondary);

  /* ── Estados (semânticos + legado rgb) ── */
  --ec-success:         #16a34a;
  --ec-success-bg:      #f0fdf4;
  --ec-success-border:  #bbf7d0;
  --ec-success-text:    #15803d;
  --ec-warning:         #d97706;
  --ec-warning-bg:      #fffbeb;
  --ec-warning-border:  #fde68a;
  --ec-warning-text:    #b45309;
  --ec-danger:          #dc2626;
  --ec-danger-bg:       #fef2f2;
  --ec-danger-border:   #fecaca;
  --ec-danger-text:     #b91c1c;
  --ec-danger-rgb:      220, 38, 38;
  --ec-info:            #2563eb;
  --ec-info-bg:         #eff6ff;
  --ec-info-border:     #bfdbfe;
  --ec-info-text:       #1d4ed8;
  --ec-info-rgb:        37, 99, 235;
  --ec-success-rgb:     22, 163, 74;
  --ec-warning-rgb:     217, 119, 6;

  /* ── Badges / pills de status de OS ── */
  --ec-status-open-bg:      #eff6ff;
  --ec-status-open-text:    #1e40af;
  --ec-status-open-border:  #bfdbfe;
  --ec-status-scheduled-bg:     #fffbeb;
  --ec-status-scheduled-text:   #92400e;
  --ec-status-scheduled-border: #fde68a;
  --ec-status-inprog-bg:     #f0fdf4;
  --ec-status-inprog-text:   #166534;
  --ec-status-inprog-border: #bbf7d0;
  --ec-status-paused-bg:     #f5f3ff;
  --ec-status-paused-text:   #5b21b6;
  --ec-status-paused-border: #ddd6fe;
  --ec-status-closed-bg:     #f9fafb;
  --ec-status-closed-text:   #374151;
  --ec-status-closed-border: #d1d5db;
  --ec-status-cancelled-bg:     #fef2f2;
  --ec-status-cancelled-text:   #991b1b;
  --ec-status-cancelled-border: #fecaca;

  /* ── Inputs ── */
  --ec-input-bg:           #ffffff;
  --ec-input-border:       rgba(0, 0, 0, 0.14);
  --ec-input-border-focus: var(--ec-ui-accent, #2563eb);
  --ec-input-placeholder:  #9ca3af;
  --ec-input-text:         #111827;
  --ec-input-bg-disabled:  #f3f4f6;
  --ec-focus-ring: 0 0 0 3px rgba(var(--ec-ui-accent-rgb, 37, 99, 235), 0.25);

  /* ── Tipografia (legibilidade + hierarquia UI) ── */
  --ec-font-size-base: 15px;
  --ec-text-xs:   11px;
  --ec-text-sm:   12.5px;
  --ec-text-base: 14px;
  --ec-text-md:   15px;
  --ec-text-lg:   16px;
  --ec-text-xl:   19px;
  --ec-text-2xl:  23px;
  --ec-text-3xl:  29px;
  /* Menus / chrome (sidebar, settings lateral) */
  --ec-font-size-nav-section: 11px;
  --ec-font-size-nav:         15px;
  --ec-font-size-nav-sub:     14px;
  --ec-font-size-brand-title: 15px;
  --ec-font-size-topbar-title: 17px;
  --ec-font-size-topbar-meta: 13px;

  /* ── Badges (pills de estado) ── */
  --ec-badge-font-size-sm: 10px;
  --ec-badge-font-size: 11px;
  --ec-badge-font-size-lg: 12px;
  --ec-badge-padding-y: 2px;
  --ec-badge-padding-y-lg: 3px;
  --ec-badge-padding-x-sm: 6px;
  --ec-badge-padding-x: 8px;
  --ec-badge-padding-x-lg: 10px;
  --ec-badge-line-height: 1.45;
  --ec-badge-letter-spacing: 0.03em;
  --ec-badge-border-width: 1px;

  /* ── Espaçamento / raio (clean / arredondado) ── */
  --ec-radius-sm:  4px;
  --ec-radius:     8px;
  --ec-radius-md:  10px;
  --ec-radius-lg:  14px;
  --ec-radius-xl:  20px;

  /* ── Topbar (chrome dos botões ícone — alinhado ao estilo da barra) ── */
  --ec-topbar-bg: var(--ec-surface);
  --ec-topbar-text: var(--ec-primary);
  --ec-topbar-border: var(--ec-border);
  --ec-topbar-control-bg: var(--ec-fill-subtle);
  --ec-topbar-control-border: var(--ec-border);
  --ec-topbar-control-hover-bg: #e2e8f0;
  --ec-topbar-control-active-bg: rgba(var(--ec-ui-accent-rgb), 0.12);

  /* ── Sombras ── */
  --ec-topbar-shadow: 0 1px 3px rgba(var(--ec-primary-rgb), 0.06);
  --ec-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
  --ec-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
  --ec-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.06);
  --ec-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.07);
  --ec-shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.14), 0 8px 16px rgba(0, 0, 0, 0.08);

  /* Login — painel hero (gradiente pode ser sobrescrito pelo branding) */
  --ec-auth-hero-from: #1d2d6b;
  --ec-auth-hero-mid: #263a84;
  --ec-auth-hero-to: #0f1e52;
  --ec-auth-hero-heading: #ffffff;
  --ec-auth-hero-text: #c8d4f0;
  --ec-auth-hero-icon: #ffffff;

  /* ── Shell (sidebar + topbar) ── */
  --ec-shell-sidebar-width: 240px;
  --ec-shell-topbar-height: 60px;
  --ec-page-padding: 18px;
  --ec-page-padding-inline: 20px;
  --ec-page-padding-block-end: 28px;
  --ec-page-padding-mobile: 14px;
  --ec-page-padding-mobile-inline: 12px;
  --ec-z-sidebar: 30;
  --ec-z-sidebar-backdrop: 25;
  --ec-z-topbar: 40;
  --ec-z-topbar-dropdown: 60;

  /* ── Breakpoints responsivos (usar em @media quando possível) ── */
  --ec-bp-xs: 520px;
  --ec-bp-sm: 640px;
  --ec-bp-md: 1023px;
  --ec-bp-lg: 901px;
  /* Perfis oficiais S/T/N/D — ver docs/RESPONSIVE-STRATEGY.md */
  --ec-bp-tablet-max: 1023px;
  --ec-bp-notebook-max: 1365px;
  --ec-bp-desktop-min: 1366px;

  /* Scrollbar (webkit) */
  --ec-scrollbar-track: #eceef3;
  --ec-scrollbar-thumb: #b8bfd4;
  --ec-scrollbar-thumb-hover: #8fa3d4;
}

/* ==================================================================
   DARK THEME — mesma estrutura de variáveis, valores para fundo escuro
   ================================================================== */
[data-ec-theme="dark"] {
  --ec-primary:         #f5f5f4;
  --ec-primary-strong:  #ffffff;
  --ec-primary-rgb:     245, 245, 244;
  --ec-text:            var(--ec-primary);
  --ec-text-2:          #d6d3d1;
  --ec-text-muted:      #a8a29e;
  --ec-muted:           var(--ec-text-muted);
  --ec-text-subtle:     #78716c;
  --ec-text-on-accent:  #ffffff;
  --ec-text-inverse:    #0f0e0d;

  --ec-bg:              #0f0e0d;
  --ec-main-canvas:     #141312;
  --ec-surface:         #1c1a18;
  --ec-surface-2:       #242220;
  --ec-surface-3:       #2d2a27;
  --ec-surface-raised:  #242220;
  --ec-fill-subtle:     #242220;
  --ec-fill-subtle-hover: #2d2a27;

  --ec-border:          rgba(255, 255, 255, 0.10);
  --ec-border-strong:   rgba(255, 255, 255, 0.18);
  --ec-border-2:        var(--ec-border-strong);
  --ec-border-input:    rgba(255, 255, 255, 0.14);
  --ec-divider:         rgba(255, 255, 255, 0.06);

  --ec-table-header-bg:   var(--ec-surface-2);
  --ec-table-header-text: var(--ec-text-muted);
  --ec-table-row-hover:   rgba(255, 255, 255, 0.04);
  --ec-table-border:      rgba(255, 255, 255, 0.08);
  --ec-table-stripe:      rgba(255, 255, 255, 0.02);

  --ec-success:         #4ade80;
  --ec-success-bg:      rgba(74, 222, 128, 0.12);
  --ec-success-border:  rgba(74, 222, 128, 0.28);
  --ec-success-text:    #4ade80;
  --ec-success-rgb:     74, 222, 128;
  --ec-warning:         #fbbf24;
  --ec-warning-bg:      rgba(251, 191, 36, 0.12);
  --ec-warning-border:  rgba(251, 191, 36, 0.28);
  --ec-warning-text:    #fbbf24;
  --ec-warning-rgb:     251, 191, 36;
  --ec-danger:          #f87171;
  --ec-danger-bg:       rgba(248, 113, 113, 0.12);
  --ec-danger-border:   rgba(248, 113, 113, 0.28);
  --ec-danger-text:     #f87171;
  --ec-danger-rgb:      248, 113, 113;
  --ec-info:            #60a5fa;
  --ec-info-bg:         rgba(96, 165, 250, 0.12);
  --ec-info-border:     rgba(96, 165, 250, 0.28);
  --ec-info-text:       #60a5fa;
  --ec-info-rgb:        96, 165, 250;

  --ec-status-open-bg:      rgba(96, 165, 250, 0.12);
  --ec-status-open-text:    #60a5fa;
  --ec-status-open-border:  rgba(96, 165, 250, 0.25);
  --ec-status-scheduled-bg:     rgba(251, 191, 36, 0.12);
  --ec-status-scheduled-text:   #fbbf24;
  --ec-status-scheduled-border: rgba(251, 191, 36, 0.25);
  --ec-status-inprog-bg:     rgba(74, 222, 128, 0.12);
  --ec-status-inprog-text:   #4ade80;
  --ec-status-inprog-border: rgba(74, 222, 128, 0.25);
  --ec-status-paused-bg:     rgba(167, 139, 250, 0.12);
  --ec-status-paused-text:   #a78bfa;
  --ec-status-paused-border: rgba(167, 139, 250, 0.25);
  --ec-status-closed-bg:     rgba(168, 162, 158, 0.12);
  --ec-status-closed-text:   #a8a29e;
  --ec-status-closed-border: rgba(168, 162, 158, 0.25);
  --ec-status-cancelled-bg:     rgba(248, 113, 113, 0.10);
  --ec-status-cancelled-text:   #f87171;
  --ec-status-cancelled-border: rgba(248, 113, 113, 0.25);

  --ec-input-bg:          #0f0e0d;
  --ec-input-border:      rgba(255, 255, 255, 0.14);
  --ec-input-border-focus: rgba(var(--ec-ui-accent-rgb, 96, 165, 250), 0.85);
  --ec-input-placeholder: #78716c;
  --ec-input-text:        #f5f5f4;
  --ec-input-bg-disabled: #1c1a18;
  --ec-focus-ring: 0 0 0 3px rgba(var(--ec-ui-accent-rgb, 96, 165, 250), 0.32);

  --ec-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.45);
  --ec-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
  --ec-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.55), 0 2px 4px rgba(0, 0, 0, 0.4);
  --ec-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.65), 0 4px 8px rgba(0, 0, 0, 0.45);
  --ec-shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.75), 0 8px 16px rgba(0, 0, 0, 0.55);

  --ec-scrollbar-track: #1c1a18;
  --ec-scrollbar-thumb: #44403c;
  --ec-scrollbar-thumb-hover: #78716c;

  color-scheme: dark;
}

[data-ec-theme="dark"] .card,
[data-ec-theme="dark"] .filter-bar,
[data-ec-theme="dark"] .filter-panel,
[data-ec-theme="dark"] .inline-panel {
  background: var(--ec-surface);
  border-color: var(--ec-border);
}

[data-ec-theme="dark"] .data-table tbody tr.is-overdue {
  background: var(--ec-danger-bg);
}

[data-ec-theme="dark"] .item-type-pill__label,
[data-ec-theme="dark"] .status-pill__label {
  background: var(--ec-surface-2);
}

[data-ec-theme="dark"] .dash-alert--warn {
  border-color: var(--ec-warning-border);
  background: var(--ec-warning-bg);
}

[data-ec-theme="dark"] body.auth-page {
  background: var(--ec-bg);
}

[data-ec-theme="dark"] .auth-v2__right {
  background: var(--ec-surface);
}

[data-ec-theme="dark"] .topbar__menu-btn {
  background: var(--ec-surface);
  color: var(--ec-text);
  border-color: var(--ec-border);
}

[data-ec-theme="dark"] .topbar-notifications__badge {
  border-color: var(--ec-topbar-bg, var(--ec-surface));
}

[data-ec-theme="dark"] .topbar-notifications__panel,
[data-ec-theme="dark"] .ec-notif-panel {
  box-shadow: var(--ec-shadow-lg);
}

[data-ec-theme="dark"] .ec-notif-tab--active {
  background: var(--ec-surface);
  box-shadow: var(--ec-shadow-sm);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--ec-scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--ec-scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ec-scrollbar-thumb-hover);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(
    --ec-font-family,
    'Roboto',
    system-ui,
    -apple-system,
    'Segoe UI',
    'Helvetica Neue',
    Arial,
    sans-serif
  );
  background-color: var(--ec-bg);
  color: var(--ec-primary);
  font-size: var(--ec-font-size-base, 15px);
  line-height: 1.52;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.003em;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================================
   AUTH v2 — tela de login moderna
   ============================================================ */
body.auth-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ec-bg);
  font-family: var(
    --ec-font-family,
    'Roboto',
    system-ui,
    -apple-system,
    'Segoe UI',
    'Helvetica Neue',
    Arial,
    sans-serif
  );
}

.auth-page .alert.alert-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--ec-radius-md, 8px);
  border: 1px solid color-mix(in srgb, var(--ec-ok, #16a34a) 35%, transparent);
  background: color-mix(in srgb, var(--ec-ok, #16a34a) 10%, var(--ec-surface, #fff));
  color: var(--ec-text, #0f172a);
  font-size: var(--ec-text-sm, 13px);
}

body.page-print {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ec-bg);
  font-family: var(--ec-font-family, system-ui, sans-serif);
  color: var(--ec-primary);
  padding: 16px;
  box-sizing: border-box;
}

body.page-print .label-sheet {
  margin: 0 auto;
}

body.page-print .page-toolbar {
  max-width: 480px;
  margin: 0 auto 16px;
}

.auth-v2 {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---- painel esquerdo (marca, escuro) ---- */
.auth-v2__left {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 420px;
  flex-shrink: 0;
  padding: 52px 48px;
  background: linear-gradient(
    160deg,
    var(--ec-auth-hero-from) 0%,
    var(--ec-auth-hero-mid) 60%,
    var(--ec-auth-hero-to) 100%
  );
  color: var(--ec-auth-hero-text);
  position: relative;
  overflow: hidden;
}

.auth-v2__left::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(var(--ec-ui-secondary-rgb, 205, 32, 39), 0.15);
  pointer-events: none;
}

.auth-v2__left::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(var(--ec-ui-accent-rgb, 38, 58, 132), 0.12);
  pointer-events: none;
}

.auth-v2__left-inner {
  position: relative;
  z-index: 1;
}

.auth-v2__logo-wrap {
  margin-bottom: 40px;
}

.auth-v2__logo-img {
  display: block;
  max-height: 52px;
  max-width: 160px;
  object-fit: contain;
}

.auth-v2__icon-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ec-auth-hero-icon);
  backdrop-filter: blur(4px);
}

.auth-v2__brand-name {
  margin: 0 0 12px;
  font-size: var(--ec-text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ec-auth-hero-heading);
  line-height: 1.15;
}

.auth-v2__tagline {
  margin: 0 0 40px;
  font-size: var(--ec-text-md);
  line-height: 1.6;
  color: rgba(224, 231, 255, 0.75);
  font-weight: 400;
}

.auth-v2__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-v2__features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--ec-text-base);
  color: rgba(224, 231, 255, 0.85);
  font-weight: 500;
  line-height: 1.45;
}

.auth-v2__feat-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ec-ui-secondary, #cd2027);
  box-shadow: 0 0 0 3px rgba(var(--ec-ui-secondary-rgb, 205, 32, 39), 0.35);
}

.auth-v2__left-footer {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: var(--ec-text-xs);
  color: rgba(224, 231, 255, 0.4);
  font-weight: 400;
}

/* ---- painel direito (form) ---- */
.auth-v2__right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--ec-main-canvas);
}

.auth-v2__form-wrap {
  width: 100%;
  max-width: 420px;
  animation: authFadeUp 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-v2__form-header {
  margin-bottom: 32px;
}

.auth-v2__form-logo {
  display: block;
  max-height: 40px;
  max-width: 140px;
  object-fit: contain;
  margin-bottom: 20px;
}

.auth-v2__form-title {
  margin: 0 0 6px;
  font-size: var(--ec-text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ec-text);
  line-height: 1.2;
}

.auth-v2__form-lede {
  margin: 0;
  font-size: var(--ec-text-base);
  line-height: 1.55;
  color: var(--ec-table-header-text);
  font-weight: 400;
}

.auth-v2__alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: var(--ec-radius-md);
  background: rgba(var(--ec-danger-rgb), 0.08);
  border: 1px solid rgba(var(--ec-danger-rgb), 0.22);
  color: var(--ec-danger);
  font-size: var(--ec-text-base);
  font-weight: 500;
  line-height: 1.4;
}

.auth-v2__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-v2__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-v2__label {
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: var(--ec-text-2);
  letter-spacing: 0.02em;
}

.auth-v2__input {
  width: 100%;
  padding: 11px 14px;
  font-size: calc(var(--ec-font-size-base) + 0.5px);
  font-family: inherit;
  border: 1.5px solid var(--ec-border-2);
  border-radius: var(--ec-radius-lg, 12px);
  background: var(--ec-surface);
  color: var(--ec-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.auth-v2__input:focus {
  border-color: var(--ec-ui-accent, #263a84);
  box-shadow: 0 0 0 3px rgba(var(--ec-ui-accent-rgb, 38, 58, 132), 0.14);
}

.auth-v2__input--error {
  border-color: #f87171;
  border-color: color-mix(in srgb, var(--ec-danger) 58%, white);
}

.auth-v2__input--error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.auth-v2__pwd-wrap {
  position: relative;
}

.auth-v2__pwd-wrap .auth-v2__input {
  padding-right: 46px;
}

.auth-v2__pwd-toggle {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ec-text-subtle);
  border-radius: var(--ec-radius-md);
  transition: color 0.15s, background 0.15s;
}

.auth-v2__pwd-toggle:hover {
  color: var(--ec-ui-accent, #263a84);
  background: rgba(var(--ec-ui-accent-rgb, 38, 58, 132), 0.07);
}

.auth-v2__pwd-toggle:focus-visible {
  outline: 2px solid var(--ec-ui-accent);
  outline-offset: 2px;
}

.auth-v2__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 13px 20px;
  font-size: calc(var(--ec-font-size-base) + 1px);
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--ec-radius-lg, 12px);
  background: var(--ec-ui-accent, #263a84);
  color: var(--ec-surface);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: none;
}

.auth-v2__submit:hover {
  background: var(--ec-ui-accent-strong, #1e2f6a);
  box-shadow: none;
}

.auth-v2__submit:active {
  transform: scale(0.98);
}

.auth-v2__submit--inline {
  display: inline-flex;
  width: auto;
  text-decoration: none;
  padding: 12px 20px;
}

.auth-v2__submit:focus-visible {
  outline: 2px solid var(--ec-ui-accent-strong);
  outline-offset: 3px;
}

.auth-v2__legal {
  margin: 20px 0 0;
  font-size: var(--ec-text-xs);
  text-align: center;
  color: var(--ec-text-subtle);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .auth-v2__form-wrap {
    animation: none;
  }

  .auth-v2__submit:active {
    transform: none;
  }

  .flash-message,
  .page-content > .alert,
  .page-content > .card.card--error,
  .sidebar-nav__link.is-active::before,
  .sidebar-nav__link[aria-current="page"]::before,
  .sidebar-nav a:not(.sidebar-nav__sub).active::before,
  .sidebar-nav a:not(.sidebar-nav__sub)[aria-current="page"]::before {
    animation: none;
  }
}

/* ---- desktop ---- */
@media (min-width: 860px) {
  .auth-v2__left {
    display: flex;
  }
}

/* ---- layout: card (form centrado sem painel lateral) ---- */
.auth-v2--card .auth-v2__left {
  display: none !important;
}
.auth-v2--card .auth-v2__right {
  background: var(--ec-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-v2--card .auth-v2__form-wrap {
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-xl);
  padding: 40px 44px;
  box-shadow: none;
  max-width: 440px;
  width: 100%;
}

/* ---- layout: fullform (fundo colorido ocupa tudo) ---- */
.auth-v2--fullform .auth-v2__left {
  display: none !important;
}
.auth-v2--fullform .auth-v2__right {
  background: linear-gradient(135deg, rgba(var(--ec-ui-accent-rgb),0.06) 0%, rgba(var(--ec-ui-accent-rgb),0.02) 100%), var(--ec-main-canvas);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-v2--fullform .auth-v2__form-wrap {
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-xl);
  padding: 48px 52px;
  box-shadow: var(--ec-shadow-sm);
  max-width: 460px;
  width: 100%;
}

/* ---- mobile ---- */
@media (max-width: 1023px) {
  .auth-v2__right {
    padding: 40px 20px;
    background: var(--ec-surface);
    min-height: 100vh;
  }

  .auth-v2__input {
    font-size: 16px;
    padding: 13px 14px;
  }

  .auth-v2__submit {
    padding: 15px 20px;
    font-size: 16px;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: var(--ec-text-muted);
}

.field label {
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: var(--ec-text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea,
.ec-form-field__control,
.ec-form-field input,
.ec-form-field select,
.ec-form-field textarea {
  padding: 8px 12px;
  border: 1px solid var(--ec-input-border);
  border-radius: var(--ec-radius-md);
  background: var(--ec-input-bg);
  font-size: var(--ec-text-base);
  font-family: inherit;
  color: var(--ec-input-text);
  transition: border-color 0.12s, box-shadow 0.12s;
  outline: none;
  line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder,
.ec-form-field__control::placeholder,
.ec-form-field textarea::placeholder {
  color: var(--ec-input-placeholder);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.ec-form-field__control:focus,
.ec-form-field select:focus,
.ec-form-field textarea:focus {
  border-color: var(--ec-input-border-focus);
  box-shadow: var(--ec-focus-ring);
  background: var(--ec-input-bg);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled,
.ec-form-field__control:disabled,
.ec-form-field select:disabled {
  background: var(--ec-input-bg-disabled);
  opacity: 0.6;
}

.stack {
  display: grid;
  gap: 14px;
}

.form-section {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--ec-border);
}

.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.form-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: var(--ec-font-size-nav-section);
  font-weight: 700;
  color: var(--ec-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-section h4::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 1px;
  background: var(--ec-border-2);
  flex-shrink: 0;
}

/* status pill (employment, active, etc.) */
.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.status-pill {
  position: relative;
}

.status-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.status-pill__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 2px solid var(--ec-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--ec-text-base);
  font-weight: 500;
  background: var(--ec-surface);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.status-pill__label:hover {
  border-color: var(--ec-ui-accent);
  background: var(--ec-ui-accent-muted-hover);
  color: var(--ec-text);
}

.status-pill__label:active {
  background: var(--ec-ui-accent-muted-active);
  border-color: var(--ec-ui-accent-strong);
  color: var(--ec-text);
}

.status-pill input[type="radio"]:checked + .status-pill__label {
  border-color: var(--ec-ui-accent);
  background: var(--ec-ui-accent-muted);
  color: var(--ec-text);
}

.status-pill input[type="radio"]:focus-visible + .status-pill__label {
  outline: 2px solid rgba(var(--ec-ui-accent-rgb), 0.45);
  outline-offset: 2px;
}

.status-pill--warn input[type="radio"]:checked + .status-pill__label {
  border-color: var(--ec-warning);
  background: var(--ec-warning-bg);
  color: var(--ec-warning-text);
}

.status-pill--danger input[type="radio"]:checked + .status-pill__label {
  border-color: var(--ec-danger);
  background: var(--ec-danger-bg);
  color: var(--ec-danger-text);
}

.status-pill--ok input[type="radio"]:checked + .status-pill__label {
  border-color: var(--ec-success);
  background: var(--ec-success-bg);
  color: var(--ec-success-text);
}

/* Legado: preferir ec-form-grid nas views; mantido para compatibilidade residual. */
.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

@media (max-width: 640px) {
  .form-grid.four {
    grid-template-columns: 1fr;
  }
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: var(--ec-text-base);
}

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

.inline-form {
  display: inline-flex;
  margin: 0;
}

.inline-form--table-cell {
  display: inline-flex;
  margin: 0;
}

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

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert {
  border-radius: var(--ec-radius-md);
  border: 1px solid;
  padding: 10px 14px;
  margin-bottom: 12px;
  animation: ec-flash-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page-content > .card.card--error.mb-12 {
  animation: ec-flash-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ec-flash-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-error,
.alert-danger {
  background: var(--ec-danger-bg);
  color: var(--ec-danger-text);
  border: 1px solid var(--ec-danger-border);
}

.alert-success {
  background: var(--ec-success-bg);
  color: var(--ec-success-text);
  border: 1px solid var(--ec-success-border);
}

.alert-warning {
  background: var(--ec-warning-bg);
  color: var(--ec-warning-text);
  border: 1px solid var(--ec-warning-border);
}

.alert-info {
  background: var(--ec-info-bg);
  color: var(--ec-info-text);
  border: 1px solid var(--ec-info-border);
}

.calendar-mount {
  min-height: 400px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar-backdrop {
  display: none;
}

body.sidebar-nav-open {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   SIDEBAR — shell redesign
   ═══════════════════════════════════════════════ */
.app-shell > .sidebar {
  flex-shrink: 0;
  width: var(--ec-shell-sidebar-width);
  transition: width 0.25s ease;
  overflow: hidden;
  min-height: 0;
  align-self: stretch;
}

.sidebar {
  width: 100%;
  background: var(--ec-sidebar-bg);
  color: var(--ec-sidebar-text);
  border-right: 1px solid var(--ec-sidebar-border, var(--ec-border));
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.sidebar__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: var(--ec-shell-topbar-height);
  padding: 0 10px 0 12px;
  margin: 0 8px;
  border-bottom: 1px solid var(--ec-sidebar-border, var(--ec-border));
  background: var(--ec-sidebar-bg);
}

.sidebar__brand.brand,
.sidebar__head .brand,
.sidebar-nav__brand-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-bottom: none;
  min-height: 0;
  color: var(--ec-sidebar-text);
  font-weight: 700;
  font-size: var(--ec-font-size-brand-title);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__close {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--ec-radius, 8px);
  background: transparent;
  color: var(--ec-sidebar-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease;
}

.sidebar__close:hover {
  background: var(--ec-nav-hover-bg);
}

.sidebar__close:focus-visible {
  outline: 2px solid var(--ec-nav-active-border, var(--ec-ui-accent));
  outline-offset: 2px;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 8px 12px;
}

.sidebar__foot {
  flex-shrink: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
  margin: 0 8px 8px;
  border-top: 1px solid var(--ec-sidebar-border, var(--ec-border));
  font-size: var(--ec-text-xs);
  color: var(--ec-sidebar-muted, var(--ec-text-subtle));
}

.sidebar__foot-hint {
  display: none;
  margin: 0;
  line-height: 1.25;
  text-align: center;
  font-size: 10px;
  letter-spacing: -0.02em;
}

.sidebar__foot-scope {
  margin: 0 0 6px;
  line-height: 1.35;
}

.sidebar__foot-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ec-sidebar-text);
  text-decoration: none;
  font-size: var(--ec-font-size-nav-sub);
  font-weight: 500;
  padding: 6px 8px;
  border-radius: var(--ec-radius, 8px);
  transition: background 0.12s ease;
}

.sidebar__foot-link:hover {
  background: var(--ec-nav-hover-bg);
  text-decoration: none;
}

.sidebar__foot-link.active {
  background: var(--ec-nav-active-bg);
  color: var(--ec-nav-active-text, var(--ec-ui-secondary));
  font-weight: 600;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 18px;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav-section__title,
.sidebar-nav__section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--ec-font-size-nav-section);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ec-sidebar-muted, var(--ec-text-subtle));
  margin: 0 0 2px;
  padding: 4px 10px;
  opacity: 0.7;
  text-align: left;
  border-radius: var(--ec-radius-sm);
  transition: opacity 0.12s ease, background 0.12s ease;
}

.nav-section__title:hover {
  opacity: 1;
  background: var(--ec-nav-hover-bg);
}

.nav-section__title:focus-visible {
  outline: 2px solid var(--ec-ui-accent);
  outline-offset: 1px;
  opacity: 1;
}

.nav-section__chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -2px;
  transition: transform 0.15s ease;
}

.nav-section--collapsed .nav-section__chevron {
  transform: rotate(-45deg);
  margin-top: 2px;
}

.nav-section__links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.15s ease;
}

.nav-section--collapsed .nav-section__links {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.app-shell.sidebar--collapsed .nav-section__title {
  pointer-events: none;
}

/* Links da navegação lateral */
.sidebar-nav a,
.sidebar-nav__link,
.sidebar-nav__sub-link {
  border-radius: var(--ec-radius, 8px);
  border-left: 3px solid transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
  line-height: 1.4;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

/* Links principais */
.sidebar-nav a:not(.sidebar-nav__sub),
.sidebar-nav__link {
  position: relative;
  padding: 8px 10px;
  color: var(--ec-sidebar-text);
  font-size: var(--ec-font-size-nav);
  font-weight: 500;
  gap: 9px;
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.nav-link-badge {
  margin-left: auto;
  flex-shrink: 0;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  background: var(--ec-danger);
  color: var(--ec-text-on-accent);
}

.sidebar-nav a.sidebar-nav__sub .nav-link-badge {
  font-size: 10px;
  min-width: 18px;
  padding: 1px 5px;
}

.sidebar-nav a:not(.sidebar-nav__sub):hover,
.sidebar-nav__link:hover {
  background: var(--ec-nav-hover-bg);
  color: var(--ec-sidebar-text);
}

.sidebar-nav a:not(.sidebar-nav__sub).active,
.sidebar-nav__link.active {
  background: var(--ec-nav-active-bg);
  color: var(--ec-nav-active-text, var(--ec-ui-secondary));
  font-weight: 600;
  border-left-color: transparent;
}

.sidebar-nav__link.is-active::before,
.sidebar-nav__link[aria-current="page"]::before,
.sidebar-nav a:not(.sidebar-nav__sub).active::before,
.sidebar-nav a:not(.sidebar-nav__sub)[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ec-nav-active-border, var(--ec-ui-secondary));
  animation: ec-slide-indicator 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ec-slide-indicator {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Links sub (indented) */
.sidebar-nav a.sidebar-nav__sub,
.sidebar-nav__sub-link {
  padding: 6px 10px 6px 24px;
  font-size: var(--ec-font-size-nav-sub);
  font-weight: 400;
  color: var(--ec-sidebar-muted, var(--ec-text-subtle));
  gap: 7px;
  display: flex;
  align-items: center;
}

.sidebar-nav a.sidebar-nav__sub:hover,
.sidebar-nav__sub-link:hover {
  color: var(--ec-sidebar-text);
  background: var(--ec-nav-hover-bg);
}

.sidebar-nav a.sidebar-nav__sub.active,
.sidebar-nav__sub-link.active {
  color: var(--ec-nav-active-text, var(--ec-ui-secondary));
  font-weight: 500;
  background: var(--ec-nav-active-bg);
  border-left-color: var(--ec-nav-active-border, var(--ec-ui-secondary));
}

/* Focus */
.sidebar-nav a:focus-visible,
.sidebar-nav a.sidebar-nav__sub:focus-visible {
  outline: 2px solid var(--ec-nav-active-border, var(--ec-ui-secondary));
  outline-offset: 1px;
}

#ec-main-pane.ec-main-pane--loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.main-content {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--ec-main-canvas);
  overflow: auto;
  min-height: 0;
}

/* ═══════════════════════════════════════════════
   TOPBAR — redesign
   ═══════════════════════════════════════════════ */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 12px 16px;
  background: var(--ec-topbar-bg);
  color: var(--ec-topbar-text);
  padding: 0 20px;
  border-bottom: 1px solid var(--ec-topbar-border);
  box-shadow: var(--ec-topbar-shadow, var(--ec-shadow-xs));
  position: sticky;
  top: 0;
  z-index: var(--ec-z-topbar);
  height: var(--ec-shell-topbar-height);
  min-height: var(--ec-shell-topbar-height);
  flex-shrink: 0;
}

.topbar__start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar__center {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 320px;
  justify-self: center;
}

@media (min-width: 1100px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, auto);
  }

  .topbar__center {
    display: flex;
  }
}

.topbar__center .topbar-search {
  width: 100%;
  max-width: 320px;
}

.topbar__center .topbar-search__input {
  width: 100%;
  max-width: none;
}

.topbar__titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topbar__menu-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--ec-radius, 8px);
  background: transparent;
  color: var(--ec-topbar-text, var(--ec-primary));
  cursor: pointer;
  transition: background 0.12s ease;
}

.topbar__menu-btn:hover {
  background: var(--ec-topbar-control-hover-bg, var(--ec-fill-subtle));
}

.topbar__menu-btn:focus-visible {
  outline: 2px solid var(--ec-ui-accent);
  outline-offset: 2px;
}

.topbar__menu-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  box-shadow:
    0 -5px 0 currentColor,
    0 5px 0 currentColor;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.app-shell.sidebar--open .topbar__menu-icon {
  transform: rotate(45deg);
}

.topbar__title-block {
  min-width: 0;
  flex: 1;
}

.topbar h1 {
  margin: 0;
  color: inherit;
  font-size: var(--ec-font-size-topbar-title, 17px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar small,
.topbar__subtitle {
  display: block;
  margin-top: 2px;
  font-size: var(--ec-font-size-topbar-meta, 13px);
  font-weight: 400;
  color: inherit;
  opacity: 0.55;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}

.topbar__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
  margin-left: auto;
}

.topbar__actions-end,
.topbar__end {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
  flex-wrap: nowrap;
  justify-self: end;
}

.topbar-search {
  display: flex;
  align-items: center;
  margin: 0;
  position: relative;
}

.topbar-search__suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 120;
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  box-shadow: var(--ec-shadow-md);
  padding: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.topbar-search__suggest-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--ec-radius-sm, 6px);
  text-decoration: none;
  color: inherit;
  font-size: 13px;
}

.topbar-search__suggest-item:hover,
.topbar-search__suggest-item:focus {
  background: var(--ec-fill-subtle);
  outline: none;
}

.topbar-search__suggest-heading {
  margin: 6px 8px 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topbar-search__input {
  width: min(220px, 28vw);
  max-width: 220px;
  padding: 7px 12px;
  font-size: var(--ec-text-base);
  border: 1px solid var(--ec-topbar-control-border, var(--ec-border));
  border-radius: var(--ec-radius, 8px);
  background: var(--ec-topbar-control-bg, var(--ec-fill-subtle));
  color: var(--ec-topbar-text, inherit);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.topbar-search__input:focus {
  outline: none;
  border-color: var(--ec-input-border-focus, var(--ec-ui-accent));
  background: var(--ec-surface);
  box-shadow: var(--ec-focus-ring);
}

.topbar-search__hint {
  display: none;
  margin-left: 4px;
  padding: 2px 5px;
  border: 1px solid var(--ec-topbar-control-border, var(--ec-border));
  border-radius: var(--ec-radius-sm, 4px);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0.6;
}

@media (min-width: 1100px) {
  .topbar-search__hint {
    display: inline-block;
  }
}

.topbar-search-open-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--ec-topbar-control-border, var(--ec-border));
  border-radius: var(--ec-radius, 8px);
  background: var(--ec-topbar-control-bg, var(--ec-fill-subtle));
  color: var(--ec-topbar-text, var(--ec-primary));
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.topbar-search-open-btn:hover {
  background: var(--ec-topbar-control-hover-bg, var(--ec-fill-subtle));
  border-color: var(--ec-ui-accent);
}

.topbar-search-open-btn:focus-visible {
  outline: 2px solid var(--ec-ui-accent);
  outline-offset: 2px;
}

.topbar-search-open-btn__icon {
  width: 18px;
  height: 18px;
}

@media (max-width: 1099px) {
  .topbar-search-open-btn {
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

.topbar-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--ec-shell-topbar-height, 60px) + 12px) 16px 24px;
  pointer-events: none;
}

.topbar-search-overlay[hidden] {
  display: none !important;
}

.topbar-search-overlay:not([hidden]) {
  pointer-events: auto;
}

.topbar-search-overlay__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.topbar-search-overlay__panel {
  position: relative;
  width: min(560px, 100%);
  z-index: 1;
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  box-shadow: var(--ec-shadow-lg);
  padding: 12px 14px 14px;
}

.topbar-search-overlay__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.topbar-search-overlay__title {
  margin: 0;
  font-size: var(--ec-text-base);
  font-weight: 600;
  color: var(--ec-text);
}

.topbar-search-overlay__close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--ec-radius, 8px);
  background: var(--ec-fill-subtle);
  color: var(--ec-text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.topbar-search-overlay__close:hover {
  background: var(--ec-border);
  color: var(--ec-text);
}

.topbar-search--overlay {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.topbar-search--overlay .topbar-search__input {
  width: 100%;
  max-width: none;
  font-size: 16px;
  padding: 12px 14px;
}

.topbar-search--overlay .topbar-search__hint {
  display: inline-block;
}

.topbar-search--overlay .topbar-search__suggest {
  position: static;
  margin-top: 8px;
  max-height: min(50vh, 320px);
}

.topbar-search__submit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ec-ui-accent);
  border-radius: var(--ec-radius, 8px);
  background: var(--ec-ui-accent);
  color: var(--ec-btn-on-accent, #fff);
  cursor: pointer;
  touch-action: manipulation;
}

.topbar-search__submit-icon {
  width: 18px;
  height: 18px;
}

.topbar-search__suggest-item {
  min-height: 44px;
}

body.topbar-search-overlay-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .topbar-search-overlay {
    align-items: stretch;
    padding: 0;
  }

  .topbar-search-overlay__panel {
    width: 100%;
    max-width: none;
    min-height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding:
      max(12px, env(safe-area-inset-top, 0))
      max(14px, env(safe-area-inset-right, 0))
      max(16px, env(safe-area-inset-bottom, 0))
      max(14px, env(safe-area-inset-left, 0));
    display: flex;
    flex-direction: column;
  }

  .topbar-search--overlay {
    flex: 0 0 auto;
  }

  .topbar-search--overlay .topbar-search__suggest {
    flex: 1 1 auto;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Dropdown de perfil ── */
.topbar-profile {
  position: relative;
  flex-shrink: 0;
}

.topbar-profile__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--ec-topbar-control-border, var(--ec-border));
  border-radius: 999px;
  padding: 3px 8px 3px 3px;
  cursor: pointer;
  color: var(--ec-topbar-text, var(--ec-text));
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  white-space: nowrap;
}

.topbar-profile__btn:hover {
  background: var(--ec-topbar-control-hover-bg, var(--ec-fill-subtle));
  border-color: var(--ec-ui-accent);
  box-shadow: 0 0 0 3px rgba(var(--ec-ui-accent-rgb), 0.08);
}

.topbar-profile__btn[aria-expanded="true"] {
  background: var(--ec-topbar-control-active-bg, rgba(var(--ec-ui-accent-rgb), 0.1));
  border-color: var(--ec-ui-accent);
  box-shadow: 0 0 0 3px rgba(var(--ec-ui-accent-rgb), 0.12);
}

.topbar-profile__name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--ec-font-size-nav, 15px);
}

.topbar-profile__caret {
  font-size: 8px;
  opacity: 0.45;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.topbar-profile__btn[aria-expanded="true"] .topbar-profile__caret {
  transform: rotate(180deg);
}

.topbar-profile__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--ec-z-topbar-dropdown);
  min-width: 230px;
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg, 14px);
  box-shadow: var(--ec-shadow-lg);
  overflow: hidden;
}

.topbar-profile__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
}

.topbar-profile__header-info {
  min-width: 0;
}

.topbar-profile__full-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ec-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-profile__email {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ec-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-profile__establishment {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ec-text-muted);
}

.topbar-profile__divider {
  height: 1px;
  background: var(--ec-border);
  margin: 0;
}

.topbar-profile__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--ec-text-2);
  background: none;
  border: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.topbar-profile__item:hover {
  background: var(--ec-fill-subtle);
  color: var(--ec-text);
}

.topbar-profile__item--danger {
  color: var(--ec-danger);
}

.topbar-profile__item--danger:hover {
  background: rgba(var(--ec-danger-rgb), 0.06);
  color: var(--ec-danger);
}

.topbar-profile__logout-form {
  margin: 0;
}

.topbar-user__avatar--lg {
  width: 36px;
  height: 36px;
  min-width: 36px;
  font-size: 13px;
  flex-shrink: 0;
}

/* Botões do topbar harmonizados com a barra (Conta + sino) */
.topbar .btn-secondary {
  background: var(--ec-topbar-control-bg, var(--ec-surface));
  border-color: var(--ec-topbar-control-border, var(--ec-border-2));
  color: var(--ec-topbar-text, var(--ec-text-2));
}

.topbar .btn-secondary:hover:not(:disabled) {
  background: var(--ec-topbar-control-hover-bg, var(--ec-fill-subtle));
  border-color: var(--ec-topbar-control-border, var(--ec-border-2));
  color: var(--ec-topbar-text, var(--ec-text));
}

.topbar .btn-secondary:active:not(:disabled) {
  background: var(--ec-topbar-control-active-bg, var(--ec-border));
  color: var(--ec-topbar-text, var(--ec-text));
}

.topbar .btn-secondary[aria-expanded="true"] {
  background: var(--ec-topbar-control-active-bg, rgba(var(--ec-ui-accent-rgb), 0.12));
  border-color: var(--ec-topbar-control-border, var(--ec-border-2));
  color: var(--ec-topbar-text, var(--ec-text));
}

/* --- Notificações (sino + inbox) — identidade EC --- */
.topbar-notifications {
  position: relative;
  flex-shrink: 0;
}

.topbar-notifications__btn {
  position: relative;
  padding: 6px 9px;
  min-width: 36px;
  justify-content: center;
}

.topbar-notifications--has-unread .topbar-notifications__btn {
  border-color: var(--ec-ui-secondary);
  box-shadow: 0 0 0 1px rgba(var(--ec-ui-secondary-rgb), 0.2);
}

.topbar-notifications__btn--pulse {
  animation: ec-notif-bell-pulse 0.55s ease;
}

@keyframes ec-notif-bell-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
}

.topbar-notifications__icon-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
}

.topbar-notifications__btn.notif-bell--danger .topbar-notifications__icon-svg,
.topbar-notifications__btn.notif-bell--danger {
  color: var(--ec-danger);
}

.topbar-notifications__btn.notif-bell--warn .topbar-notifications__icon-svg,
.topbar-notifications__btn.notif-bell--warn {
  color: var(--ec-warning);
}

.topbar-notifications__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ec-ui-secondary, var(--ec-brand-secondary));
  color: var(--ec-btn-on-accent, #fff);
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--ec-topbar-bg, var(--ec-surface));
  box-shadow: 0 1px 4px rgba(var(--ec-ui-secondary-rgb), 0.45);
  animation: ec-notif-badge-pop 0.35s ease;
}

@keyframes ec-notif-badge-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.topbar-notifications__panel,
.ec-notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  width: min(380px, calc(100vw - 24px));
  max-height: min(480px, calc(100vh - 80px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg, 12px);
  box-shadow: var(--ec-shadow-md, 0 12px 32px rgba(var(--ec-ui-accent-rgb), 0.12));
}

/* display:flex acima anulava o atributo hidden em alguns browsers */
.topbar-notifications__panel[hidden],
.ec-notif-panel[hidden] {
  display: none !important;
}

.ec-notif-panel::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--ec-ui-accent) 0%,
    var(--ec-ui-secondary) 100%
  );
  flex-shrink: 0;
}

.ec-notif-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--ec-border);
}

.ec-notif-panel__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ec-notif-panel__brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ec-radius);
  background: var(--ec-ui-accent-muted);
  color: var(--ec-ui-accent);
  flex-shrink: 0;
}

.ec-notif-panel__brand-mark .ui-icon {
  width: 18px;
  height: 18px;
}

.ec-notif-panel__title {
  display: block;
  font-size: var(--ec-text-md, 15px);
  font-weight: 700;
  color: var(--ec-text);
}

.ec-notif-panel__summary {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.ec-notif-panel__filters-wrap {
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--ec-border);
}

.ec-notif-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ec-notif-cats--page {
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ec-border);
}

.ec-notif-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ec-text-2);
  text-decoration: none;
  border: 1px solid var(--ec-border);
  border-radius: 999px;
  background: var(--ec-surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

button.ec-notif-cat {
  font-family: inherit;
}

.ec-notif-cat:hover {
  border-color: rgba(var(--ec-ui-accent-rgb), 0.35);
  color: var(--ec-ui-accent);
}

.ec-notif-cat--active {
  background: var(--ec-ui-accent-muted);
  border-color: rgba(var(--ec-ui-accent-rgb), 0.45);
  color: var(--ec-ui-accent-strong);
  font-weight: 600;
}

.ec-notif-cat__count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ec-ui-secondary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.ec-notif-cat--active .ec-notif-cat__count {
  background: var(--ec-ui-accent);
}

.ec-notif-cat__count--danger {
  background: rgba(var(--ec-danger-rgb), 0.14);
  color: var(--ec-danger);
}

.ec-notif-cat__count--warn {
  background: rgba(var(--ec-warning-rgb), 0.14);
  color: var(--ec-warning);
}

.ec-notif-kbd-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-family: inherit;
  border: 1px solid var(--ec-border);
  border-radius: 4px;
  background: var(--ec-surface-2);
}

.ec-notif-panel__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.ec-notif-feed {
  list-style: none;
  margin: 0;
  padding: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  max-height: none;
}

.topbar-notifications__panel .ec-notif-panel__body {
  max-height: min(360px, calc(100vh - 140px));
}

.ec-notif-feed--page {
  max-height: none;
  padding: 8px;
}

.ec-notif-item {
  margin: 0;
  position: relative;
}

.ec-notif-item--incoming {
  animation: ec-notif-item-in 0.35s ease;
}

@keyframes ec-notif-item-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ec-notif-item--read-anim .ec-notif-item__link {
  animation: ec-notif-read-fade 0.4s ease;
}

@keyframes ec-notif-read-fade {
  from {
    background: var(--ec-ui-accent-muted);
  }
  to {
    background: transparent;
  }
}

.ec-notif-item__link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px;
  padding-right: 36px;
  border-radius: var(--ec-radius);
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.ec-notif-item__link:hover {
  background: var(--ec-fill-subtle);
  border-color: var(--ec-border);
}

.ec-notif-item--unread .ec-notif-item__link {
  background: var(--ec-ui-accent-muted);
  border-color: rgba(var(--ec-ui-accent-rgb), 0.12);
}

.ec-notif-item--unread.ec-notif-item--danger .ec-notif-item__link {
  background: rgba(var(--ec-danger-rgb), 0.07);
  border-color: rgba(var(--ec-danger-rgb), 0.2);
}

.ec-notif-item--unread.ec-notif-item--warn .ec-notif-item__link {
  background: rgba(var(--ec-warning-rgb), 0.08);
  border-color: rgba(var(--ec-warning-rgb), 0.22);
}

.ec-notif-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--ec-radius);
  flex-shrink: 0;
  background: var(--ec-surface-2);
  color: var(--ec-text-muted);
}

.ec-notif-item__icon--accent {
  background: var(--ec-ui-accent-muted);
  color: var(--ec-ui-accent);
}

.ec-notif-item__icon--success {
  background: rgba(var(--ec-success-rgb), 0.12);
  color: var(--ec-success);
}

.ec-notif-item__icon--neutral {
  background: var(--ec-surface-2);
  color: var(--ec-text-muted);
}

.ec-notif-item__icon--warn {
  background: rgba(var(--ec-warning-rgb), 0.12);
  color: var(--ec-warning);
}

.ec-notif-item__icon--danger {
  background: rgba(var(--ec-danger-rgb), 0.1);
  color: var(--ec-danger);
}

.ec-notif-item__svg {
  width: 18px;
  height: 18px;
}

.ec-notif-item__content {
  flex: 1;
  min-width: 0;
}

.ec-notif-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 3px;
  width: 100%;
}

.ec-notif-item__chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ec-surface-2);
  color: var(--ec-text-muted);
}

.ec-notif-item--unread .ec-notif-item__chip {
  background: rgba(var(--ec-ui-accent-rgb), 0.14);
  color: var(--ec-ui-accent-strong);
}

.ec-notif-item--danger.ec-notif-item--unread .ec-notif-item__chip {
  background: rgba(var(--ec-danger-rgb), 0.14);
  color: var(--ec-danger);
}

.ec-notif-item__when {
  font-size: 11px;
  color: var(--ec-text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.ec-notif-item__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ec-ui-secondary);
  flex-shrink: 0;
}

.ec-notif-item__mark {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
  background: var(--ec-surface);
  color: var(--ec-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 2;
}

.ec-notif-item__mark .ui-icon {
  width: 14px;
  height: 14px;
}

.ec-notif-item:hover .ec-notif-item__mark,
.ec-notif-item:focus-within .ec-notif-item__mark {
  opacity: 1;
}

.ec-notif-item__mark:hover {
  background: var(--ec-ui-accent-muted);
  border-color: rgba(var(--ec-ui-accent-rgb), 0.35);
  color: var(--ec-ui-accent);
}

.ec-notif-item--compact .ec-notif-item__mark {
  right: 6px;
}

.ec-notif-item__title {
  display: block;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ec-text);
}

.ec-notif-item__body {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ec-text-2);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ec-notif-item__time {
  display: block;
  font-size: 11px;
  color: var(--ec-text-muted);
  margin-top: 6px;
}

.ec-notif-item__chevron {
  flex-shrink: 0;
  align-self: center;
  font-size: 18px;
  line-height: 1;
  color: var(--ec-text-subtle);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.ec-notif-item__link:hover .ec-notif-item__chevron {
  opacity: 1;
  transform: translateX(2px);
}

.ec-notif-item--full .ec-notif-item__chevron {
  opacity: 0.5;
}

.ec-notif-empty {
  padding: 28px 20px;
  text-align: center;
}

.ec-notif-empty--page {
  padding: 48px 24px;
}

.ec-notif-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--ec-ui-accent-muted);
  color: var(--ec-ui-accent);
}

.ec-notif-empty__icon .ui-icon {
  width: 24px;
  height: 24px;
}

.ec-notif-empty__title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: var(--ec-text-md);
  color: var(--ec-text);
}

.ec-notif-empty__hint {
  margin: 0;
  font-size: 13px;
}

.ec-notif-panel__loading[hidden],
.ec-notif-empty[hidden] {
  display: none !important;
}

.ec-notif-panel__loading {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ec-notif-skeleton {
  display: block;
  height: 52px;
  border-radius: var(--ec-radius);
  background: linear-gradient(
    90deg,
    var(--ec-fill-subtle) 25%,
    var(--ec-surface-2) 50%,
    var(--ec-fill-subtle) 75%
  );
  background-size: 200% 100%;
  animation: ec-notif-shimmer 1.2s ease infinite;
}

.ec-notif-skeleton--short {
  width: 70%;
}

@keyframes ec-notif-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.ec-notif-panel__foot {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--ec-border);
  background: var(--ec-surface-2);
}

.ec-notif-panel__foot-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 14px 4px;
  border-bottom: 1px solid var(--ec-border);
}

.ec-notif-panel__load-more {
  display: block;
  width: 100%;
  padding: 8px 14px;
  text-align: center;
}

.ec-notif-item__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: var(--ec-ui-accent-muted);
  color: var(--ec-ui-accent);
}

.ec-notif-panel__footer-link {
  display: block;
  padding: 11px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ec-ui-accent);
  text-decoration: none;
  transition: background 0.15s;
}

.ec-notif-panel__footer-link:hover {
  background: var(--ec-ui-accent-muted);
}

.ec-notif-panel__footer-link--muted {
  font-weight: 500;
  font-size: 12px;
  color: var(--ec-text-muted);
  padding-top: 0;
  padding-bottom: 12px;
}

.ec-notif-panel__footer-link--muted:hover {
  color: var(--ec-ui-accent);
  background: transparent;
}

/* Inbox /notifications */
.ec-notif-inbox {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ec-notif-inbox__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.ec-notif-inbox__stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
}

.ec-notif-inbox__stat strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--ec-ui-accent);
  line-height: 1;
}

.ec-notif-inbox__stat--accent strong {
  color: var(--ec-ui-secondary);
}

.ec-notif-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--ec-radius);
  background: var(--ec-fill-subtle);
  border: 1px solid var(--ec-border);
}

.ec-notif-tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ec-text-2);
  text-decoration: none;
  border-radius: calc(var(--ec-radius) - 2px);
  transition: background 0.15s, color 0.15s;
}

.ec-notif-tab:hover {
  color: var(--ec-text);
}

.ec-notif-tab--active {
  background: var(--ec-surface);
  color: var(--ec-ui-accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ec-notif-inbox__feed {
  padding: 0;
  overflow: hidden;
}

.ec-notif-inbox__stat-total {
  font-size: 13px;
  padding-left: 12px;
  border-left: 1px solid var(--ec-border);
}

.ec-notif-inbox__group {
  border-bottom: 1px solid var(--ec-border);
}

.ec-notif-inbox__group:last-of-type {
  border-bottom: none;
}

.ec-notif-inbox__group-title {
  margin: 0;
  padding: 12px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ec-text-muted);
  background: var(--ec-surface-2);
}

.ec-notif-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--ec-border);
  background: var(--ec-surface-2);
}

.ec-notif-pager__btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--ec-ui-accent);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--ec-radius);
  transition: background 0.15s;
}

.ec-notif-pager__btn:hover {
  background: var(--ec-ui-accent-muted);
}

.ec-notif-pager__info {
  font-size: 12px;
}

.ec-notif-pref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.ec-notif-pref-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
  background: var(--ec-surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ec-notif-pref-card:hover {
  border-color: rgba(var(--ec-ui-accent-rgb), 0.35);
  background: var(--ec-fill-subtle);
}

.ec-notif-pref-card:has(input:checked) {
  border-color: rgba(var(--ec-ui-accent-rgb), 0.45);
  box-shadow: 0 0 0 3px var(--ec-ui-accent-muted);
}

.ec-notif-pref-card:has(input:not(:checked)) {
  opacity: 0.72;
}

.ec-notif-pref-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ec-notif-pref-card__icon {
  flex-shrink: 0;
}

.ec-notif-pref-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  min-width: 0;
}

.ec-notif-pref-card__text strong {
  color: var(--ec-text);
  font-size: 14px;
}

.page-content,
.page-wrapper {
  padding: var(--ec-page-padding) var(--ec-page-padding-inline) var(--ec-page-padding-block-end);
  max-width: none;
  margin-inline: 0;
  width: 100%;
  background: var(--ec-main-canvas);
  box-sizing: border-box;
}

.page-content a:not([class]) {
  color: var(--ec-ui-accent);
  text-decoration: none;
}

.page-content a:not([class]):hover {
  text-decoration: underline;
}

/* Desktop: sidebar e área principal rolam em eixos independentes (altura fixa ao viewport) */
@media (min-width: 901px) {
  .app-shell {
    height: 100vh;
    max-height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .sidebar {
    overscroll-behavior: contain;
  }

  .main-content {
    overflow: hidden;
  }

  .topbar {
    position: relative;
    top: auto;
  }

  .page-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar,
  .page-content {
    scrollbar-width: thin;
    scrollbar-color: var(--ec-border-2) transparent;
  }

  .sidebar::-webkit-scrollbar,
  .page-content::-webkit-scrollbar {
    width: 9px;
    height: 9px;
  }

  .sidebar::-webkit-scrollbar-thumb,
  .page-content::-webkit-scrollbar-thumb {
    background-color: var(--ec-border-2);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
  }

  .sidebar::-webkit-scrollbar-thumb:hover,
  .page-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--ec-text-subtle);
  }
}

@media (max-width: 1023px) {
  .page-content,
  .page-wrapper {
    padding: var(--ec-page-padding-mobile) var(--ec-page-padding-mobile-inline);
    padding-bottom: max(var(--ec-page-padding-mobile), env(safe-area-inset-bottom, 0));
  }

  .calendar-mount {
    min-height: 320px;
  }

  .field-scan input,
  .input-touch-lg {
    min-height: 44px;
    font-size: 16px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 44px;
    font-size: 16px;
  }

  th,
  td {
    padding: 10px 12px;
    font-size: var(--ec-font-size-topbar-meta);
  }

  .btn {
    min-height: 42px;
    padding: 10px 14px;
  }

  .btn.btn--compact {
    min-height: 0;
  }

  .form-page-jump {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .topbar h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ---- Responsivo: topbar, notificações, toolbars, tabelas, modais ---- */
@media (max-width: 640px) {
  .topbar {
    gap: 6px;
    padding: 8px 10px;
  }

  .topbar__actions {
    gap: 6px;
  }

  .topbar__actions-end {
    gap: 5px;
    flex-wrap: nowrap;
  }

  /* Não ocultar .topbar-search--overlay (painel da lupa em mobile) */
  .topbar__center .topbar-search {
    display: none;
  }

  .topbar-profile__dropdown {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    min-width: 100%;
    border-radius: var(--ec-radius-lg) var(--ec-radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 32px rgba(var(--ec-primary-rgb), 0.18);
  }

  .topbar-notifications__panel.ec-notif-panel,
  .ec-notif-panel.topbar-notifications__panel {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: min(85dvh, 85vh);
    border-radius: var(--ec-radius-lg) var(--ec-radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 32px rgba(var(--ec-primary-rgb), 0.18);
  }

  .page-toolbar--stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .page-toolbar--stack > .btn,
  .page-toolbar--stack > form,
  .page-toolbar--stack > a.btn {
    width: 100%;
    justify-content: center;
    margin: 0;
  }

  .page-toolbar--stack > .page-toolbar__more {
    grid-column: 1 / -1;
  }

  .page-toolbar--overflow:not(.page-toolbar--stack) {
    gap: 6px;
  }

  .ec-modal {
    padding: 0;
    align-items: flex-end;
  }

  .ec-modal__panel {
    width: 100%;
    max-height: min(92dvh, 92vh);
    border-radius: var(--ec-radius-lg) var(--ec-radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .ec-modal--drawer {
    align-items: stretch;
  }

  .ec-modal--drawer .ec-modal__panel {
    width: 100%;
    max-height: 100dvh;
    border-left: none;
    border-radius: 0;
  }
}

@media (max-width: 1023px) {
  .table-scroll,
  .table-wrap--os-list {
    max-height: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .card-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .filter-bar__actions {
    flex-wrap: wrap;
  }

  .filter-bar__actions .btn {
    flex: 1 1 auto;
    min-width: min(100%, 8rem);
  }

  .calendar-mount .fc-header-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .calendar-mount .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
}

.cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
}

.card {
  background: var(--ec-surface);
  border-radius: var(--ec-radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--ec-border);
  box-shadow: var(--ec-shadow-sm);
}

.card--error {
  border: 1px solid var(--ec-danger-border);
  background: var(--ec-danger-bg);
  color: var(--ec-danger-text);
  box-shadow: inset 3px 0 0 var(--ec-danger);
}

.card--danger-zone {
  border-color: var(--ec-danger-border);
  background: var(--ec-danger-bg);
}

.card--danger-soft {
  border-color: rgba(185, 28, 28, 0.22);
}

.callout-warn {
  border: 1px solid var(--ec-warning-border);
  background: var(--ec-warning-bg);
  color: var(--ec-warning-text);
  box-shadow: inset 3px 0 0 var(--ec-warning);
  padding: 10px 12px 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--ec-radius-md);
}

.field--tight {
  margin: 0;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.ml-8 {
  margin-left: 8px;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.m-0 {
  margin: 0;
}

.mr-4 {
  margin-right: 4px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.self-start {
  align-self: flex-start;
}

.self-center {
  align-self: center;
}

.departure-page-title {
  margin: 8px 0 4px;
  color: var(--ec-primary);
}

.page-actions__delete-form {
  display: inline-block;
  margin-left: auto;
}

.form-delete-divider {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ec-border);
}

.inline-form--table-cell {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}

.form-inline--spaced {
  margin-left: 6px;
}

.perm-edit-toolbar {
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.perm-fieldset {
  margin: 0 0 20px;
  border: 1px solid var(--ec-border);
  border-radius: 8px;
  padding: 12px 16px;
}

.perm-fieldset:last-of-type {
  margin-bottom: 0;
}

.perm-fieldset__legend {
  font-weight: 600;
  padding: 0 8px;
}

.perm-perm-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.label--flex-start {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.label--checkbox-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.form-actions--footer {
  margin-top: 16px;
}

.checklist-upload-hint {
  margin: 6px 0;
  font-size: var(--ec-text-sm);
}

.checklist-item-note {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: var(--ec-text-sm);
}

.settings-page-title {
  margin: 0 0 8px;
  font-size: var(--ec-text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ec-primary);
}

.settings-nav-hint {
  margin: 8px 8px 0;
  font-size: var(--ec-text-sm);
  line-height: 1.45;
}

.org-readonly-dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.org-readonly-dl dt {
  font-size: var(--ec-text-sm);
  margin: 0;
  color: var(--ec-text-muted);
  font-weight: 600;
}

.org-readonly-dl dd {
  margin: 4px 0 0;
}

.integrations-page-title {
  margin: 0 0 8px;
  font-size: var(--ec-text-xl);
  font-weight: 700;
  color: var(--ec-primary);
}

.integrations-muted-list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.page-toolbar--tight {
  gap: 8px;
  margin-bottom: 12px;
}

.page-toolbar--loose {
  margin-bottom: 20px;
}

.page-toolbar__more {
  position: relative;
}

.page-toolbar__more-trigger {
  cursor: pointer;
}

.page-toolbar__more--open > .page-toolbar__more-trigger {
  background: var(--ec-fill-subtle, #f1f5f9);
}

.page-toolbar__more-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  box-shadow: var(--ec-shadow-md);
  min-width: min(100%, 220px);
}

.page-toolbar__more-menu[hidden] {
  display: none !important;
}

.page-toolbar__more-menu .btn,
.page-toolbar__more-menu form {
  width: 100%;
}

.page-toolbar__more-menu form {
  margin: 0;
}

.page-toolbar__more-heading {
  margin: 8px 0 4px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ec-text-muted);
}

.page-toolbar__more-heading:first-child {
  margin-top: 0;
}

.page-toolbar__more-heading--danger {
  color: var(--ec-danger, #dc2626);
}

.page-toolbar__more-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--ec-radius-sm, 4px);
  background: transparent;
  color: var(--ec-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.page-toolbar__more-item:hover,
.page-toolbar__more-item:focus-visible {
  background: var(--ec-fill-subtle, #f1f5f9);
  outline: none;
}

.page-toolbar__more-item--danger {
  color: var(--ec-danger, #dc2626);
}

.page-toolbar__more-form {
  margin: 0;
}

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

.page-toolbar__more[hidden] {
  display: none !important;
}

.pagination,
.págination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.pagination--spaced,
.págination--spaced {
  margin-top: 12px;
}

.pagination-row,
.págination-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 10px 0 6px;
  margin-bottom: 8px;
}

.pagination-row .btn,
.págination-row .btn {
  min-height: 32px;
  padding: 5px 12px;
  font-size: var(--ec-text-sm);
}

.pagination-row .btn:not(.btn-secondary),
.págination-row .btn:not(.btn-secondary) {
  font-weight: 600;
}

.form--disabled {
  opacity: 0.6;
  pointer-events: none;
}

.td-nowrap {
  white-space: nowrap;
}

.text-mono {
  font-family: ui-monospace, monospace;
  font-size: var(--ec-text-sm);
}

.pre-notes {
  white-space: pre-wrap;
  margin: 8px 0 0;
  font: inherit;
}

.code-break {
  word-break: break-all;
}

.card--flush {
  margin: 0;
}

.card--muted {
  opacity: 0.85;
}

.card--warn {
  border: 1px solid var(--ec-warning-border);
  background: var(--ec-warning-bg);
  color: var(--ec-warning-text);
  box-shadow: inset 3px 0 0 var(--ec-warning);
}

.card--warn-tight {
  padding: 10px 12px;
}

.card--ok {
  border-color: var(--ec-success-border);
  background: var(--ec-success-bg);
  color: var(--ec-success-text);
}

a.trash-module-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.btn.is-disabled,
.btn-secondary.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.checkbox-field.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.card__title--tight {
  margin-bottom: 4px;
}

.card__lede--spaced {
  margin-bottom: 16px;
}

.muted--shift-hint {
  font-size: var(--ec-text-base);
  margin: 4px 0 0;
}

.card__title--danger {
  color: var(--ec-danger);
  margin-bottom: 8px;
}

.card__lede--danger-block {
  margin-bottom: 12px;
}

.dashboard-section-title--flush {
  margin-top: 0;
  margin-bottom: 10px;
}

.settings-hub-grid--spaced {
  margin-top: 16px;
}

.alert.mb-12 {
  margin-bottom: 12px;
}

.card-section-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: var(--ec-text-lg);
  font-weight: 700;
  color: var(--ec-primary);
}

.card-section-title--sm {
  font-size: var(--ec-text-md);
}

.section-heading {
  margin-top: 20px;
  margin-bottom: 0;
  font-size: var(--ec-text-lg);
  font-weight: 700;
  color: var(--ec-primary);
}

.section-heading--lg {
  margin-top: 24px;
  font-size: var(--ec-text-lg);
}

.section-heading--sm {
  font-size: var(--ec-text-md);
}

.page-actions {
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.page-actions--center {
  align-items: center;
}

.form-row-end {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.field.form-row-end {
  flex-direction: row;
  align-items: flex-end;
}

.table-meta {
  margin-bottom: 16px;
  font-size: var(--ec-text-base);
}

.section-title {
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: var(--ec-text-lg);
  font-weight: 700;
  color: var(--ec-primary);
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
}

.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.card--grow {
  flex: 1;
  min-width: 260px;
}

.card--narrow {
  max-width: 420px;
}

.card__title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: var(--ec-text-md);
  color: var(--ec-text);
}

.card__title:first-child {
  margin-top: 0;
}

.card__title--primary {
  color: var(--ec-primary);
}

.card__lede {
  margin: 0 0 8px;
  font-size: var(--ec-text-base);
  color: var(--ec-text-muted);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field.form-grid-2 {
  display: grid;
  flex-direction: unset;
}

.form-grid-2__full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .field.form-grid-2 {
    grid-template-columns: 1fr;
  }
}

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

.form-inline {
  display: inline;
  margin: 0;
}

.table-actions {
  white-space: nowrap;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.field--search-wide {
  min-width: 16rem;
  flex: 1 1 12rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-w-6 {
  width: 6rem;
  max-width: 100%;
}

.input-w-5 {
  width: 5rem;
  max-width: 100%;
}

.input-w-7 {
  width: 7rem;
  max-width: 100%;
}

.input-w-8 {
  width: 8rem;
  max-width: 100%;
}

.input-w-10 {
  width: 10rem;
  max-width: 100%;
}

.input-w-notes {
  min-width: 12rem;
  flex: 1 1 8rem;
  max-width: 100%;
}

.input-min-14 {
  min-width: 14rem;
  max-width: 100%;
}

.card-toolbar {
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.form-page-jump {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-left: auto;
}

.form-actions-mt {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ============================================================
   ITEM FORM — legacy sectioned layout (@deprecated: use .ec-form-section)
   ============================================================ */
.item-form-sections {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.item-form-section {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--ec-border);
}

.item-form-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ec-list-card-header,
.item-form-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ec-border);
  margin-bottom: 16px;
}

.ec-list-card-header--compact {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--ec-border);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ec-list-card-header--compact.ec-list-card-header--mb-16 {
  margin-bottom: 16px;
}

.item-form-section__icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--ec-fill-subtle);
  color: var(--ec-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ec-text-base);
  flex-shrink: 0;
}

.item-form-section__title {
  font-size: var(--ec-text-base);
  font-weight: 700;
  color: var(--ec-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

.item-form-section__subtitle {
  font-size: var(--ec-text-sm);
  color: var(--ec-text-muted);
  margin: 0;
}

/* Type-pill radio selector */
.item-type-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.item-type-pill {
  position: relative;
}

.item-type-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.item-type-pill__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border: 2px solid var(--ec-border);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  background: var(--ec-surface);
  user-select: none;
}

.item-type-pill__label:hover {
  border-color: var(--ec-ui-accent);
  background: var(--ec-ui-accent-muted-hover);
  color: var(--ec-text);
}

.item-type-pill__label:active {
  background: var(--ec-ui-accent-muted-active);
  border-color: var(--ec-ui-accent-strong);
  color: var(--ec-text);
}

.item-type-pill input[type="radio"]:checked + .item-type-pill__label {
  border-color: var(--ec-ui-accent);
  background: var(--ec-ui-accent-muted);
  color: var(--ec-text);
}

.item-type-pill input[type="radio"]:focus-visible + .item-type-pill__label {
  outline: 2px solid rgba(var(--ec-ui-accent-rgb), 0.45);
  outline-offset: 2px;
}

.item-type-pill__icon {
  font-size: var(--ec-text-xl);
  line-height: 1;
}

.item-type-pill__name {
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: inherit;
}

.item-type-pill__hint {
  font-size: var(--ec-text-xs);
  color: var(--ec-text-muted);
  line-height: 1.3;
}

.item-type-pill input[type="radio"]:checked + .item-type-pill__label .item-type-pill__name {
  color: var(--ec-ui-accent);
}

.item-type-pill input[type="radio"]:checked + .item-type-pill__label .item-type-pill__hint {
  color: var(--ec-text-muted);
}

/* Unit free-text toggle */
.unit-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.unit-free-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ec-text-sm);
  color: var(--ec-text-muted);
  cursor: pointer;
  user-select: none;
  width: fit-content;
}

.unit-free-toggle input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.field-required {
  color: var(--ec-danger);
  margin-left: 2px;
}

/* form field hint inline */
.field-hint {
  font-size: var(--ec-text-sm);
  color: var(--ec-text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* Required star */
.req {
  color: var(--ec-danger);
  margin-left: 2px;
}

@media (max-width: 640px) {
  .item-type-pills {
    grid-template-columns: repeat(2, 1fr);
  }
}

.btn-secondary.btn--outline-danger {
  border-color: var(--ec-danger);
  color: var(--ec-danger);
}

.btn-secondary.btn--outline-danger:hover:not(:disabled) {
  background: var(--ec-danger-bg);
  border-color: var(--ec-danger);
  color: var(--ec-danger-text);
}

.btn--compact {
  padding: 6px 10px;
  font-size: var(--ec-text-base);
}

.ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ops-toolbar__label {
  font-size: var(--ec-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ec-text-muted);
  margin-right: 4px;
}

.card--compact {
  padding: 10px 12px;
}

.card .value {
  font-size: var(--ec-text-3xl);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ec-surface);
  border-radius: var(--ec-radius-lg);
  border: 1px solid var(--ec-border);
  box-shadow: var(--ec-shadow-sm);
}

.table-empty {
  text-align: center;
  color: var(--ec-text-muted);
  padding: 20px 10px;
}

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

th,
td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--ec-border);
  text-align: left;
  font-size: var(--ec-text-base);
  line-height: 1.45;
}

th {
  background: var(--ec-surface-2);
  color: var(--ec-text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--ec-border);
}

tbody tr {
  transition: background 0.08s ease;
}

tbody tr:hover {
  background: var(--ec-fill-subtle);
}

.badge {
  padding: var(--ec-badge-padding-y) var(--ec-badge-padding-x);
  border-radius: 999px;
  font-size: var(--ec-badge-font-size);
  font-weight: 600;
  letter-spacing: var(--ec-badge-letter-spacing);
  text-transform: uppercase;
  display: inline-block;
  line-height: var(--ec-badge-line-height);
  vertical-align: middle;
  white-space: nowrap;
  border: var(--ec-badge-border-width) solid transparent;
  margin: 0;
}

.badge--sm {
  font-size: var(--ec-badge-font-size-sm);
  padding: var(--ec-badge-padding-y) var(--ec-badge-padding-x-sm);
}

.badge--lg {
  font-size: var(--ec-badge-font-size-lg);
  padding: var(--ec-badge-padding-y-lg) var(--ec-badge-padding-x-lg);
}

a.badge {
  text-decoration: none;
  cursor: pointer;
}

a.badge:hover {
  filter: brightness(0.97);
}

.badge.ok {
  background: var(--ec-success-bg);
  color: var(--ec-success-text);
  border: 1px solid var(--ec-success-border);
}

.badge.warn {
  background: var(--ec-warning-bg);
  color: var(--ec-warning-text);
  border: 1px solid var(--ec-warning-border);
}

.badge.danger {
  background: var(--ec-danger-bg);
  color: var(--ec-danger-text);
  border: 1px solid var(--ec-danger-border);
}

.badge.info {
  background: var(--ec-info-bg);
  color: var(--ec-info-text);
  border: 1px solid var(--ec-info-border);
}

.badge.muted,
.badge.neutral {
  background: var(--ec-status-closed-bg);
  color: var(--ec-status-closed-text);
  border: 1px solid var(--ec-status-closed-border);
}

.btn {
  border: 1px solid var(--ec-ui-accent);
  background: var(--ec-ui-accent);
  color: var(--ec-btn-on-accent, #fff);
  padding: 7px 16px;
  border-radius: var(--ec-radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-size: var(--ec-text-base);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  white-space: nowrap;
  box-shadow: none;
}

.btn:hover:not(:disabled) {
  background: var(--ec-ui-accent-strong);
  border-color: var(--ec-ui-accent-strong);
  color: var(--ec-btn-on-accent, #fff);
  box-shadow: none;
}

.btn:active:not(:disabled) {
  background: color-mix(in srgb, var(--ec-ui-accent-strong) 88%, #000);
  border-color: color-mix(in srgb, var(--ec-ui-accent-strong) 88%, #000);
  color: var(--ec-btn-on-accent, #fff);
}

.btn:focus-visible {
  outline: 2px solid rgba(var(--ec-ui-accent-rgb), 0.45);
  outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--ec-fill-subtle);
  color: var(--ec-primary);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  font-weight: 500;
  box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--ec-fill-subtle-hover);
  border-color: var(--ec-border-strong);
  color: var(--ec-primary);
}

.btn-secondary:active:not(:disabled) {
  background: var(--ec-fill-subtle-hover);
  border-color: var(--ec-border-strong);
  color: var(--ec-primary);
}

.btn-danger {
  border-color: var(--ec-danger);
  background: var(--ec-danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ec-danger) 80%, #000);
  border-color: color-mix(in srgb, var(--ec-danger) 80%, #000);
  color: #fff;
}

.muted {
  color: var(--ec-text-muted);
  font-size: var(--ec-text-md);
  margin: 0 0 12px;
}

/* Tom neutral/muted do badge — depois do utilitário .muted para não herdar 15px */
.badge.neutral,
.badge.muted {
  margin: 0;
  font-size: var(--ec-badge-font-size);
  font-weight: 600;
  letter-spacing: var(--ec-badge-letter-spacing);
  text-transform: uppercase;
  line-height: var(--ec-badge-line-height);
}

.badge.badge--sm.neutral,
.badge.badge--sm.muted {
  font-size: var(--ec-badge-font-size-sm);
  padding: var(--ec-badge-padding-y) var(--ec-badge-padding-x-sm);
}

.muted--12 {
  font-size: var(--ec-text-sm);
}

.muted--11 {
  font-size: var(--ec-text-xs);
}

.muted.muted-hint-block {
  margin: -4px 0 12px;
  font-size: var(--ec-text-base);
}

.muted.muted-hint-block--export {
  margin: -8px 0 12px;
  font-size: var(--ec-text-base);
}

/* Dashboard */
.dashboard-welcome {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ec-border);
}

.dashboard-welcome__greet {
  margin: 0 0 4px;
  font-size: var(--ec-text-2xl);
  font-weight: 700;
  color: var(--ec-primary);
}

.dashboard-welcome__date {
  margin: 0;
}

.dash-alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.dash-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--ec-radius-md);
  border: 1px solid;
  font-size: var(--ec-text-base);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}

.dash-alert--warn {
  border-color: rgba(var(--ec-warning-rgb), 0.4);
  background: rgba(var(--ec-warning-rgb), 0.07);
}

.dash-alert--warn:hover {
  background: rgba(var(--ec-warning-rgb), 0.12);
}

.dash-alert--danger {
  border-color: rgba(var(--ec-primary-rgb), 0.12);
  background: rgba(229, 62, 62, 0.06);
}

.dash-alert--danger:hover {
  background: rgba(229, 62, 62, 0.10);
}

.dash-alert__icon {
  font-size: var(--ec-text-md);
  flex-shrink: 0;
}

.dashboard-section-title {
  margin: 20px 0 10px;
  font-size: var(--ec-text-md);
  font-weight: 700;
  color: var(--ec-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-section-title:first-of-type {
  margin-top: 0;
}

.dashboard-quick-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 8px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--ec-shadow-sm);
}

.quick-action:hover {
  border-color: var(--ec-ui-accent);
  box-shadow: var(--ec-shadow-md);
}

.quick-action__title {
  font-weight: 700;
  font-size: var(--ec-text-lg);
  color: var(--ec-primary);
}

.quick-action__hint {
  font-size: var(--ec-text-sm);
  color: var(--ec-text-muted);
  line-height: 1.35;
}

@media (max-width: 1023px) {
  .dashboard-quick-grid {
    grid-template-columns: 1fr;
  }
}


/* --- Etiqueta / QR do item (impressao) --- */
@media print {
  html,
  body,
  body.page-print {
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .app-shell {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .page-content {
    overflow: visible !important;
  }

  .no-print {
    display: none !important;
  }

  .label-sheet {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    margin: 0 auto !important;
  }
}

.label-sheet {
  max-width: 320px;
  margin: 24px auto;
  padding: 20px;
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  text-align: center;
  background: var(--ec-surface);
}

.label-sheet h1 {
  font-size: var(--ec-text-lg);
  margin: 0 0 4px;
  color: var(--ec-primary);
}

.label-sheet .sku {
  font-size: var(--ec-text-base);
  font-weight: 600;
}

.label-sheet .scan {
  font-family: ui-monospace, monospace;
  font-size: var(--ec-font-size-topbar-meta);
  margin: 8px 0;
  word-break: break-all;
}

.label-sheet img {
  display: block;
  margin: 12px auto;
}

/* --- Tabela de dados genérica --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ec-text-base);
}

.data-table th,
table thead th {
  padding: 8px 12px;
  text-align: left;
  font-size: var(--ec-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ec-table-header-text, var(--ec-text-muted));
  background: var(--ec-table-header-bg);
  border-bottom: 1px solid var(--ec-border-strong);
}

.data-table td,
table tbody td {
  padding: 10px 12px;
  color: var(--ec-primary);
  border-bottom: 1px solid var(--ec-table-border);
  vertical-align: middle;
}

.data-table tbody tr:hover td,
table tbody tr:hover td {
  background: var(--ec-table-row-hover);
}

.data-table tbody tr.is-overdue {
  background: var(--ec-danger-bg);
}

/* --- Campo obrigatório (alternativa a .req) --- */
.field-required {
  color: var(--ec-danger);
  margin-left: 2px;
}

/* --- Branding: swatches de preset e fonte --- */
.preset-swatch {
  width: 64px;
  height: 44px;
  border-radius: var(--ec-radius-md);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: none;
  cursor: pointer;
}

.preset-swatch--active,
.preset-swatch:has(+ input:checked) {
  border-color: var(--ec-brand-warm);
  box-shadow: 0 0 0 1px rgba(var(--ec-brand-warm-rgb), 0.35);
}

.font-swatch {
  padding: 8px 16px;
  border-radius: var(--ec-radius-md);
  border: 2px solid var(--ec-border);
  transition: border-color 0.15s;
  cursor: pointer;
}

.font-swatch--active {
  border-color: var(--ec-brand-warm);
  box-shadow: 0 0 0 1px rgba(var(--ec-brand-warm-rgb), 0.3);
}

/* --- Estado vazio genérico --- */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--ec-text-muted);
}

/* --- Botão extra-pequeno (tabelas densas) --- */
.btn--xs {
  font-size: var(--ec-text-sm);
  padding: 3px 8px;
}

/* --- Utilitários de margem --- */
.mt-4 {
  margin-top: 4px;
}

.mb-4 {
  margin-bottom: 4px;
}

/* --- Utilitário de texto muted --- */
.muted--13 {
  font-size: var(--ec-text-sm);
  color: var(--ec-text-muted);
}

/* --- Painel de filtro inline (togglável) --- */
.hidden {
  display: none !important;
}

.filter-panel {
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* --- Painel de formulário inline (togglável) --- */
.inline-panel {
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

/* --- Rodapé de tabela com link --- */
.table-footer-link {
  padding: 10px 0 0;
  text-align: right;
}

/* --- Célula de tabela com truncate --- */
.td-truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Célula de empty state em tabela --- */
.td-empty-state {
  text-align: center;
  padding: 40px 0;
  color: var(--ec-text-muted);
}

/* --- Links em células de tabela --- */
.td-link-bold {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.td-link-bold:hover {
  text-decoration: underline;
}

.td-link-inherit {
  color: inherit;
  text-decoration: none;
}

.td-link-inherit:hover {
  text-decoration: underline;
}



/* --- Rótulo de campo de detalhe (show pages) --- */
.detail-label {
  font-size: var(--ec-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ec-text-muted);
  display: block;
  margin-bottom: 2px;
}


/* --- Célula com fonte monospace --- */
.td-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--ec-text-sm);
}

/* ==================================================================
   SHELL DE PÁGINA (.ec-page) — padrão dashboard em todo o ERP
   ================================================================== */
.page-content:has(.ec-page) {
  background: var(--ec-bg);
}

.ec-page {
  color: var(--ec-primary);
  width: 100%;
  max-width: min(1280px, 100%);
  margin-inline: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ec-page > .page-header,
.ec-page > .page-header.mb-12,
.ec-page > .page-header.mb-16,
.ec-page > .related-links,
.ec-page > .alert,
.ec-page > .ec-tabs,
.ec-page > .db-kpi-row,
.ec-page > .db-layout,
.ec-page > .page--dashboard,
.ec-page > .page--finance,
.ec-page > .os-list-layout {
  margin-bottom: 0;
}

/* Cartões de filtro / secção */
.ec-page > .card,
.ec-page .card.mb-16,
.ec-page .card.mb-12,
.ec-page .card.p-16,
.ec-page .os-kpi-more.card {
  background: var(--ec-surface, #fff);
  border: 1px solid var(--ec-border, #e2e8f0);
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  margin-bottom: 0;
}

.ec-page .card-section-title,
.ec-page .item-form-section__title,
.ec-page h3.card-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ec-text, #0f172a);
  margin: 0 0 16px;
  letter-spacing: .01em;
}

.ec-page .table-wrap {
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* Abas internas = estilo dashboard */
.ec-page .ec-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--ec-border, #e2e8f0);
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.ec-page .ec-tabs__btn {
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ec-text-muted, #64748b);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

.ec-page .ec-tabs__btn:hover,
.ec-page .ec-tabs__btn.is-active {
  color: var(--ec-text, #0f172a);
}

.ec-page .ec-tabs__btn.is-active {
  border-bottom-color: var(--ec-text, #0f172a);
  font-weight: 600;
}

/* Lista OS — alinhar sidebar e filtros */
.ec-page .os-list-sidebar {
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  padding: 16px 18px;
}

.ec-page .os-list-sidebar__title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ec-text-muted, #64748b);
}

.ec-page .os-kpi-more {
  padding: 14px 18px;
}

.ec-page .os-kpi-more__summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--ec-text-muted, #64748b);
  cursor: pointer;
}

.ec-page .os-list-filter-bar {
  background: var(--ec-surface, #fff);
  border: 1px solid var(--ec-border, #e2e8f0);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.ec-page .os-kpi-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ec-page .os-kpi-sidebar__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ec-border, #e2e8f0);
  border-radius: 8px;
  background: var(--ec-surface, #fff);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}

.ec-page .os-kpi-sidebar__item:hover {
  border-color: var(--ec-ui-accent, #2563eb);
}

.ec-page .os-kpi-sidebar__item--active {
  border-color: var(--ec-ui-accent, #2563eb);
  box-shadow: 0 0 0 1px rgba(var(--ec-ui-accent-rgb, 38, 58, 132), 0.1);
}

.ec-page .os-kpi-sidebar__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ec-text-muted, #64748b);
}

.ec-page .os-kpi-sidebar__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ec-text, #0f172a);
  font-variant-numeric: tabular-nums;
}

.ec-page .os-kpi-sidebar__item--alert .os-kpi-sidebar__value {
  color: #dc2626;
}

/* Formulários full-width dentro do shell */
.ec-page .ec-form-page__grid {
  padding-left: 0;
  padding-right: 0;
}

.ec-page .ec-form-page--compact .ec-form-page__grid {
  padding: 0;
}

@media print {
  .ec-page {
    max-width: none;
  }
}

/* ==================================================================
   DASHBOARD (.page--dashboard) — só tokens globais --ec-*
   ================================================================== */
.page--dashboard,
.page--finance {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ec-page:has(.bi-dashboard-page) {
  max-width: min(1440px, 100%);
  overflow: hidden;
}

.page--dashboard .page-header__desc,
.page--dashboard .page-header__breadcrumb,
.page--dashboard .page-header__breadcrumb a {
  color: var(--ec-text-muted);
}

.page--dashboard .page-header__breadcrumb a:hover {
  color: var(--ec-primary);
}

.page--dashboard .related-links,
.page--dashboard .related-links a {
  color: var(--ec-text-muted);
}

.page--dashboard .related-links a:hover,
.page--finance .related-links a:hover {
  color: var(--ec-ui-accent);
}

.page--finance .page-header__desc,
.page--finance .page-header__breadcrumb,
.page--finance .page-header__breadcrumb a,
.page--finance .related-links,
.page--finance .related-links a {
  color: var(--ec-text-muted);
}
.page--finance .page-header__breadcrumb a:hover {
  color: var(--ec-primary);
}

.bi-builder-gridstack-error[hidden] {
  display: none !important;
}
.bi-builder-gridstack-error:not([hidden]) {
  display: flex;
}
.bi-builder-gridstack-error__detail {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
}

/* Finance — tabs e listas alinhados ao dashboard */
.page--finance .ec-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--ec-border, #e2e8f0);
}
.page--finance .ec-tabs__btn {
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ec-text-muted, #64748b);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.page--finance .ec-tabs__btn:hover,
.page--finance .ec-tabs__btn.is-active {
  color: var(--ec-text, #0f172a);
}
.page--finance .ec-tabs__btn.is-active {
  border-bottom-color: var(--ec-text, #0f172a);
  font-weight: 600;
}
.page--finance .db-finance-lists {
  gap: 0;
}
.page--finance .db-finance-lists > .ec-tabs {
  padding: 0 4px;
}
.page--finance #finance-region .card {
  border: 1px solid var(--ec-border, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  margin-bottom: 12px;
}
.page--finance #finance-region .card:last-child {
  margin-bottom: 0;
}
.page--finance .tab-loading {
  padding: 12px 0;
}

/* Dashboard — shadcn/ui */
.db-card {
  background: var(--ec-surface, #fff);
  border: 1px solid var(--ec-border, #e2e8f0);
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.db-card--mb { margin-bottom: 16px; }
.db-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.db-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ec-text, #0f172a);
  margin: 0 0 16px;
  letter-spacing: .01em;
}
.db-card__title--flush { margin-bottom: 0; }
.db-card__hint {
  margin: -8px 0 12px;
  font-size: 12px;
  color: var(--ec-text-muted, #64748b);
}
.db-card__link {
  font-size: 12px;
  color: var(--ec-text-muted, #64748b);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s;
}
.db-card__link:hover { color: var(--ec-text, #0f172a); }

.db-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 20px;
  align-items: start;
  width: 100%;
}
.db-layout__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.db-layout__main > .db-heading,
.db-layout__main > .db-kpi-row,
.db-layout__main > .db-chart-row,
.db-layout__main > .db-two-col,
.db-layout__main > .db-card--mb,
.db-layout__main > .db-section,
.db-layout__main > .db-alerts {
  margin-bottom: 0;
}
.db-layout__rail {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.db-layout__rail .db-alerts,
.db-layout__rail .db-card {
  margin-bottom: 0;
}
.db-layout--stack {
  grid-template-columns: 1fr;
}
.db-layout--stack .db-layout__rail {
  position: static;
  order: -1;
}

.db-kpi-board {
  padding: 0;
  overflow: hidden;
}
.db-kpi-board .db-kpi-section {
  padding: 18px 22px;
}
.db-kpi-board .db-kpi-section + .db-kpi-section {
  padding-top: 14px;
  border-top: 1px solid var(--ec-border, #e2e8f0);
}
.db-kpi-section__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ec-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 12px;
}
.db-kpi-board .db-kpi-row { margin-bottom: 0; }

.db-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.db-section .db-heading,
.db-section .db-heading--spaced {
  margin: 0;
}
.db-section--spaced {
  padding-top: 4px;
  border-top: 1px solid var(--ec-border, #e2e8f0);
}

.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.db-kpi-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.db-kpi-row--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.db-kpi-row--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.db-kpi-row--6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.db-kpi {
  background: var(--ec-surface, #fff);
  border: 1px solid var(--ec-border, #e2e8f0);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: border-color .15s;
}
.db-kpi:hover {
  border-color: var(--ec-ui-accent, #2563eb);
}
a.db-kpi.db-kpi--active,
.db-kpi.db-kpi--active {
  border-color: var(--ec-ui-accent, #2563eb);
  box-shadow: 0 0 0 1px rgba(var(--ec-ui-accent-rgb, 38, 58, 132), 0.12);
}
.db-kpi__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ec-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 4px;
}
.db-kpi__value {
  font-size: 32px;
  font-weight: 700;
  color: var(--ec-text, #0f172a);
  line-height: 1.1;
  letter-spacing: -.03em;
}
.db-kpi__value--sm    { font-size: 22px; letter-spacing: -.02em; }
.db-kpi__value--green { color: #16a34a; }
.db-kpi__value--red   { color: #dc2626; }
.db-kpi__value--amber { color: #d97706; }
.db-kpi__trend {
  font-size: 11.5px;
  color: var(--ec-text-muted, #94a3b8);
  line-height: 1.4;
  margin-top: 2px;
}
.db-kpi__trend--up   { color: #16a34a; }
.db-kpi__trend--down { color: #dc2626; }
.db-kpi__foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ec-border, #f1f5f9);
  font-size: 11.5px;
}
.db-kpi__foot a {
  color: var(--ec-text-muted, #64748b);
  text-decoration: none;
  transition: color .15s;
}
.db-kpi__foot a:hover { color: var(--ec-ui-accent, #2563eb); }
.db-kpi--start { align-self: start; }

.db-kpi__dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.db-kpi__dot--blue   { background: var(--ec-ui-accent, #2563eb); }
.db-kpi__dot--green  { background: #16a34a; }
.db-kpi__dot--red    { background: #dc2626; }
.db-kpi__dot--amber  { background: #d97706; }
.db-kpi__dot--violet { background: #7c3aed; }
.db-kpi__dot--muted  { background: #cbd5e1; }

.db-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--ec-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 12px;
}
.db-heading--spaced { margin-top: 24px; }

.db-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ec-border, #e2e8f0);
}
.db-tab-btn {
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ec-text-muted, #64748b);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.db-tab-btn:hover { color: var(--ec-text, #0f172a); }
.db-tab-btn.active {
  color: var(--ec-text, #0f172a);
  border-bottom-color: var(--ec-text, #0f172a);
  font-weight: 600;
}
.db-tab-panel { display: none; }
.db-tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.db-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.db-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  border-left-width: 4px;
  background: var(--ec-surface, #fff);
}
.db-alert--danger {
  border-color: #fecaca;
  border-left-color: #dc2626;
  color: #7f1d1d;
}
.db-alert--warn {
  border-color: #fde68a;
  border-left-color: #d97706;
  color: #78350f;
}
.db-alert--info {
  border-color: #bfdbfe;
  border-left-color: #2563eb;
  color: #1e3a8a;
}
.db-alert--static { cursor: default; }
.db-alert__icon {
  flex-shrink: 0;
  width: 15px; height: 15px;
  opacity: .6;
}
.db-alert__cta {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  opacity: .6;
}
.db-alert--gap-top { margin-top: 4px; }

.db-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.db-chart-row--3 {
  grid-template-columns: 1.1fr 1fr 0.95fr;
}
.db-card--chart-side {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.db-card--chart-side .db-card__title {
  margin-bottom: 10px;
}
.db-card--chart-side .db-bar-row {
  grid-template-columns: minmax(0, 1fr) 1fr 28px;
  gap: 8px;
}
.db-card--chart-side .db-bar-row__label--wide {
  width: auto;
  text-align: left;
  font-size: 11.5px;
  line-height: 1.3;
}
.db-chart-wrap { height: 220px; }
.db-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.db-table-wrap { overflow-x: auto; }
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.db-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ec-text-muted, #94a3b8);
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--ec-border, #e2e8f0);
}
.db-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--ec-border, #f8fafc);
  vertical-align: middle;
  color: var(--ec-text, #0f172a);
  font-size: 13px;
}
.db-table tr:last-child td { border-bottom: none; }
.db-table__cell--clip {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-table__cell--muted { color: var(--ec-text-muted, #64748b); }
.db-code-link {
  font-weight: 600;
  font-size: 12px;
  color: var(--ec-ui-accent, #2563eb);
  text-decoration: none;
  font-family: ui-monospace, monospace;
}
.db-delay-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.db-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
}
.db-pill--open        { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.db-pill--scheduled   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.db-pill--in_progress { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.db-noteam {
  font-size: 11.5px;
  color: var(--ec-text-muted, #94a3b8);
  font-style: italic;
}

.db-rank-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.db-rank-item {
  display: grid;
  grid-template-columns: 18px 1fr 72px 28px;
  align-items: center;
  gap: 10px;
}
.db-rank-item__pos {
  font-size: 11px;
  font-weight: 700;
  color: var(--ec-text-muted, #94a3b8);
  text-align: center;
}
.db-rank-item__name { font-size: 13px; font-weight: 500; color: var(--ec-text, #0f172a); }
.db-rank-item__bar {
  height: 4px;
  background: var(--ec-border, #e2e8f0);
  border-radius: 2px;
  overflow: hidden;
}
.db-rank-item__fill {
  height: 100%;
  background: var(--ec-ui-accent, #2563eb);
  border-radius: 2px;
}
.db-rank-item__val {
  font-size: 12px;
  font-weight: 700;
  color: var(--ec-text, #0f172a);
  text-align: right;
}

.db-bar-group { display: flex; flex-direction: column; gap: 10px; }
.db-bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 32px;
  align-items: center;
  gap: 10px;
}
.db-bar-row__label {
  font-size: 12px;
  color: var(--ec-text-muted, #64748b);
  text-align: right;
}
.db-bar-row__label--wide { width: 160px; text-align: left; }
.db-bar-row__track {
  height: 6px;
  background: var(--ec-border, #e2e8f0);
  border-radius: 3px;
  overflow: hidden;
}
.db-bar-row__fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;
}
.db-bar-row__fill--blue { background: var(--ec-ui-accent, #2563eb); }
.db-bar-row__fill--30   { background: #f59e0b; }
.db-bar-row__fill--60   { background: #ef4444; }
.db-bar-row__fill--90   { background: #991b1b; }
.db-bar-row__val {
  font-size: 12px;
  font-weight: 600;
  color: var(--ec-text, #0f172a);
  text-align: right;
}

.db-shortcuts-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ec-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 24px 0 10px;
}
.db-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}
.db-shortcut {
  background: var(--ec-surface, #fff);
  border: 1px solid var(--ec-border, #e2e8f0);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.db-shortcut:hover {
  background: var(--ec-surface-hover, #f8fafc);
  border-color: var(--ec-ui-accent, #2563eb);
}
.db-shortcut__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ec-text, #0f172a);
}
.db-shortcut__hint {
  font-size: 11.5px;
  color: var(--ec-text-muted, #94a3b8);
}

.event-list { list-style: none; padding: 0; margin: 0; }
.event-list__item { border-bottom: 1px solid var(--ec-border, #f1f5f9); }
.event-list__item:last-child { border-bottom: none; }
.event-list__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  text-decoration: none;
  color: inherit;
}
.event-list__link:hover .event-list__body strong {
  color: var(--ec-ui-accent, #2563eb);
}
.event-list__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.event-list__dot--service_order { background: var(--ec-ui-accent, #2563eb); }
.event-list__dot--internal       { background: #d97706; }
.event-list__body { display: flex; flex-direction: column; gap: 1px; }
.event-list__body strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--ec-text, #0f172a);
  transition: color .15s;
}

.db-empty {
  font-size: 13px;
  color: var(--ec-text-muted, #94a3b8);
  padding: 16px 0;
  text-align: center;
}
.db-empty--compact { padding: 8px 0; text-align: left; }
.db-more-alerts summary {
  font-size: 12px;
  cursor: pointer;
  color: var(--ec-text-muted, #64748b);
  padding: 6px 0;
  list-style: none;
}
.db-more-alerts__inner { margin-top: 6px; }
.db-fin-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}
.db-inline-bar { display: flex; align-items: center; gap: 8px; }
.db-inline-bar__track {
  flex: 1; height: 4px;
  background: var(--ec-border, #e2e8f0);
  border-radius: 2px; overflow: hidden;
}
.db-inline-bar__fill {
  height: 100%;
  background: var(--ec-ui-accent, #2563eb);
  border-radius: 2px;
}
.db-inline-bar__val {
  font-size: 12px;
  font-weight: 600;
  min-width: 28px;
  text-align: right;
  color: var(--ec-text, #0f172a);
}

@media (max-width: 1200px) {
  .db-layout {
    grid-template-columns: 1fr;
  }
  .db-layout__rail {
    position: static;
    order: -1;
  }
  .db-kpi-row--4,
  .db-fin-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-kpi-row--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .db-chart-row--3 {
    grid-template-columns: 1fr 1fr;
  }
  .db-chart-row--3 .db-card--chart-side {
    grid-column: 1 / -1;
  }
}
@media (max-width: 768px) {
  .db-chart-row,
  .db-chart-row--3,
  .db-two-col { grid-template-columns: 1fr; }
  .db-chart-row--3 .db-card--chart-side { grid-column: auto; }
  .db-kpi-row,
  .db-kpi-row--4,
  .db-kpi-row--5,
  .db-fin-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-shortcuts { grid-template-columns: repeat(2, 1fr); }
  .db-bar-row { grid-template-columns: 60px 1fr 28px; }
  .db-bar-row__label--wide { width: auto; }
}
@media (max-width: 480px) {
  .db-kpi-row,
  .db-kpi-row--3,
  .db-kpi-row--4,
  .db-kpi-row--5,
  .db-fin-row { grid-template-columns: 1fr; }
  .db-chart-row,
  .db-chart-row--3 { grid-template-columns: 1fr; }
}

/* Icons */
.ui-icon {
  display: block;
  flex-shrink: 0;
}

.ui-icon--lg {
  width: 40px;
  height: 40px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.12s;
}

.sidebar-nav a.active .nav-icon,
.sidebar-nav a:hover .nav-icon {
  opacity: 1;
}

.topbar-user__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(var(--ec-ui-accent-rgb), 0.12);
  color: var(--ec-ui-accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  border: 1.5px solid rgba(var(--ec-ui-accent-rgb), 0.2);
}

.topbar-user__avatar--img {
  object-fit: cover;
  display: block;
  background: var(--ec-surface-muted, #eee);
}

.topbar-user__locale {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(var(--ec-ui-accent-rgb), 0.1);
  font-weight: 600;
  flex-shrink: 0;
}

/* Page header */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}

.page-header__title {
  margin: 0 0 4px;
  font-size: var(--ec-text-xl);
  font-weight: 800;
  color: var(--ec-primary);
  letter-spacing: -0.03em;
}

.page-header__breadcrumb {
  font-size: var(--ec-text-xs);
  color: var(--ec-text-muted);
  margin-bottom: 6px;
}

.page-header__breadcrumb a {
  color: var(--ec-ui-accent);
  text-decoration: none;
}

.page-header__sep {
  margin: 0 4px;
  opacity: 0.5;
}

.page-header__desc {
  margin: 0;
  max-width: 52ch;
}

.btn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.page-header__actions .page-toolbar__more {
  position: relative;
}

.page-header__actions .page-toolbar__more-menu,
.os-show-top__actions .page-toolbar__more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin-top: 0;
  min-width: 240px;
  max-width: min(92vw, 320px);
  max-height: min(70vh, 420px);
  overflow-y: auto;
}

/* Empty state (rich) */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ec-text-muted);
  background: var(--ec-surface);
  border: 1px dashed var(--ec-border);
  border-radius: var(--ec-radius-lg);
}

.empty-state--compact {
  padding: 28px 16px;
  border: none;
  background: transparent;
}

.empty-state__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--ec-text-subtle);
}

.empty-state__title {
  margin: 0 0 6px;
  font-size: var(--ec-text-md);
  font-weight: 700;
  color: var(--ec-text);
}

.empty-state__message {
  margin: 0 0 14px;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

.empty-state__cta {
  margin-top: 4px;
}

.td-empty-state {
  padding: 0 !important;
  border: none !important;
}

.td-empty-state .empty-state {
  margin: 8px 0;
}

/* Filter chips */
.filter-chips {
  margin: -8px 0 14px;
}

.filter-chips__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.filter-chips__clear {
  display: none;
}

.filter-chips__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

a.filter-chip {
  text-decoration: none;
}

a.filter-chip:hover {
  border-color: var(--ec-primary);
  color: var(--ec-text);
}

a.filter-chip.filter-chip--active {
  background: rgba(var(--ec-primary-rgb, 37, 99, 235), 0.12);
  border-color: var(--ec-primary);
  color: var(--ec-primary);
  font-weight: 600;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  font-size: var(--ec-text-xs);
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: 999px;
  color: var(--ec-text-2);
}

.filter-chip__remove {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  color: var(--ec-text-muted);
  border-radius: 4px;
}

.filter-chip__remove:hover {
  color: var(--ec-danger);
  background: rgba(var(--ec-danger-rgb), 0.1);
}

/* Sticky + responsive tables */
.table-scroll {
  overflow: auto;
  max-height: min(70vh, 720px);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  background: var(--ec-surface);
}

.table-scroll .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ec-table-header-bg);
  box-shadow: 0 1px 0 var(--ec-border);
}

.table-wrap.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.table-wrap.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--ec-ui-accent-rgb), 0.06),
    transparent
  );
  animation: ec-shimmer 1.2s infinite;
}

@keyframes ec-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 1023px) {
  .data-table--cards thead {
    display: none;
  }

  .data-table--cards tbody tr {
    display: block;
    margin-bottom: 10px;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    padding: 8px 10px;
    background: var(--ec-surface);
  }

  .data-table--cards tbody td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border: none;
    text-align: right;
  }

  .data-table--cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: var(--ec-text-xs);
    color: var(--ec-text-muted);
    text-align: left;
    flex-shrink: 0;
  }

  .data-table--cards .td-empty-state {
    display: block;
  }

  .data-table--cards .td-empty-state::before {
    display: none;
  }

  .data-table--cards tbody td[colspan]::before {
    display: none;
  }

  .data-table--cards tbody td[colspan] {
    display: block;
    text-align: left;
  }
}

.row-actions {
  position: relative;
  display: inline-block;
}

.row-actions__toggle {
  list-style: none;
  cursor: pointer;
  min-width: 2rem;
  padding-left: 8px;
  padding-right: 8px;
  font-size: var(--ec-text-lg);
  line-height: 1;
  letter-spacing: 0;
}

.row-actions__toggle::-webkit-details-marker {
  display: none;
}

.row-actions__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
  background: var(--ec-surface);
  box-shadow: var(--ec-shadow-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.row-actions__menu.row-actions__menu--fixed {
  position: fixed;
  right: auto;
  top: 0;
  left: 0;
  z-index: 1100;
}

.row-actions:not([open]) .row-actions__menu {
  display: none;
}

.row-actions__menu .btn,
.row-actions__menu form {
  width: 100%;
}

.row-actions__menu .btn {
  justify-content: flex-start;
  white-space: nowrap;
}

.table-wrap:has(.row-actions[open]) {
  overflow: visible;
}

.data-table tbody tr:has(.row-actions[open]) {
  position: relative;
  z-index: 5;
}

.data-table tbody tr:has(.row-actions[open]) td {
  overflow: visible;
}

@media (max-width: 1023px) {
  .data-table--cards tbody td.actions-cell {
    justify-content: flex-end;
    overflow: visible;
    flex-wrap: wrap;
  }

  .data-table--cards tbody td.actions-cell::before {
    align-self: center;
  }
}

.ec-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--ec-border);
  padding-bottom: 0;
}

.ec-tabs__btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ec-text-muted);
  font: inherit;
  font-size: var(--ec-text-sm);
  font-weight: 500;
  padding: 10px 16px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  border-radius: var(--ec-radius-sm) var(--ec-radius-sm) 0 0;
  transition: color 0.12s, background 0.12s;
}

.ec-tabs__btn:hover {
  color: var(--ec-text);
  background: rgba(var(--ec-ui-accent-rgb), 0.04);
}

.ec-tabs__btn.is-active {
  color: var(--ec-ui-accent);
  font-weight: 600;
  border-bottom-color: var(--ec-ui-accent);
}

.ec-tab-panel--hidden,
[data-ec-tab-panel].ec-tab-panel--hidden {
  display: none !important;
}

.ec-system-alerts__primary {
  margin-bottom: 0;
}

.ec-system-alerts__list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
  font-size: 13px;
}

.ec-system-alerts__foot {
  margin: 8px 0 0;
  font-size: 13px;
}

.ec-system-alerts__more {
  margin-top: 8px;
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  background: var(--ec-surface);
}

.ec-system-alerts__more-summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ec-system-alerts__more-summary::-webkit-details-marker {
  display: none;
}

.ec-system-alerts__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ec-fill-subtle);
  color: var(--ec-text-muted);
}

.ec-system-alerts__more-body {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ec-system-alerts__more-body .alert {
  margin-bottom: 0;
}


.inv-hub__grid,
.settings-hub-grid--spaced {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .inv-hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .inv-hub__grid--tight {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.inv-hub-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.inv-hub-card h3 {
  margin: 0;
}

.settings-hub-card {
  height: 100%;
}

.page-toolbar--overflow.page-toolbar--desktop-more .page-toolbar__more {
  position: relative;
}

.page-toolbar--overflow.page-toolbar--desktop-more .page-toolbar__more-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 40;
  margin-top: 4px;
}

.dash-do-now__more summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
}

.dash-do-now__more summary::-webkit-details-marker {
  display: none;
}

.checklist-page .page-toolbar .btn,
.checklist-page .form-row-flex-end .btn,
.checklist-page .form-row-flex-end select,
.checklist-page .form-row-flex-end input[type="number"],
.checklist-page .form-row-flex-end input[type="text"] {
  min-height: 44px;
}

@media (min-width: 1024px) {
  .checklist-page .page-toolbar .btn,
  .checklist-page .form-row-flex-end .btn,
  .checklist-page .form-row-flex-end select,
  .checklist-page .form-row-flex-end input[type="number"],
  .checklist-page .form-row-flex-end input[type="text"] {
    min-height: auto;
  }
}

/* Dashboard alerts */
.dash-alert__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.dash-alert__body {
  flex: 1;
  min-width: 0;
}

.dash-alert__cta {
  flex-shrink: 0;
}

/* Focus visible */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(var(--ec-ui-accent-rgb), 0.5);
  outline-offset: 2px;
}

.brand .brand-logo,
.sidebar__brand .brand-logo {
  max-height: 36px;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

/* Logo sidebar: dia/noite segue data-sidebar-logo-tone (sidebar_preset), não data-ec-theme */
.brand .brand-logo--night {
  display: none;
}

[data-sidebar-logo-tone="dark"] .brand .brand-logo--day {
  display: none;
}

[data-sidebar-logo-tone="dark"] .brand .brand-logo--night {
  display: block;
}

.brand-text {
  line-height: 1.25;
}

.auth-v2__isotipo {
  display: block;
  max-height: 56px;
  max-width: 56px;
  object-fit: contain;
}

.auth-v2__login-logo {
  display: block;
  max-height: 72px;
  max-width: 220px;
  object-fit: contain;
}

.auth-v2__form-isotipo.auth-v2__login-logo {
  max-height: 56px;
  max-width: 200px;
  margin-bottom: 16px;
}

.auth-v2__form-isotipo {
  display: block;
  max-height: 44px;
  max-width: 44px;
  object-fit: contain;
  margin-bottom: 16px;
}

.brand-image-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ec-brand-primary, #263a84) 14%, transparent);
  color: var(--ec-brand-primary, #263a84);
  border: 1px dashed color-mix(in srgb, var(--ec-brand-primary, #263a84) 35%, transparent);
  user-select: none;
}

.brand-image-placeholder--hero {
  width: 56px;
  height: 56px;
  font-size: 1.35rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.brand-image-placeholder--form {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.brand-image-placeholder--print {
  display: inline-flex;
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
  border-radius: 8px;
}

/* Form auth (card / central): isotipo claro vs branco conforme data-ec-theme */
.auth-v2__form-isotipo.brand-logo--night {
  display: none;
}

[data-ec-theme="dark"] .auth-v2__form-isotipo.brand-logo--light {
  display: none;
}

[data-ec-theme="dark"] .auth-v2__form-isotipo.brand-logo--night {
  display: block;
}

/* Auth card (2FA, recuperar senha): isotipo dia/noite conforme tema */
.auth-v2--card .auth-v2__form-isotipo.brand-logo--night,
.auth-v2--card .auth-v2__form-logo.brand-logo--night,
.auth-v2--card .auth-v2__form-logo.brand-logo--dark {
  display: none;
}

[data-ec-theme="dark"] .auth-v2--card .auth-v2__form-isotipo.brand-logo--light,
[data-ec-theme="dark"] .auth-v2--card .auth-v2__form-logo.brand-logo--light {
  display: none;
}

[data-ec-theme="dark"] .auth-v2--card .auth-v2__form-isotipo.brand-logo--night,
[data-ec-theme="dark"] .auth-v2--card .auth-v2__form-logo.brand-logo--night,
[data-ec-theme="dark"] .auth-v2--card .auth-v2__form-logo.brand-logo--dark {
  display: block;
}

.filter-active-tag {
  color: var(--ec-ui-accent);
  font-weight: 600;
}

.finance-panel {
  background: var(--ec-fill-subtle);
  border: 1px solid var(--ec-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.finance-panel--form {
  padding: 16px;
}

.item-form-section__grow {
  flex: 1;
  min-width: 0;
}

.form-panel-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.form-grid--compact {
  gap: 8px;
}

.form-grid--roomy {
  gap: 10px;
}


.td-stock-qty--low {
  color: var(--ec-danger);
  font-weight: 700;
}

.td-stock-qty--low .td-unit {
  font-weight: 400;
  color: var(--ec-text-muted);
}

.ml-6 {
  margin-left: 6px;
}

.td-num-right {
  text-align: right;
  font-weight: 600;
}

.td-center {
  text-align: center;
}

.td-strong {
  font-weight: 600;
}

.td-meta {
  font-size: var(--ec-text-sm);
}

.td-paid {
  color: var(--ec-text-muted);
  text-decoration: line-through;
}

.td-overdue {
  color: var(--ec-danger);
  font-weight: 700;
}

.data-table th.td-num-right,
.data-table td.td-num-right {
  text-align: right;
}

.data-table th.td-center,
.data-table td.td-center {
  text-align: center;
}


/* ============================================================
   EC FORM PAGE — unified create/edit layout
   ============================================================ */
.ec-form-page__card {
  overflow: visible;
  border-radius: var(--ec-radius-lg);
  box-shadow: var(--ec-shadow-sm);
}

.ec-form-page__hero {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--ec-border);
}

.ec-form-page__hero-title {
  margin: 0;
  font-size: var(--ec-text-lg);
  font-weight: 700;
  color: var(--ec-text);
}

.ec-form-page__hero-subtitle {
  margin: 4px 0 0;
  font-size: var(--ec-text-sm);
  color: var(--ec-text-muted);
}

.ec-form-page__grid {
  display: block;
  padding: 0 20px 20px;
}

.ec-form-page__main {
  min-width: 0;
  max-width: none;
}

.ec-form-page__sections {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 1024px) {
  .ec-form-page:not(.ec-form-page--compact) .ec-form-page__grid {
    display: grid;
    grid-template-columns: 1fr min(280px, 28%);
    gap: 24px;
    align-items: start;
  }

  .ec-form-page__aside {
    position: relative;
  }
}

.ec-form-section {
  border-bottom: 1px solid var(--ec-border);
}

.ec-form-section:last-child {
  border-bottom: none;
}

.ec-form-section__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ec-form-section__summary::-webkit-details-marker {
  display: none;
}

.ec-form-section__summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--ec-text-muted);
  font-size: 12px;
  transition: transform 0.15s ease;
}

.ec-form-section[open] > .ec-form-section__summary::after {
  transform: rotate(-180deg);
}

.ec-form-section__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ec-ui-accent-muted);
  color: var(--ec-ui-accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.ec-form-section__icon .ec-form-section__icon-svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.ec-form-section__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ec-form-section__title {
  font-size: var(--ec-text-base);
  font-weight: 700;
  color: var(--ec-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ec-form-section__subtitle {
  font-size: var(--ec-text-sm);
  color: var(--ec-text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.ec-form-section__body {
  padding: 0 0 20px 42px;
}

@media (max-width: 640px) {
  .ec-form-section__body {
    padding-left: 0;
  }
}

.ec-form-grid {
  display: grid;
  gap: 14px 16px;
}

.ec-form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ec-form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ec-form-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ec-form-grid--align-end {
  align-items: end;
}

.ec-detail-grid {
  gap: 8px 16px;
}

@media (max-width: 1023px) {
  .ec-form-grid--2,
  .ec-form-grid--3,
  .ec-form-grid--4 {
    grid-template-columns: 1fr;
  }

  .ec-form-grid--3 > .ec-form-field--span-2 {
    grid-column: 1 / -1;
  }
}

.ec-form-field--span-2 {
  grid-column: 1 / -1;
}

.ec-form-field__label {
  display: block;
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: var(--ec-text-2);
  margin-bottom: 6px;
}

.ec-form-field__control,
.ec-form-field select,
.ec-form-field textarea {
  width: 100%;
  box-sizing: border-box;
}

.ec-form-field__control:focus,
.ec-form-field select:focus,
.ec-form-field textarea:focus {
  outline: none;
  border-color: var(--ec-input-border-focus);
  box-shadow: var(--ec-focus-ring);
}

.ec-form-field__hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ec-text-muted);
}

.ec-form-field .field,
.ec-form-field label.field {
  display: block;
  margin: 0;
}

.ec-form-nav {
  position: sticky;
  top: 72px;
  padding: 16px;
  background: var(--ec-surface-2);
  border: 1px solid var(--ec-border);
  border-radius: 10px;
}

.ec-form-nav__title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ec-text-muted);
}

.ec-form-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ec-form-nav__list a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ec-text-2);
  text-decoration: none;
}

.ec-form-nav__list a:hover {
  background: var(--ec-fill-subtle);
  color: var(--ec-text);
}

.ec-form-nav__list a.is-active {
  background: var(--ec-ui-accent-muted);
  color: var(--ec-ui-accent-strong);
  font-weight: 600;
}

.ec-form-nav--mobile .ec-form-nav__list {
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 4px;
}

.ec-form-nav--mobile .ec-form-nav__list a {
  white-space: nowrap;
  flex-shrink: 0;
}

.ec-form-footer {
  position: sticky;
  bottom: 0;
  margin: 24px -20px -20px;
  padding: 14px 20px;
  background: var(--ec-surface);
  border-top: 1px solid var(--ec-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  z-index: 2;
}

.ec-form-page--compact .ec-form-footer {
  margin-left: 0;
  margin-right: 0;
}

.ec-form-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ec-form-footer__submit {
  min-width: 140px;
}

/* Alias: legacy required markers */
.req,
.field-required {
  color: var(--ec-danger, #dc2626);
  font-weight: 600;
}

/* Painéis inline (ex.: financeiro) */
.finance-panel--form.ec-form-inline-panel {
  padding: 16px;
  border-top: 1px solid var(--ec-border);
}

.finance-panel--form .ec-form-grid {
  margin-bottom: 12px;
}

/* @deprecated — prefer .ec-form-section; legacy .form-section kept for gradual removal */
.form-section h4 {
  font-size: var(--ec-text-base);
  font-weight: 700;
  color: var(--ec-text);
  margin: 0 0 12px;
}


.dashboard-section-details {
  border: none;
}

.dashboard-section-details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.dashboard-section-details > summary::-webkit-details-marker {
  display: none;
}

.dashboard-section-title--summary::after {
  content: " ▾";
  font-size: 12px;
  color: var(--ec-text-muted);
}

.dashboard-section-details[open] > .dashboard-section-title--summary::after {
  content: " ▴";
}

.so-plan-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ec-text-muted);
  margin: 24px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ec-border);
}

.so-plan-section-title:first-child {
  margin-top: 8px;
}

.so-danger-details {
  margin-bottom: 16px;
}

.so-danger-details__summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ec-danger, #dc2626);
  cursor: pointer;
  list-style: none;
  padding: 6px 0;
}

.so-danger-details__summary::-webkit-details-marker {
  display: none;
}

.so-danger-details__summary::before {
  content: "▶";
  font-size: 10px;
  transition: transform 0.15s;
}

.so-danger-details[open] > .so-danger-details__summary::before {
  transform: rotate(90deg);
}

/* ==================================================================
   OS v2 — ficha + aba Execução (tokens, kv-grid, layout)
   ================================================================== */
:root,
[data-ec-theme="light"],
[data-ec-theme="dark"] {
  --os-space-1: 4px;
  --os-space-2: 8px;
  --os-space-3: 12px;
  --os-space-4: 16px;
  --os-space-5: 24px;
}

.os-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--os-space-3);
}

.os-kv-item {
  min-width: 0;
}

.os-kv-item--wide {
  grid-column: 1 / -1;
}

.os-kv-label {
  display: block;
  font-size: var(--ec-text-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ec-text-subtle);
  line-height: 1.35;
  margin-bottom: 2px;
}

.os-kv-value {
  font-size: var(--ec-text-base);
  font-weight: 500;
  color: var(--ec-text-2);
  line-height: 1.45;
  margin: 0;
  word-break: break-word;
}

.os-kv-value--pre {
  white-space: pre-wrap;
}

.os-exec-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.os-exec-sidebar {
  position: static;
  top: auto;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: var(--os-space-3);
  border-right: 1px solid var(--ec-divider);
}

.os-exec-sidebar__panel {
  padding: var(--os-space-3) 0;
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--ec-divider);
}

.os-exec-sidebar__panel:last-child {
  border-bottom: none;
}

.os-exec-sidebar__title {
  font-size: var(--ec-text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ec-text-subtle);
  margin: 0 0 var(--os-space-2);
}

.os-exec-sidebar__progress-pct {
  font-size: var(--ec-text-md);
  font-weight: 600;
  color: var(--ec-text-2);
  margin: 0;
}

.os-exec-sidebar__stage-list {
  display: flex;
  flex-direction: column;
  gap: var(--os-space-1);
  margin: var(--os-space-3) 0 0;
  padding: 0;
  list-style: none;
}

.os-exec-sidebar__stage-item {
  display: flex;
  justify-content: space-between;
  gap: var(--os-space-2);
  font-size: var(--ec-text-sm);
  color: var(--ec-text-2);
}

.os-exec-sidebar__facts {
  display: flex;
  flex-direction: column;
  gap: var(--os-space-3);
}

.os-exec-sidebar__facts-all {
  margin-top: var(--os-space-2);
}

.os-exec-sidebar__facts-all summary {
  cursor: pointer;
  font-size: var(--ec-text-sm);
  font-weight: 500;
  color: var(--ec-text-muted);
}

.os-exec-sidebar__facts-all summary:hover {
  color: var(--ec-text-2);
}

.os-exec-main {
  min-width: 0;
}

.os-show-hero {
  padding: var(--os-space-3) 0 var(--os-space-4);
  margin-bottom: var(--os-space-2);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--ec-divider);
}

.os-show-hero__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--os-space-4);
}

.os-show-hero__identity {
  flex: 1 1 280px;
  min-width: 0;
}

.os-show-hero__code {
  font-size: var(--ec-text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ec-text);
  margin: 0;
  line-height: 1.25;
}

.os-show-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--os-space-2);
  margin-top: var(--os-space-2);
}

.os-show-hero__customer {
  font-size: var(--ec-text-base);
  font-weight: 500;
  color: var(--ec-text-muted);
  margin: var(--os-space-1) 0 0;
}

.os-show-hero__sub {
  font-size: var(--ec-text-sm);
  color: var(--ec-text-muted);
  margin: var(--os-space-1) 0 0;
}

.os-show-hero__actions {
  flex: 0 1 auto;
}

[data-ec-tab-panels] {
  --os-show-tabs-nav-height: 64px;
  --os-show-wizard-alerts-height: 0px;
  --os-show-header-sticky-offset: var(--os-show-tabs-nav-height);
}

[data-ec-tab-panels]:has(.os-show-wizard-sticky .os-show-wizard-alerts) {
  --os-show-wizard-alerts-height: 52px;
  --os-show-header-sticky-offset: calc(var(--os-show-tabs-nav-height) + var(--os-show-wizard-alerts-height));
}

.os-show-header-sticky {
  margin: 0 0 var(--os-space-3);
}

/* Abas da ficha OS — fixas no topo ao rolar */
.os-show-tabs-sticky {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--ec-main-canvas);
  border-bottom: 1px solid var(--ec-divider);
}

/* Aviso «Executar tarefas» — fixo logo abaixo das abas */
.os-show-wizard-sticky {
  position: sticky;
  top: var(--os-show-tabs-nav-height, 48px);
  z-index: 24;
  background: var(--ec-main-canvas);
  border-bottom: 1px solid var(--ec-divider);
}

.os-show-wizard-sticky:empty {
  display: none;
}

/* Secções do relatório — estáticas abaixo das abas (só aba Execução) */
.os-exec-sections-sticky {
  display: none;
  position: static;
  background: var(--ec-main-canvas);
  border-bottom: 1px solid var(--ec-divider);
}

.os-exec-sections-sticky.is-active:not(:empty) {
  display: block;
}

.os-show-tabs-v2 {
  position: static;
  padding: var(--os-space-2) 0 var(--os-space-2);
  margin-bottom: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#os-exec-sections-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--os-space-2);
  width: 100%;
  margin: 0;
  padding: var(--os-space-2) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: transparent;
  border-bottom: none;
}

.os-exec-sections-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: var(--ec-radius);
  font-size: var(--ec-text-sm);
  font-weight: 500;
  color: var(--ec-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.os-exec-sections-bar__link:hover {
  background: var(--ec-fill-subtle);
  color: var(--ec-text-2);
}

.os-exec-sections-bar__link.is-active,
.os-exec-sections-bar__link[aria-current="location"] {
  background: var(--ec-fill-subtle);
  color: var(--ec-accent, #263a84);
  font-weight: 600;
}

.os-exec-sections-bar__count {
  font-size: var(--ec-text-xs);
  font-weight: 600;
  color: var(--ec-text-subtle);
}

.os-show-tabs-v2__progress-row {
  display: flex;
  align-items: center;
  gap: var(--os-space-2);
  margin-bottom: var(--os-space-2);
}

.os-show-tabs-v2__progress {
  flex: 1 1 auto;
  height: 3px;
  background: var(--ec-divider);
  border-radius: 999px;
  overflow: hidden;
}

.os-show-tabs-v2__progress-fill {
  height: 100%;
  background: var(--ec-accent, #263a84);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.os-show-tabs-v2__progress-label {
  flex: 0 0 auto;
  font-size: var(--ec-text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ec-text-subtle);
  letter-spacing: 0.02em;
}

.os-show-tabs-v2__nav-scroll {
  position: relative;
  margin: 0 -2px;
  padding: 0 2px;
}

.os-show-tabs-v2__nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 4px;
  padding: 4px;
  background: var(--ec-fill-subtle);
  border: 1px solid var(--ec-divider);
  border-radius: calc(var(--ec-radius) + 4px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.os-show-tabs-v2__nav-sep {
  flex: 0 0 1px;
  align-self: stretch;
  width: 1px;
  min-height: 36px;
  margin: 6px 4px;
  background: var(--ec-divider);
}

.os-show-tabs-v2__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: max(7.5rem, 0);
  max-width: 14rem;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--ec-radius);
  background: transparent;
  color: var(--ec-text-muted);
  font-size: var(--ec-text-sm);
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.os-show-tabs-v2__btn:focus-visible {
  outline: 2px solid var(--ec-accent, #263a84);
  outline-offset: 2px;
}

.os-show-tabs-v2__btn:hover:not([aria-disabled="true"]):not(.is-active) {
  background: rgba(var(--ec-surface-rgb, 255, 255, 255), 0.65);
  color: var(--ec-text-2);
}

.os-show-tabs-v2__btn.is-active {
  background: var(--ec-surface);
  border-color: var(--ec-border);
  color: var(--ec-text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.os-show-tabs-v2__btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.os-show-tabs-v2__btn-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--ec-border);
  background: var(--ec-surface);
  color: var(--ec-text-subtle);
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.os-show-tabs-v2__btn.is-active .os-show-tabs-v2__btn-step {
  border-color: var(--ec-accent, #263a84);
  background: rgba(var(--ec-primary-rgb, 38, 58, 132), 0.1);
  color: var(--ec-accent, #263a84);
}

.os-show-tabs-v2__btn-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}

.os-show-tabs-v2__btn-label {
  font-weight: 600;
  font-size: var(--ec-text-sm);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.os-show-tabs-v2__btn-meta {
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ec-text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.os-show-tabs-v2__btn.is-active .os-show-tabs-v2__btn-meta {
  color: var(--ec-text-muted);
}

.os-show-tabs-v2__btn-alert {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ec-warn, #f59e0b);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.os-show-tabs-v2__btn--warn:not(.is-active) .os-show-tabs-v2__btn-label {
  color: var(--ec-warning-text, #b45309);
}

.os-show-tabs-v2__btn--warn:not(.is-active) .os-show-tabs-v2__btn-step {
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--ec-warning-text, #b45309);
}

.os-show-tabs-v2__btn--done:not(.is-active) .os-show-tabs-v2__btn-step {
  border-color: transparent;
  background: var(--ec-success-bg, rgba(22, 163, 74, 0.12));
  color: var(--ec-success-text, #15803d);
  font-size: 0;
}

.os-show-tabs-v2__btn--done:not(.is-active) .os-show-tabs-v2__btn-step::after {
  content: "";
  display: block;
  width: 0.55rem;
  height: 0.3rem;
  margin-top: -1px;
  border: 2px solid currentColor;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg);
}

.os-show-tabs-v2__btn--locked .os-show-tabs-v2__btn-step {
  border-style: dashed;
  opacity: 0.85;
}

.os-show-tabs-v2__btn--aux {
  flex: 0 1 auto;
  min-width: 6.5rem;
  max-width: 9rem;
}

.os-show-tabs-v2__btn--aux .os-show-tabs-v2__btn-label {
  font-weight: 600;
}

/* Compat: badge legado se ainda existir noutros partials */
.os-show-tabs-v2__btn .os-show-tabs__badge {
  display: none;
}

@media (min-width: 1100px) {
  .os-show-tabs-v2__nav {
    overflow-x: visible;
  }

  .os-show-tabs-v2__btn {
    flex: 1 1 0;
    max-width: none;
  }

  .os-show-tabs-v2__nav-sep {
    margin-left: auto;
  }

  .os-show-tabs-v2__btn--aux {
    flex: 0 0 auto;
    max-width: 10rem;
  }
}

.os-rdo-header-card--slim {
  padding: var(--os-space-3) var(--os-space-4);
  border-top: none;
  box-shadow: none;
}

.os-rdo-header-card--slim .os-rdo-header__top {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.os-rdo-header-card--slim .os-rdo-header__progress-inline {
  display: none;
}

.os-rdo-section-card--elevated {
  border-color: var(--ec-border);
  box-shadow: none;
}

.os-rdo-section-card--elevated .os-rdo-section-card__head {
  background: transparent;
  border-bottom-color: var(--ec-divider);
  padding-top: 12px;
  padding-bottom: 10px;
}

.os-rdo-section-card--elevated .os-rdo-section-card__body {
  padding: var(--os-space-3) var(--os-space-4);
}

.os-rdo-table th,
.os-rdo-table td {
  padding: 10px 12px;
}

.os-rdo-table tbody tr:nth-child(even) {
  background: var(--ec-table-stripe);
}

.os-show-summary--v2,
.os-show-summary--v3 {
  padding: var(--os-space-3) var(--os-space-4);
  box-shadow: none;
}

.os-show-summary--v3 .os-show-summary__primary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--os-space-4);
  padding-bottom: var(--os-space-3);
  border-bottom: 1px solid var(--ec-divider);
}

.os-show-summary__primary-col {
  min-width: 0;
}

.os-show-summary__fact-label {
  display: block;
  font-size: var(--ec-text-xs);
  font-weight: 500;
  color: var(--ec-text-subtle);
  margin-bottom: 4px;
}

.os-show-summary__fact-value {
  font-size: var(--ec-text-base);
  font-weight: 600;
  color: var(--ec-text-2);
  line-height: 1.45;
}

.os-show-summary__fact--schedule .os-show-summary__fact-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--ec-text-md);
}

.os-show-summary__fact-muted {
  font-weight: 500;
  color: var(--ec-text-muted);
}

.os-show-summary__fact-sub {
  margin-top: 8px;
  font-size: var(--ec-text-sm);
  color: var(--ec-text-2);
  line-height: 1.45;
}

.os-show-summary__fact-sub-label {
  color: var(--ec-text-subtle);
  font-weight: 500;
}

.os-show-summary__inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.os-show-summary__action-link {
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: var(--ec-link, var(--ec-primary));
  text-decoration: none;
}

.os-show-summary__action-link:hover {
  text-decoration: underline;
}

.os-show-summary__sla {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.os-show-summary__sla-due {
  font-size: var(--ec-text-sm);
  color: var(--ec-text-muted);
  font-weight: 500;
}

.os-show-summary__fact--warn .os-show-summary__fact-value {
  font-weight: 500;
}

.os-show-summary__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--os-space-3) 0 0;
}

.os-show-summary__meta-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--ec-text-xs);
  font-weight: 500;
  color: var(--ec-text-muted);
  background: var(--ec-surface-2, var(--ec-table-stripe));
  line-height: 1.5;
}

.os-show-summary__description-block {
  padding-top: var(--os-space-3);
  margin-top: var(--os-space-3);
  border-top: 1px solid var(--ec-divider);
}

.os-show-summary--v3 .os-show-summary__description {
  margin-top: 6px;
  max-height: 8.5em;
  overflow-y: auto;
}

.os-show-summary__more {
  margin-top: var(--os-space-3);
  padding-top: var(--os-space-2);
  border-top: 1px solid var(--ec-divider);
}

.os-show-summary__more .os-show-details__summary {
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: var(--ec-text-muted);
}

.os-kv-grid--compact {
  gap: var(--os-space-2) var(--os-space-3);
}

.os-show-summary--v2 .os-show-summary__head {
  margin-bottom: var(--os-space-3);
}

.os-show-summary--v2 .os-show-summary__title {
  font-size: var(--ec-text-md);
  font-weight: 600;
  color: var(--ec-text-2);
}

.os-show-summary__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--os-space-3);
  padding-bottom: var(--os-space-3);
  border-bottom: 1px solid var(--ec-divider);
}

.os-show-summary__groups {
  display: flex;
  flex-direction: column;
  gap: var(--os-space-4);
}

.os-show-summary__group {
  margin: 0;
}

.os-show-summary__group-title {
  margin: 0 0 var(--os-space-2);
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: var(--ec-text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.os-show-summary__schedule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.os-show-summary__schedule .ui-icon--inline {
  flex-shrink: 0;
  opacity: 0.75;
}

.os-show-summary__description {
  margin: 0;
  padding: var(--os-space-3);
  border-radius: var(--ec-radius-sm, 6px);
  background: var(--ec-surface-2, var(--ec-table-stripe));
  font-size: var(--ec-text-base);
  line-height: 1.5;
  color: var(--ec-text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.os-show-summary__group--description .os-show-summary__group-title {
  margin-bottom: var(--os-space-2);
}

.os-rdo-page .card.os-rdo-section-card {
  box-shadow: none;
}

.os-rdo-page .os-rdo-section-card__head {
  background: transparent;
  border-bottom-color: var(--ec-divider);
}

.os-rdo-page .card-section-title {
  font-size: var(--ec-text-md);
  font-weight: 600;
  color: var(--ec-text-2);
}

.so-campo-hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.so-campo-hub-filters__search {
  flex: 1 1 200px;
  min-width: 160px;
}

.so-campo-hub-stack {
  gap: 12px;
}

.so-campo-hub-card {
  padding: 0;
  overflow: hidden;
  border-left: 4px solid var(--ec-border, #e5e7eb);
}

.so-campo-hub-card--danger {
  border-left-color: var(--ec-danger, #dc2626);
}

.so-campo-hub-card--info {
  border-left-color: var(--ec-info, #2563eb);
}

.so-campo-hub-card--warn {
  border-left-color: var(--ec-warning);
}

.so-campo-hub-card__main {
  display: block;
  padding: 14px 14px 10px;
  color: inherit;
  text-decoration: none;
}

.so-campo-hub-card__main:hover {
  background: var(--ec-surface-hover, rgba(0, 0, 0, 0.02));
}

.so-campo-hub-card__code {
  font-size: var(--ec-text-md);
}

.so-campo-hub-card__customer {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.so-campo-hub-card__schedule {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.so-campo-hub-card__addr {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.so-campo-hub-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.so-campo-hub-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
  border-top: 1px solid var(--ec-border, #e5e7eb);
  padding-top: 10px;
  margin-top: 0;
}


.inline-form--push {
  margin-left: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.upload-drop-area {
  background: var(--ec-bg-soft, #f9fafb);
  border: 2px dashed var(--ec-border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}

.upload-drop-area__icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.upload-drop-area__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-drop-area__hint {
  font-size: 12px;
  margin-bottom: 12px;
}

/* ============================================================
   UTILITY CLASSES — substituem style="" inline nas views
   ============================================================ */

/* Layout */
.flex-1       { flex: 1; min-width: 0; }
.ml-auto      { margin-left: auto; }
.flex-row     { display: flex; align-items: center; }
.flex-row-gap { display: flex; align-items: center; gap: 8px; }
.flex-row-gap-16 { display: flex; align-items: center; gap: 16px; }
.flex-wrap    { flex-wrap: wrap; }

/* Detail value (ficha de detalhe: rótulo + valor) */
.detail-value {
  margin: 2px 0;
  font-weight: 600;
}
.detail-value--normal {
  margin: 2px 0;
}
.detail-value--pre {
  margin: 4px 0;
  white-space: pre-wrap;
}
.detail-notes {
  margin-top: 12px;
}

/* Danger zone header (card danger) */
.danger-zone-body {
  padding: 0 20px 20px;
}
.text-danger {
  color: var(--ec-danger);
}
.icon-danger-bg {
  background: var(--ec-danger-bg);
  color: var(--ec-danger);
}

/* Table cell helpers */
.td-right {
  text-align: right;
}
.td-fw-700 { font-weight: 700; }
.td-strong { font-weight: 600; }
.td-overdue { color: var(--ec-danger); font-weight: 700; }

/* Font size helpers */
.text-12  { font-size: 12px; }
.text-13  { font-size: var(--ec-text-sm); }
.text-14  { font-size: var(--ec-text-base); }
.text-15  { font-size: var(--ec-text-md); }
.text-16  { font-size: var(--ec-text-lg); }

/* Spacing helpers (new — no duplicates of earlier declarations) */
.p-y-8    { padding-top: 8px; padding-bottom: 8px; }
.gap-8    { gap: 8px; }
.gap-16   { gap: 16px; }
.mr-6     { margin-right: 6px; }
.mt-24    { margin-top: 24px; }
.mt-22    { margin-top: 22px; }
.ml-4     { margin-left: 4px; }
.p-0      { padding: 0; }
.border-0 { border: 0; }
.p-16     { padding: 16px; }
.p-20     { padding: 20px; }
.p-warn   { padding: 10px 14px; }
.pl-indent { padding-left: 1.2rem; }
/* Typography helpers (new) */
.text-10  { font-size: 10px; }
.text-11  { font-size: 11px; }
.font-mono { font-family: monospace; }
.lh-15    { line-height: 1.5; }
.text-success { color: var(--ec-success, #16a34a); }
.text-accent  { color: var(--ec-ui-accent); }
/* Layout helpers (new) */
.flex-2         { flex: 2; }
.flex-col        { display: flex; flex-direction: column; }
.flex-col-gap-8  { display: flex; flex-direction: column; gap: 8px; }
.grid-span-full  { grid-column: 1 / -1; }
.cursor-pointer  { cursor: pointer; }
.list-none       { list-style: none; }
.list-disc       { list-style: disc; }
.border-bottom   { border-bottom: 1px solid var(--ec-border); }
.border-top      { border-top: 1px solid var(--ec-border); }
.pt-12           { padding-top: 12px; }
.td-vtop         { vertical-align: top; }
.td-truncate     { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-100          { width: 100px; }
.fieldset-clean  { border: 0; padding: 0; }
/* Component helpers (new) */
.task-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  object-position: center;
  background: var(--ec-fill-subtle, #eef2f6);
  border-radius: 6px;
  border: 1px solid var(--ec-border);
  cursor: zoom-in;
}

/* Avatar / photo */
.avatar-round {
  border-radius: 50%;
  object-fit: cover;
}

/* Inline checkbox row */
.checkbox-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Session list (settings/sessions) */
.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ec-border);
}
.session-item__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(var(--ec-ui-accent-rgb), 0.08);
  color: var(--ec-ui-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.session-item__body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.session-item__info { min-width: 0; }
.session-item__name { font-weight: 600; font-size: 14px; }
.session-item__meta { font-size: 12px; margin-top: 2px; }
.session-item__action { flex-shrink: 0; }
.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--ec-border);
}

/* Signature / image preview */
.img-preview {
  display: block;
  max-width: min(400px, 100%);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  background: var(--ec-surface);
}

/* Alpine + Sidebar collapse */
.app-shell.sidebar--collapsed > .sidebar {
  width: 64px;
  overflow: hidden;
}

.app-shell.sidebar--collapsed .nav-section__title,
.app-shell.sidebar--collapsed .sidebar__foot-scope,
.app-shell.sidebar--collapsed .brand-text {
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.app-shell.sidebar--collapsed .sidebar__foot-scope {
  display: none;
}

.app-shell.sidebar--collapsed .sidebar__foot-hint {
  display: block;
  opacity: 1;
  pointer-events: none;
}

.app-shell.sidebar--collapsed .nav-link-text {
  display: none;
}

.app-shell.sidebar--collapsed .sidebar-nav a:not(.sidebar-nav__sub),
.app-shell.sidebar--collapsed .sidebar-nav a.sidebar-nav__sub {
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}

.app-shell.sidebar--collapsed .nav-link-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  font-size: 9px;
  line-height: 16px;
}

.app-shell.sidebar--collapsed .sidebar-nav a:not(.sidebar-nav__sub),
.app-shell.sidebar--collapsed .sidebar-nav a.sidebar-nav__sub {
  position: relative;
}

.app-shell.sidebar--collapsed .brand-logo {
  max-width: 36px;
}

.sidebar__toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--ec-sidebar-border);
  border-radius: var(--ec-radius-sm);
  background: transparent;
  color: var(--ec-sidebar-text);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.sidebar__toggle-btn:hover {
  background: var(--ec-nav-hover-bg);
}
.sidebar__toggle-btn:focus-visible {
  outline: 2px solid var(--ec-ui-accent);
  outline-offset: 2px;
}

/* Perfil N (Notebook, 1024-1365px): mostrar botão de toggle */
@media (min-width: 1024px) and (max-width: 1365px) {
  .sidebar__toggle-btn {
    display: inline-flex;
  }
}

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 299;
}

.app-shell.sidebar--open .sidebar-overlay,
.sidebar-overlay[style*="display: block"],
.sidebar-overlay:not([style*="display: none"]) {
  display: block;
}

@media (max-width: 640px) {
  .app-shell {
    display: block;
  }

  .app-shell > .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px !important;
    max-width: min(260px, 90vw);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 300;
    align-self: auto;
    box-shadow: 4px 0 24px rgba(var(--ec-primary-rgb), 0.12);
  }

  .app-shell.sidebar--open .sidebar {
    transform: translateX(0);
  }

  .app-shell .main-content {
    width: 100%;
    margin-left: 0 !important;
  }

  .sidebar__close {
    display: inline-flex;
  }

  .sidebar__head {
    margin: 0;
    padding-left: max(12px, env(safe-area-inset-left, 0));
    padding-right: 8px;
    padding-top: env(safe-area-inset-top, 0);
  }

  .sidebar__foot {
    margin: 0;
    padding-left: max(12px, env(safe-area-inset-left, 0));
    padding-right: 12px;
  }

  .topbar__menu-btn {
    display: inline-flex;
  }

  .topbar__center {
    display: none;
  }

  .topbar {
    padding: 10px 14px;
    padding-left: max(10px, env(safe-area-inset-left, 0));
    padding-right: max(10px, env(safe-area-inset-right, 0));
    padding-top: max(10px, env(safe-area-inset-top, 0));
  }

  .topbar h1 {
    font-size: var(--ec-text-lg);
  }

  .topbar small {
    font-size: var(--ec-text-sm);
  }

  .sidebar-nav {
    display: grid;
    gap: 16px;
  }

  .nav-section__links {
    display: grid;
    gap: 6px;
  }

  .sidebar-nav a {
    padding: 12px 12px;
    font-size: calc(var(--ec-font-size-nav) + 1px);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .sidebar-nav a.sidebar-nav__sub {
    min-height: 40px;
    font-size: calc(var(--ec-font-size-nav-sub) + 1px);
    padding-left: 17px;
  }
}

/* Miniaturas clicáveis → GLightbox */
a[href*="/attachments/"]:has(img) {
  cursor: zoom-in;
}

a[href*="/attachments/"]:has(img) img {
  cursor: zoom-in;
}

.ec-static-photo,
.ec-static-photo img {
  cursor: default;
}

.os-attachments-thumb-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}

/* Esconder Alpine antes de inicializar (evita flash) */
[x-cloak] { display: none !important; }

/* HTMX loading indicator */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator { display: block; }

/* Tab lazy load */
.tab-loading {
  padding: 24px 0;
  text-align: center;
}
.htmx-indicator.tab-loading { display: block; }

/* Finance — fluxo de caixa mensual */
.finance-cashflow { margin-bottom: 0; padding-bottom: 16px; }
.finance-cashflow .cashflow-bars {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  padding: 8px 16px 16px;
  overflow-x: auto;
}
.cashflow-month {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 48px;
}
.bar-wrap {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 100px;
}
.bar {
  width: 18px;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
}
.bar--income  { background: var(--ec-success, #16a34a); }
.bar--expense { background: var(--ec-danger, #dc2626); }
.cashflow-label   { font-size: 11px; color: var(--ec-text-muted, #64748b); }
.cashflow-balance { font-size: 11px; font-weight: 600; }

/* Finance — gestão de categorias */
.finance-categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .finance-categories-grid { grid-template-columns: 1fr; }
}
.finance-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.finance-category-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.finance-category-item__name { flex: 1; min-width: 0; }
.finance-category-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.timeline-item {
  border-left: 3px solid var(--color-border);
  padding-left: 1rem;
}
.timeline-meta {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 4px;
}
.timeline-body {
  margin: 0;
  white-space: pre-wrap;
}

/* --- Centro de operação OS --- */
.ec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.ec-kpi-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.card--link {
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.card--link:hover {
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
  border-color: var(--color-primary, #2563eb);
}
.card--flat {
  padding: 10px 12px;
}
.card--danger {
  border-color: var(--color-danger, #dc2626);
}
.ops-map-canvas {
  height: 280px;
  width: 100%;
  border-radius: 8px;
  z-index: 1;
  position: relative;
}
.ops-map-canvas .leaflet-container {
  height: 100%;
  width: 100%;
  border-radius: 8px;
}
.ec-page-tabs--sub .ec-page-tabs__tab {
  cursor: pointer;
  border: none;
  background: transparent;
  font: inherit;
}
.os-outage-start-fields {
  padding: 10px 12px;
  background: var(--ec-surface-raised, #f8fafc);
  border-radius: 8px;
  border: 1px solid var(--ec-border, #e2e8f0);
}

