/* Demeter executive UI. One cascade for the complete application. */
:root {
    color-scheme: light;
    --page: #f3f6fa;
    --surface: #fff;
    --navy: #10243b;
    --ink: #10243b;
    --ink-soft: #435b73;
    --muted: #5f7288;
    --line: #e4eaf1;
    --blue: #2e74e5;
    --blue-deep: #205ab4;
    --cyan: #32a9c5;
    --green: #137f5b;
    --amber: #99621b;
    --red: #b53e46;
    --text-primary: var(--ink);
    --text-secondary: var(--ink-soft);
    --text-tertiary: var(--muted);
    --card-bg: var(--surface);
    --border-color: var(--line);
    --radius-md: 16px;
    --radius-lg: 20px;
    --shadow-card: 0 3px 15px rgb(16 36 59 / 4%);
    --ease-out: cubic-bezier(.2,.75,.25,1);
    --sidebar-width: 224px;
    --nav-height: 76px;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-padding-block: 88px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
svg { vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
input, select, textarea { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd6e2; border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.4; transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(46 116 229 / 10%); }
input[type="month"], input[type="date"] { appearance: auto; -webkit-appearance: auto; }
input::placeholder { color: #77899b; }
label { color: var(--ink-soft); }
.screen { min-height: 100vh; }
.pwa-status { height: env(safe-area-inset-top); background: var(--surface); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); padding: 30px 16px 22px; display: flex; flex-direction: column; gap: 40px; background: var(--navy); color: #fff; overflow-y: auto; z-index: 20; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; padding: 0 10px; }
.sidebar-logo { flex: 0 0 38px; width: 38px; height: 38px; }
.sidebar-brand-text { display: grid; gap: 2px; }
.sidebar-name { font-size: 22px; font-weight: 730; letter-spacing: -.04em; }
.sidebar-sub { color: #b4c5d8; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 8px; }
.nav-btn { display: flex; gap: 12px; align-items: center; min-height: 48px; width: 100%; padding: 12px 14px; border: 0; border-radius: 11px; background: transparent; color: #b9cbde; text-align: left; font-size: 14px; font-weight: 600; transition: background .18s, color .18s; }
.nav-btn.active { background: #244463; color: #fff; box-shadow: inset 3px 0 #66bdec; }
.nav-svg { width: 21px; height: 21px; flex: 0 0 21px; }
.sidebar-user { margin-top: auto; border-top: 1px solid #324960; padding: 20px 8px 0; display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar { width: 32px; height: 32px; flex: 0 0 32px; background: #31577e; border: 5px solid #456b90; border-radius: 50%; }
.sidebar-user-info { min-width: 0; }
.sidebar-username { display: block; font-size: 13px; overflow-wrap: anywhere; }
.sidebar-date { color: #b4c5d8; font-size: 12px; margin-top: 3px; }
.app-main { margin-left: var(--sidebar-width); min-width: 0; min-height: 100vh; }
.app-topbar { position: sticky; top: 0; z-index: 10; min-height: 70px; padding: 16px 32px; display: flex; align-items: center; gap: 20px; justify-content: space-between; background: rgb(255 255 255 / 97%); border-bottom: 1px solid var(--line); }
.topbar-brand { display: none; align-items: center; gap: 8px; }
.topbar-name { font-size: 18px; font-weight: 750; letter-spacing: -.035em; }
.topbar-section-title { font-size: 14px; font-weight: 650; }
.topbar-context { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.topbar-context time { padding-left: 12px; margin-left: 5px; border-left: 1px solid var(--line); }
.connection-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.bottom-nav-mobile { display: none; }
.main-content { width: min(100%, 1640px); min-width: 0; margin-inline: auto; padding: 32px 32px 64px; }
.content-section { display: none; min-width: 0; }
.content-section.active { display: block; animation: section-enter .3s var(--ease-out); }
.ds2-period-row, .rpt-page-header, .page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
.ds2-period-left, .rpt-header-left, .page-heading > div { min-width: 0; }
.ds2-eyebrow, .rpt-eyebrow { display: block; margin-bottom: 7px; color: var(--blue-deep); font-size: 11px; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; }
.ds2-title, .rpt-page-title, .page-heading h1 { font-size: clamp(26px, 2.4vw, 36px); font-weight: 760; letter-spacing: -.04em; }
.page-heading p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.ds2-period-right, .period-control { display: grid; gap: 5px; flex: 0 0 284px; }
.ds2-period-label, .period-control > span, .period-control > label { font-size: 12px; font-weight: 650; color: var(--ink-soft); }
.ds2-month-input, .period-control input { width: 100%; min-height: 46px; font-size: 16px; font-weight: 600; }
.month-switcher { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 8px; min-width: 0; }
.month-switcher > button { display: grid; place-items: center; width: 44px; height: 46px; padding: 10px; border: 1px solid #cbd6e2; border-radius: 10px; background: var(--surface); color: var(--blue-deep); }
.month-switcher > button svg { width: 18px; height: 18px; }
.card, .performance-panel, .bl-form-panel, .bl-history-panel, .gl2-card, .report-output { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-card); }
.card, .performance-panel { padding: 24px; margin-bottom: 22px; }
.card h3, .performance-panel h2, .bl-form-title, .bl-history-header h3, .gl2-list-title, .gl2-form-title { font-size: 18px; font-weight: 720; letter-spacing: -.025em; }
.ds2-card-header, .performance-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.ds2-card-header > div, .performance-panel-heading > div { min-width: 0; }
.ds2-card-subtitle, .data-note { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.ds2-text-action { min-height: 44px; padding: 8px 12px; border: 1px solid #d6e3f6; border-radius: 9px; background: #f1f6ff; color: var(--blue-deep); font-size: 13px; font-weight: 650; flex-shrink: 0; }
.summary-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-item { min-width: 0; min-height: 132px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-card); }
.stat-featured { grid-column: span 2; background: var(--navy); border-color: var(--navy); color: #fff; }
.stat-label { order: -1; font-size: 12px; line-height: 1.4; font-weight: 650; color: var(--ink-soft); }
.stat-value { max-width: 100%; font-size: clamp(21px, 1.7vw, 28px); line-height: 1.2; font-weight: 750; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-context { color: var(--muted); font-size: 12px; line-height: 1.45; }
.stat-featured .stat-label, .stat-featured .stat-context { color: #c5d5e6; }
.stat-featured .stat-value { font-size: clamp(28px, 2.3vw, 38px); }
.stat-item:last-child:not(.ds2-stat-loading) { border-top: 3px solid var(--green); }
.ds2-chart-card { padding-bottom: 20px; }
.ds2-bar-chart { display: block; min-width: 0; position: relative; }
.report-chart { display: block; width: 100%; height: auto; max-height: 310px; }
.report-chart text { font: 12px Inter, system-ui, sans-serif; fill: var(--muted); }
.report-chart-area { fill: rgb(46 116 229 / 9%); }
.report-chart-line { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.report-chart-point { fill: var(--surface); stroke: var(--blue); stroke-width: 2.5; }
.chart-grid-line { fill: none; stroke: var(--line); stroke-width: 1; }
.report-chart .chart-point-value { fill: var(--ink-soft); font-size: 14px; font-weight: 650; }
.chart-trend-line { stroke-dasharray: 1; stroke-dashoffset: 0; animation: chart-line-reveal 1s var(--ease-out) both; }
.chart-caption { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
@keyframes chart-line-reveal { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.chart-data-table { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ds2-sparkline-wrap { display: none; }
.ds2-bottom-row { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr); gap: 22px; }
.ds2-donut-card, .ds2-rings-card { margin-bottom: 22px; }
.ds2-donut-card > h3 { margin-bottom: 24px; }
.ds2-donut-wrap { display: flex; align-items: center; gap: 24px; min-height: 112px; }
.ds2-donut-wrap > svg { width: 112px; height: 112px; flex-shrink: 0; }
.ds2-donut-legend { display: grid; gap: 16px; min-width: 0; flex: 1; }
.ds2-donut-item { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.ds2-donut-dot { width: 8px; height: 8px; border-radius: 50%; }
.ds2-donut-pct { font-variant-numeric: tabular-nums; }
.ds2-rings-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px,1fr)); gap: 20px 12px; }
.ds2-ring-item { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; min-width: 0; }
.ds2-ring-item svg { width: 62px; height: 62px; overflow: visible; }
.ds2-ring-label { font-size: 12px; line-height: 1.45; color: var(--ink-soft); overflow-wrap: anywhere; }
.overall-progress-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 12px; }
.overall-title { font-size: 14px; font-weight: 700; }
.overall-values { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; font-variant-numeric: tabular-nums; }
.overall-values > :last-child { color: var(--green); font-weight: 750; }
.overall-progress-bar, .goal-overview-bar, .performance-progress-track, .performance-mix-track, .gl2-progress-bar, .report-bar-track, .report-progress-track { height: 9px; background: #eaf0f6; border-radius: 8px; overflow: hidden; }
.overall-progress-fill, .goal-overview-fill, .performance-progress-track > span, .performance-mix-track > span, .gl2-progress-fill, .report-bar-fill, .report-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .65s var(--ease-out); max-width: 100%; }
.performance-mix-track > span { background: var(--cyan); }
.overall-progress-bar { height: 12px; }
.goals-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 24px; margin-top: 24px; }
.goal-overview-item { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.goal-overview-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.goal-store-name { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.goal-progress-text { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; font-size: 13px; font-weight: 750; text-align: right; }
.goal-overview-values { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 9px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.goal-achieved-badge { display: inline-flex; align-items: center; gap: 4px; background: #e8f6ee; color: #166743; font-size: 11px; font-weight: 700; padding: 4px 7px; border-radius: 6px; white-space: nowrap; }
.goal-achieved-badge svg { width: 12px; height: 12px; }
.goal-achieved { border-color: #b8ddcc; }
.no-goals-message, .report-empty, .performance-empty { padding: 24px 0; color: var(--muted); font-size: 14px; }
.ds2-recent-entry { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.ds2-recent-entry:last-child { padding-bottom: 0; border-bottom: 0; }
.ds2-recent-entry > div { min-width: 0; }
.ds2-recent-entry strong { font-size: 14px; font-weight: 650; }
.ds2-recent-entry span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ds2-recent-entry b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.performance-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.performance-summary-card { display: grid; gap: 8px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.performance-summary-card > span { font-size: 13px; color: var(--ink-soft); }
.performance-summary-card > b { font-size: 27px; line-height: 1.25; letter-spacing: -.035em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.performance-summary-card small { color: var(--muted); font-size: 12px; font-weight: 400; }
.performance-summary-card > b small { font-size: 20px; }
.performance-units { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.performance-unit { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fcfdff; animation: page-enter .35s var(--ease-out) both; animation-delay: var(--unit-delay, 0ms); }
.performance-unit-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.performance-unit-top > div { min-width: 0; }
.performance-unit-top > div > span { color: var(--muted); font-size: 11px; }
.performance-unit h3 { margin-top: 5px; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.unit-status { flex: 0 0 auto; padding: 4px 8px; border-radius: 7px; font-size: 11px; font-weight: 700; }
.is-positive { background: #e9f6ef; color: #166743; }
.is-warning { background: #fff3df; color: #895915; }
.is-neutral { background: #eaf0f6; color: var(--ink-soft); }
.performance-unit-value { margin: 20px 0 16px; display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.performance-unit-value b { font-size: 23px; line-height: 1.3; font-weight: 750; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.performance-unit-value span { font-size: 12px; color: var(--muted); }
.performance-unit-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; margin-top: 10px; font-size: 12px; color: var(--ink-soft); }
.performance-unit-change { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.performance-mix { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 32px; }
.performance-mix-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: 13px; margin-bottom: 10px; }
.performance-mix-label span { color: var(--ink-soft); overflow-wrap: anywhere; }
.performance-mix-label b { font-size: 13px; font-variant-numeric: tabular-nums; }
.performance-mix-row > small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.bl-split { display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); gap: 24px; align-items: start; }
.bl-form-panel, .bl-history-panel { padding: 24px; }
.bl-form-header { margin-bottom: 24px; }
.bl-form { display: grid; gap: 18px; }
.form-group { display: grid; gap: 7px; min-width: 0; }
.form-group > label, .rpt-filter-label { font-size: 12px; font-weight: 650; }
.bl-form-dates, .bl-history-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.btn-primary, .btn-secondary, .btn-generate-rpt { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 16px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 650; text-decoration: none; transition: background .18s, box-shadow .18s; }
.btn-primary, .btn-generate-rpt { background: var(--blue-deep); color: #fff; }
.btn-secondary { border-color: #cbd6e2; background: var(--surface); color: var(--ink-soft); }
.bl-submit { width: 100%; margin-top: 4px; }
.bl-history-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.bl-total-badge { background: #eff5ff; color: var(--blue-deep); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bl-total-badge:empty { display: none; }
.bl-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.bl-chip, .rpt-period-pill { min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fc; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.bl-chip.active, .rpt-period-pill.active { border-color: #c1d5f4; background: #eaf2ff; color: var(--blue-deep); }
.bl-history-filters { margin-bottom: 20px; }
.bl-month-header { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.bl-month-group:first-child .bl-month-header { margin-top: 0; }
.bl-month-name { text-transform: capitalize; color: var(--muted); }
.bl-month-total { font-variant-numeric: tabular-nums; }
.bl-entry-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.bl-segment-badge { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; font-size: 10px; font-weight: 750; background: #e9f1ff; color: var(--blue-deep); }
.seg-conveniences { background: #fff3e1; color: #9d611a; }
.seg-petiscarias { background: #e8f5ed; color: #166743; }
.bl-entry-info { min-width: 0; }
.bl-entry-store { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.bl-entry-period { font-size: 12px; color: var(--muted); margin-top: 4px; }
.bl-entry-amount { font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.bl-entry-actions { grid-column: 2 / -1; display: flex; gap: 8px; justify-content: end; }
.btn-edit, .btn-delete, .btn-report, .close-btn, .gl2-delete-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-soft); }
.btn-delete, .gl2-delete-btn { color: var(--red); }
.btn-report, .btn-edit { color: var(--blue-deep); }
.fab-add { display: none; }
.rpt-filter-card { padding: 24px; }
.rpt-filters-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 20px; }
.rpt-filter-group { display: grid; align-content: start; gap: 7px; min-width: 0; }
.rpt-filter-row-dual { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.rpt-period-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-generate-rpt { margin-top: 24px; }
.rpt-empty-state { display: grid; justify-items: center; padding: 56px 24px; text-align: center; background: var(--surface); border: 1px dashed #cbd6e2; border-radius: var(--radius-md); }
.rpt-empty-wheat { width: 70px; height: 70px; margin-bottom: 18px; }
.rpt-empty-primary { color: var(--ink); font-size: 18px; font-weight: 650; }
.rpt-empty-secondary { color: var(--muted); margin-top: 8px; font-size: 14px; max-width: 360px; }
.report-output { padding: 24px; }
.report-note { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.report-kpis { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.report-kpi { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.report-kpi > span { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.report-kpi strong { font-size: 23px; line-height: 1.25; letter-spacing: -.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.report-kpi small { font-size: 12px; color: var(--muted); }
.report-progress-track { height: 12px; margin-bottom: 26px; }
.report-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-bottom: 24px; font-size: 13px; }
.report-table th, .report-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.report-table thead th { color: var(--muted); font-size: 12px; font-weight: 650; background: #f7f9fc; }
.report-table tbody th { font-weight: 650; }
.report-bars { display: grid; gap: 20px; }
.report-bar-row { display: grid; grid-template-columns: minmax(120px,.6fr) minmax(80px,1fr) minmax(0,1.2fr); align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.report-bar-row > strong { font-size: 13px; overflow-wrap: anywhere; }
.report-bar-row > span { font-size: 12px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.gl2-form-title { margin-bottom: 22px; }
.gl2-form-row { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr) auto; gap: 16px; align-items: end; }
.gl2-list-header { margin: 30px 0 20px; }
.gl2-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.gl2-card { position: relative; padding: 22px; display: grid; align-content: start; gap: 20px; }
.gl2-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gl2-card-meta { display: grid; gap: 7px; min-width: 0; }
.gl2-segment-label { color: var(--muted); font-size: 11px; }
.gl2-store-name { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.gl2-status-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; }
.gl2-ring-row { display: flex; align-items: center; gap: 18px; min-width: 0; }
.gl2-ring-row > svg { flex-shrink: 0; overflow: visible; }
.gl2-ring-row > svg > circle:first-child { stroke: #e4eaf1; }
.gl2-ring-stats { display: grid; gap: 5px; min-width: 0; }
.gl2-achieved-label { color: var(--muted); font-size: 12px; }
.gl2-achieved-value { font-size: 20px; font-weight: 730; line-height: 1.25; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gl2-goal-value { color: var(--ink-soft); font-size: 12px; }
.gl2-delete-btn { justify-self: end; }
.modal, .weekly-report-modal { display: none; position: fixed; inset: 0; z-index: 50; padding: 24px; background: rgb(16 36 59 / 45%); overflow-y: auto; }
.modal.active, .weekly-report-modal.active { display: grid; place-items: center; }
.modal-content { width: min(100%,520px); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 26px; border-radius: 20px; background: var(--surface); box-shadow: 0 20px 70px rgb(16 36 59 / 20%); }
.modal-header, .billing-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.modal-header h3, .billing-dialog-header h3 { font-size: 20px; font-weight: 700; }
#editForm { display: grid; gap: 18px; }
.modal-actions { display: flex; justify-content: end; gap: 12px; margin-top: 8px; }
.billing-dialog { width: min(520px,calc(100% - 24px)); max-height: calc(100dvh - 32px); border: 0; padding: 24px; border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 70px rgb(16 36 59 / 20%); }
.billing-dialog::backdrop { background: rgb(16 36 59 / 45%); }
.weekly-report-modal .modal-content { width: min(100%,720px); }
.weekly-report-modal .weekly-report-modal { display: block; position: static; width: min(100%,720px); padding: 0; background: transparent; overflow: visible; }
.weekly-report-modal .weekly-report-modal > .modal-content { width: 100%; }
.report-period, .report-store, .report-description { margin-bottom: 16px; color: var(--ink-soft); font-size: 14px; }
.weekly-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.weekly-stat-item { padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.weekly-stat-item .stat-value { font-size: 24px; }
.weekly-stat-item .stat-label { margin-top: 8px; }
.report-actions { display: flex; justify-content: end; margin-top: 24px; }
.notifications-container { position: fixed; top: 88px; right: 24px; width: min(370px,calc(100% - 48px)); display: grid; gap: 10px; z-index: 60; pointer-events: none; }
.notification { transform: translateY(-8px); opacity: 0; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 12px; padding: 16px 18px; background: var(--surface); color: var(--ink); box-shadow: 0 8px 25px rgb(16 36 59 / 12%); font-size: 14px; transition: transform .2s var(--ease-out), opacity .2s; pointer-events: auto; overflow-wrap: anywhere; }
.notification.show { transform: translateY(0); opacity: 1; }
.notification.success { border-left-color: var(--green); }
.notification.error { border-left-color: var(--red); }
.notification.warning { border-left-color: var(--amber); }
.install-prompt { position: fixed; right: 24px; bottom: 24px; z-index: 35; width: min(390px,calc(100% - 48px)); display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #ccd9e7; border-radius: 14px; color: var(--ink); background: var(--surface); box-shadow: 0 8px 28px rgb(16 36 59 / 14%); }
.install-prompt-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px; }
.install-prompt-copy { min-width: 0; flex: 1; }
.install-prompt-title { display: block; font-size: 13px; font-weight: 700; }
.install-prompt-text { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.install-prompt-actions { display: flex; align-items: center; gap: 8px; }
.install-btn { min-height: 44px; padding: 9px 12px; border: 0; border-radius: 9px; background: var(--blue-deep); color: #fff; font-size: 12px; font-weight: 650; }
.install-dismiss { display: grid; place-items: center; width: 44px; height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #f5f8fc; color: var(--ink-soft); font-size: 18px; }
.app-topbar .install-prompt { position: static; width: auto; margin-left: auto; padding: 0; border: 0; background: transparent; box-shadow: none; flex-shrink: 0; }
.app-topbar .install-prompt-icon, .app-topbar .install-prompt-copy { display: none; }
.install-instructions { position: fixed; right: 24px; bottom: 24px; z-index: 36; width: min(390px,calc(100% - 48px)); padding: 20px; border: 1px solid #ccd9e7; border-radius: 14px; background: var(--surface); box-shadow: 0 8px 28px rgb(16 36 59 / 14%); }
.install-instructions strong { display: block; font-size: 14px; margin-bottom: 8px; }
.install-instructions p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.main-loader { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: var(--page); transition: opacity .3s; }
.main-loader.hidden { display: none; }
.loader-content { width: min(100%,360px); padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); text-align: center; box-shadow: var(--shadow-card); }
.loader-icon { margin-bottom: 16px; }
.loader-icon svg { width: 56px; height: 56px; }
.loader-content h1 { font-size: 28px; letter-spacing: -.04em; }
.loader-content h2 { font-size: 12px; margin-top: 5px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.loader-content p { color: var(--muted); font-size: 13px; margin-top: 16px; }
.progress-bar { height: 6px; margin-top: 28px; background: #e4eaf1; border-radius: 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--blue); transition: width .25s; }
.ds2-loading-line, .bl-history-skeleton > span, .skeleton-card > span, .skeleton-card > b, .ds2-bar-skel, .unit-skeleton { display: block; border-radius: 7px; background: linear-gradient(100deg,#edf1f6 20%,#f9fbfd 45%,#edf1f6 70%); background-size: 200% 100%; animation: skeleton-shimmer 1.5s linear infinite; }
.ds2-loading-value { height: 30px; width: 80%; }
.ds2-loading-label { height: 12px; width: 55%; margin-top: 8px; }
.ds2-chart-loading { height: 236px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 20px; align-items: end; }
.ds2-bar-skel { height: 60%; }
.ds2-bar-skel:nth-child(2n) { height: 85%; }
.bl-history-skeleton { display: grid; grid-template-columns: 34px minmax(0,1fr) 80px; gap: 12px; align-items: center; padding: 20px 0; }
.bl-history-skeleton > span { height: 18px; }
.bl-history-skeleton > span:first-child { height: 34px; }
.skeleton-card > span { height: 14px; width: 60%; }
.skeleton-card > b { height: 32px; width: 80%; margin-top: 14px; }
.unit-skeleton { height: 225px; }
@keyframes skeleton-shimmer { to { background-position: -200% 0; } }
@keyframes section-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes page-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (hover: hover) {
    .nav-btn:hover { color: #fff; background: #1b3752; }
    .btn-primary:hover, .btn-generate-rpt:hover { background: #194b98; box-shadow: 0 3px 10px rgb(32 90 180 / 15%); }
    .btn-secondary:hover, .close-btn:hover, .btn-edit:hover, .btn-report:hover { background: #eff5ff; }
    .btn-delete:hover, .gl2-delete-btn:hover { background: #fff0f1; }
    .bl-chip:hover, .rpt-period-pill:hover, .ds2-text-action:hover { background: #eaf2ff; }
}
@media (min-width: 1440px) {
    :root { --sidebar-width: 248px; }
    .main-content { padding: 36px 40px 72px; }
    .app-topbar { padding-inline: 40px; }
    .summary-stats { grid-template-columns: 1.22fr repeat(4,minmax(0,1fr)); }
    .stat-featured { grid-column: auto; }
    .stat-item { padding: 21px 18px; }
    .stat-featured .stat-value { font-size: clamp(25px,1.6vw,32px); }
    .stat-value { font-size: clamp(21px,1.45vw,27px); }
    .performance-units { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .gl2-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (min-width: 1200px) {
    .report-kpis:has(> .report-kpi:nth-child(4):last-child) { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 1199px) {
    .main-content { padding-inline: 24px; }
    .app-topbar { padding-inline: 24px; }
    .ds2-bottom-row { grid-template-columns: minmax(0,1fr); gap: 0; }
    .bl-split { grid-template-columns: minmax(0,1fr); }
    .bl-form-dates { gap: 18px; }
    .bl-entry-row { grid-template-columns: 34px minmax(0,1fr) auto auto; gap: 14px; }
    .bl-entry-actions { grid-column: auto; }
    .gl2-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .gl2-form-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .performance-summary-card { padding: 18px; }
    .performance-summary-card > b { font-size: 23px; }
    .report-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .report-bar-row { grid-template-columns: minmax(100px,.65fr) minmax(0,1fr); }
    .report-bar-row > span { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
    .sidebar { display: none; }
    .app-main { margin-left: 0; }
    .app-topbar { padding: 12px 24px; min-height: 64px; }
    .topbar-brand { display: flex; }
    .topbar-context { display: none; }
    .topbar-section-title { color: var(--muted); font-size: 12px; }
    .main-content { padding-top: 26px; padding-bottom: calc(var(--nav-height) + 32px + env(safe-area-inset-bottom)); }
    .bottom-nav-mobile { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; position: fixed; inset: auto 0 0; z-index: 30; min-height: var(--nav-height); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(255 255 255 / 98%); box-shadow: 0 -5px 20px rgb(16 36 59 / 4%); }
    .bottom-nav-btn { min-width: 0; min-height: 56px; padding: 7px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
    .bottom-nav-btn.active { background: #edf4ff; color: var(--blue-deep); }
    .nav-label { font-size: 10px; font-weight: 650; white-space: nowrap; letter-spacing: -.02em; }
    .bottom-nav-btn .nav-svg { width: 21px; height: 21px; flex-basis: 21px; }
    .bl-form-panel { display: none; }
    .fab-add { display: grid; place-items: center; position: fixed; right: 22px; bottom: calc(var(--nav-height) + 18px + env(safe-area-inset-bottom)); z-index: 25; width: 52px; height: 52px; border: 0; border-radius: 16px; background: var(--blue-deep); color: #fff; box-shadow: 0 6px 20px rgb(32 90 180 / 25%); }
    .notifications-container { top: 78px; }
    .install-prompt, .install-instructions { bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom)); }
    body:has(> .install-prompt) .fab-add { bottom: calc(var(--nav-height) + 110px + env(safe-area-inset-bottom)); }
}
@media (max-width: 699px) {
    .main-content { padding: 24px 16px calc(var(--nav-height) + 32px + env(safe-area-inset-bottom)); }
    .app-topbar { padding-inline: 16px; }
    .ds2-period-row, .page-heading { align-items: start; gap: 16px; flex-direction: column; margin-bottom: 22px; }
    .ds2-period-right, .period-control { width: 100%; flex-basis: auto; }
    .ds2-title, .rpt-page-title, .page-heading h1 { font-size: 28px; }
    .summary-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .stat-item { min-height: 118px; padding: 18px 15px; }
    .stat-featured, .stat-item:nth-child(4), .stat-item:last-child { grid-column: 1 / -1; }
    .stat-value { font-size: clamp(18px,4.3vw,23px); }
    .stat-featured .stat-value { font-size: 32px; }
    .stat-item:nth-child(4) .stat-value, .stat-item:last-child .stat-value { font-size: 28px; }
    .stat-item:nth-child(4), .stat-item:last-child { min-height: 106px; }
    .stat-label { font-size: 12px; }
    .card, .performance-panel, .bl-history-panel, .report-output { padding: 20px 16px; margin-bottom: 18px; }
    .card h3, .performance-panel h2 { font-size: 17px; }
    .report-chart text { font-size: 24px; }
    .report-chart .chart-point-value { font-size: 20px; }
    .app-topbar:has(.install-prompt) .topbar-section-title { display: none; }
    .ds2-card-header, .performance-panel-heading { align-items: start; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
    .ds2-donut-wrap { gap: 20px; }
    .ds2-donut-wrap > svg { width: 90px; height: 90px; }
    .ds2-donut-item { font-size: 12px; }
    .ds2-rings-wrap { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px 12px; }
    .ds2-ring-label { font-size: 12px; }
    .overall-progress-header { align-items: start; flex-direction: column; gap: 10px; }
    .overall-values { width: 100%; justify-content: space-between; font-size: 12px; gap: 6px; }
    .goals-list { grid-template-columns: minmax(0,1fr); gap: 14px; }
    .goal-overview-item { padding: 15px 12px; }
    .ds2-recent-entry { align-items: start; gap: 8px; flex-direction: column; }
    .ds2-recent-entry b { font-size: 15px; }
    .performance-summary, .performance-units, .performance-mix, .gl2-grid { grid-template-columns: minmax(0,1fr); }
    .performance-summary-card > b { font-size: 28px; }
    .performance-unit { padding: 18px 15px; }
    .performance-unit-top { gap: 8px; }
    .unit-status { font-size: 10px; padding: 5px 7px; }
    .performance-unit-value b { font-size: 26px; }
    .bl-entry-row { grid-template-columns: 34px minmax(0,1fr); gap: 8px 12px; padding: 18px 0; }
    .bl-entry-amount { grid-column: 2; text-align: left; font-size: 16px; }
    .bl-entry-actions { grid-column: 2; justify-content: start; }
    .bl-entry-store { font-size: 14px; }
    .bl-history-header { align-items: start; flex-wrap: wrap; }
    .bl-total-badge { font-size: 12px; }
    .bl-history-filters { grid-template-columns: minmax(0,1fr); gap: 16px; }
    .bl-form-dates { grid-template-columns: minmax(0,1fr); gap: 18px; }
    .rpt-filters-layout, .rpt-filter-row-dual { grid-template-columns: minmax(0,1fr); gap: 18px; }
    .rpt-period-pills { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rpt-period-pill:last-child { grid-column: 1 / -1; }
    .btn-generate-rpt { width: 100%; }
    .report-kpis { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .report-kpi { padding: 18px; }
    .report-kpi strong { font-size: 27px; }
    .report-table { display: block; max-width: 100%; overflow-x: auto; table-layout: auto; }
    .report-table th, .report-table td { min-width: 115px; font-size: 12px; }
    .report-table th:first-child { min-width: 145px; }
    .report-bar-row { grid-template-columns: minmax(0,1fr); gap: 10px; }
    .report-bar-row > span { grid-column: auto; }
    .gl2-form-row { grid-template-columns: minmax(0,1fr); gap: 18px; }
    .gl2-card { padding: 22px; }
    .gl2-achieved-value { font-size: 25px; }
    .modal { padding: 12px; }
    .modal-content { padding: 22px 18px; max-height: calc(100dvh - 24px); }
    .modal-actions > button { flex: 1; }
    .billing-dialog { padding: 22px 18px; }
    .notifications-container { right: 12px; width: calc(100% - 24px); }
    .install-prompt { right: 12px; width: calc(100% - 24px); padding: 10px; gap: 8px; }
    .install-prompt-text { display: none; }
    .install-prompt-icon { width: 28px; height: 28px; flex-basis: 28px; }
    .install-prompt-title { font-size: 12px; }
    .install-btn { padding-inline: 10px; }
    .install-instructions { right: 12px; width: calc(100% - 24px); }
    .weekly-stats { grid-template-columns: minmax(0,1fr); }
    .weekly-stat-item .stat-value { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .notification { transform: none; }
}
@media print {
    .sidebar, .app-topbar, .bottom-nav-mobile, .fab-add, .notifications-container, .main-loader { display: none; }
    .app-main { margin: 0; }
    .main-content { width: 100%; padding: 0; }
    .card, .performance-panel, .gl2-card { break-inside: avoid; box-shadow: none; }
    .content-section.active { display: block; }
    body { background: #fff; }
}
