.adhoc-dashboard {
    color-scheme: light;
    font-family: "DM Sans", sans-serif;
    --sidebar: #f8f8fb;
    --surface: #ffffff;
    --surface-soft: #f7f7fa;
    --canvas: #f1f1f5;
    --text: #20202a;
    --muted: #797989;
    --muted-strong: #5a5969;
    --border: #e5e4eb;
    --accent: #6d5ce7;
    --accent-soft: #eeebff;
    --positive: #2ba471;
    --negative: #d84a62;
    --shadow: 0 5px 24px rgba(36, 31, 61, .07);
}

.adhoc-dashboard, .adhoc-dashboard * { box-sizing: border-box; }
.adhoc-dashboard button, .adhoc-dashboard input, .adhoc-dashboard select, .adhoc-dashboard textarea { font: inherit; }
.adhoc-dashboard button { color: inherit; }
:where(.adhoc-dashboard) svg { width: 20px; height: 20px; fill: currentColor; }
.workspace { min-height: 100vh; display: flex; background: var(--canvas); color: var(--text); transition: color .2s, background .2s; }
.workspace.theme-dark { color-scheme: dark; --sidebar: #191922; --surface: #22222d; --surface-soft: #292934; --canvas: #15151c; --text: #f1f0f6; --muted: #a2a0b0; --muted-strong: #bbb9c6; --border: #343440; --accent-soft: #332f54; --shadow: 0 7px 28px rgba(0,0,0,.2); color: var(--text); background: var(--canvas); }

.dashboard-sidebar { position: sticky; z-index: 20; top: 0; flex: 0 0 258px; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 16px; background: var(--sidebar); border-right: 1px solid var(--border); transition: flex-basis .22s ease, padding .22s ease; overflow: hidden; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 22px; min-width: 220px; }
.eyebrow { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-header h2, .widget-drawer h2 { margin: 0; font-family: "Manrope", sans-serif; font-size: 20px; letter-spacing: -.03em; }
.icon-button { width: 38px; height: 38px; flex: 0 0 auto; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; transition: .18s ease; }
.icon-button:hover { border-color: #c8c5db; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(32,30,48,.08); }
.icon-button.subtle { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); box-shadow: none; }
.icon-button.subtle:hover { color: var(--text); background: var(--surface-soft); transform: none; }
.icon-button.subtle svg { width: 16px; height: 16px; }
.icon-button.danger:hover { color: var(--negative); }
.new-dashboard-button { height: 42px; min-width: 220px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; color: #fff; background: var(--accent); font-weight: 700; cursor: pointer; box-shadow: 0 7px 16px rgba(109,92,231,.2); }
.new-dashboard-button svg { width: 17px; }
.sidebar-search, .drawer-search { min-width: 220px; height: 40px; display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); }
.sidebar-search svg, .drawer-search svg { width: 16px; }
.sidebar-search input, .drawer-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.dashboard-list { min-width: 222px; padding-top: 14px; overflow: auto; }
.dashboard-category { display: flex; align-items: center; gap: 7px; padding: 13px 9px 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.dashboard-category small { min-width: 19px; padding: 2px 5px; border-radius: 8px; background: var(--border); text-align: center; font-size: 9px; }
.dashboard-link { position: relative; width: 100%; min-height: 55px; display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.dashboard-link:hover { background: var(--surface); }
.dashboard-link.active { background: var(--surface); box-shadow: 0 3px 12px rgba(34,31,56,.06); }
.dashboard-link.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 24px; border-radius: 3px; background: var(--accent); }
.dashboard-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); background: var(--surface-soft); }
.dashboard-icon svg { width: 16px; }
.dashboard-link.active .dashboard-icon { color: var(--accent); background: var(--accent-soft); }
.dashboard-link-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px; }
.dashboard-link-copy strong { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-link-copy small { color: var(--muted); font-size: 10px; }
.default-star { color: #e8a52d; font-size: 12px; }
.sidebar-footer { min-width: 220px; margin-top: auto; padding: 13px 10px 2px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.sidebar-footer span { display: flex; align-items: center; gap: 6px; }
.sidebar-footer i { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 3px rgba(43,164,113,.12); }
.dashboard-sidebar.collapsed { flex-basis: 0; padding-left: 0; padding-right: 0; border: 0; }

.dashboard-stage { min-width: 0; flex: 1; }
.topbar { min-height: 111px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.breadcrumbs { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.breadcrumbs b { color: #bbb9c3; }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row h1 { margin: 0; font-family: "Manrope", sans-serif; font-size: 25px; letter-spacing: -.035em; }
.title-block p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.visibility-badge { padding: 4px 8px; border: 1px solid var(--border); border-radius: 12px; color: var(--muted-strong); background: var(--surface-soft); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.unsaved-dot { width: 7px; height: 7px; border-radius: 50%; background: #e59b2f; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.primary-button, .secondary-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border-radius: 10px; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; transition: .18s ease; }
.primary-button { border: 1px solid var(--accent); color: #fff; background: var(--accent); box-shadow: 0 5px 12px rgba(109,92,231,.18); }
.primary-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; pointer-events: none; }
.secondary-button { border: 1px solid var(--border); background: var(--surface); color: var(--muted-strong); }
.secondary-button:hover { border-color: #c7c4d8; color: var(--text); }
.primary-button svg, .secondary-button svg { width: 15px; }
.menu-anchor { position: relative; }
.action-menu { position: absolute; z-index: 60; top: 44px; right: 0; width: 190px; padding: 6px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: 0 12px 34px rgba(20,18,32,.16); }
.action-menu button, .action-menu label { width: 100%; display: block; padding: 9px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; font-size: 12px; cursor: pointer; }
.action-menu button:hover, .action-menu label:hover { background: var(--surface-soft); }
.action-menu input { display: none; }
.filter-bar { min-height: 61px; display: flex; align-items: center; gap: 9px; padding: 10px 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.filter-chip { height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; }
.filter-chip span { color: var(--muted); font-size: 10px; }
.filter-chip strong { font-size: 11px; }
.filter-chip b { color: var(--muted); font-weight: 400; }
.filter-spacer { flex: 1; }
.last-update { color: var(--muted); font-size: 10px; }
.edit-banner { display: flex; align-items: center; gap: 10px; margin: 18px 32px 0; padding: 10px 13px; border: 1px solid #d9d3ff; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.edit-banner > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: rgba(109,92,231,.12); }
.edit-banner svg { width: 15px; }
.edit-banner div { display: flex; flex: 1; flex-direction: column; }
.edit-banner strong { font-size: 11px; }
.edit-banner small { color: var(--muted-strong); font-size: 10px; }
.edit-banner button { border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 700; cursor: pointer; }
.dashboard-scroll { padding: 22px 32px 42px; overflow: auto; }
.dashboard-grid { --grid-columns: 12; --row-height: 72px; --grid-gap: 16px; min-height: calc(100vh - 220px); display: grid; grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr)); grid-auto-rows: var(--row-height); gap: var(--grid-gap); align-items: stretch; }
.dashboard-grid.editing { padding: 10px; margin: -10px; border-radius: 12px; background-image: radial-gradient(circle, rgba(109,92,231,.18) 1px, transparent 1px); background-size: calc((100% - 11 * var(--grid-gap)) / 12 + var(--grid-gap)) calc(var(--row-height) + var(--grid-gap)); }

.dashboard-widget { position: relative; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: border-color .18s, box-shadow .18s, transform .15s; }
.dashboard-widget:hover { border-color: #d5d2e0; box-shadow: 0 8px 28px rgba(36,31,61,.1); }
.dashboard-grid.editing .dashboard-widget { border-style: dashed; border-color: #bbb4ef; }
.dashboard-widget.is-dragging, .dashboard-widget.is-resizing { z-index: 20; opacity: .9; border-style: solid; box-shadow: 0 18px 45px rgba(50,40,110,.22); transition: none; }
.widget-header { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 8px 17px; }
.widget-header.widget-drag { cursor: grab; touch-action: none; }
.widget-header.widget-drag:active { cursor: grabbing; }
.widget-heading { min-width: 0; display: flex; flex-direction: column-reverse; gap: 3px; }
.widget-heading h2 { overflow: hidden; margin: 0; font-family: "Manrope", sans-serif; font-size: 13px; font-weight: 700; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.widget-kicker { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.widget-actions { display: flex; opacity: .25; transition: opacity .18s; }
.dashboard-widget:hover .widget-actions, .dashboard-grid.editing .widget-actions { opacity: 1; }
.widget-content { min-height: 0; flex: 1; padding: 2px 17px 15px; }
.resize-handle { position: absolute; z-index: 3; right: 2px; bottom: 2px; width: 20px; height: 20px; border: 0; background: linear-gradient(135deg, transparent 45%, var(--accent) 46%, var(--accent) 53%, transparent 54%, transparent 64%, var(--accent) 65%, var(--accent) 72%, transparent 73%); cursor: nwse-resize; touch-action: none; opacity: .75; }
.widget-skeleton { height: 100%; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.widget-skeleton span { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-soft), var(--border), var(--surface-soft)); background-size: 200%; animation: shimmer 1.2s infinite; }
.widget-skeleton span:first-child { width: 45%; height: 30px; }
.widget-skeleton span:last-child { width: 75%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.widget-empty { display: grid; height: 100%; place-items: center; color: var(--muted); font-size: 12px; }

.kpi-visual { position: relative; height: 100%; display: flex; flex-direction: column; }
.kpi-main { margin-top: 2px; font-family: "Manrope", sans-serif; font-size: clamp(25px, 2vw, 32px); font-weight: 700; letter-spacing: -.055em; }
.kpi-meta { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: var(--muted); font-size: 9px; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 10px; }
.trend.positive { color: var(--positive); }
.trend.negative { color: var(--negative); }
.kpi-sparkline { height: 32px; margin-top: auto; color: var(--accent); }
.kpi-sparkline svg { width: 100%; height: 100%; overflow: visible; }
.spark-area { fill: currentColor; opacity: .1; }
.spark-line { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; }
.accent-blue { --accent: #4f83e4; --accent-soft: #eaf2ff; }
.accent-green { --accent: #2ba471; --accent-soft: #e5f6ef; }
.accent-orange { --accent: #e19632; --accent-soft: #fff3e2; }
.gauge-visual { height: 100%; display: flex; align-items: center; justify-content: space-around; gap: 12px; }
.gauge-ring { --gauge-value: 0; width: 92px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--gauge-value) * 1%), var(--border) 0); position: relative; }
.gauge-ring::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.gauge-center { z-index: 1; display: flex; flex-direction: column; align-items: center; }
.gauge-center strong { font-family: "Manrope", sans-serif; font-size: 19px; }
.gauge-center span { color: var(--muted); font-size: 8px; }
.gauge-legend { display: flex; flex-direction: column; color: var(--muted); font-size: 9px; }
.gauge-legend strong { color: var(--text); font-size: 13px; }
.chart-shell { height: 100%; display: flex; flex-direction: column; }
.chart-summary { display: flex; align-items: baseline; gap: 10px; margin: 0 0 3px; }
.chart-summary strong { font-family: "Manrope", sans-serif; font-size: 18px; }
.line-chart { width: 100%; height: calc(100% - 45px); min-height: 100px; color: var(--accent); overflow: visible; }
.chart-grid line { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.line-area { fill: url(#lineFill); }
.line-stroke { fill: none; stroke: currentColor; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.line-point { fill: var(--surface); stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.bar-chart { height: 100%; display: flex; align-items: flex-end; gap: 12px; padding-top: 20px; }
.bar-column { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar-fill { width: min(34px, 70%); border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff)); }
.bar-value, .bar-label { color: var(--muted); font-size: 9px; }
.donut-layout { height: 100%; display: flex; align-items: center; justify-content: center; gap: 25px; }
.donut-chart { width: min(135px, 48%); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; position: relative; }
.donut-chart::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: var(--surface); }
.donut-center { z-index: 1; display: flex; flex-direction: column; align-items: center; }
.donut-center strong { font-family: "Manrope", sans-serif; font-size: 17px; }
.donut-center span { color: var(--muted); font-size: 8px; }
.donut-legend { min-width: 120px; display: flex; flex-direction: column; gap: 10px; }
.donut-legend div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; font-size: 9px; }
.donut-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.donut-legend span { color: var(--muted); }
.data-table-wrap { height: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.data-table th { padding: 7px 9px; border-bottom: 1px solid var(--border); color: var(--muted); text-align: left; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.data-table td { padding: 8px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.company-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.company-cell i { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-style: normal; font-size: 7px; }
.status-pill { padding: 3px 7px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.activity-feed { height: 100%; overflow: auto; }
.activity-item { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: start; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border: 0; }
.activity-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #4f83e4; box-shadow: 0 0 0 3px rgba(79,131,228,.1); }
.activity-dot.success { background: var(--positive); }.activity-dot.warning { background: #e19b35; }
.activity-item div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.activity-item strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.activity-item span, .activity-item time { color: var(--muted); font-size: 8px; }
.activity-item time { white-space: nowrap; }

/* Família de gráficos corporativos. As cores usam o accent do próprio widget,
   preservando tema claro/escuro e permitindo novos providers sem CSS específico. */
.advanced-chart { height: 100%; display: flex; flex-direction: column; min-height: 120px; }
.advanced-chart__legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 5px; color: var(--muted); font-size: 8px; }
.advanced-chart__legend span { display: inline-flex; align-items: center; gap: 4px; }
.advanced-chart__legend i { width: 7px; height: 7px; border-radius: 2px; }
.series-color-0 { background: var(--accent); }.series-color-1 { background: #4f83e4; }.series-color-2 { background: #2ba471; }.series-color-3 { background: #e5ad50; }
.advanced-line-chart { width: 100%; height: calc(100% - 30px); min-height: 105px; overflow: visible; }
.advanced-area { fill: var(--accent); opacity: .18; }
.advanced-line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.series-stroke-0 { stroke: var(--accent); }.series-stroke-1 { stroke: #4f83e4; }.series-stroke-2 { stroke: #2ba471; }.series-stroke-3 { stroke: #e5ad50; }

.column-chart { position: relative; min-height: 125px; flex: 1; display: flex; align-items: stretch; gap: 11px; border-bottom: 1px solid var(--border); }
.column-chart__group { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; }
.column-chart__plot { width: 100%; min-height: 0; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.column-chart__plot > i { width: min(21px, 38%); min-height: 4px; border-radius: 3px 3px 0 0; }
.column-chart__group > span { overflow: hidden; width: 100%; padding-top: 5px; color: var(--muted); font-size: 8px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.chart-stacked-column .column-chart__plot, .chart-stacked-column-100 .column-chart__plot { flex-direction: column-reverse; justify-content: flex-start; gap: 0; }
.chart-stacked-column .column-chart__plot > i, .chart-stacked-column-100 .column-chart__plot > i { width: min(34px, 72%); min-height: 0; border-radius: 0; }
.chart-stacked-column .column-chart__plot > i:last-child, .chart-stacked-column-100 .column-chart__plot > i:last-child { border-radius: 4px 4px 0 0; }
.chart-combo .column-chart__plot { position: relative; }
.combo-column { width: min(30px, 55%) !important; }
.combo-point { position: absolute; z-index: 3; left: 50%; width: 7px; height: 7px; border: 2px solid var(--surface); border-radius: 50%; background: #2ba471; transform: translate(-50%, 50%); }
.combo-line { position: absolute; z-index: 2; inset: 0 0 20px; width: 100%; height: calc(100% - 20px); pointer-events: none; }
.combo-line polyline { fill: none; stroke: #2ba471; stroke-width: 2; vector-effect: non-scaling-stroke; }

.horizontal-bars { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 9px; }
.horizontal-bars__row { display: grid; grid-template-columns: minmax(62px, 24%) minmax(70px, 1fr) 35px; align-items: center; gap: 8px; font-size: 9px; }
.horizontal-bars__row > span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.horizontal-bars__row > div { height: 16px; border-radius: 3px; background: var(--surface-soft); overflow: hidden; }
.horizontal-bars__row i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #fff)); }
.horizontal-bars__row strong { font-size: 9px; }

.funnel-chart { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.funnel-chart__stage { min-width: 28%; display: flex; justify-content: space-between; gap: 8px; padding: 5px 9px; color: #fff; background: var(--accent); clip-path: polygon(5% 0, 95% 0, 85% 100%, 15% 100%); font-size: 8px; }
.funnel-chart__stage:nth-child(2) { filter: brightness(1.08); }.funnel-chart__stage:nth-child(3) { filter: brightness(1.16); }.funnel-chart__stage:nth-child(4) { filter: brightness(1.24); }.funnel-chart__stage:nth-child(5) { filter: brightness(1.32); }

.bullet-chart { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 13px; }
.bullet-chart__values { display: flex; align-items: baseline; justify-content: space-between; }
.bullet-chart__values strong { font: 700 24px "Manrope", sans-serif; }.bullet-chart__values span { color: var(--muted); font-size: 9px; }
.bullet-chart__track { position: relative; height: 27px; display: flex; overflow: visible; }
.bullet-chart__range { height: 100%; }.range-low { width: 45%; background: color-mix(in srgb, var(--border) 80%, var(--surface)); }.range-medium { width: 30%; background: color-mix(in srgb, var(--muted) 35%, var(--surface)); }.range-high { width: 25%; background: color-mix(in srgb, var(--muted) 55%, var(--surface)); }
.bullet-chart__value { position: absolute; top: 8px; left: 0; height: 11px; background: var(--accent); }
.bullet-chart__target { position: absolute; top: -4px; width: 3px; height: 35px; background: var(--text); transform: translateX(-50%); }

.semicircle-gauge { position: relative; height: 100%; min-height: 120px; display: grid; place-items: end center; overflow: hidden; }
.semicircle-gauge__arc { --gauge-degrees: calc(var(--gauge-value) * 1.8deg); position: absolute; bottom: -50%; width: min(190px, 88%); aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 270deg, var(--accent) 0deg var(--gauge-degrees), var(--border) var(--gauge-degrees) 180deg, transparent 180deg); }
.semicircle-gauge__arc::after { content: ""; position: absolute; inset: 15%; border-radius: 50%; background: var(--surface); }
.semicircle-gauge__center { z-index: 1; display: flex; flex-direction: column; align-items: center; padding-bottom: 7px; }
.semicircle-gauge__center strong { font: 700 27px "Manrope", sans-serif; color: var(--accent); }.semicircle-gauge__center span { color: var(--muted); font-size: 8px; }

.ratio-chart { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 17px; }
.ratio-chart__item { display: grid; grid-template-columns: 35px auto 1fr; align-items: center; gap: 10px; }
.ratio-chart__item i { width: 27px; height: 27px; background: var(--positive); transform: rotate(45deg); }
.ratio-chart__item.warning i { background: var(--negative); clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: none; }
.ratio-chart__item.neutral i { background: var(--muted); }
.ratio-chart__item strong { font: 700 21px "Manrope", sans-serif; }.ratio-chart__item span { color: var(--muted); font-size: 9px; }

.waterfall-chart { height: 100%; display: flex; align-items: stretch; gap: 8px; }
.waterfall-chart__column { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; }
.waterfall-chart__value, .waterfall-chart__label { overflow: hidden; width: 100%; color: var(--muted); font-size: 8px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.waterfall-chart__plot { position: relative; width: 100%; min-height: 90px; flex: 1; border-bottom: 1px solid var(--border); }
.waterfall-chart__plot i { position: absolute; right: 14%; left: 14%; min-height: 4px; background: var(--positive); }.waterfall-chart__plot i.decrease { background: var(--negative); }.waterfall-chart__plot i.total { background: var(--accent); }
.waterfall-chart__label { padding-top: 5px; }

.matrix-wrap { height: 100%; overflow: auto; }
.matrix-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.matrix-table th, .matrix-table td { padding: 7px 8px; border: 1px solid var(--border); text-align: left; white-space: nowrap; }
.matrix-table th { position: sticky; top: 0; background: var(--surface-soft); color: var(--muted); font-size: 8px; text-transform: uppercase; }
.matrix-table tbody tr:nth-child(even) { background: var(--surface-soft); }
.matrix-table tfoot td { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.drawer-backdrop, .modal-backdrop { position: fixed; z-index: 70; inset: 0; background: rgba(18,16,28,.3); backdrop-filter: blur(2px); }
.widget-drawer { position: fixed; z-index: 80; inset: 0 0 0 auto; width: min(390px, 92vw); display: flex; flex-direction: column; padding: 24px; background: var(--surface); box-shadow: -16px 0 45px rgba(18,16,28,.16); animation: slide-in .2s ease-out; }
@keyframes slide-in { from { transform: translateX(100%); } }
.widget-drawer header { display: flex; align-items: flex-start; justify-content: space-between; }
.drawer-search { min-width: 0; margin: 20px 0 12px; }
.widget-catalog { display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.catalog-card { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); text-align: left; cursor: pointer; transition: .18s ease; }
.catalog-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateX(-2px); }
.catalog-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.catalog-card > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 2px; }
.catalog-card strong { font-size: 12px; }.catalog-card small { color: var(--muted); font-size: 9px; }.catalog-card em { margin-top: 3px; color: var(--accent); font-size: 8px; font-style: normal; font-weight: 700; text-transform: uppercase; }
.catalog-card b { color: var(--accent); font-size: 20px; font-weight: 400; }
.settings-drawer footer, .modal-card footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
.form-stack { display: flex; flex-direction: column; gap: 15px; padding: 24px 0; }
.form-stack label { display: flex; flex-direction: column; gap: 6px; color: var(--muted-strong); font-size: 10px; font-weight: 700; }
.form-stack input, .form-stack select, .form-stack textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--border); border-radius: 9px; outline: 0; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 400; }
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-stack textarea { min-height: 80px; resize: vertical; }
.form-stack .toggle-row { flex-direction: row; align-items: center; }
.form-stack .toggle-row input { width: 16px; }
.modal-backdrop { display: grid; place-items: center; z-index: 100; }
.modal-card { width: min(480px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 25px 70px rgba(20,18,32,.25); }
.modal-card header { display: flex; align-items: flex-start; gap: 12px; }
.modal-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-soft); }
.modal-card header div { flex: 1; }.modal-card h2 { margin: 1px 0 3px; font: 700 17px "Manrope", sans-serif; }.modal-card p { margin: 0; color: var(--muted); font-size: 10px; }
.modal-card footer { margin-top: 0; }
.toast { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 9px; max-width: 390px; padding: 11px 12px; border: 1px solid #bce4d2; border-radius: 11px; background: #effaf5; color: #1d7651; box-shadow: 0 10px 30px rgba(20,18,32,.15); font-size: 11px; font-weight: 600; }
.toast > span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--positive); color: #fff; }
.toast.error { border-color: #f0c1ca; background: #fff1f3; color: #a42e44; }.toast.error > span { background: var(--negative); }
.toast button { margin-left: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.empty-dashboard { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; }
.empty-icon { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 20px; color: var(--accent); background: var(--accent-soft); }
.empty-icon svg { width: 32px; height: 32px; }.empty-dashboard h1 { margin: 18px 0 7px; font: 700 24px "Manrope",sans-serif; }.empty-dashboard p { max-width: 440px; margin: 0 0 20px; color: var(--muted); font-size: 12px; }

@media (max-width: 1180px) {
    .dashboard-sidebar { flex-basis: 220px; }
    .topbar, .filter-bar { padding-left: 22px; padding-right: 22px; }
    .dashboard-scroll { padding-left: 22px; padding-right: 22px; }
    .secondary-button { padding: 0 10px; }
}

@media (max-width: 900px) {
    .dashboard-sidebar { flex-basis: 0; padding-left: 0; padding-right: 0; border: 0; }
    .topbar { align-items: flex-start; flex-direction: column; padding: 17px 18px; }
    .topbar-actions { width: 100%; overflow-x: auto; }.topbar-actions .icon-button:first-child { margin-left: auto; }
    .filter-bar { padding: 10px 18px; overflow-x: auto; }.filter-chip { flex: 0 0 auto; }.last-update { display: none; }
    .dashboard-scroll { padding: 16px 18px 35px; }
    .dashboard-grid, .dashboard-grid.editing { display: flex; flex-direction: column; gap: 14px; min-height: 0; margin: 0; padding: 0; background: none; }
    .dashboard-widget { min-height: 180px; }.dashboard-widget:has(.line-chart), .dashboard-widget:has(.data-table) { min-height: 300px; }
    .edit-banner { margin: 14px 18px 0; }.edit-banner small { display: none; }
}

@media (max-width: 560px) {
    .topbar-actions .secondary-button { font-size: 0; }.topbar-actions .secondary-button svg { width: 16px; }
    .title-row h1 { max-width: 230px; font-size: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .filter-chip:nth-child(3) { display: none; }.dashboard-scroll { padding: 13px; }.edit-banner { margin: 12px 13px 0; }
    .widget-content { padding-left: 14px; padding-right: 14px; }.donut-layout { gap: 14px; }.toast { right: 12px; bottom: 70px; left: 12px; }
}
