/* Composição aprovada da Home; paleta centralizada em theme.css. */
.app[data-page="home"] .topbar, .app:has(.home) .topbar { display: none; }
.app[data-page="home"] .content, .app:has(.home) .content { max-width: none; padding: 20px; }
.home { display: grid; gap: 14px; min-width: 0; color: var(--gg-text-primary); }
.home :where(p, h1, h2, h3, div, section, aside, article, figure) { min-width: 0; }
.home :where(button, a, select):focus-visible, .home-actions-menu :where(button, a):focus-visible { outline: 2px solid var(--gg-accent); outline-offset: 3px; }
.home [hidden] { display: none !important; }
.home .btn { font-size: 13px; font-weight: 600; }
.home .home-hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 178px; gap: 24px; padding: 25px 30px; overflow: hidden; border: 1px solid var(--gg-panel-border); border-left: 3px solid var(--gg-button); border-radius: 12px; background: var(--gg-panel); }
.home .home-hero-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.home .home-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--gg-hero-overlay-start) 0%, var(--gg-hero-overlay-middle) 45%, var(--gg-hero-overlay-end) 100%); }
@media (max-width: 600px) {
  .home .home-hero::before { background: linear-gradient(90deg, rgba(2,20,22,.92), rgba(2,20,22,.55)); }
}
.home .home-hero-content { flex: 1; max-width: calc(100% - 345px); }
.home .home-eyebrow { margin: 0 0 8px; color: var(--gg-accent); font-size: 11px; font-weight: 700; letter-spacing: 1px; line-height: 1.4; }
.home #home-title { margin: 0; color: var(--gg-text-strong); font-family: var(--gg-font); font-size: 34px; font-weight: 500; line-height: 1.15; letter-spacing: -.025em; }
.home #home-title > span { color: var(--gg-accent); }
.home .home-subtitle { margin: 8px 0 0; color: var(--gg-text-primary); font-size: 14px; font-weight: 400; line-height: 1.5; }
.home .home-hero-tools { position: absolute; top: 12px; right: 14px; display: flex; align-items: center; gap: 8px; }
.home .home-hero-actions { display: flex; gap: 10px; }
.home .home-hero-actions .btn { min-height: 38px; padding: 8px 13px; background: var(--gg-subtle-bg); border-color: var(--gg-input-border); }
.home .home-hero-actions .btn.primary { background: var(--gg-button); color: var(--gg-button-text); border-color: var(--gg-button); }
.home .home-hero-actions .btn.primary:hover { background: var(--gg-button-hover); border-color: var(--gg-button-hover); }
.home .home-menu { display: none; }
.home .home-quote { position: absolute; bottom: 13px; right: 22px; display: flex; align-items: flex-start; gap: 11px; width: 235px; margin: 0; padding: 12px 15px; border: 1px solid var(--gg-quote-border); border-radius: 9px; background: var(--gg-quote-bg); }
.home .home-quote > svg { width: 23px; height: 23px; flex: none; color: var(--gg-logo-leaf); }
.home .home-quote p { margin: 0; color: var(--gg-text-strong); font: 400 15px/1.35 Georgia, 'Times New Roman', serif; }

