/* PERFECTUM GESTAO — R10.8.6_THEME_ENGINE + R10.8.6.1_THEME_POLISH
   Tema visual aditivo. Nao altera cores semanticas de sucesso/alerta/erro. */

:root{
  --pt-status-ok:#31c98a;
  --pt-status-warn:#e6a63a;
  --pt-status-danger:#e35d6a;
  --pt-theme-accent:#18b9e6;
  --pt-theme-accent-2:#1683e8;
  --pt-theme-bg:#0b1220;
  --pt-theme-bg-soft:#0e1726;
  --pt-theme-panel:#111c2e;
  --pt-theme-panel-2:#15243a;
  --pt-theme-text:#f8fafc;
  --pt-theme-muted:#94a3b8;
  --pt-theme-line:#26384d;
  --pt-theme-shadow:0 18px 55px rgba(0,0,0,.24);
}
html[data-perfectum-theme="corporate"]{
  --bg:#08101b;--bg-soft:#0b1421;--panel:#0f1b2b;--panel-2:#132238;--panel-3:#172a42;
  --cyan:#18b9e6;--cyan-soft:#8ce5fb;--blue:#1683e8;--text:#f8fafc;--muted:#9aabbd;--muted-2:#70869b;--line:#27415c;--line-soft:#1b3148;
  --pt-theme-accent:#18b9e6;--pt-theme-accent-2:#1683e8;--pt-theme-bg:#08101b;--pt-theme-bg-soft:#0b1421;--pt-theme-panel:#0f1b2b;--pt-theme-panel-2:#132238;--pt-theme-text:#f8fafc;--pt-theme-muted:#9aabbd;--pt-theme-line:#27415c;
}
html[data-perfectum-theme="light"]{
  /* UI-2: fundo cool-grey (não branco) para dar hierarquia às superfícies brancas */
  --bg:#e9edf3;--bg-soft:#e2e7ee;--panel:#ffffff;--panel-2:#f1f4f8;--panel-3:#e8edf4;
  --cyan:#1769e0;--cyan-soft:#0756bf;--blue:#1769e0;--text:#172033;--muted:#667085;--muted-2:#7c8799;--line:#d4dbe4;--line-soft:#e0e5ec;
  --pt-theme-accent:#1769e0;--pt-theme-accent-2:#00a6d6;--pt-theme-bg:#e9edf3;--pt-theme-bg-soft:#e2e7ee;--pt-theme-panel:#ffffff;--pt-theme-panel-2:#f1f4f8;--pt-theme-text:#172033;--pt-theme-muted:#667085;--pt-theme-line:#d4dbe4;--pt-theme-shadow:0 1px 2px rgba(23,42,69,.05),0 14px 34px rgba(23,42,69,.10);
}
html[data-perfectum-theme="obsidian"]{
  --bg:#090a0c;--bg-soft:#0e1012;--panel:#141619;--panel-2:#1a1d21;--panel-3:#20242a;
  --cyan:#c6a15b;--cyan-soft:#dfc88f;--blue:#b48b45;--text:#f4f4f2;--muted:#a6a8ab;--muted-2:#7f8388;--line:#3c362b;--line-soft:#2b2925;
  --pt-theme-accent:#c6a15b;--pt-theme-accent-2:#d6bc7c;--pt-theme-bg:#090a0c;--pt-theme-bg-soft:#0e1012;--pt-theme-panel:#141619;--pt-theme-panel-2:#1a1d21;--pt-theme-text:#f4f4f2;--pt-theme-muted:#a6a8ab;--pt-theme-line:#3c362b;--pt-theme-shadow:0 18px 55px rgba(0,0,0,.34);
}

