/* Enterprise dashboard filters. Colors follow the shared enterprise workspace. */
.insight-date-filter,.insight-department-filter{position:relative;color:var(--ink,#101828);font-size:14px;min-width:0}
.insight-date-presets{display:flex;flex-wrap:wrap;gap:6px}
.insight-date-presets>button{min-height:36px;padding:7px 12px;border:1px solid var(--line,#d0d5dd);border-radius:6px;background:#fff;color:var(--muted,#667085);font:inherit;cursor:pointer}
.insight-date-presets>button.selected,.insight-date-presets>button[aria-pressed=true]{border-color:var(--brand,#1664d3);background:var(--brand-soft,#eff6ff);color:var(--brand,#1664d3)}
.insight-date-summary{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-top:10px}
.insight-current-range{font-size:13px;font-variant-numeric:tabular-nums}
.insight-compare-switch{display:inline-flex;align-items:center;gap:7px;min-height:32px;border:0;background:none;padding:2px 0;color:var(--muted,#667085);font-size:12px;cursor:pointer}
.insight-switch-track{position:relative;display:block;width:30px;height:18px;background:#98a2b3;border-radius:12px;flex:none}
.insight-switch-track:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .15s}
.insight-compare-switch[aria-checked=true] .insight-switch-track{background:var(--brand,#1664d3)}
.insight-compare-switch[aria-checked=true] .insight-switch-track:after{transform:translateX(12px)}
.insight-previous-range{margin:3px 0 0;color:var(--muted,#667085);font-size:12px;font-variant-numeric:tabular-nums}
.insight-popover-mask{position:fixed;inset:0;z-index:75;display:flex;align-items:center;justify-content:center;padding:24px}
body:has(.insight-popover-mask){overflow:hidden}
.insight-popover-backdrop{position:absolute;inset:0;width:100%;height:100%;border:0;background:#10182866;cursor:default}
.insight-filter-popover{position:relative;display:flex;flex-direction:column;width:min(680px,100%);max-height:min(85dvh,820px);border:1px solid var(--line,#d0d5dd);border-radius:8px;background:#fff;box-shadow:0 16px 48px #10182826;overflow:hidden;text-align:left}
.insight-dept-popover{width:min(540px,100%)}
.insight-popover-header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line,#d0d5dd);flex:none}
.insight-popover-header h3{flex:1;font-size:16px;margin:0;font-weight:600}
.insight-icon-button{display:grid;place-items:center;width:36px;height:36px;flex:none;border:0;border-radius:5px;background:transparent;color:var(--muted,#667085);font-size:24px;cursor:pointer}
.insight-icon-button:disabled{opacity:.35;cursor:default}
.insight-popover-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:16px}
.insight-popover-footer{display:flex;gap:10px;align-items:center;justify-content:flex-end;padding:12px 16px;background:var(--surface-subtle,#f9fafb);border-top:1px solid var(--line,#d0d5dd);flex:none}
.insight-popover-footer>.insight-filter-hint{margin-right:auto}
.insight-popover-footer>.btn{min-height:40px}
.insight-filter-hint{font-size:12px;line-height:1.6;color:var(--muted,#667085);margin:8px 0}
.insight-date-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.insight-date-field{display:block;min-width:0;font-size:12px;color:var(--muted,#667085)}
.insight-date-field>span:first-child{display:block;margin-bottom:6px}
.insight-date-field input{display:block;width:100%;min-height:40px;box-sizing:border-box;padding:8px 10px;border:1px solid var(--line,#d0d5dd);border-radius:6px;background:#fff;color:var(--ink,#101828);font:inherit;font-size:14px;font-variant-numeric:tabular-nums}
.insight-date-field.active input{border-color:var(--brand,#1664d3)}
.insight-date-field input[aria-invalid=true]{border-color:var(--danger,#b42318)}
.insight-field-error{display:block;color:var(--danger,#b42318);font-size:12px;line-height:1.5;margin:5px 0 0;min-height:0}
.insight-field-error:empty{display:none}
.insight-calendar-nav{display:flex;justify-content:space-between;align-items:center;margin-top:12px;color:var(--muted,#667085);font-size:12px}
.insight-calendar-months{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.insight-calendar-month{min-width:0}
.insight-calendar-month h4{font-size:14px;font-weight:600;margin:10px 0 12px;text-align:center}
.insight-calendar-weekdays,.insight-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}
.insight-calendar-weekdays span{display:grid;place-items:center;height:28px;font-size:12px;color:var(--muted,#667085)}
.insight-calendar-day{display:grid;place-items:center;width:100%;min-height:34px;border:1px solid transparent;border-radius:5px;background:#fff;color:var(--ink,#101828);font-size:12px;cursor:pointer;font-variant-numeric:tabular-nums}
.insight-calendar-day:hover:not(:disabled){background:var(--brand-soft,#eff6ff);border-color:var(--brand,#1664d3)}
.insight-calendar-day.in-range{background:var(--brand-soft,#eff6ff);border-radius:0}
.insight-calendar-day.today{border-color:var(--brand,#1664d3)}
.insight-calendar-day.selected{background:var(--brand,#1664d3);color:#fff}
.insight-calendar-day:disabled{background:#f9fafb;color:#b0b7c3;cursor:default;border-color:transparent}
.insight-sheet-sizes{display:none}
.insight-department-trigger{display:flex;align-items:center;gap:8px;width:100%;height:42px;min-width:0;box-sizing:border-box;padding:6px 10px;border:1px solid var(--line,#d0d5dd);border-radius:6px;background:#fff;color:var(--ink,#101828);font:inherit;font-size:12px;text-align:left;cursor:pointer}
.insight-dept-label{color:var(--muted,#667085);flex:none}
.insight-dept-tags{display:flex;align-items:center;gap:4px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;height:28px}
.insight-dept-tag{min-width:0;flex:0 1 auto;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:155px;padding:3px 6px;border-radius:4px;background:var(--surface-subtle,#f2f4f7);color:var(--ink,#101828);font-size:12px;line-height:18px}
.insight-dept-more{flex:none;max-width:none;color:var(--brand,#1664d3);background:var(--brand-soft,#eff6ff)}
.insight-dept-arrow{flex:none;color:var(--muted,#667085);font-size:18px}
.insight-dept-tooltip{display:none;position:absolute;top:calc(100% + 5px);right:0;z-index:12;max-width:min(500px,calc(100vw - 32px));max-height:180px;overflow:auto;overflow-wrap:anywhere;white-space:normal;background:var(--ink,#101828);color:#fff;border-radius:5px;padding:9px 11px;font-size:12px;line-height:1.7;box-shadow:0 4px 16px #10182826}
.insight-department-trigger:hover~.insight-dept-tooltip,.insight-department-trigger:focus-visible~.insight-dept-tooltip{display:block}
.insight-department-filter:has(.insight-popover-mask)>.insight-dept-tooltip{display:none}
.insight-dept-search{display:block;margin-bottom:10px}
.insight-dept-search input{width:100%;box-sizing:border-box;min-height:40px;padding:8px 10px;border:1px solid var(--line,#d0d5dd);border-radius:6px;background:#fff;color:var(--ink,#101828);font:inherit;font-size:14px}
.insight-dept-tools{display:flex;align-items:center;flex-wrap:wrap;gap:14px;font-size:12px}
.insight-dept-tools button{min-height:36px;padding:4px 0;border:0;background:none;color:var(--brand,#1664d3);font:inherit;cursor:pointer}
.insight-dept-tools>span{margin-left:auto;color:var(--muted,#667085)}
.insight-dept-tree{min-height:140px;margin-top:12px;border-top:1px solid var(--line,#d0d5dd);padding-top:6px}
.insight-dept-row{display:flex;align-items:center;min-height:40px;padding-left:calc(var(--insight-depth,0) * 16px);border-radius:5px}
.insight-dept-row:hover{background:var(--surface-subtle,#f9fafb)}
.insight-dept-expand,.insight-dept-expand-placeholder{display:grid;place-items:center;width:28px;height:36px;flex:none}
.insight-dept-expand{border:0;background:none;color:var(--muted,#667085);font-size:20px;cursor:pointer}
.insight-dept-checkbox{display:flex;align-items:center;gap:8px;flex:1;min-width:0;min-height:40px;padding:4px 8px 4px 0;border:0;background:none;text-align:left;font:inherit;font-size:14px;color:var(--ink,#101828);cursor:pointer}
.insight-dept-checkmark{display:grid;place-items:center;box-sizing:border-box;width:17px;height:17px;flex:none;border:1px solid #98a2b3;border-radius:3px;background:#fff;font-size:13px;line-height:1}
.insight-dept-checkbox.checked .insight-dept-checkmark,.insight-dept-checkbox.mixed .insight-dept-checkmark{background:var(--brand,#1664d3);border-color:var(--brand,#1664d3);color:#fff}
.insight-dept-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.insight-dept-count{font-size:12px;color:var(--muted,#667085);margin-left:auto;flex:none}
.insight-dept-empty{padding:22px 12px;text-align:center;color:var(--muted,#667085);font-size:13px}
.insight-sr-only{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;border:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important}
.insight-date-filter button:focus-visible,.insight-department-filter button:focus-visible,.insight-filter-popover input:focus-visible{outline:2px solid var(--brand,#1664d3);outline-offset:2px}
@media(max-width:640px){
 .insight-date-presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
 .insight-date-presets>button{min-height:44px;padding:8px 5px}
 .insight-date-summary{gap:5px 12px}
 .insight-compare-switch{min-height:44px}
 .insight-popover-mask{padding:0;align-items:flex-end}
 .insight-filter-popover{width:100%;max-height:80dvh;height:var(--insight-sheet-height,60dvh);border-radius:12px 12px 0 0;border-bottom:0;transition:height .18s ease}
 .insight-filter-popover[data-sheet-size="30"]{--insight-sheet-height:30dvh}
 .insight-filter-popover[data-sheet-size="60"]{--insight-sheet-height:60dvh}
 .insight-filter-popover[data-sheet-size="80"]{--insight-sheet-height:80dvh}
 .insight-filter-popover.is-dragging{transition:none}
 .insight-popover-header{position:relative;min-height:54px;padding:8px 12px 4px;touch-action:none;gap:8px}
 .insight-popover-header:before{content:"";position:absolute;top:5px;left:calc(50% - 16px);width:32px;height:3px;border-radius:3px;background:#d0d5dd}
 .insight-popover-header h3{font-size:15px}
 .insight-sheet-sizes{display:flex;gap:1px}
 .insight-sheet-sizes button{min-width:38px;min-height:44px;padding:5px 3px;border:0;background:none;color:var(--muted,#667085);font-size:11px;cursor:pointer}
 .insight-sheet-sizes button[aria-pressed=true]{color:var(--brand,#1664d3);font-weight:600}
 .insight-icon-button{width:44px;height:44px}
 .insight-popover-body{padding:12px 14px}
 .insight-popover-footer{padding:10px 14px max(10px,env(safe-area-inset-bottom));flex-wrap:wrap}
 .insight-popover-footer>.btn{min-height:44px}
 .insight-popover-footer>.insight-filter-hint{flex:1;font-size:11px;max-width:110px}
 .insight-date-fields{gap:10px}
 .insight-date-field input{min-height:44px;padding:8px 5px;font-size:13px}
 .insight-calendar-months{grid-template-columns:1fr;gap:20px}
 .insight-calendar-day{min-height:40px;font-size:13px}
 .insight-calendar-nav>span{font-size:11px}
 .insight-department-trigger{height:44px}
 .insight-dept-tag{max-width:115px;padding:3px 4px}
 .insight-dept-row{padding-left:calc(var(--insight-depth,0) * 12px)}
 .insight-dept-expand,.insight-dept-expand-placeholder{width:30px;height:44px}
 .insight-dept-checkbox{min-height:44px;font-size:13px}
 .insight-dept-tools button,.insight-dept-search input{min-height:44px}
}
@media(prefers-reduced-motion:reduce){.insight-filter-popover,.insight-switch-track:after{transition:none}}