/* Indicadores conectados aos dados e cálculos existentes. */
.home .home-kpis { display: grid; grid-template-columns: 1fr 1.12fr 1fr 1.1fr 1.24fr; gap: 12px; }
.home .home-kpis .kpi { position: relative; display: flex; align-items: flex-start; gap: 11px; width: 100%; min-width: 0; min-height: 92px; padding: 12px 11px; color: var(--gg-text-primary); background: linear-gradient(135deg, var(--gg-card-start), var(--gg-card-end)); border: 1px solid var(--gg-card-border); border-radius: 12px; box-shadow: var(--gg-shadow); text-align: left; font-family: inherit; text-decoration: none; }
.home .home-kpis button.kpi { cursor: pointer; }
.home .home-kpis .kpi:hover { background: var(--gg-card-hover); border-color: var(--gg-input-border); color: var(--gg-text-primary); }
.home .home-kpi-icon { display: grid; place-items: center; flex: 0 0 43px; width: 43px; height: 44px; border-radius: 8px; color: var(--gg-accent); background: var(--gg-green-icon-bg); }
.home .home-kpi-icon svg { width: 25px; height: 25px; }
.home .home-kpi-copy { flex: 1; min-width: 0; }
.home .home-kpis .lbl { color: var(--gg-text-secondary); font-size: 12px; font-weight: 500; line-height: 1.4; }
.home .home-kpis .val { display: block; margin: 5px 0 3px; color: var(--gg-text-strong); font-size: 24px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.home .home-kpis .sub { display: block; margin-top: 4px; color: var(--gg-text-muted); font-size: 12px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.home .home-kpi-arrow { flex: 0 0 12px; width: 12px; height: 15px; margin: 7px 0 0 auto; color: var(--gg-text-muted); }
.home .home-kpi-today .lbl { color: var(--gg-text-strong); font-size: 13px; font-weight: 600; }
.home .home-today-line { display: block; margin-top: 7px; color: var(--gg-text-secondary); font-size: 12px; font-weight: 400; line-height: 1.4; }
.home .home-today-line + .home-today-line { margin-top: 4px; }
.home .home-today-line b { color: var(--gg-accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.home .home-today-line > span { margin: 0 5px; color: var(--gg-text-muted); }
.home .home-today-list { display: grid; gap: 7px; margin-top: 0; }
.home .home-today-item { display: block; overflow-wrap: anywhere; }
.home .home-kpi-today .home-today-item .val { font-size: 16px; line-height: 1.35; }
.home .home-kpi-next .val { font-size: 16px; line-height: 1.35; }
.home .home-next-event { display: block; margin-top: 2px; color: var(--gg-text-primary); font-size: 12px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.home .home-next-client { display: block; margin-top: 1px; color: var(--gg-text-muted); font-size: 12px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.home .home-kpi-count .home-kpi-icon { color: var(--gg-blue); background: var(--gg-blue-icon-bg); }
.home .home-kpi-money .val { color: var(--gg-accent); }
.home .home-kpis .home-kpi-pending { background: linear-gradient(135deg, var(--gg-warning-bg-start), var(--gg-warning-bg-end)); border-color: var(--gg-warning-border); }
.home .home-kpis .home-kpi-pending:hover { background: var(--gg-warning-bg-start); border-color: var(--gg-warning); }
.home .home-kpi-pending .home-kpi-icon { background: var(--gg-warning-icon-bg); color: var(--gg-warning); }
.home .home-kpi-pending .lbl { color: var(--gg-text-primary); }
.home .home-kpi-pending .val { color: var(--gg-warning); }
.home .home-pending-breakdown { display: grid; gap: 3px; color: var(--gg-text-primary); font-size: 12px; font-weight: 400; line-height: 1.45; }
.home .home-pending-breakdown > span { display: block; overflow-wrap: anywhere; }
.home .home-pending-breakdown b { color: var(--gg-warning-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.home .home-kpi-pending .home-kpi-copy { display: grid; grid-template-columns: minmax(54px, .7fr) minmax(75px, 1fr); align-items: start; gap: 2px 8px; }
.home .home-kpi-pending .lbl, .home .home-kpi-pending .val { grid-column: 1; }
.home .home-kpi-pending .home-pending-breakdown { grid-column: 2; grid-row: 1 / 3; }
.home .home-kpi-pending .sub { grid-column: 1 / -1; }
.home .home-kpi-pending .home-kpi-arrow { display: none; }

/* Painéis inferiores e cabeçalho dos eventos. */
.home .home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.home .home-events { container: home-events / inline-size; min-width: 0; padding: 11px; border: 1px solid var(--gg-panel-border); border-radius: 12px; background: var(--gg-panel); }
.home .home-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.home .home-section-head h2 { display: flex; align-items: center; gap: 8px; color: var(--gg-text-strong); font-size: 15px; font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.home .home-section-head h2 > svg { color: var(--gg-text-secondary); }
.home .home-event-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home .home-event-controls select { width: auto; max-width: 185px; min-height: 32px; padding: 5px 27px 5px 10px; border: 1px solid var(--gg-input-border); border-radius: 7px; background-color: var(--gg-input-bg); color: var(--gg-text-primary); font-size: 12px; }
.home .home-event-controls .btn { min-height: 32px; padding: 6px; background: var(--gg-input-bg); }
.home .home-filters { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 12px; border-top: 1px solid var(--gg-panel-border); border-bottom: 1px solid var(--gg-panel-border); }
.home .home-filters button { flex: 1 1 auto; min-height: 36px; padding: 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--gg-text-secondary); font: 400 12px/1.4 var(--gg-font); cursor: pointer; transition: color 160ms; }
.home .home-filters button:hover { color: var(--gg-text-strong); }
.home .home-filters button[aria-pressed="true"] { border-bottom-color: var(--gg-accent); color: var(--gg-accent); font-weight: 600; }
.home .home-event-table { min-width: 0; }
.home .home-event-head { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.home #home-event-list { display: grid; gap: 7px; }
.home .home-event-row { display: grid; grid-template-columns: 54px repeat(5, minmax(0, 1fr)) 136px; grid-template-areas: 'date event event client client time actions' 'date event event total paid balance status'; gap: 8px 10px; align-items: center; min-width: 0; padding: 11px 12px; border: 1px solid var(--gg-card-border); border-left: 3px solid var(--gg-neutral); border-radius: 10px; background: var(--gg-row-bg); transition: background-color 160ms; }
.home .home-event-row:hover { background: var(--gg-row-hover); }
.home .home-event-row.row-overdue { border-left-color: var(--gg-danger); }
.home .home-event-row.row-pending { border-left-color: var(--gg-warning); }
.home .home-event-row.row-free { border-left-color: var(--gg-neutral); }
.home .home-event-row.row-paid { border-left-color: var(--gg-accent); }
.home .home-event-row.row-pre { border-left-color: var(--gg-purple); }
.home .home-cell { min-width: 0; color: var(--gg-text-primary); font-size: 13px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.home .home-cell[data-label]::before { display: block; margin-bottom: 3px; content: attr(data-label); color: var(--gg-text-muted); font-size: 12px; font-weight: 500; line-height: 1.3; }
.home :is(.home-cell-date, .home-cell-event, .home-cell-actions)[data-label]::before { display: none; }
.home .home-cell-date { grid-area: date; align-self: start; }
.home .home-cell-event { grid-area: event; }
.home .home-cell-client { grid-area: client; }
.home .home-cell-time { grid-area: time; }
.home .home-cell-total { grid-area: total; }
.home .home-cell-paid { grid-area: paid; }
.home .home-cell-balance { grid-area: balance; }
.home .home-cell-status { grid-area: status; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.home .home-cell-status[data-label]::before { display: none; }
.home .home-cell-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.home .evdate { margin: 0; padding: 5px 2px; border: 1px solid var(--gg-panel-border); border-radius: 8px; background: var(--gg-date-bg); text-align: center; font-variant-numeric: tabular-nums; }
.home .evdate b { display: block; color: var(--gg-text-strong); font-size: 24px; font-weight: 700; line-height: 1.1; }
.home .evdate span { display: block; margin-top: 1px; color: var(--gg-accent); font-size: 11px; font-weight: 700; line-height: 1.2; text-transform: uppercase; }
.home .evdate small { display: block; margin-top: 2px; color: var(--gg-text-secondary); font-size: 12px; font-weight: 400; line-height: 1.2; text-transform: capitalize; }
.home .home-cell-event h3 { margin: 0 0 3px; color: var(--gg-text-strong); font-size: 14px; font-weight: 600; line-height: 1.3; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.home .home-row-clean, .home .home-row-contract { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin: 2px 0 0; color: var(--gg-text-secondary); font-size: 12px; font-weight: 400; line-height: 1.4; }
.home .home-row-clean > svg, .home .home-row-contract > svg { width: 12px; height: 12px; color: var(--gg-text-muted); }
.home .home-row-label { color: var(--gg-text-muted); }
.home .home-row-clean .info { color: var(--gg-text-secondary); }
.home .home-clean-note { color: var(--gg-text-muted); }
.home .home-row-clean .is-missing, .home .home-cell-time.is-missing { color: var(--gg-warning-text); }
.home .home-cell-time > svg { width: 13px; height: 13px; color: var(--gg-text-muted); }
.home .home-cell-total, .home .home-cell-paid, .home .home-cell-balance { font-variant-numeric: tabular-nums; }
.home .home-cell-balance.is-pending { color: var(--gg-warning-text); font-weight: 600; }
.home .home-cell-balance.is-overdue { color: var(--gg-danger); font-weight: 600; }
.home .home-cell-balance.is-zero { color: var(--gg-text-secondary); }
.home .badge { padding: 1px 6px; border-width: 1px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.4; white-space: normal; }
.home :is(.home-badge-reserved, .home-badge-sent) { background: var(--gg-reserved-bg); border-color: var(--gg-reserved-border); color: var(--gg-reserved-text); }
.home :is(.home-badge-confirmed, .home-badge-paid, .home-badge-signed) { background: var(--gg-confirmed-bg); border-color: var(--gg-confirmed-border); color: var(--gg-confirmed-text); }
.home :is(.home-badge-pending, .home-badge-generated) { background: var(--gg-pending-bg); border-color: var(--gg-pending-border); color: var(--gg-warning-text); }
.home .home-badge-pre { background: var(--gg-purple-bg); border-color: var(--gg-purple-border); color: var(--gg-purple); }
.home :is(.home-badge-free, .home-badge-no-contract) { background: var(--gg-neutral-bg); border-color: var(--gg-neutral-border); color: var(--gg-neutral-text); }
.home .home-badge-overdue { background: var(--gg-danger-bg); border-color: var(--gg-danger-border); color: var(--gg-danger); }
.home .home-cell-actions > .btn { min-height: 32px; padding: 6px 8px; border-radius: 8px; line-height: 1.25; }
.home .home-cell-actions > .btn.primary { gap: 5px; white-space: nowrap; }
.home .home-cell-actions .btn > svg { width: 14px; height: 14px; }
.home .home-more { flex: none; width: 30px; min-width: 30px; padding: 5px; background: var(--gg-row-bg); color: var(--gg-text-secondary); border-color: var(--gg-input-border); }
.home .home-more:hover { background: var(--gg-row-hover); }
.home .empty { padding: 26px 14px; color: var(--gg-text-muted); font-size: 13px; }

/* Camada superior nativa: o menu não é cortado pelo painel. */
.home-actions-menu { position: fixed; inset: auto; width: 205px; max-width: calc(100vw - 24px); margin: 0; padding: 6px; overflow: auto; border: 1px solid var(--gg-input-border); border-radius: 8px; background: var(--gg-sidebar-end); color: var(--gg-text-primary); box-shadow: var(--gg-menu-shadow); }
.home-actions-menu :is(a, button) { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 9px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--gg-text-primary); font: 500 13px/1.4 var(--gg-font); text-align: left; text-decoration: none; cursor: pointer; }
.home-actions-menu :is(a, button):hover { color: var(--gg-text-primary); background: var(--gg-card-hover); text-decoration: none; }
.home-actions-menu :is(a, button) > svg { width: 16px; height: 16px; color: var(--gg-text-secondary); }
.home-actions-menu .danger, .home-actions-menu .danger > svg { color: var(--gg-danger); }
.home-actions-menu :disabled { background: var(--gg-disabled-bg); color: var(--gg-text-disabled); cursor: not-allowed; }

/* Calendário e histórico reais. */
.home .home-aside { display: grid; gap: 14px; min-width: 0; }
.home .home-aside > .card { margin: 0; padding: 13px 12px; border: 1px solid var(--gg-panel-border); border-radius: 12px; background: var(--gg-panel); }
.home .home-aside .home-section-head { flex-wrap: nowrap; gap: 7px; margin: 0 0 11px; }
.home .home-calendar h2 { color: var(--gg-text-strong); font-size: 14px; font-weight: 600; text-transform: none; }
.home .home-calendar-nav { display: flex; flex: none; gap: 6px; }
.home .home-calendar-nav .btn { width: 29px; min-height: 29px; padding: 4px; border-color: var(--gg-panel-border); background: var(--gg-row-hover); color: var(--gg-text-secondary); }
.home .home-calendar-nav svg { width: 14px; height: 14px; }
.home .home-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.home .home-weekday { display: grid; place-items: center; padding: 2px 0 6px; color: var(--gg-text-secondary); font-size: 12px; font-weight: 500; }
.home .home-day { position: relative; display: grid; place-items: center; min-width: 0; min-height: 28px; padding: 3px 0 5px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--gg-text-primary); font: 400 12px/1.25 var(--gg-font); font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color 160ms, border-color 160ms; }
.home .home-day.out { color: var(--gg-text-muted); }
.home .home-day.today { border-color: var(--gg-accent); }
.home .home-day.has-visits { background: var(--gg-visit-bg); color: var(--gg-text-strong); }
.home .home-day.has-events { background: var(--gg-active-bg); color: var(--gg-text-strong); }
.home .home-day:hover { border-color: var(--gg-text-muted); background: var(--gg-row-hover); }
.home .home-day.today:hover { border-color: var(--gg-accent); }
.home .home-calendar-markers { position: absolute; bottom: 2px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; }
.home .home-calendar-dot { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--gg-neutral); }
.home .home-calendar-dot.marker-event { background: var(--gg-accent); }
.home .home-calendar-dot.marker-visit { background: var(--gg-visit); }
.home .home-calendar-dot.marker-maintenance { background: var(--gg-warning); }
.home .home-calendar-dot.marker-other { background: var(--gg-neutral); }
.home .home-calendar-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin: 9px 0 0; color: var(--gg-text-secondary); font-size: 12px; font-weight: 400; line-height: 1.4; }
.home .home-calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.home .home-calendar-legend span::before { content: ''; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--gg-neutral); }
.home .home-calendar-legend .marker-event::before { background: var(--gg-accent); }
.home .home-calendar-legend .marker-visit::before { background: var(--gg-visit); }
.home .home-calendar-legend .marker-maintenance::before { background: var(--gg-warning); }
.home .home-calendar-legend .marker-other::before { background: var(--gg-neutral); }
.home .home-activities .home-section-head > .btn { flex: none; min-height: 28px; padding: 4px 0 4px 5px; color: var(--gg-text-secondary); font-size: 12px; font-weight: 500; background: transparent; }
.home .home-activities .home-section-head > .btn:hover { color: var(--gg-accent); }
.home .home-section-note { margin: -3px 0 8px; color: var(--gg-text-muted); font-size: 12px; line-height: 1.4; }
.home .home-activity-list { list-style: none; margin: 0; padding: 0; }
.home .home-activity-list li { padding: 9px 0; }
.home .home-activity-list li + li { border-top: 1px solid var(--gg-panel-border); }
.home .home-activity-list li:first-child { padding-top: 0; }
.home .home-activity-list li:last-child { padding-bottom: 0; }
.home .home-activity-list a { display: flex; align-items: center; gap: 9px; color: var(--gg-text-primary); text-decoration: none; }
.home .home-activity-list a:hover strong { color: var(--gg-accent); }
.home .home-activity-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--gg-green-icon-bg); color: var(--gg-accent); }
.home .home-activity-icon svg { width: 16px; height: 16px; }
.home .home-activity-icon.activity-payment { background: var(--gg-warning-icon-bg); color: var(--gg-warning-text); }
.home .home-activity-icon.activity-visit { background: var(--gg-blue-icon-bg); color: var(--gg-blue); }
.home .home-activity-icon.activity-import { background: var(--gg-import-bg); color: var(--gg-import-text); }
.home .home-activity-list a > div { flex: 1; min-width: 0; }
.home .home-activity-list strong { display: block; color: var(--gg-text-primary); font-size: 13px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.home .home-activity-list small, .home .home-activity-list a > div > span { display: block; margin-top: 3px; color: var(--gg-text-muted); font-size: 12px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.home .home-activity-list time { display: block; flex: 0 0 56px; color: var(--gg-text-muted); font-size: 12px; font-weight: 400; line-height: 1.4; font-variant-numeric: tabular-nums; }

/* Grade de nove colunas só quando cabe com texto legível. */
@container home-events (min-width: 1035px) {
  .home .home-event-head, .home .home-event-row { grid-template-columns: 52px minmax(180px, 1.9fr) minmax(100px, 1fr) minmax(74px, .7fr) repeat(3, minmax(76px, .8fr)) minmax(100px, 1fr) 136px; column-gap: 6px; }
  .home .home-event-head { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal; display: grid; align-items: center; padding: 6px 12px; border: 1px solid var(--gg-panel-border); border-radius: 8px 8px 0 0; background: var(--gg-subtle-bg); color: var(--gg-text-muted); font-size: 12px; font-weight: 500; line-height: 1.35; }
  .home .home-event-head > span:last-child { text-align: center; }
  .home .home-event-row { grid-template-areas: none; gap: 8px 6px; padding: 7px 10px; min-height: 78px; }
  .home .home-cell { grid-area: auto; }
  .home .home-cell-date { align-self: center; }
  .home .home-cell[data-label]::before { display: none; }
  .home .home-cell-actions { justify-content: flex-end; }
  .home .home-cell-status { gap: 4px; }
  .home .home-cell-total, .home .home-cell-paid, .home .home-cell-balance { white-space: nowrap; }
}
@container home-events (max-width: 680px) {
  .home .home-event-row { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-areas: 'date event event event event event' 'date client client client client client' 'time time time status status status' 'total total paid paid balance balance' 'actions actions actions actions actions actions'; gap: 11px 10px; padding: 12px; }
  .home .home-cell-total, .home .home-cell-paid, .home .home-cell-balance { white-space: nowrap; }
  .home .home-cell-actions { justify-content: stretch; }
  .home .home-cell-actions > .btn.primary { flex: 1; }
  .home .home-cell-actions > .btn { min-height: 44px; }
  .home .home-more { width: 44px; min-width: 44px; }
  .home .home-cell-status { justify-content: flex-start; align-self: start; }
  .home .home-cell-status[data-label]::before { display: block; flex-basis: 100%; }
}
@media (max-width: 1499px) {
  .home .home-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home .home-kpis .kpi { min-height: 100px; padding: 13px; }
  .home .home-layout { grid-template-columns: minmax(0, 1fr); }
  .home .home-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .home .home-hero { padding-left: 25px; }
  .home .home-hero-content { max-width: calc(100% - 320px); }
}
@media (max-width: 1199px) {
  .home .home-hero { padding-top: 22px; padding-bottom: 22px; }
  .home .home-hero-content { max-width: calc(100% - 275px); }
  .home #home-title { font-size: 32px; }
  .home .home-hero-actions { gap: 7px; }
  .home .home-hero-actions .btn { padding: 8px 10px; }
  .home .home-quote { right: 15px; width: 225px; padding: 12px; }
}
@media (max-width: 1023px) {
  .app[data-page="home"] .content, .app:has(.home) .content { padding: 16px; }
  .home .home-menu { display: inline-flex; min-height: 40px; width: 40px; background: var(--gg-subtle-bg); }
  .home .home-hero { min-height: 210px; padding-top: 68px; padding-right: 20px; padding-bottom: 22px; }
  .home .home-hero-tools { top: 12px; left: 16px; right: 16px; justify-content: space-between; }
  .home .home-hero-content { max-width: calc(100% - 245px); }
  .home .home-quote { bottom: 20px; }
  .home .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .home-kpi-pending { grid-column: 1 / -1; }
  .home .home-kpi-pending .home-kpi-copy { grid-template-columns: minmax(70px, .35fr) 1fr; }
  .home .home-pending-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .home-calendar-nav .btn { width: 38px; min-height: 38px; }
  .home .home-day { min-height: 36px; }
  .home .home-filters button { min-height: 42px; }
  .home .home-event-controls select, .home .home-event-controls .btn { min-height: 40px; }
}
@media (max-width: 760px) {
  .home .home-hero-content { max-width: none; }
  .home .home-quote { display: none; }
  .home .home-hero { min-height: 0; padding: 72px 20px 24px; }
  .home #home-title { font-size: 28px; }
  .home .home-hero-actions .btn { min-height: 44px; }
  .home .home-menu { min-height: 44px; width: 44px; }
  .home .home-aside { grid-template-columns: minmax(0, 1fr); }
  .home .home-calendar-nav .btn { width: 44px; min-height: 44px; }
  .home .home-day { min-height: 40px; }
  .home .home-aside > .card { padding: 14px; }
  .home-actions-menu :is(a, button) { min-height: 44px; }
}
@media (max-width: 540px) {
  .app[data-page="home"] .content, .app:has(.home) .content { padding: 12px; }
  .home .home-hero { padding: 74px 16px 22px; }
  .home .home-hero-tools { left: 12px; right: 12px; }
  .home .home-hero-actions { gap: 6px; }
  .home .home-hero-actions .btn { gap: 5px; padding: 8px 9px; }
  .home .home-hero-actions .btn > svg { width: 15px; height: 15px; }
  .home .home-menu { width: 38px; min-width: 38px; padding: 7px; }
  .home #home-title { font-size: 27px; }
  .home #home-title > span { display: block; }
  .home .home-subtitle { font-size: 14px; }
  .home .home-kpis { gap: 10px; }
  .home .home-kpis .kpi { min-height: 132px; padding: 12px; gap: 8px; flex-wrap: wrap; align-content: start; }
  .home .home-kpi-icon { flex-basis: 34px; width: 34px; height: 34px; }
  .home .home-kpi-icon svg { width: 21px; height: 21px; }
  .home .home-kpi-copy { flex-basis: 100%; }
  .home .home-kpi-arrow { position: absolute; top: 17px; right: 10px; margin: 0; }
  .home .home-kpis .val { font-size: 24px; }
  .home .home-kpi-next .val { font-size: 16px; }
  .home .home-kpi-pending .home-kpi-copy { flex: 1; grid-template-columns: minmax(66px, .55fr) minmax(100px, 1fr); }
  .home .home-kpi-pending .home-kpi-icon { flex-basis: 34px; }
  .home .home-kpis .home-kpi-pending { min-height: 100px; flex-wrap: nowrap; }
  .home .home-pending-breakdown { grid-template-columns: minmax(0, 1fr); }
  .home .home-events { padding: 9px; }
  .home .home-events > .home-section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .home .home-event-controls { width: 100%; }
  .home .home-event-controls select { flex: 1; max-width: none; }
  .home .home-event-controls select, .home .home-event-controls .btn { min-height: 44px; }
  .home .home-filters button { min-height: 44px; }
  .home .home-day { min-height: 44px; }
}
@media (max-width: 380px) {
  .home .home-hero-tools { flex-wrap: wrap; }
  .home .home-hero-actions { flex: 1; }
  .home .home-hero-actions .btn { flex: 1; font-size: 12px; padding: 7px 6px; }
  .home .home-hero-actions .btn > svg { display: none; }
  .home .home-kpis { grid-template-columns: minmax(0, 1fr); }
  .home .home-kpis .kpi { min-height: 94px; flex-wrap: nowrap; }
  .home .home-kpi-copy { flex-basis: auto; }
  .home .home-kpis .home-kpi-pending { min-height: 100px; }
  .home .home-kpi-pending .home-kpi-copy { grid-template-columns: minmax(66px, .55fr) minmax(100px, 1fr); }
}



/* Em telas muito estreitas, cada valor preserva sua unidade e seus centavos. */
@container home-events (max-width: 320px) {
  .home .home-event-row { grid-template-areas: 'date event event event event event' 'client client client client client client' 'time time time status status status' 'total total total total total total' 'paid paid paid paid paid paid' 'balance balance balance balance balance balance' 'actions actions actions actions actions actions'; }
  .home .home-cell-date { width: 45px; }
  .home .home-cell-event { padding-left: 10px; }
  .home .home-cell-total, .home .home-cell-paid, .home .home-cell-balance { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .home .home-cell-total[data-label]::before, .home .home-cell-paid[data-label]::before, .home .home-cell-balance[data-label]::before { margin: 0; }
}