/* Base e superficies comuns */
html[data-perfectum-theme] body{background:radial-gradient(circle at 76% -10%,color-mix(in srgb,var(--pt-theme-accent) 9%,transparent),transparent 31%),var(--pt-theme-bg)!important;color:var(--pt-theme-text)!important;transition:background-color .18s ease,color .18s ease}
html[data-perfectum-theme] .sidebar{background:linear-gradient(180deg,color-mix(in srgb,var(--pt-theme-bg-soft) 96%,black 4%) 0%,var(--pt-theme-bg) 100%)!important;border-color:var(--pt-theme-line)!important}
html[data-perfectum-theme] .sidebar-brand,html[data-perfectum-theme] .sidebar-footer,html[data-perfectum-theme] .top,html[data-perfectum-theme] .context-strip,html[data-perfectum-theme] .mobile-topbar{border-color:var(--pt-theme-line)!important}
html[data-perfectum-theme] .context-strip{background:color-mix(in srgb,var(--pt-theme-bg) 94%,transparent)!important}
html[data-perfectum-theme] .mobile-topbar{background:color-mix(in srgb,var(--pt-theme-bg) 94%,transparent)!important}
html[data-perfectum-theme] .card,html[data-perfectum-theme] .section,html[data-perfectum-theme] .authbox,html[data-perfectum-theme] .user-card,html[data-perfectum-theme] .rule-box,html[data-perfectum-theme] .formula-note,html[data-perfectum-theme] .schedule-presets,html[data-perfectum-theme] .schedule-line,html[data-perfectum-theme] .schedule-line.scale-row,html[data-perfectum-theme] .schedule-line.enhanced,html[data-perfectum-theme] .operational-scale-section,html[data-perfectum-theme] .team-add-form,html[data-perfectum-theme] .team-rule,html[data-perfectum-theme] .report-card,html[data-perfectum-theme] .quick-action,html[data-perfectum-theme] .summary-grid>div,html[data-perfectum-theme] .proposal-summary>div,html[data-perfectum-theme] .dependency-grid>div,html[data-perfectum-theme] .deletion-principles>div,html[data-perfectum-theme] .labor-reference-strip>div,html[data-perfectum-theme] .hiring-kpis>div,html[data-perfectum-theme] .report-period-note,html[data-perfectum-theme] .inline-editor{background:linear-gradient(180deg,var(--pt-theme-panel),color-mix(in srgb,var(--pt-theme-panel) 92%,var(--pt-theme-bg) 8%))!important;border-color:var(--pt-theme-line)!important;box-shadow:var(--pt-theme-shadow)}
html[data-perfectum-theme] .card::after{background:radial-gradient(circle,color-mix(in srgb,var(--pt-theme-accent) 10%,transparent),transparent 67%)!important}
html[data-perfectum-theme] .table-section .table-wrap,html[data-perfectum-theme] .table-wrap{border-color:var(--pt-theme-line)!important}
html[data-perfectum-theme] th{background:var(--pt-theme-panel)!important;color:color-mix(in srgb,var(--pt-theme-text) 62%,var(--pt-theme-accent) 38%)!important}
html[data-perfectum-theme] th,html[data-perfectum-theme] td,html[data-perfectum-theme] .kv,html[data-perfectum-theme] .dre-row,html[data-perfectum-theme] .cost-lines>div,html[data-perfectum-theme] .annual-cost{border-color:var(--pt-theme-line)!important}
html[data-perfectum-theme] tbody tr:hover{background:color-mix(in srgb,var(--pt-theme-accent) 7%,transparent)!important}
html[data-perfectum-theme] input,html[data-perfectum-theme] select,html[data-perfectum-theme] textarea{background:var(--pt-theme-panel-2)!important;color:var(--pt-theme-text)!important;border-color:var(--pt-theme-line)!important}
html[data-perfectum-theme] input::placeholder,html[data-perfectum-theme] textarea::placeholder{color:color-mix(in srgb,var(--pt-theme-muted) 78%,transparent)!important}
html[data-perfectum-theme] input:hover,html[data-perfectum-theme] select:hover,html[data-perfectum-theme] textarea:hover{border-color:color-mix(in srgb,var(--pt-theme-accent) 58%,var(--pt-theme-line))!important}
html[data-perfectum-theme] input:focus,html[data-perfectum-theme] select:focus,html[data-perfectum-theme] textarea:focus{border-color:var(--pt-theme-accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--pt-theme-accent) 12%,transparent)!important}
html[data-perfectum-theme] label,html[data-perfectum-theme] .muted,html[data-perfectum-theme] .sub,html[data-perfectum-theme] .micro,html[data-perfectum-theme] .hint,html[data-perfectum-theme] .user-meta span,html[data-perfectum-theme] .table-counter{color:var(--pt-theme-muted)!important}
html[data-perfectum-theme] .card .label,html[data-perfectum-theme] .context-label,html[data-perfectum-theme] .nav-group summary{color:color-mix(in srgb,var(--pt-theme-muted) 86%,var(--pt-theme-accent) 14%)!important}
html[data-perfectum-theme] .brand-copy span,html[data-perfectum-theme] .card .value.cyan,html[data-perfectum-theme] .rule-title,html[data-perfectum-theme] .summary-grid b,html[data-perfectum-theme] .dre-row.total,html[data-perfectum-theme] .effective-time b,html[data-perfectum-theme] .live-dot,html[data-perfectum-theme] .help-icon{color:var(--pt-theme-accent)!important}
html[data-perfectum-theme] .live-dot{background:var(--pt-theme-accent)!important;box-shadow:0 0 12px color-mix(in srgb,var(--pt-theme-accent) 65%,transparent)!important}
html[data-perfectum-theme] .nav-link{color:color-mix(in srgb,var(--pt-theme-text) 80%,var(--pt-theme-muted) 20%)!important}
html[data-perfectum-theme] .nav-link:hover{background:color-mix(in srgb,var(--pt-theme-accent) 8%,var(--pt-theme-panel))!important;border-color:color-mix(in srgb,var(--pt-theme-accent) 30%,var(--pt-theme-line))!important;color:var(--pt-theme-text)!important}
html[data-perfectum-theme] .nav-link.active{background:linear-gradient(90deg,color-mix(in srgb,var(--pt-theme-accent) 17%,var(--pt-theme-panel)),var(--pt-theme-panel))!important;border-color:color-mix(in srgb,var(--pt-theme-accent) 48%,var(--pt-theme-line))!important;color:var(--pt-theme-text)!important;box-shadow:inset 3px 0 0 var(--pt-theme-accent)!important}
html[data-perfectum-theme] .nav-dot{background:color-mix(in srgb,var(--pt-theme-muted) 45%,var(--pt-theme-panel))!important}
html[data-perfectum-theme] .nav-link.active .nav-dot{background:var(--pt-theme-accent)!important;box-shadow:0 0 12px color-mix(in srgb,var(--pt-theme-accent) 62%,transparent)!important}
html[data-perfectum-theme] .user-avatar{background:linear-gradient(135deg,color-mix(in srgb,var(--pt-theme-accent) 25%,var(--pt-theme-panel)),var(--pt-theme-panel-2))!important;color:var(--pt-theme-accent)!important}
html[data-perfectum-theme] .brand-copy small,html[data-perfectum-theme] kbd{background:var(--pt-theme-panel-2)!important;border-color:var(--pt-theme-line)!important;color:var(--pt-theme-muted)!important}
html[data-perfectum-theme] .btn:not(.danger-btn):not(.danger):not(.danger-button):not(.ghost):not(.whatsapp-btn){background:linear-gradient(135deg,var(--pt-theme-accent-2),var(--pt-theme-accent))!important;border-color:color-mix(in srgb,var(--pt-theme-accent) 58%,transparent)!important;color:#fff!important;box-shadow:0 8px 24px color-mix(in srgb,var(--pt-theme-accent) 15%,transparent)!important}
html[data-perfectum-theme="obsidian"] .btn:not(.danger-btn):not(.danger):not(.danger-button):not(.ghost):not(.whatsapp-btn){color:#111!important;font-weight:800}
/* UI-3: destrutiva e ghost saem do primario tematizado e ganham estilo proprio nos 3 temas */
html[data-perfectum-theme] :is(.btn.danger-btn,.btn.danger,.btn.danger-button){background:var(--pt-status-danger)!important;border-color:transparent!important;color:#fff!important;box-shadow:none!important}
html[data-perfectum-theme] .btn.ghost{background:transparent!important;border-color:var(--pt-theme-line)!important;color:var(--pt-theme-muted)!important;box-shadow:none!important}
html[data-perfectum-theme] .btn.ghost:hover{background:color-mix(in srgb,var(--pt-theme-accent) 8%,transparent)!important;border-color:color-mix(in srgb,var(--pt-theme-accent) 42%,var(--pt-theme-line))!important;color:var(--pt-theme-text)!important}
html[data-perfectum-theme] :is(.btn.danger-link,a.danger-link){background:transparent!important;border-color:var(--pt-theme-line)!important;color:var(--pt-status-danger)!important;box-shadow:none!important}
html[data-perfectum-theme] .btn.secondary{background:var(--pt-theme-panel-2)!important;border-color:var(--pt-theme-line)!important;color:var(--pt-theme-text)!important;box-shadow:none!important}
html[data-perfectum-theme] .btn.secondary:hover{background:color-mix(in srgb,var(--pt-theme-accent) 8%,var(--pt-theme-panel-2))!important;border-color:color-mix(in srgb,var(--pt-theme-accent) 45%,var(--pt-theme-line))!important}
html[data-perfectum-theme] .pill:not(.ok):not(.warn):not(.danger),html[data-perfectum-theme] .notice-window,html[data-perfectum-theme] .scope-badge,html[data-perfectum-theme] .chip,html[data-perfectum-theme] .commercial-status{background:color-mix(in srgb,var(--pt-theme-accent) 9%,var(--pt-theme-panel))!important;border-color:color-mix(in srgb,var(--pt-theme-accent) 36%,var(--pt-theme-line))!important;color:color-mix(in srgb,var(--pt-theme-text) 64%,var(--pt-theme-accent) 36%)!important}
html[data-perfectum-theme] .alert{background:var(--pt-theme-panel-2)!important;border-color:var(--pt-theme-line)!important;border-left-color:var(--pt-theme-accent)!important;color:var(--pt-theme-text)!important}
html[data-perfectum-theme] .alert.ok,html[data-perfectum-theme] .alert.success{border-left-color:var(--pt-status-ok)!important}
html[data-perfectum-theme] .alert.warn{border-left-color:var(--pt-status-warn)!important}
html[data-perfectum-theme] .alert.danger,html[data-perfectum-theme] .alert.error{border-left-color:var(--pt-status-danger)!important}
html[data-perfectum-theme] .alert.info{border-left-color:var(--pt-theme-accent)!important}

/* Overlays e ferramentas */
html[data-perfectum-theme] .help-fab,html[data-perfectum-theme] .weather-symbol,html[data-perfectum-theme] .context-action-btn{background:var(--pt-theme-panel-2)!important;border-color:var(--pt-theme-line)!important;color:var(--pt-theme-accent)!important}
html[data-perfectum-theme] .help-panel,html[data-perfectum-theme] .field-help-popover,html[data-perfectum-theme] .command-box,html[data-perfectum-theme] .quick-create-pop,html[data-perfectum-theme] .confirm-box{background:var(--pt-theme-panel)!important;border-color:var(--pt-theme-line)!important;color:var(--pt-theme-text)!important;box-shadow:0 22px 70px rgba(0,0,0,.28)!important}
html[data-perfectum-theme="light"] .help-panel,html[data-perfectum-theme="light"] .field-help-popover,html[data-perfectum-theme="light"] .command-box,html[data-perfectum-theme="light"] .quick-create-pop,html[data-perfectum-theme="light"] .confirm-box{box-shadow:0 22px 70px rgba(32,50,72,.18)!important}

/* Tema claro: ajustes de contraste que nao podem depender dos tons escuros antigos */
html[data-perfectum-theme="light"] body{background:linear-gradient(180deg,#ebeff4 0%,#e7ebf2 100%)!important}
html[data-perfectum-theme="light"] .sidebar{background:linear-gradient(180deg,#f5f7fa 0%,#eef2f7 100%)!important;box-shadow:8px 0 30px rgba(31,50,72,.05)}
html[data-perfectum-theme="light"] .sidebar-footer{background:#eef2f7!important}
html[data-perfectum-theme="light"] .section p,html[data-perfectum-theme="light"] .help-panel p,html[data-perfectum-theme="light"] .team-rule p,html[data-perfectum-theme="light"] .report-card p{color:#566477!important}
html[data-perfectum-theme="light"] .section strong,html[data-perfectum-theme="light"] .card .value,html[data-perfectum-theme="light"] .user-card strong,html[data-perfectum-theme="light"] .context-item strong,html[data-perfectum-theme="light"] .help-panel strong{color:#172033!important}
html[data-perfectum-theme="light"] .logout-link{color:#667085!important}
html[data-perfectum-theme="light"] .logout-link:hover{color:#1769e0!important}
html[data-perfectum-theme="light"] [data-tooltip]::after{background:#172033!important;color:#fff!important;border-color:#344054!important}
html[data-perfectum-theme="light"] option{background:#fff;color:#172033}

/* Obsidian: dourado so como acento; status operacionais continuam semanticos */
html[data-perfectum-theme="obsidian"] body{background:radial-gradient(circle at 75% -12%,rgba(198,161,91,.085),transparent 30%),#090a0c!important}
html[data-perfectum-theme="obsidian"] .sidebar{background:linear-gradient(180deg,#111316 0%,#090a0c 100%)!important}
html[data-perfectum-theme="obsidian"] .card,html[data-perfectum-theme="obsidian"] .section,html[data-perfectum-theme="obsidian"] .report-card{background:linear-gradient(180deg,#15171a,#101214)!important}
html[data-perfectum-theme="obsidian"] .pill.ok,html[data-perfectum-theme="obsidian"] .ok-pill{background:#12382d!important;color:#8cf0c5!important;border-color:#245d4b!important}
html[data-perfectum-theme="obsidian"] .pill.warn{background:#3c2d10!important;color:#ffd68a!important;border-color:#5b471e!important}
html[data-perfectum-theme="obsidian"] .pill.danger{background:#3c1620!important;color:#ff9cab!important;border-color:#61303a!important}

/* Seletor de aparencia */
.perfectum-theme-trigger{width:100%;display:flex;align-items:center;gap:10px;margin:0 0 9px;padding:9px;border:1px solid var(--pt-theme-line);border-radius:12px;background:var(--pt-theme-panel);color:var(--pt-theme-text);cursor:pointer;text-align:left;transition:.16s ease}
.perfectum-theme-trigger:hover{border-color:color-mix(in srgb,var(--pt-theme-accent) 48%,var(--pt-theme-line));background:color-mix(in srgb,var(--pt-theme-accent) 6%,var(--pt-theme-panel))}
.perfectum-theme-trigger-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:color-mix(in srgb,var(--pt-theme-accent) 13%,var(--pt-theme-panel-2));color:var(--pt-theme-accent);font-size:18px}
.perfectum-theme-trigger>span:nth-child(2){min-width:0;flex:1}.perfectum-theme-trigger b,.perfectum-theme-trigger small{display:block}.perfectum-theme-trigger b{font-size:11px}.perfectum-theme-trigger small{margin-top:2px;color:var(--pt-theme-muted);font-size:9.5px}.perfectum-theme-trigger>i{font-style:normal;color:var(--pt-theme-muted);font-size:18px}
.auth-theme-trigger,.floating-theme-trigger{position:fixed;right:20px;top:18px;width:auto;min-width:158px;z-index:90;box-shadow:var(--pt-theme-shadow)}
.perfectum-theme-overlay{position:fixed;inset:0;display:grid;place-items:center;padding:20px;background:rgba(3,7,12,.68);backdrop-filter:blur(8px);opacity:0;visibility:hidden;pointer-events:none;transition:.16s ease;z-index:2000}
.perfectum-theme-overlay.open{opacity:1;visibility:visible;pointer-events:auto}
.perfectum-theme-dialog{width:min(920px,96vw);max-height:90vh;overflow:auto;padding:22px;border:1px solid var(--pt-theme-line);border-radius:20px;background:var(--pt-theme-bg-soft);color:var(--pt-theme-text);box-shadow:0 28px 90px rgba(0,0,0,.42)}
.perfectum-theme-head{display:flex;gap:20px;justify-content:space-between;align-items:flex-start;padding-bottom:18px;border-bottom:1px solid var(--pt-theme-line)}
.perfectum-theme-head span{display:block;color:var(--pt-theme-accent);font-size:9px;font-weight:850;letter-spacing:.14em}.perfectum-theme-head h2{margin:5px 0 0;font-size:23px}.perfectum-theme-head p{max-width:680px;margin:7px 0 0;color:var(--pt-theme-muted);font-size:12px}.perfectum-theme-close{width:36px;height:36px;border:1px solid var(--pt-theme-line);border-radius:10px;background:var(--pt-theme-panel);color:var(--pt-theme-text);font-size:21px;cursor:pointer}
.perfectum-theme-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:18px}
.perfectum-theme-choice{min-height:188px;display:flex;flex-direction:column;justify-content:space-between;padding:16px;border:1px solid var(--pt-theme-line);border-radius:16px;background:var(--pt-theme-panel);color:var(--pt-theme-text);cursor:pointer;text-align:left;transition:.16s ease}
.perfectum-theme-choice:hover{transform:translateY(-2px);border-color:color-mix(in srgb,var(--pt-theme-accent) 50%,var(--pt-theme-line))}.perfectum-theme-choice.active{border-color:var(--pt-theme-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--pt-theme-accent) 12%,transparent)}
.theme-choice-top{display:flex;gap:12px;align-items:flex-start}.theme-choice-top>span{flex:1}.theme-choice-top b,.theme-choice-top small{display:block}.theme-choice-top b{font-size:14px}.theme-choice-top small{margin-top:7px;color:var(--pt-theme-muted);font-size:10.5px;line-height:1.45}.theme-choice-mark{width:25px;height:25px;display:grid;place-items:center;border:1px solid var(--pt-theme-line);border-radius:50%;color:var(--pt-theme-accent);font-style:normal;font-weight:900}.perfectum-theme-choice.active .theme-choice-mark{border-color:var(--pt-theme-accent);background:color-mix(in srgb,var(--pt-theme-accent) 12%,transparent)}
.theme-swatches{display:grid;grid-template-columns:repeat(4,1fr);height:40px;margin-top:18px;border:1px solid var(--pt-theme-line);border-radius:10px;overflow:hidden}.theme-swatches i{background:var(--swatch)}
.perfectum-theme-foot{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-top:18px;padding-top:16px;border-top:1px solid var(--pt-theme-line)}.perfectum-theme-foot>span{color:var(--pt-theme-muted);font-size:10.5px}
@media(max-width:780px){.perfectum-theme-grid{grid-template-columns:1fr}.perfectum-theme-choice{min-height:142px}.perfectum-theme-dialog{padding:16px}.perfectum-theme-head h2{font-size:20px}.perfectum-theme-foot{align-items:stretch;flex-direction:column}.perfectum-theme-foot .btn{width:100%}}
@media(max-width:900px){.perfectum-theme-trigger{margin-bottom:8px}}
@media print{.perfectum-theme-trigger,.perfectum-theme-overlay{display:none!important}}

/* ==========================================================
   PERFECTUM GESTAO — R10.8.6.1_THEME_POLISH
   Normalizacao premium de contraste e superficies.
   Escopo: Executive Light + Obsidian Premium.
   Corporate permanece visualmente inalterado.
   ========================================================== */

/* ---------- TOKENS DE LEITURA / SUPERFICIE ---------- */
html[data-perfectum-theme="light"]{
  --pt-surface-0:#e9edf3;
  --pt-surface-1:#ffffff;
  --pt-surface-2:#f1f4f8;
  --pt-surface-3:#e8edf4;
  --pt-surface-line:#d4dbe4;
  --pt-ink-strong:#101828;
  --pt-ink:#1d2939;
  --pt-ink-soft:#475467;
  --pt-ink-muted:#667085;
  --pt-accent-soft:#eaf2ff;
}
html[data-perfectum-theme="obsidian"]{
  --pt-surface-0:#090a0c;
  --pt-surface-1:#111316;
  --pt-surface-2:#17191d;
  --pt-surface-3:#1d2025;
  --pt-surface-line:#3b352b;
  --pt-ink-strong:#fffaf0;
  --pt-ink:#f2eee6;
  --pt-ink-soft:#c4beb3;
  --pt-ink-muted:#a7a198;
  --pt-accent-soft:#2b2418;
  --pt-theme-accent:#d0aa62;
  --pt-theme-accent-2:#e0c078;
  --cyan:#d0aa62;
  --cyan-soft:#e8d29b;
  --blue:#b88e49;
  --text:#f2eee6;
  --muted:#a7a198;
  --muted-2:#837e76;
}

/* ---------- TIPOGRAFIA: nunca herdar texto escuro sobre painel escuro ---------- */
html[data-perfectum-theme="light"] :is(h1,h2,h3,h4,h5,h6){color:var(--pt-ink-strong)!important}
html[data-perfectum-theme="light"] :is(.page-title,.section-title,.panel-title,.card-title,.metric-value,.kpi-value,.stat-value,.summary-value,.total-value){color:var(--pt-ink-strong)!important}
html[data-perfectum-theme="obsidian"] :is(h1,h2,h3,h4,h5,h6){color:var(--pt-ink-strong)!important}
html[data-perfectum-theme="obsidian"] :is(.page-title,.section-title,.panel-title,.card-title,.metric-value,.kpi-value,.stat-value,.summary-value,.total-value){color:var(--pt-ink-strong)!important}

/* Textos comuns dentro de superficies gerenciais */
html[data-perfectum-theme="light"] :is(.card,.section,.report-card,.proposal-qr-card,.analysis-hero,.health-overall,.health-check,.labor-status,.hiring-decision,.proposal-schedule-card,.team-rule,.team-add-form,.quick-action,.cause-grid>div,.hiring-kpis>div,.labor-reference-strip>div) :is(b,strong){color:var(--pt-ink-strong)!important}
html[data-perfectum-theme="light"] :is(.card,.section,.report-card,.proposal-qr-card,.analysis-hero,.health-overall,.health-check,.labor-status,.hiring-decision,.proposal-schedule-card,.team-rule,.team-add-form,.quick-action,.cause-grid>div,.hiring-kpis>div,.labor-reference-strip>div) :is(p,small,span:not(.pill):not(.chip):not(.commercial-status):not(.analysis-status)){color:var(--pt-ink-soft)}
html[data-perfectum-theme="obsidian"] :is(.card,.section,.report-card,.proposal-qr-card,.analysis-hero,.health-overall,.health-check,.labor-status,.hiring-decision,.proposal-schedule-card,.team-rule,.team-add-form,.quick-action,.cause-grid>div,.hiring-kpis>div,.labor-reference-strip>div) :is(b,strong){color:var(--pt-ink-strong)!important}
html[data-perfectum-theme="obsidian"] :is(.card,.section,.report-card,.proposal-qr-card,.analysis-hero,.health-overall,.health-check,.labor-status,.hiring-decision,.proposal-schedule-card,.team-rule,.team-add-form,.quick-action,.cause-grid>div,.hiring-kpis>div,.labor-reference-strip>div) :is(p,small,span:not(.pill):not(.chip):not(.commercial-status):not(.analysis-status)){color:var(--pt-ink-soft)}

/* ---------- EXECUTIVE LIGHT: superficies antigas escuras passam a claras ---------- */
html[data-perfectum-theme="light"] :is(
  .proposal-qr-card,.analysis-hero,.health-overall,.health-check,.history-health-grid>div,.health-legend,
  .cause-grid>div,.analysis-guidance,.analysis-footer-note,.team-total,.team-add-form,.team-rule,
  .labor-status,.labor-reference-strip>div,.hiring-switches,.hiring-decision,.hiring-kpis>div,
  .deletion-principles>div,.dependency-grid>div,.report-card,.report-card.featured,.inline-editor,
  .proposal-schedule-card,.schedule-preset-control,.proposal-description-box,.proposal-checklist>div,
  .receipt-preview-card,.check-card,.nr6-mini,.epi-receipt-item,.center-state,.onboarding-card,
  .simulator-decision-card,.health-period-banner,.batch-review,.field-help-popover
){
  background:linear-gradient(180deg,var(--pt-surface-1),var(--pt-surface-2))!important;
  border-color:var(--pt-surface-line)!important;
  color:var(--pt-ink)!important;
  box-shadow:0 1px 2px rgba(23,42,69,.05),0 12px 30px rgba(23,42,69,.10)!important;
}
html[data-perfectum-theme="light"] :is(.proposal-qr-card,.report-card,.report-card.featured,.analysis-hero,.hiring-decision,.simulator-decision-card)::after{opacity:.28}
html[data-perfectum-theme="light"] .proposal-qr-card :is(strong,b){color:var(--pt-ink-strong)!important}
html[data-perfectum-theme="light"] .proposal-qr-card :is(span,a){color:#1769e0!important}
html[data-perfectum-theme="light"] .proposal-qr-card small{color:var(--pt-ink-soft)!important}
html[data-perfectum-theme="light"] .report-card>span{color:#1769e0!important}
html[data-perfectum-theme="light"] .report-card h2{color:var(--pt-ink-strong)!important}
html[data-perfectum-theme="light"] .report-card p{color:var(--pt-ink-soft)!important}
html[data-perfectum-theme="light"] .report-card>b{color:#1769e0!important}

/* UI-6: removidos os blocos especulativos .kanban-*/.pipeline-*/div[class*="kpi-card"] etc.
   (nenhum template usa essas classes; ver perfectum-components.css p/ primitivas reais). */

/* Tabelas Light — leitura longa */
html[data-perfectum-theme="light"] table{background:#fff!important;color:var(--pt-ink)!important}
html[data-perfectum-theme="light"] thead th{background:#eef2f7!important;color:#23406a!important;border-color:#d4dbe4!important}
html[data-perfectum-theme="light"] tbody tr{background:#fff}
html[data-perfectum-theme="light"] tbody tr:nth-child(even){background:#f9fbfd}
html[data-perfectum-theme="light"] tbody td{color:var(--pt-ink)!important;border-color:#e0e6ed!important}
html[data-perfectum-theme="light"] tbody tr:hover{background:#eef5ff!important}

/* Graficos Light */
html[data-perfectum-theme="light"] .chart-grid{stroke:#dbe3ec!important;opacity:1!important}
html[data-perfectum-theme="light"] .chart-axis,html[data-perfectum-theme="light"] .chart-label{fill:#667085!important}
html[data-perfectum-theme="light"] .chart-value{fill:#1769e0!important}
html[data-perfectum-theme="light"] .margin-line{stroke:#1769e0!important}
html[data-perfectum-theme="light"] .margin-point{fill:#fff!important;stroke:#1769e0!important}
html[data-perfectum-theme="light"] .chart-legend{color:#667085!important}

/* ---------- OBSIDIAN PREMIUM: contraste executivo completo ---------- */
html[data-perfectum-theme="obsidian"] .sidebar-footer{background:#0d0f11!important}
html[data-perfectum-theme="obsidian"] :is(
  .proposal-qr-card,.analysis-hero,.health-overall,.health-check,.history-health-grid>div,.health-legend,
  .cause-grid>div,.analysis-guidance,.analysis-footer-note,.team-total,.team-add-form,.team-rule,
  .labor-status,.labor-reference-strip>div,.hiring-switches,.hiring-decision,.hiring-kpis>div,
  .deletion-principles>div,.dependency-grid>div,.report-card,.report-card.featured,.inline-editor,
  .proposal-schedule-card,.schedule-preset-control,.proposal-description-box,.proposal-checklist>div,
  .receipt-preview-card,.check-card,.nr6-mini,.epi-receipt-item,.center-state,.onboarding-card,
  .simulator-decision-card,.health-period-banner,.batch-review,.field-help-popover
){
  background:linear-gradient(180deg,#17191d,#111316)!important;
  border-color:#3b352b!important;
  color:var(--pt-ink)!important;
  box-shadow:0 14px 38px rgba(0,0,0,.28)!important;
}
html[data-perfectum-theme="obsidian"] .proposal-qr-card :is(strong,b,h3){color:#fffaf0!important}
html[data-perfectum-theme="obsidian"] .proposal-qr-card :is(span,a){color:#e0c078!important}
html[data-perfectum-theme="obsidian"] .proposal-qr-card small{color:#b8b1a6!important}
html[data-perfectum-theme="obsidian"] .report-card>span{color:#d0aa62!important}
html[data-perfectum-theme="obsidian"] .report-card h2{color:#fffaf0!important}
html[data-perfectum-theme="obsidian"] .report-card p{color:#bdb6ab!important}
html[data-perfectum-theme="obsidian"] .report-card>b{color:#e0c078!important}

/* UI-6: removidos os blocos especulativos .kanban-*/div[class*="kpi-card"] etc. (0 uso). */

/* Tabelas Obsidian */
html[data-perfectum-theme="obsidian"] table{background:#111316!important;color:#f2eee6!important}
html[data-perfectum-theme="obsidian"] thead th{background:#1a1d21!important;color:#e2c784!important;border-color:#40382c!important}
html[data-perfectum-theme="obsidian"] tbody tr{background:#111316!important}
html[data-perfectum-theme="obsidian"] tbody tr:nth-child(even){background:#15171a!important}
html[data-perfectum-theme="obsidian"] tbody td{color:#eeeae2!important;border-color:#302d28!important}
html[data-perfectum-theme="obsidian"] tbody tr:hover{background:#211d16!important}

/* Inputs e selects Obsidian — contraste de texto, option e autofill */
html[data-perfectum-theme="obsidian"] input,html[data-perfectum-theme="obsidian"] select,html[data-perfectum-theme="obsidian"] textarea{background:#17191d!important;color:#f4f0e8!important;border-color:#40382d!important}
html[data-perfectum-theme="obsidian"] option{background:#17191d;color:#f4f0e8}
html[data-perfectum-theme="obsidian"] input::placeholder,html[data-perfectum-theme="obsidian"] textarea::placeholder{color:#817c74!important}
html[data-perfectum-theme="obsidian"] input:-webkit-autofill,html[data-perfectum-theme="obsidian"] input:-webkit-autofill:hover,html[data-perfectum-theme="obsidian"] input:-webkit-autofill:focus{-webkit-text-fill-color:#f4f0e8!important;box-shadow:0 0 0 1000px #17191d inset!important}

/* Graficos Obsidian */
html[data-perfectum-theme="obsidian"] .chart-grid{stroke:#383126!important;opacity:1!important}
html[data-perfectum-theme="obsidian"] .chart-axis,html[data-perfectum-theme="obsidian"] .chart-label{fill:#aaa399!important}
html[data-perfectum-theme="obsidian"] .chart-value{fill:#e0c078!important}
html[data-perfectum-theme="obsidian"] .bar-revenue{fill:#a17d42!important}
html[data-perfectum-theme="obsidian"] .bar-result{fill:#d0aa62!important}
html[data-perfectum-theme="obsidian"] .margin-line{stroke:#e0c078!important}
html[data-perfectum-theme="obsidian"] .margin-point{fill:#111316!important;stroke:#e0c078!important}
html[data-perfectum-theme="obsidian"] .chart-legend{color:#aaa399!important}
html[data-perfectum-theme="obsidian"] .legend-dot.revenue{background:#a17d42!important}
html[data-perfectum-theme="obsidian"] .legend-dot.result{background:#d0aa62!important}

/* Bordas, divisores e links — acabamento */
html[data-perfectum-theme="light"] :is(hr,.divider,.separator){border-color:#dbe3ec!important;color:#dbe3ec!important}
html[data-perfectum-theme="obsidian"] :is(hr,.divider,.separator){border-color:#393229!important;color:#393229!important}
html[data-perfectum-theme="light"] a:not(.btn):not(.nav-link):not(.whatsapp-btn){color:#1769e0}
html[data-perfectum-theme="obsidian"] a:not(.btn):not(.nav-link):not(.whatsapp-btn){color:#d7b56d}
html[data-perfectum-theme="light"] ::selection{background:#cfe1ff;color:#101828}
html[data-perfectum-theme="obsidian"] ::selection{background:#6b552e;color:#fffaf0}

/* Scrollbar discreta, mantendo navegabilidade */
html[data-perfectum-theme="light"] *{scrollbar-color:#bcc9d8 #edf2f7}
html[data-perfectum-theme="obsidian"] *{scrollbar-color:#5a4b34 #111316}

/* Guardrail: estados semanticos nunca viram azul/dourado por causa do tema */
html[data-perfectum-theme] :is(.pill.ok,.ok-pill,.status-ok,.status-success,.success,.badge-success){--pt-semantic-color:var(--pt-status-ok)}
html[data-perfectum-theme] :is(.pill.warn,.status-warn,.warning,.badge-warning){--pt-semantic-color:var(--pt-status-warn)}
html[data-perfectum-theme] :is(.pill.danger,.status-danger,.danger,.critical,.badge-danger){--pt-semantic-color:var(--pt-status-danger)}

/* Impressao continua independente do tema de tela */
@media print{
  html[data-perfectum-theme="light"],html[data-perfectum-theme="obsidian"]{color-scheme:light!important}
  html[data-perfectum-theme="light"] body,html[data-perfectum-theme="obsidian"] body{background:#fff!important;color:#111!important}
}

/* ==========================================================
   PERFECTUM GESTAO — R10.8.6.2_LIGHT_SEMANTIC_HOTFIX_SAFE
   Escopo: Executive Light apenas. Corporate e Obsidian inalterados.
   - Status semanticos em superficies claras
   - Texto generico .warning/.danger permanece texto, nao vira pilula
   - Contraste reforcado no texto secundario
   ========================================================== */
html[data-perfectum-theme="light"]{
  --pt-status-ok-ink:#12784a;
  --pt-status-warn-ink:#8a5a0a;
  --pt-status-danger-ink:#b3283a;
  --pt-status-ok-bg:#e6f6ee;
  --pt-status-warn-bg:#fdf3e0;
  --pt-status-danger-bg:#fdeaed;
  --pt-status-ok-line:#9fd9bc;
  --pt-status-warn-line:#ecc78a;
  --pt-status-danger-line:#f0a7b1;
  --pt-muted-2-light:#5f6b7a;
  --muted-2:var(--pt-muted-2-light);
}
/* Pilulas/badges/status: fundo semantico claro. Nao inclui .warning/.danger genericos. */
html[data-perfectum-theme="light"] :is(.pill.ok,.ok-pill,.badge-success,.status-ok,.status-success){
  background:var(--pt-status-ok-bg)!important;color:var(--pt-status-ok-ink)!important;border-color:var(--pt-status-ok-line)!important;
}
html[data-perfectum-theme="light"] :is(.pill.warn,.badge-warning,.status-warn,.status-warning){
  background:var(--pt-status-warn-bg)!important;color:var(--pt-status-warn-ink)!important;border-color:var(--pt-status-warn-line)!important;
}
html[data-perfectum-theme="light"] :is(.pill.danger,.badge-danger,.status-danger,.status-critical){
  background:var(--pt-status-danger-bg)!important;color:var(--pt-status-danger-ink)!important;border-color:var(--pt-status-danger-line)!important;
}
/* Alertas completos */
html[data-perfectum-theme="light"] :is(.alert.ok,.alert.success){background:var(--pt-status-ok-bg)!important;border-color:var(--pt-status-ok-line)!important;color:var(--pt-ink)!important;}
html[data-perfectum-theme="light"] :is(.alert.warn,.alert.warning){background:var(--pt-status-warn-bg)!important;border-color:var(--pt-status-warn-line)!important;color:var(--pt-ink)!important;}
html[data-perfectum-theme="light"] :is(.alert.danger,.alert.error,.alert.critical){background:var(--pt-status-danger-bg)!important;border-color:var(--pt-status-danger-line)!important;color:var(--pt-ink)!important;}
/* Classes semanticas de texto: mantem somente cor, sem criar fundo/borda inesperados em KPIs. */
html[data-perfectum-theme="light"] :is(.text-ok,.text-success,.ok-text){color:var(--pt-status-ok-ink)!important;}
html[data-perfectum-theme="light"] :is(.text-warn,.text-warning,.warn-text,.warning){color:var(--pt-status-warn-ink)!important;}
html[data-perfectum-theme="light"] :is(.text-danger,.danger-text,.danger,.critical){color:var(--pt-status-danger-ink)!important;}

/* ============================================================================
   R10.11.1 — PADRAO PREMIUM: componentes com <style> local passam a respeitar
   os 3 temas (corporate / light / obsidian). Somente cor/superficie; layout intacto.
   ============================================================================ */

/* --- Rentabilidade executiva (bloco .r82-* em contract_detail.html) --- */
html[data-perfectum-theme] .r82-profit{
  background:linear-gradient(135deg,color-mix(in srgb,var(--pt-theme-panel) 96%,var(--pt-theme-accent) 4%),var(--pt-theme-panel-2))!important;
  border:1px solid color-mix(in srgb,var(--pt-theme-accent) 22%,var(--pt-theme-line))!important;
  box-shadow:var(--pt-theme-shadow)!important;
}
html[data-perfectum-theme] .r82-card{
  background:color-mix(in srgb,var(--pt-theme-panel) 88%,var(--pt-theme-bg) 12%)!important;
  border:1px solid var(--pt-theme-line)!important;
}
html[data-perfectum-theme] .r82-step,
html[data-perfectum-theme] .r82-target{
  background:color-mix(in srgb,var(--pt-theme-panel-2) 92%,var(--pt-theme-bg) 8%)!important;
  border:1px solid var(--pt-theme-line)!important;
}
html[data-perfectum-theme] .r82-card .k,
html[data-perfectum-theme] .r82-card .s{color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] .r82-cyan{color:var(--pt-theme-accent)!important;}
html[data-perfectum-theme] .r82-ok,
html[data-perfectum-theme] .r82-status .status-big.ok{color:var(--pt-status-ok)!important;}
html[data-perfectum-theme] .r82-warn,
html[data-perfectum-theme] .r82-status .status-big.warn{color:var(--pt-status-warn)!important;}
html[data-perfectum-theme] .r82-danger,
html[data-perfectum-theme] .r82-status .status-big.danger{color:var(--pt-status-danger)!important;}
html[data-perfectum-theme] .r82-status .status-big.muted{color:var(--pt-theme-muted)!important;}

/* --- Dashboard executivo (.exec2): redefine os tokens locais por tema --- */
html[data-perfectum-theme] .exec2{
  --e2:var(--pt-theme-accent);
  --e2b:var(--pt-theme-panel);
  --e2c:var(--pt-theme-panel-2);
  --e2line:var(--pt-theme-line);
  --e2muted:var(--pt-theme-muted);
  --e2danger:var(--pt-status-danger);
  --e2warn:var(--pt-status-warn);
}
html[data-perfectum-theme] .exec2 .e2-panel,
html[data-perfectum-theme] .exec2 .e2-kpi,
html[data-perfectum-theme] .exec2 .e2-action-alert{
  background:linear-gradient(150deg,var(--pt-theme-panel),color-mix(in srgb,var(--pt-theme-panel) 92%,var(--pt-theme-bg) 8%))!important;
  border-color:var(--pt-theme-line)!important;
}
html[data-perfectum-theme] .exec2 .e2-mini,
html[data-perfectum-theme] .exec2 .e2-alert,
html[data-perfectum-theme] .exec2 .e2-op,
html[data-perfectum-theme] .exec2 .e2-attention-pill,
html[data-perfectum-theme] .exec2 .e2-filter,
html[data-perfectum-theme] .exec2 .e2-status,
html[data-perfectum-theme] .exec2 .e2-badge,
html[data-perfectum-theme] .exec2 .e2-month-link{
  background:color-mix(in srgb,var(--pt-theme-panel-2) 90%,var(--pt-theme-bg) 10%)!important;
  border-color:var(--pt-theme-line)!important;
}
html[data-perfectum-theme] .exec2 .e2-kpi .lab,
html[data-perfectum-theme] .exec2 .e2-kpi .micro2,
html[data-perfectum-theme] .exec2 .e2-cat,
html[data-perfectum-theme] .exec2 .e2-action-detail,
html[data-perfectum-theme] .exec2 .e2-attention-note,
html[data-perfectum-theme] .exec2 .e2-table th{color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] .exec2 .e2-action-title,
html[data-perfectum-theme] .exec2 .e2-table a,
html[data-perfectum-theme] .exec2 .e2-foot-actions a,
html[data-perfectum-theme] .exec2 .e2-month-link,
html[data-perfectum-theme] .exec2 .e2-badge,
html[data-perfectum-theme] .exec2 .e2-section-title .smalllink{color:var(--pt-theme-text)!important;}
html[data-perfectum-theme] .exec2 .e2-kpi.primary .num,
html[data-perfectum-theme] .exec2 .e2-cash-main.pos,
html[data-perfectum-theme] .exec2 .e2-status.ok,
html[data-perfectum-theme] .exec2 .e2-margin.good{color:var(--pt-status-ok)!important;}
html[data-perfectum-theme] .exec2 .e2-margin.warn,
html[data-perfectum-theme] .exec2 .e2-status.blocked{color:var(--pt-status-warn)!important;}
html[data-perfectum-theme] .exec2 .e2-margin.bad,
html[data-perfectum-theme] .exec2 .e2-cash-main.neg{color:var(--pt-status-danger)!important;}
html[data-perfectum-theme] .exec2 .e2-table td,
html[data-perfectum-theme] .exec2 .e2-statline{border-color:var(--pt-theme-line)!important;}
html[data-perfectum-theme] .exec2 .e2-table th{background:color-mix(in srgb,var(--pt-theme-panel) 92%,var(--pt-theme-bg) 8%)!important;border-color:var(--pt-theme-line)!important;}

/* --- reports.html: caixa executiva destacada --- */
html[data-perfectum-theme] .report-exec-highlight{
  border:1px solid color-mix(in srgb,var(--pt-theme-accent) 30%,var(--pt-theme-line))!important;
  background:linear-gradient(135deg,color-mix(in srgb,var(--pt-theme-panel) 94%,var(--pt-theme-accent) 6%),var(--pt-theme-panel-2))!important;
}
html[data-perfectum-theme] .report-exec-kicker{color:var(--pt-theme-accent)!important;}

/* --- smart_pricing.html: cartoes de jornada --- */
html[data-perfectum-theme] .pricing-choice{
  border:1px solid color-mix(in srgb,var(--pt-theme-accent) 24%,var(--pt-theme-line))!important;
  background:color-mix(in srgb,var(--pt-theme-panel-2) 90%,var(--pt-theme-bg) 10%)!important;
}
html[data-perfectum-theme] .pricing-choice:hover{border-color:var(--pt-theme-accent)!important;}
html[data-perfectum-theme] .value-card.floor-warn{border-color:color-mix(in srgb,var(--pt-status-danger) 55%,var(--pt-theme-line))!important;}

/* --- caixa de assinatura (inspecao): area clara p/ assinar, borda temada --- */
html[data-perfectum-theme] .signature-pad-box{border:1px solid var(--pt-theme-line)!important;}

/* --- R10.11 sugestoes de disponibilidade: superficie temada --- */
html[data-perfectum-theme] tr.r1011-suggest>td{
  background:color-mix(in srgb,var(--pt-theme-panel-2) 85%,var(--pt-theme-bg) 15%)!important;
}

/* --- R10.11.1 (parte 2): design-systems de escopo local (telas de Operacao/RH/CRM) --- */
html[data-perfectum-theme] :is(
  .r102-hero,.r102-card,.r102-panel,
  .rh-hero,.rh-kpi,.rh-card,
  .op2-hero,.op2-card,.op2-panel,.op2-kpi,
  .abs-hero,.abs-card,.abs-panel,
  .sub-hero,.sub-card,.sub-panel,
  .cov-hero,.cov-card,.cov-panel,
  .crm108-card,.crm108-panel,
  .c360-card,.c360-panel,.client360-card,
  .box,.metrics .m,.two>section){
  background:linear-gradient(160deg,var(--pt-theme-panel),color-mix(in srgb,var(--pt-theme-panel) 92%,var(--pt-theme-bg) 8%))!important;
  border-color:var(--pt-theme-line)!important;
  color:var(--pt-theme-text)!important;
}
html[data-perfectum-theme] :is(.r102-hero,.rh-hero,.op2-hero,.abs-hero,.sub-hero,.cov-hero){
  background:linear-gradient(135deg,color-mix(in srgb,var(--pt-theme-panel) 94%,var(--pt-theme-accent) 6%),var(--pt-theme-panel-2))!important;
  border:1px solid color-mix(in srgb,var(--pt-theme-accent) 22%,var(--pt-theme-line))!important;
}
html[data-perfectum-theme] :is(
  .r102-hero .k,.r102-card small,.r102-panel p,.r102-panel small,.r102-empty,
  .rh-kpi .k,.rh-meta,.rh-row span,
  .op2-card small,.abs-card small,.sub-card small,.cov-card small){color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] :is(.r102-card b,.r102-panel h2,.rh-card h3){color:var(--pt-theme-text)!important;}
html[data-perfectum-theme] :is(.r102-hero .k,.rh-filter a.active,.rh-pill.good){color:var(--pt-theme-accent)!important;}
html[data-perfectum-theme] :is(.r102-card .warn,.rh-missing,.rh-pill.warn){color:var(--pt-status-warn)!important;}
html[data-perfectum-theme] :is(.r102-table th){background:color-mix(in srgb,var(--pt-theme-panel) 92%,var(--pt-theme-bg) 8%)!important;color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] :is(.r102-table th,.r102-table td){border-color:var(--pt-theme-line)!important;color:var(--pt-theme-text)!important;}
html[data-perfectum-theme] .r102-table tr:hover td{background:color-mix(in srgb,var(--pt-theme-accent) 7%,transparent)!important;}
html[data-perfectum-theme] :is(.r102-chip,.rh-pill){background:color-mix(in srgb,var(--pt-theme-accent) 9%,var(--pt-theme-panel))!important;border-color:color-mix(in srgb,var(--pt-theme-accent) 30%,var(--pt-theme-line))!important;}
html[data-perfectum-theme] :is(.r102-chip.bad){background:color-mix(in srgb,var(--pt-status-danger) 12%,var(--pt-theme-panel))!important;border-color:color-mix(in srgb,var(--pt-status-danger) 40%,var(--pt-theme-line))!important;color:var(--pt-status-danger)!important;}
html[data-perfectum-theme] :is(.rh-kpi,.rh-progress){background:color-mix(in srgb,var(--pt-theme-panel-2) 88%,var(--pt-theme-bg) 12%)!important;}
html[data-perfectum-theme] .rh-filter a{background:color-mix(in srgb,var(--pt-theme-panel-2) 90%,var(--pt-theme-bg) 10%)!important;border-color:var(--pt-theme-line)!important;color:var(--pt-theme-muted)!important;}

/* ============================================================================
   R10.11.2 — PADRAO PREMIUM: CRM Comercial (funil + oportunidade) e Banco de
   Talentos. Alinha os <style> locais (crm108-* / r9-*) aos 3 temas. Somente
   cor/superficie; a grade dos indicadores volta ao componente .cards padrao
   pelo proprio template. Sem app.py, sem rota, sem schema.
   ============================================================================ */

/* --- CRM · agenda / inteligencia comercial --- */
html[data-perfectum-theme] :is(.crm108-agenda-item,.crm108-attention-item){
  background:color-mix(in srgb,var(--pt-theme-panel-2) 88%,var(--pt-theme-bg) 12%)!important;
  border-color:var(--pt-theme-line)!important;
  color:var(--pt-theme-text)!important;
}
html[data-perfectum-theme] :is(
  .crm108-agenda-item span,.crm108-attention-item span,.crm108-attention-item small,
  .crm108-due,.crm108-empty,.crm108-legacy span,.crm108-money small,
  .crm108-scoreline,.crm108-meta,.crm108-meta b small){color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] .crm108-due.overdue,
html[data-perfectum-theme] .crm108-meta.overdue b{color:var(--pt-status-danger)!important;}

/* --- CRM · chips de score --- */
html[data-perfectum-theme] .crm108-score{border-color:var(--pt-theme-line)!important;}
html[data-perfectum-theme] .crm108-score.score-high{color:var(--pt-status-danger)!important;border-color:color-mix(in srgb,var(--pt-status-danger) 45%,var(--pt-theme-line))!important;}
html[data-perfectum-theme] .crm108-score.score-mid{color:var(--pt-status-warn)!important;border-color:color-mix(in srgb,var(--pt-status-warn) 45%,var(--pt-theme-line))!important;}
html[data-perfectum-theme] .crm108-score.score-low{color:var(--pt-theme-accent)!important;}

/* --- CRM · board / colunas / cards do funil --- */
html[data-perfectum-theme] .crm108-board-wrap{background:transparent!important;}
html[data-perfectum-theme] .crm108-column,
html[data-perfectum-theme] .crm108-column header{
  background:color-mix(in srgb,var(--pt-theme-panel) 92%,var(--pt-theme-bg) 8%)!important;
  border-color:var(--pt-theme-line)!important;
}
html[data-perfectum-theme] .crm108-column header span{
  background:color-mix(in srgb,var(--pt-theme-accent) 12%,var(--pt-theme-panel))!important;
  border-color:color-mix(in srgb,var(--pt-theme-accent) 34%,var(--pt-theme-line))!important;
  color:color-mix(in srgb,var(--pt-theme-text) 62%,var(--pt-theme-accent) 38%)!important;
}
html[data-perfectum-theme] .crm108-card{
  background:linear-gradient(180deg,var(--pt-theme-panel),color-mix(in srgb,var(--pt-theme-panel) 90%,var(--pt-theme-bg) 10%))!important;
  border-color:var(--pt-theme-line)!important;
}
html[data-perfectum-theme] .crm108-money{color:var(--pt-theme-text)!important;}
html[data-perfectum-theme] .crm108-scoreline b,
html[data-perfectum-theme] .crm108-meta b{color:var(--pt-theme-text)!important;}
html[data-perfectum-theme] .crm108-temp{border-color:var(--pt-theme-line)!important;}
html[data-perfectum-theme] .crm108-temp.temp-quente{color:var(--pt-status-danger)!important;border-color:color-mix(in srgb,var(--pt-status-danger) 45%,var(--pt-theme-line))!important;}
html[data-perfectum-theme] .crm108-temp.temp-morno{color:var(--pt-status-warn)!important;border-color:color-mix(in srgb,var(--pt-status-warn) 45%,var(--pt-theme-line))!important;}
html[data-perfectum-theme] .crm108-temp.temp-frio{color:var(--pt-theme-accent)!important;}
html[data-perfectum-theme] :is(.crm108-scoreline,.crm108-meta) b.danger{color:var(--pt-status-danger)!important;}
html[data-perfectum-theme] :is(.crm108-scoreline,.crm108-meta) b.warning{color:var(--pt-status-warn)!important;}
html[data-perfectum-theme] :is(.crm108-scoreline,.crm108-meta) b.cyan{color:var(--pt-theme-accent)!important;}

/* --- CRM · funil legado preservado / motivos de perda --- */
html[data-perfectum-theme] .crm108-legacy>div{
  background:color-mix(in srgb,var(--pt-theme-panel-2) 88%,var(--pt-theme-bg) 12%)!important;
  border-color:var(--pt-theme-line)!important;
}

/* --- Banco de Talentos · tags e urgencia --- */
html[data-perfectum-theme] .r9-tag{
  border-color:color-mix(in srgb,var(--pt-theme-accent) 26%,var(--pt-theme-line))!important;
  color:color-mix(in srgb,var(--pt-theme-text) 60%,var(--pt-theme-accent) 40%)!important;
}
html[data-perfectum-theme] .r9-urgente{color:var(--pt-status-danger)!important;}

/* Executive Light: sombra discreta nas superficies acima (sem caixa dura) */
html[data-perfectum-theme="light"] :is(
  .crm108-column,.crm108-column header,.crm108-card,
  .crm108-agenda-item,.crm108-attention-item,.crm108-legacy>div){box-shadow:0 8px 22px rgba(25,45,70,.06)!important;}

/* ============================================================================
   R10.12 — PADRAO PREMIUM (fecho): CRM oportunidade + Banco de Talentos ficha/
   pipeline + carimbo de build + bloco de cobertura sugerida (Operacao).
   Somente cor/superficie; !important vence os <style> locais. 3 temas.
   ============================================================================ */

/* --- carimbo de build no rodape da sidebar --- */
.build-stamp{margin-top:9px;text-align:center;font-size:9px;letter-spacing:.12em;opacity:.55}
html[data-perfectum-theme] .build-stamp{color:var(--pt-theme-muted)!important}

/* --- CRM · ficha da oportunidade (crm_opportunity_detail/form_r108) --- */
html[data-perfectum-theme] :is(.crm108-health,.crm108-links){
  background:color-mix(in srgb,var(--pt-theme-panel-2) 88%,var(--pt-theme-bg) 12%)!important;
  border-color:var(--pt-theme-line)!important;color:var(--pt-theme-text)!important;
}
html[data-perfectum-theme] .crm108-health strong{color:var(--pt-status-ok)!important;}
html[data-perfectum-theme] :is(.crm108-row,.crm108-add){border-color:var(--pt-theme-line)!important;}
html[data-perfectum-theme] :is(.crm108-row span,.crm108-row small,.crm108-time,.crm108-empty){color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] .crm108-add summary{color:var(--pt-theme-accent)!important;}
html[data-perfectum-theme] .crm108-dot{background:var(--pt-theme-accent)!important;box-shadow:0 0 0 4px color-mix(in srgb,var(--pt-theme-accent) 20%,transparent)!important;}
html[data-perfectum-theme] .crm108-event{border-color:var(--pt-theme-line)!important;}
html[data-perfectum-theme] .crm108-event p{color:var(--pt-theme-text)!important;}
html[data-perfectum-theme] .crm108-event small{color:var(--pt-theme-muted)!important;}

/* --- RH · ficha da candidata (recruitment_candidate_detail/form) --- */
html[data-perfectum-theme] .r9-health{
  background:color-mix(in srgb,var(--pt-theme-panel-2) 88%,var(--pt-theme-bg) 12%)!important;
  border-color:var(--pt-theme-line)!important;color:var(--pt-theme-text)!important;
}
html[data-perfectum-theme] .r9-health strong{color:var(--pt-status-ok)!important;}
html[data-perfectum-theme] .r9-doc-card{
  background:color-mix(in srgb,var(--pt-theme-panel) 90%,var(--pt-theme-bg) 10%)!important;
  border-color:var(--pt-theme-line)!important;
}
html[data-perfectum-theme] .r9-doc-card img{border-color:var(--pt-theme-line)!important;}
html[data-perfectum-theme] .r9-doc-card small,
html[data-perfectum-theme] .r9-doc-upload small{color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] :is(.r9-file-icon,.r9-empty-file){
  background:color-mix(in srgb,var(--pt-theme-accent) 12%,var(--pt-theme-panel-2))!important;
  border-color:color-mix(in srgb,var(--pt-theme-accent) 30%,var(--pt-theme-line))!important;
  color:var(--pt-theme-accent)!important;
}
html[data-perfectum-theme] .r9-empty-file{color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] :is(.r9-doc-upload,.r9-doc-history){border-color:var(--pt-theme-line)!important;}
html[data-perfectum-theme] :is(.r9-doc-upload summary,.r9-doc-history summary){color:var(--pt-theme-accent)!important;}
html[data-perfectum-theme] .r9-delete-blocked{color:var(--pt-status-danger)!important;}
html[data-perfectum-theme] .r96-interviews .excellent,
html[data-perfectum-theme] .r96-interviews .good{color:var(--pt-status-ok)!important;}
html[data-perfectum-theme] .r96-interviews .warn{color:var(--pt-status-warn)!important;}
html[data-perfectum-theme] .r96-interviews .danger{color:var(--pt-status-danger)!important;}

/* --- RH · pipeline de recrutamento (recruitment_pipeline) --- */
html[data-perfectum-theme] .r9-column,
html[data-perfectum-theme] .r9-column header{
  background:color-mix(in srgb,var(--pt-theme-panel) 92%,var(--pt-theme-bg) 8%)!important;
  border-color:var(--pt-theme-line)!important;
}
html[data-perfectum-theme] .r9-column header span{
  background:color-mix(in srgb,var(--pt-theme-accent) 12%,var(--pt-theme-panel))!important;
  border-color:color-mix(in srgb,var(--pt-theme-accent) 34%,var(--pt-theme-line))!important;
  color:color-mix(in srgb,var(--pt-theme-text) 62%,var(--pt-theme-accent) 38%)!important;
}
html[data-perfectum-theme] .r9-card{
  background:linear-gradient(180deg,var(--pt-theme-panel),color-mix(in srgb,var(--pt-theme-panel) 90%,var(--pt-theme-bg) 10%))!important;
  border-color:var(--pt-theme-line)!important;
}
html[data-perfectum-theme] .r9-card p{color:var(--pt-theme-text)!important;}
html[data-perfectum-theme] .r9-priority{border-color:var(--pt-theme-line)!important;}
html[data-perfectum-theme] :is(.r9-priority.urgente,.r9-priority.alta){color:var(--pt-status-danger)!important;border-color:color-mix(in srgb,var(--pt-status-danger) 45%,var(--pt-theme-line))!important;}
html[data-perfectum-theme] .r9-meta{color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] .r9-meta b{color:var(--pt-theme-text)!important;}
html[data-perfectum-theme] .r9-meta.overdue b{color:var(--pt-status-danger)!important;}
html[data-perfectum-theme] .r9-empty{color:var(--pt-theme-muted)!important;}

/* --- Operacao · bloco de cobertura sugerida (operations_absences_v2 / operations_home) --- */
html[data-perfectum-theme] .abs-cov{
  background:color-mix(in srgb,var(--pt-theme-accent) 7%,var(--pt-theme-panel))!important;
  border-color:var(--pt-theme-line)!important;border-left-color:var(--pt-theme-accent)!important;
}
html[data-perfectum-theme] .abs-cand{
  background:color-mix(in srgb,var(--pt-theme-panel) 90%,var(--pt-theme-bg) 10%)!important;
  border-color:var(--pt-theme-line)!important;
}
html[data-perfectum-theme] :is(.abs-cov-h,.abs-cov-note,.abs-cand small){color:var(--pt-theme-muted)!important;}
html[data-perfectum-theme] .abs-cand.ok{border-color:color-mix(in srgb,var(--pt-status-ok) 45%,var(--pt-theme-line))!important;}
html[data-perfectum-theme] .abs-cand.ok i{color:var(--pt-status-ok)!important;}
html[data-perfectum-theme] .abs-cand.bad{border-color:color-mix(in srgb,var(--pt-status-danger) 40%,var(--pt-theme-line))!important;}
html[data-perfectum-theme] .abs-cand.bad i{color:var(--pt-status-danger)!important;}
