/* HAVAL LAWYER / final module finishing - admin/client shared visual rules.
   CSS only. Retains record states, editors, PDF templates and all event handlers. */
html[data-haval-brand="white-first"] {
 --hl3-bg:#F8F9FA;--hl3-panel:#FFFFFF;--hl3-soft:#F3F5F7;
 --hl3-text:#0B1F33;--hl3-muted:#536478;--hl3-edge:#E2E7EC;
 --hl3-action:#0B1F33;--hl3-gold:#B68A45;--hl3-focus:#37679D;
 --hl3-overlay:rgba(7,20,33,.50);
}
html[data-haval-brand="white-first"][data-haval-theme="dark"] {
 --hl3-bg:#0B1624;--hl3-panel:#152539;--hl3-soft:#1C3046;
 --hl3-text:#ECF2FA;--hl3-muted:#B9C9DA;--hl3-edge:#34475C;
 --hl3-action:#315574;--hl3-gold:#C49B5B;--hl3-focus:#86B4ED;
 --hl3-overlay:rgba(1,8,17,.72);
}
/* Editors mounted directly under body previously ignored both portal themes. */
html[data-haval-brand="white-first"] #hvFieldsPanel{
 --fd-surface:var(--hl3-panel);--fd-bg:var(--hl3-soft);
 --fd-text:var(--hl3-text);--fd-muted:var(--hl3-muted);
 --fd-border:var(--hl3-edge);--fd-primary:var(--hl3-action);
 --fd-gold:var(--hl3-gold);
 background:var(--hl3-overlay)!important;color:var(--hl3-text)!important;
}
html[data-haval-brand="white-first"] #hvCompanyGridPanel{
 --ge-panel:var(--hl3-panel);--ge-bg:var(--hl3-soft);
 --ge-ink:var(--hl3-text);--ge-muted:var(--hl3-muted);
 --ge-border:var(--hl3-edge);--ge-accent:var(--hl3-action);
 --ge-gold:var(--hl3-gold);
 background:var(--hl3-overlay)!important;color:var(--hl3-text)!important;
}
html[data-haval-brand="white-first"] #hvFieldsPanel :is(
 .hv-fields-shell,.hv-fields-head,.hv-fields-form,.hv-fd-row,.hv-fields-notice
),
html[data-haval-brand="white-first"] #hvCompanyGridPanel :is(
 .hv-grid-editor,.hv-grid-editor-head,.hv-grid-editor-foot,.hv-grid-editor-row,.hv-grid-notice
){
 background:var(--hl3-panel)!important;background-image:none!important;
 border-color:var(--hl3-edge)!important;color:var(--hl3-text)!important;
 box-shadow:none!important;
}
html[data-haval-brand="white-first"] :is(#hvFieldsPanel,#hvCompanyGridPanel) :is(
 .hv-fields-notice,.hv-grid-notice,.hv-fields-form
){background:var(--hl3-soft)!important}
html[data-haval-brand="white-first"] :is(#hvFieldsPanel,#hvCompanyGridPanel) :is(
 input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
 select,textarea
){
 background:var(--hl3-panel)!important;color:var(--hl3-text)!important;
 border-color:var(--hl3-edge)!important;border-radius:9px!important;
 font-size:max(14px,1em);
}
html[data-haval-brand="white-first"] :is(#hvFieldsPanel,#hvCompanyGridPanel) :is(
 button,[role="button"],input,select,textarea
):focus-visible{
 outline:3px solid var(--hl3-focus)!important;outline-offset:2px!important;
}
html[data-haval-brand="white-first"] :is(#hvFieldsPanel,#hvCompanyGridPanel) :is(
 .hv-fd-btn.primary,.hv-grid-editor-foot button.primary
){
 background:var(--hl3-action)!important;color:#FFF!important;border-color:var(--hl3-action)!important;
}
html[data-haval-brand="white-first"] :is(#hvFieldsPanel,#hvCompanyGridPanel) :is(
 .hv-fields-close,.hv-grid-icon-btn,.hv-grid-order button,.hv-fd-btn:not(.primary),.hv-grid-editor-toolbar button
){
 background:var(--hl3-panel)!important;color:var(--hl3-text)!important;
 border-color:var(--hl3-edge)!important;
}
html[data-haval-brand="white-first"][dir="ltr"] :is(#hvFieldsPanel,#hvCompanyGridPanel){
 direction:ltr!important;
}
/* Native task dialogs live at body-level, outside the authenticated portal tree. */
html[data-haval-brand="white-first"] :is(.hv-task-focus-dialog,body>#taskDetailModal .task-detail-box){
 background:var(--hl3-panel)!important;color:var(--hl3-text)!important;
 border-color:var(--hl3-edge)!important;
 box-shadow:0 10px 40px rgba(0,0,0,.14)!important;
}
html[data-haval-brand="white-first"] .hv-task-focus-dialog :is(
 .hv-task-focus-header,.hv-task-focus-content,.task-lane,.task-lane-head,.task-card
),
html[data-haval-brand="white-first"] body>#taskDetailModal :is(
 .task-detail-head,.task-detail-body,.task-detail-panel,.task-detail-foot,.task-detail-content
){
 background:var(--hl3-panel)!important;background-image:none!important;
 color:var(--hl3-text)!important;border-color:var(--hl3-edge)!important;
}
html[data-haval-brand="white-first"] .hv-task-focus-dialog :is(
 .hv-task-focus-heading h2,.hv-task-focus-heading p,.task-lane-title,
 .hv-task-focus-eyebrow
),
html[data-haval-brand="white-first"] body>#taskDetailModal :is(h2,h3,h4,p){
 color:var(--hl3-text)!important;
}
html[data-haval-brand="white-first"] .hv-task-focus-dialog :is(
 .hv-task-focus-close,button:not(.btn)
){
 border-color:var(--hl3-edge)!important;
}
html[data-haval-brand="white-first"] body>#taskDetailModal :is(
 input:not([type="checkbox"]):not([type="radio"]),select,textarea
){
 background:var(--hl3-panel)!important;color:var(--hl3-text)!important;
 border-color:var(--hl3-edge)!important;
}
html[data-haval-brand="white-first"][dir="ltr"] .hv-task-focus-dialog{
 direction:ltr!important;
}
/* Tax withholding payroll: avoid module-specific emerald text and cream controls. */
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw{
 --tp:var(--hl2-text);--tp-line:var(--hl2-border);--tp-muted:var(--hl2-muted);
 background:var(--hl2-surface)!important;color:var(--hl2-text)!important;
 border-color:var(--hl2-border)!important;box-shadow:none!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax :is(
 .tax-pw-header,.tax-pw-overview>div,.tax-pw-report-controls,.tax-pw-panel,.tax-pw-tablewrap
){
 background:var(--hl2-surface)!important;background-image:none!important;
 color:var(--hl2-text)!important;border-color:var(--hl2-border)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax :is(
 .tax-pw-header h2,.tax-pw-header p,.tax-pw-overview span,.tax-pw-overview b,
 .tax-pw-panelhead h3,.tax-pw-panelhead p,.tax-pw-report-controls label,
 .tax-pw-table td,.tax-pw-table td b,.tax-pw-table td small
){
 color:var(--hl2-text)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax :is(
 .tax-pw-refresh,.tax-pw-secondary,.tax-pw-link
){
 color:var(--hl2-text)!important;background:var(--hl2-surface)!important;
 border-color:var(--hl2-border)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-primary{
 background:var(--hl2-action)!important;color:#FFF!important;border-color:var(--hl2-action)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-nav button{
 background:transparent!important;color:var(--hl2-muted)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-nav button.active{
 color:var(--hl2-text)!important;border-bottom-color:var(--hl2-accent)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-table th{
 background:var(--hl2-subtle)!important;color:var(--hl2-text)!important;
 border-color:var(--hl2-border)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-table td{
 border-color:var(--hl2-border)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-chip.active{
 background:var(--hl2-success-bg)!important;color:var(--hl2-success)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-chip.left{
 background:var(--hl2-warning-bg)!important;color:var(--hl2-warning)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-message:not(.error){
 background:var(--hl2-highlight)!important;color:var(--hl2-text)!important;
 border-color:var(--hl2-border)!important;
}
html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-message.error{
 background:var(--hl2-error-bg)!important;color:var(--hl2-error)!important;
}
/* Notifications: old green, fixed white row text did not adapt to dark mode. */
html[data-haval-brand="white-first"] :is(#app,#portalView) #notifyPanel{
 background:var(--hl2-elevated)!important;color:var(--hl2-text)!important;
 border-color:var(--hl2-border)!important;
}
html[data-haval-brand="white-first"] :is(#app,#portalView) #notificationsList :is(
 .hv-notif-row,.hv-notif-item,.notifitem,.hv-notif-list,.hv-notif-icon
){
 background:var(--hl2-elevated)!important;color:var(--hl2-text)!important;
 border-color:var(--hl2-border)!important;
}
html[data-haval-brand="white-first"] :is(#app,#portalView) #notificationsList .hv-notif-row.unread{
 background:var(--hl2-highlight)!important;border-inline-start:3px solid var(--hl2-accent)!important;
}
html[data-haval-brand="white-first"] :is(#app,#portalView) #notificationsList :is(
 .hv-notif-heading strong,.hv-notif-heading span,.hv-notif-row p,.hv-notif-row time
){
 color:var(--hl2-text)!important;
}
html[data-haval-brand="white-first"] :is(#app,#portalView) #notifyPanel :is(
 .hv-notif-filters,.hv-notif-filters button,.hv-notif-toolbar,.hv-notif-head,.hv-notif-close
){
 background:var(--hl2-elevated)!important;color:var(--hl2-text)!important;
 border-color:var(--hl2-border)!important;
}
html[data-haval-brand="white-first"] :is(#app,#portalView) #notifyPanel .hv-notif-filters button.active{
 background:var(--hl2-highlight)!important;border:1px solid var(--hl2-accent)!important;
}
/* Relative sizes, safe areas and scrolling for large editors on narrow phones. */
@media(max-width:820px){
 html[data-haval-brand="white-first"] :is(#hvFieldsPanel,#hvCompanyGridPanel) :is(
  .hv-fields-shell,.hv-grid-editor
 ){
  width:min(100vw,560px)!important;max-width:100vw!important;
  height:100dvh;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain;
 }
 html[data-haval-brand="white-first"] :is(#hvFieldsPanel,#hvCompanyGridPanel) :is(
  .hv-fields-head,.hv-grid-editor-head,.hv-grid-editor-foot
 ){
  padding-inline:15px!important;
 }
 html[data-haval-brand="white-first"] #hvCompanyGridPanel .hv-grid-editor-row{
  grid-template-columns:22px 22px minmax(0,1fr)!important;
  gap:7px!important;
 }
 html[data-haval-brand="white-first"] #hvCompanyGridPanel .hv-grid-editor-row :is(
  input[type="text"],select,.hv-grid-order
 ){max-width:100%;min-width:0}
 html[data-haval-brand="white-first"] :is(#hvFieldsPanel,#hvCompanyGridPanel) :is(input,select,textarea){
  font-size:16px!important;
 }
 html[data-haval-brand="white-first"] .hv-task-focus-dialog{
  width:calc(100vw - 14px)!important;max-height:calc(100dvh - 14px)!important;
  border-radius:14px!important;
 }
 html[data-haval-brand="white-first"] #app #page-direct-tax :is(
  .tax-pw-header,.tax-pw-report-controls
 ){padding:13px!important}
 html[data-haval-brand="white-first"] #app #page-direct-tax .tax-pw-tablewrap{
  overflow-x:auto!important;max-width:100%;-webkit-overflow-scrolling:touch;
 }
}
