/* Palette from the supplied Contas artwork. Load after the structural styles. */
:root {
  --brand-green: #07856f;
  --brand-deep: #00484d;
  --brand-navy: #10365e;
  --brand-gold: #f4ad15;
  --brand-gold-ink: #905400;
  --brand-background: #f2f6f5;
  --brand-muted: #60726f;
  --brand-line: #dfe9e6;
}
body, .workspace { background: var(--brand-background); color: var(--brand-navy); }
.workspace .sidebar { border-color: var(--brand-line); }
.button-primary, .primary-button { background: var(--brand-green); }
.button-primary:hover, .primary-button:hover { background: #066c5c; }
.text-link, .current-month-link, .product-extra summary { color: #066d5d; }
.workspace :is(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--brand-green); outline-offset: 3px; }
.workspace .side-link.active, .workspace .mobile-nav-item.active { color: #056453; background: #e6f4ee; }
.workspace .side-link:hover { background: #f0f6f3; }
.workspace .mobile-nav { background: #ffffffed; border-color: var(--brand-line); }
.quick-fab { color: #fff; background: var(--brand-green); border-color: #08715f; box-shadow: 0 6px 20px #00484d26; }
.quick-fab:hover { background: #066e5d; }
.quick-fab:active { background: #055c4e; }
.filter-tabs { background: #eaf2ef; }
.filter-tabs a[aria-current] { color: #056453; }
.success-message { color: #075f4f; background: #e3f5ed; }
.income { color: #08775e; }
.expense { color: var(--brand-gold-ink); }
.blue { color: var(--brand-navy); }
.margin-ring { background: conic-gradient(var(--brand-green) var(--progress), #e7efeb 0); }
.margin-ring.negative { background: #f7e1da; }
.margin-ring strong { color: var(--brand-navy); }
.legend-dot.income { background: var(--brand-green); }
.legend-dot.expense { background: var(--brand-gold); }
.legend-dot.result { background: var(--brand-navy); }
.action-row { background: #f2f7f4; }
.action-row:hover { background: #e8f3ee; border-color: #b6d9ce; }
.sale-result:hover { background: #f0f8f4; border-color: #a5d0bf; }
.sale-type-tabs button[aria-pressed=true], .payment-method[aria-pressed=true] { background: #e8f5ef; border-color: #14846a; color: #056453; }
.sale-type-tabs button:focus-visible, .payment-method:focus-visible { outline-color: var(--brand-green); }
.sale-payment-feedback[data-state=success] { color: #07694f; }
.workspace .schedule-badge { color: #7d5307; background: #fff4d9; }
.recurrence-toggle { color: #07614f; background: #edf6f0; border-color: #c6ddd3; }

/* Keep the month selector centered between alerts and account access. */
.workspace .dashboard-header { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 12px; align-items: center; }
.workspace .header-brand { display: inline-flex; grid-column: 1; grid-row: 1; align-items: center; width: 44px; min-height: 44px; }
.workspace .header-brand img { display: block; width: 40px; height: 40px; object-fit: contain; }
.workspace .local-header-actions { display: flex; align-items: center; gap: 4px; justify-self: end; grid-column: 3; grid-row: 1; }
@media (max-width: 760px) {
  .workspace .dashboard-header { grid-template-columns: 44px minmax(0, 1fr) 92px; }
}
@media (min-width: 761px) {
  .workspace .dashboard-header > .header-brand { display: none; }
  .workspace .dashboard-header .local-header-actions { display: contents; }
}
@media (max-width: 380px) {
  .workspace .dashboard-header { grid-template-columns: 40px minmax(0, 1fr) 88px; gap: 4px; }
  .workspace .local-header-actions { gap: 0; }
  .workspace .dashboard-header .period-picker summary { font-size: 14px; padding: 6px; white-space: normal; }
}
.workspace .notification-bell { grid-column: 1; grid-row: 1; }
.notification-bell { position: relative; width: 44px; height: 44px; color: var(--brand-navy); }
.notification-bell > summary { position: relative; display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; cursor: pointer; list-style: none; }
.notification-bell > summary::-webkit-details-marker { display: none; }
.notification-bell > summary::marker { content: ''; }
.notification-bell > summary:hover, .notification-bell[open] > summary { background: #edf6f1; }
.notification-bell > summary:focus-visible { outline: 3px solid var(--brand-green); outline-offset: 3px; }
.notification-bell > summary > .ui-icon { width: 23px; height: 23px; }
.notification-count { position: absolute; top: 0; right: 0; display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; background: #d94841; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; }
.notification-menu { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; display: grid; width: 230px; gap: 4px; padding: 8px; border: 1px solid var(--brand-line); border-radius: 14px; background: #fff; box-shadow: 0 12px 30px #00484d1c; }
.notification-menu a { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px; border-radius: 9px; color: var(--brand-navy); font-size: 13px; }
.notification-menu a:hover, .notification-menu a:focus-visible { background: var(--brand-green-tint); }
.login-form [hidden] { display: none !important; }
.remembered-user { margin: 0; color: var(--brand-muted); font-size: 14px; overflow-wrap: anywhere; }
.remembered-user strong { color: var(--brand-navy); }
.link-button { padding: 0; border: 0; background: none; color: var(--brand-green); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.notification-empty { margin: 0; padding: 12px 10px; color: var(--brand-muted); font-size: 13px; line-height: 1.4; }
.notification-menu a strong { display: grid; min-width: 25px; height: 25px; place-items: center; padding: 0 5px; border-radius: 999px; background: var(--brand-green-tint); color: var(--brand-deep); font-size: 12px; }
.workspace .profile-button { grid-column: 3; grid-row: 1; background: #edf6f1; color: #08765e; border-color: var(--brand-line); }
.workspace .period-toolbar { grid-column: 2; grid-row: 1; justify-self: center; min-width: 0; }
.workspace .month-switcher { padding: 0; background: transparent; border-color: transparent; }
.workspace .period-picker summary { color: var(--brand-muted); font-size: 17px; font-weight: 550; font-variant-numeric: tabular-nums; }
.workspace .period-picker summary:hover { background: #eff6f2; }
.workspace .month-arrow { color: #607970; }
.period-step-links { display: flex; justify-content: space-between; gap: 8px; }
.period-step-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: #066d5d; }
.period-step-links .ui-icon { width: 16px; height: 16px; }

/* White summary panel, inspired by the reference; open bills remain below it. */
.overview-top { min-width: 0; padding: 24px; margin-bottom: 24px; background: #fff; border: 1px solid #e7eeea; border-radius: 30px; box-shadow: 0 12px 30px #153b3310; }
.overview-top .dashboard-header { margin-bottom: 8px; }
.overview-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.overview-balance { display: flex; flex-direction: column; align-items: flex-start; flex: 1 1 auto; min-width: 0; padding: 14px 0 6px; text-align: left; }
.overview-label-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; }
.overview-margin { position: relative; display: grid; flex: 0 0 auto; place-items: center; width: 128px; height: 128px; border-radius: 50%; color: var(--brand-green); }
.overview-margin svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 3.4; }
.overview-margin .margin-track { stroke: #e3ece9; }
.overview-margin .margin-arc { stroke: currentColor; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.overview-margin .margin-center { display: grid; justify-items: center; line-height: 1.1; }
.overview-margin strong { color: var(--brand-navy); font-size: 26px; font-weight: 650; letter-spacing: -.5px; }
.overview-margin small { color: var(--brand-muted); font-size: 12px; }
.overview-margin.negative { color: #c2553a; }
.overview-margin.negative strong { color: #b14d35; }
.overview-margin:hover .margin-track { stroke: #d5e4df; }
.overview-label { color: var(--brand-muted); font-size: 16px; }
.cost-heading { display: block; margin-bottom: 6px; font-weight: 600; }
.report-overview { display: grid; gap: 16px; padding: 22px; }
.report-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-head h2, .report-trend-head h3 { margin: 0; }
.report-head .period-label { margin: 0; text-transform: capitalize; }
.report-kpis { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.report-kpi { display: grid; gap: 2px; padding: 12px 14px; background: #f6f9f8; border-radius: 16px; min-width: 0; }
.report-kpi span { color: var(--brand-muted); font-size: 13px; }
.report-kpi strong { font-size: clamp(15px, 3.6vw, 22px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--brand-navy); }
.report-kpi.income strong { color: var(--brand-green); }
.report-kpi.expense strong, .report-kpi.negative strong { color: #b14d35; }
.report-tabs { justify-self: start; }
.report-chart { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0,1fr); gap: 24px; align-items: center; }
.report-donut { position: relative; width: 100%; aspect-ratio: 1; }
.report-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.report-donut circle { transition: opacity .2s ease; }
.report-donut .donut-track { stroke: #e9f0ee; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 22%; line-height: 1.2; }
.donut-center strong { font-size: clamp(13px, 2.6vw, 18px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--brand-navy); }
.donut-center small { color: var(--brand-muted); font-size: 12px; }
.report-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.report-legend-item { display: grid; grid-template-columns: 10px minmax(0,1fr) auto auto; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 4px 8px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.report-legend-item:disabled { cursor: default; }
.report-legend-item:not(:disabled):hover, .report-legend-item[aria-pressed="true"] { background: #eef5f1; }
.report-legend-item i { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-muted); }
.report-legend-item small { color: var(--brand-muted); }
.report-legend-item strong { font-variant-numeric: tabular-nums; }
.report-trend-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.report-trend-head h3 { font-size: 15px; }
.trend-key { color: var(--brand-muted); font-size: 12px; }
.report-trend { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; align-items: end; }
.trend-col { display: grid; gap: 6px; justify-items: center; color: var(--brand-muted); font-size: 12px; text-transform: capitalize; }
.trend-col.current { color: var(--brand-navy); font-weight: 600; }
.trend-bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 84px; width: 100%; }
.trend-bars i { display: block; width: min(14px, 38%); min-height: 0; border-radius: 4px 4px 0 0; }
.trend-bars .income { background: var(--brand-green); }
.trend-bars .expense { background: #d98a73; }
.trend-col:not(.current) .trend-bars i { opacity: .55; }
.report-clear { margin-bottom: 8px; }
@media (max-width: 640px) { .report-chart { grid-template-columns: 1fr; justify-items: center; } .report-donut { max-width: 220px; } .report-legend { justify-self: stretch; } .report-overview { padding: 16px; } }
.cost-lines { display: grid; gap: 8px; margin-bottom: 6px; }
.cost-line { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) auto; gap: 8px; align-items: center; }
.overview-scope { display: inline-flex; gap: 2px; padding: 2px; margin-bottom: 6px; background: #f1f5f3; border-radius: 999px; }
.overview-scope button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--brand-muted); font: inherit; font-size: 12px; cursor: pointer; }
.overview-scope button[aria-pressed="true"] { background: #fff; color: var(--brand-navy); box-shadow: 0 1px 3px #153b3320; }
.overview-scope button:focus-visible { outline: 2px solid var(--brand-green); outline-offset: 1px; }
.overview-balance-value { max-width: 100%; margin-top: 8px; color: var(--brand-navy); font-size: clamp(34px, 4.5vw, 58px); font-weight: 650; letter-spacing: -1.5px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.overview-context { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand-muted); font-size: 13px; }
.overview-privacy { min-width: 44px; min-height: 44px; flex: 0 0 auto; background: transparent; color: var(--brand-navy); }
.overview-privacy:hover { background: #eef5f1; }
.overview-cashflow { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; padding: 8px 0 2px; }
.overview-flow { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 72px; padding: 8px 0; border-radius: 14px; }
.overview-flow:hover { background: #f7faf8; }
.overview-flow-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto; }
.overview-flow-icon .ui-icon { width: 28px; height: 28px; stroke-width: 2; }
.overview-flow.income .overview-flow-icon { color: #fff; background: var(--brand-green); }
.overview-flow.expense .overview-flow-icon { color: var(--brand-navy); background: #ffcc53; }
.overview-flow-details { min-width: 0; }
.overview-flow-details > span { display: block; color: var(--brand-muted); font-size: 14px; }
.overview-flow-details strong { display: block; margin-top: 4px; font-size: clamp(20px,2.7vw,30px); font-weight: 650; letter-spacing: -.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.amount-card { border-color: #e8efeb; }
.amount-label .income, .amount-label .expense { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; }
.amount-label .income { color: #08755c; background: #e6f5ec; }
.amount-label .expense { color: #8b5400; background: #fff1d2; }
.amount-label .ui-icon { width: 20px; height: 20px; }

/* Color is an aid; every destination keeps its label and its own icon shape. */
.icon-home, .icon-reports, .icon-customers { --icon-ink: #10365e; --icon-tint: #eaf0f7; }
.icon-finance, .icon-sale, .icon-profile, .icon-income { --icon-ink: #08765e; --icon-tint: #e5f5ec; }
.icon-services, .icon-products, .icon-suppliers, .icon-templates, .icon-expense { --icon-ink: #8c5805; --icon-tint: #fff2d3; }
.icon-categories { --icon-ink: #05656c; --icon-tint: #e1f2f1; }
.icon-catalogs { --icon-ink: #08765e; --icon-tint: #e5f5ec; }
.icon-more { --icon-ink: #10365e; --icon-tint: #eaf0f7; }
.side-link > .ui-icon, .mobile-nav-item > .ui-icon, .catalog-icon > .ui-icon { color: var(--icon-ink,var(--brand-navy)); background: var(--icon-tint,#edf4f1); border-radius: 10px; }
.workspace .side-link > .ui-icon { width: 32px; height: 32px; padding: 6px; flex-shrink: 0; }
.workspace .mobile-nav-item > .ui-icon { width: 30px; height: 30px; padding: 4px; }
.workspace .ui-icon.icon-home, .workspace .ui-icon.icon-reports, .workspace .ui-icon.icon-sale, .workspace .ui-icon.icon-products, .workspace .ui-icon.icon-profile, .workspace .ui-icon.icon-camera { padding: 0 !important; border-radius: 0; background: currentColor; fill: none; stroke: none; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain; }
.workspace .ui-icon.icon-home { -webkit-mask-image: url("brand/ui-icons/ui-home.png"); mask-image: url("brand/ui-icons/ui-home.png"); }
.workspace .ui-icon.icon-reports { -webkit-mask-image: url("brand/ui-icons/ui-reports.png"); mask-image: url("brand/ui-icons/ui-reports.png"); }
.workspace .ui-icon.icon-sale { -webkit-mask-image: url("brand/ui-icons/ui-pos.png"); mask-image: url("brand/ui-icons/ui-pos.png"); }
.workspace .ui-icon.icon-products { -webkit-mask-image: url("brand/ui-icons/ui-package.png"); mask-image: url("brand/ui-icons/ui-package.png"); }
.workspace .ui-icon.icon-profile { -webkit-mask-image: url("brand/ui-icons/ui-user.png"); mask-image: url("brand/ui-icons/ui-user.png"); }
.workspace .ui-icon.icon-camera { -webkit-mask-image: url("brand/ui-icons/ui-camera.png"); mask-image: url("brand/ui-icons/ui-camera.png"); }
.catalog-icon { display: grid; width: 44px; height: 44px; place-items: center; flex: 0 0 auto; }
.catalog-icon > .ui-icon { width: 40px; height: 40px; padding: 8px; }
.action-row > .ui-icon:first-child:not(:last-child) { width: 36px; height: 36px; padding: 7px; border-radius: 12px; color: var(--icon-ink,var(--brand-navy)); background: var(--icon-tint,#eaf2ee); flex-shrink: 0; }
.action-group summary { display: flex; align-items: center; gap: 12px; }
.action-group summary > .ui-icon { width: 36px; height: 36px; padding: 7px; border-radius: 12px; color: var(--icon-ink); background: var(--icon-tint); }
.action-group summary::after { content: '+'; margin-left: auto; color: var(--brand-muted); font-size: 20px; }
.action-group[open] summary::after { content: '−'; }

@media (max-width:760px) {
  .overview-top { padding: 16px; border-radius: 26px; margin-bottom: 18px; }
  .overview-main { gap: 12px; }
  .overview-margin { width: 96px; height: 96px; }
  .overview-margin strong { font-size: 20px; }
  .overview-margin small { font-size: 11px; }
  .overview-balance { padding-top: 10px; }
  .overview-balance-value { font-size: clamp(32px,8.7vw,46px); }
  .overview-cashflow { gap: 12px; padding-top: 4px; }
  .overview-flow { gap: 8px; }
  .overview-flow-icon { width: 40px; height: 40px; }
  .overview-flow-icon .ui-icon { width: 24px; height: 24px; }
  .overview-flow-details strong { font-size: clamp(18px,4.7vw,25px); }
  .overview-flow-details > span { font-size: 13px; }
}
@media (max-width:420px) {
  .workspace .dashboard-header { grid-template-columns: 44px minmax(0,1fr) 44px; gap: 8px; }
  .notification-bell { width: 44px; height: 44px; }
  .workspace .profile-button { width: 44px; height: 44px; }
  .workspace .period-picker summary { min-width: 0; gap: 6px; padding: 2px 6px; font-size: 16px; }
  .workspace .period-picker summary small { display: block; margin: 1px 0 0; text-align: center; font-size: 11px; }
  .workspace .period-picker summary > .ui-icon { display: block; width: 14px; height: 14px; }
}

/* Ações rápidas (+): grade minimalista com alvos de toque grandes */
.workspace .actions-dialog { width: min(calc(100vw - 32px), 400px); padding: 20px; border: 1px solid var(--brand-line); border-radius: 28px; box-shadow: 0 30px 90px #00484d40; }
.workspace .actions-dialog::backdrop { background: #00252ab3; backdrop-filter: blur(4px); }
.actions-dialog .sheet-heading { margin-bottom: 8px; }
.actions-dialog .sheet-heading h2 { color: var(--brand-navy); font-size: 22px; }
.actions-dialog .actions-list { gap: 8px; }
.action-label { margin: 12px 2px 2px; color: var(--brand-muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.action-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 12px 6px; border: 1px solid var(--brand-line); border-radius: 18px; background: #fff; color: var(--brand-navy); font: inherit; font-size: 14px; font-weight: 650; text-align: center; text-decoration: none; cursor: pointer; transition: transform .12s ease, background .12s ease, border-color .12s ease; -webkit-tap-highlight-color: transparent; }
.action-tile > .ui-icon { width: 44px; height: 44px; padding: 10px; border-radius: 14px; }
.action-grid.income .action-tile > .ui-icon { color: #fff; background: var(--brand-green); }
.action-grid.expense .action-tile > .ui-icon { color: var(--brand-navy); background: #ffcc53; }
.action-tile:hover { background: #f4faf8; border-color: #b9d8cf; }
.action-tile:active { transform: scale(.96); background: #e6f4ee; }
@media (max-width: 760px) {
  .workspace .actions-dialog { width: 100%; max-width: 100%; border-radius: 28px 28px 0 0; padding: 18px 16px max(20px, env(safe-area-inset-bottom)); }
  .workspace .actions-dialog { top: auto; bottom: 0; left: 0; transform: none; }
}
@media (max-width: 340px) { .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Cores individuais nas ações rápidas */
.action-grid .action-tile > .ui-icon { color: #fff; background: var(--tone, var(--brand-green)); }
.action-grid .action-tile[href*="view=sale"] { --tone: #07856f; }
.action-grid .action-tile[data-create="receivable"] { --tone: #0a8fa3; }
.action-grid .action-tile[data-create="income"] { --tone: #2f6fd0; }
.action-grid .action-tile[data-create="product"] { --tone: #7a4fc7; }
.action-grid .action-tile[data-create="service"] { --tone: #e0701a; }
.action-grid .action-tile[data-create="payable"] { --tone: #d64545; }
.action-grid .action-tile[data-create="expense"] { --tone: #c2336f; }
.action-grid .action-tile[href*="expense-templates"] { --tone: #5b6b8a; }
.action-tile:hover { border-color: var(--tone, #b9d8cf); }

/* Barra de rolagem discreta nos modais */
.quick-dialog, .workspace .quick-dialog { scrollbar-width: thin; scrollbar-color: #c9d8d4 transparent; }
.quick-dialog::-webkit-scrollbar { width: 6px; height: 6px; }
.quick-dialog::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
.quick-dialog::-webkit-scrollbar-thumb { background: #c9d8d4; border-radius: 999px; }
.quick-dialog::-webkit-scrollbar-thumb:hover { background: #a9bfb9; }
.quick-dialog::-webkit-scrollbar-corner { background: transparent; }
/* Prevalece sobre as cores por grupo definidas acima */
.action-grid.income .action-tile > .ui-icon, .action-grid.expense .action-tile > .ui-icon { color: #fff; background: var(--tone, var(--brand-green)); box-shadow: 0 4px 10px color-mix(in srgb, var(--tone, #07856f) 30%, transparent); }
/* Fluxo rápido: menu +, formulário e PDV */
.action-grid.main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action-grid.more { margin-top: 2px; }
.action-tile.big { min-height: 124px; gap: 12px; border-radius: 22px; font-size: 17px; }
.action-tile.big > .ui-icon { width: 56px; height: 56px; padding: 14px; border-radius: 18px; }
.action-grid .action-tile[data-create="income"] { --tone: #07856f; }
.action-grid .action-tile[data-create="expense"] { --tone: #d64545; }
.action-grid .action-tile[data-create="receivable"] { --tone: #0a8fa3; }
.action-grid .action-tile[data-create="payable"] { --tone: #e0701a; }
.action-grid .action-tile[data-create="service"], .action-grid .action-tile[href*="view=services"] { --tone: #2f6fd0; }
.action-grid .action-tile[href*="view=products"] { --tone: #7a4fc7; }
.actions-dialog [data-go="income"] { --tone: #07856f; }
.actions-dialog [data-go="expense"] { --tone: #d64545; }
.actions-dialog [data-go="receivable"] { --tone: #0a8fa3; }
.actions-dialog [data-go="payable"] { --tone: #e0701a; }
.actions-dialog [data-go="transfer"] { --tone: #2f6fd0; }
.actions-dialog [data-go="products"] { --tone: #7a4fc7; }
.actions-dialog [data-go="services"] { --tone: #e0701a; }
.actions-dialog [data-go="expenseTemplates"] { --tone: #5b6b8a; }
.actions-dialog [data-go="catalogs"] { --tone: #07856f; }
.actions-dialog [data-go="sale"] { --tone: #10365e; }
.actions-dialog .action-grid .action-tile[data-go] > .ui-icon { color: #fff; background: var(--tone); }
.actions-dialog .action-grid.main [data-go="income"] { background: #effaf6; border-color: #bfe5d9; }
.actions-dialog .action-grid.main [data-go="expense"] { background: #fdf0ef; border-color: #f0c9c6; }
.action-grid.main .action-tile[data-create="income"] { background: #effaf6; border-color: #bfe5d9; }
.action-grid.main .action-tile[data-create="expense"] { background: #fdf0ef; border-color: #f0c9c6; }
.action-pdv { display: flex; align-items: center; gap: 12px; min-height: 60px; margin-top: 10px; padding: 0 14px; border-radius: 18px; background: var(--brand-navy); color: #fff; font-weight: 650; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.action-pdv span { flex: 1; }
.action-pdv .ui-icon { width: 24px; height: 24px; }
.action-pdv .ui-icon:last-child { width: 18px; height: 18px; opacity: .7; }
.action-pdv:active { transform: scale(.98); }
.actions-dialog .action-label { margin-top: 14px; }

.quick-dialog .page-kicker:empty { display: none; }
.quick-form .quick-amount { height: 64px; font-size: 32px; font-weight: 650; letter-spacing: -.5px; text-align: center; font-variant-numeric: tabular-nums; }
.quick-dialog[data-kind="income"] .quick-amount, .quick-dialog[data-kind="receivable"] .quick-amount { color: #08775e; }
.quick-dialog[data-kind="expense"] .quick-amount, .quick-dialog[data-kind="payable"] .quick-amount { color: #c23d3d; }
.quick-dialog[data-kind="income"] .save-button { background: #07856f; }
.quick-dialog[data-kind="expense"] .save-button { background: #d64545; }
.quick-dialog[data-kind="payable"] .save-button { background: #e0701a; }
.quick-dialog[data-kind="receivable"] .save-button { background: #0a8fa3; }
.quick-form .save-button { min-height: 54px; font-size: 17px; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 44px; padding: 0 14px 0 10px; border: 1px solid var(--brand-line); border-radius: 999px; background: #fff; color: var(--brand-navy); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.date-chip[hidden] { display: none; }
.date-chip .ui-icon { width: 20px; height: 20px; color: var(--brand-green); }
.date-chip small { color: var(--brand-muted); font-weight: 500; }
.date-chip:hover { background: #f4faf8; }

.pdv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pdv-bar h2 { margin: 0; font-size: 24px; letter-spacing: -.4px; }
.pdv-quick { display: flex; gap: 8px; }
.pdv-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 10px; border: 0; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pdv-chip .ui-icon { width: 20px; height: 20px; }
.pdv-chip.income { background: #e5f5ec; color: #08775e; }
.pdv-chip.expense { background: #fde8e6; color: #b83a3a; }
.pdv-chip:active { transform: scale(.96); }
.sale-connectivity:empty, .sale-connectivity[data-state="ready"], .sale-search-status:empty, .sale-payment-feedback:empty { display: none; }

/* Imagens de produto, serviço e perfil */
.image-picker .image-preview { border-color: var(--brand-line, #dfe9e6); background: #f2f6f5; color: #07856f; }
.image-picker.is-processing { opacity: .55; pointer-events: none; }
.avatar-clear { min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #b83a3a; font-size: 13px; font-weight: 600; cursor: pointer; }
.avatar-clear[hidden] { display: none; }
.avatar-form { display: grid; justify-items: center; gap: 6px; margin-bottom: 8px; }
.avatar-edit { position: relative; display: block; width: 96px; height: 96px; cursor: pointer; }
.avatar-circle { display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; border: 2px solid #dfe9e6; background: #f2f6f5; color: #07856f; }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-circle svg { width: 40px; height: 40px; }
.avatar-badge { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid #fff; border-radius: 50%; background: #07856f; color: #fff; }
.avatar-badge svg { width: 16px; height: 16px; }
.visually-hidden:focus-visible + .avatar-clear, .avatar-form .visually-hidden:focus-visible ~ * { outline: 2px solid #07856f; }
.management-records .item-thumb { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 12px; background: #f2f6f5; color: #07856f; }
.management-records .item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.management-records .item-thumb svg { width: 22px; height: 22px; }
.management-records li:has(.item-thumb) { gap: 12px; justify-content: flex-start; }
.management-records li:has(.item-thumb) > div:not(.management-row-actions) { flex: 1; min-width: 0; }
.management-records .catalog-record { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; align-items: center; gap: 14px; min-height: 76px; padding: 10px 0; overflow: visible; }
.catalog-record .item-thumb,.catalog-record>.local-row-image { grid-column: 1; width: 56px; height: 56px; margin: 0; border-radius: 14px; object-fit: cover; background: #f2f6f5; }
.catalog-record-placeholder::before { content:'+'; display:grid; width:100%; height:100%; place-items:center; color:#82a097; font-size:22px; }
.catalog-record-main { grid-column: 2; min-width: 0; }
.catalog-record-name { display: block; overflow: hidden; color: var(--brand-navy); font-size: 15px!important; font-weight: 750; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.record-list .catalog-record-meta,.record-list .catalog-record-cost { display: block; margin-top: 4px; color: #6b7e76; font-size: 12px; line-height: 1.35; }
.catalog-record .management-row-actions { grid-column: 3; display:flex; flex-direction:row; align-items:center; gap:6px; min-width: 0; max-width: none; }
.catalog-record-price { color: var(--brand-navy); font-size: 16px!important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.catalog-actions-menu { position:relative; flex:0 0 auto; }
.catalog-actions-menu>summary { display:grid; width:44px; height:44px; place-items:center; border-radius:50%; color:var(--brand-navy); cursor:pointer; list-style:none; font-size:24px; line-height:1; }
.catalog-actions-menu>summary::-webkit-details-marker{display:none}.catalog-actions-menu>summary:hover,.catalog-actions-menu[open]>summary{background:#eef8f4;color:var(--brand-green)}
.catalog-actions-menu .management-links { position:absolute; z-index:20; top:46px; right:0; display:grid; min-width:180px; gap:2px; padding:6px; border:1px solid var(--brand-line); border-radius:14px; background:#fff; box-shadow:0 14px 36px #173d3624; }
.catalog-record .management-links :is(a,button) { display:flex; align-items:center; justify-content:flex-start; width:100%; min-height:44px; padding:0 12px; box-sizing:border-box; border:0; border-radius:9px; background:transparent; color:var(--brand-navy); font-size:13px; font-weight:650; text-decoration:none; cursor:pointer; white-space:nowrap; }
.catalog-record .management-links :is(a,button):hover { background: #eef8f4; }
@media(max-width:700px){.management-records .catalog-record{grid-template-columns:48px minmax(0,1fr) auto;gap:9px;min-height:64px;padding:8px 0}.catalog-record .item-thumb,.catalog-record>.local-row-image{width:48px;height:48px;border-radius:12px}.catalog-record .management-row-actions{gap:2px}.catalog-record-price{font-size:13px!important}.catalog-record-name{font-size:14px!important}.record-list .catalog-record-meta,.record-list .catalog-record-cost{max-width:100%;overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.catalog-actions-menu>summary{width:44px;height:44px}.catalog-actions-menu .management-links{top:46px}}
@media(max-width:380px){.management-records .catalog-record{grid-template-columns:42px minmax(0,1fr) auto;gap:7px}.catalog-record .item-thumb,.catalog-record>.local-row-image{width:42px;height:42px}.catalog-record-price{max-width:72px;overflow:hidden;text-overflow:ellipsis}.catalog-actions-menu>summary{width:44px;height:44px}}
.sale-thumb { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.sale-result > span { flex: 1; }

/* PDV: paginação do catálogo */
.sale-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: #60726f; font-size: 14px; }
.sale-pager .button-secondary { width: auto; min-height: 44px; padding: 0 16px; }
.sale-pager .button-secondary:disabled { opacity: .45; }
.sale-results { max-height: none; overflow: visible; }
.sale-type-tabs button[aria-pressed="true"] { background: var(--brand-green, #07856f); border-color: var(--brand-green, #07856f); color: #fff; }
/* Seleção rápida em Receita/Despesa */
.quick-form[hidden],.quick-pick[hidden]{display:none!important}
.quick-pick{display:grid;gap:10px;padding:4px 2px}
.pick-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pick-tabs[hidden]{display:none}
.pick-tabs button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;border:1px solid #dfe9e6;border-radius:12px;background:#fff;color:#10365e;font:inherit;font-weight:700;cursor:pointer}
.pick-tabs button svg{width:18px;height:18px}
.pick-tabs button[aria-pressed="true"]{background:#e6f4f1;border-color:#07856f;color:#00484d}
.quick-pick input[type="search"]{min-height:44px;border:1px solid #dfe9e6;border-radius:12px;padding:0 14px;font:inherit}
.pick-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.pick-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 12px;border:1px solid #dfe9e6;border-radius:14px;background:#fff;color:#10365e;text-decoration:none}
.pick-row:hover,.pick-row:focus-visible{border-color:#07856f;background:#f2f6f5}
.pick-row.late{border-color:#f0b9b0}
.pick-row.late small{color:#b3261e}
.pick-thumb{flex:none;width:40px;height:40px;border-radius:10px;background:#e6f4f1;color:#07856f;display:grid;place-items:center;font-weight:800;overflow:hidden}
.pick-thumb img{width:100%;height:100%;object-fit:cover}
.pick-name{flex:1;min-width:0;display:grid;font-weight:700}
.pick-name small{color:#60726f;font-weight:500}
.pick-row b{white-space:nowrap;color:#00484d}
.pick-pager{display:flex;align-items:center;justify-content:space-between;gap:8px}
.pick-pager[hidden]{display:none}
.pick-pager button{min-height:44px;padding:0 14px}
.pick-other{display:flex;align-items:center;justify-content:center;gap:8px;min-height:52px;border:2px dashed #07856f;border-radius:14px;background:transparent;color:#07856f;font:inherit;font-weight:800;cursor:pointer}
.pick-other svg{width:20px;height:20px}
.pick-back{justify-self:start;border:0;background:none;color:#07856f;font:inherit;font-weight:700;padding:6px 0;cursor:pointer}
.pick-back[hidden]{display:none}
.quick-dialog .quick-back{display:inline-flex;align-items:center;justify-content:flex-start;justify-self:start;gap:4px;min-height:44px;padding:6px 4px;border:0;border-radius:8px;background:transparent;color:#60726f;font:inherit;font-size:14px;font-weight:500;cursor:pointer}
.quick-back span:first-child{display:flex}
.quick-back svg{width:18px;height:18px}
.quick-dialog .quick-back:hover{color:#066d5d;background:#f2f6f5}
.quick-dialog .quick-back:focus-visible{outline:2px solid #07856f;outline-offset:2px}
.quick-dialog .quick-back:disabled{opacity:.5;cursor:default}
.pick-tabs{grid-template-columns:repeat(auto-fit,minmax(0,1fr))}
.pick-tabs button[hidden]{display:none}
.pick-row.template .pick-thumb{background:#fdf1d3;color:#8a5a00}

.quick-confirm{display:grid;gap:12px;padding:8px 2px;text-align:center}
.quick-confirm[hidden]{display:none!important}
.confirm-question{margin:0;font-size:1.15rem;font-weight:800;color:#10365e}
.confirm-name{margin:0;font-weight:700;color:#00484d;overflow-wrap:anywhere}
.quick-confirm .quick-amount{text-align:center}
.quick-confirm input.quick-amount{width:100%;min-width:0;min-height:64px;padding:12px 14px;border:1px solid #cbd6e4;border-radius:12px;background:#fff;font:inherit;font-size:32px;font-weight:650;letter-spacing:-.5px;font-variant-numeric:tabular-nums}
.quick-confirm select{width:100%;min-width:0;min-height:48px;padding:11px 12px;border:1px solid #cbd6e4;border-radius:12px;background:#fff;color:#203247;font:inherit;font-size:16px}
.confirm-actions{display:grid;grid-template-columns:1fr 1.4fr;gap:10px}
.confirm-actions button{min-height:52px;font-weight:800}
.confirm-actions .button-danger{background:#c0392b}
.pick-list>li>button.pick-row{width:100%;text-align:left;font:inherit;cursor:pointer}
.quick-income-choices .pick-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.quick-income-choices .pick-list>li:last-child{grid-column:1 / -1}
.quick-income-choices .pick-list>li>button{flex-direction:column;justify-content:center;gap:10px;min-height:116px;text-align:center;border-color:var(--choice-border);background:var(--choice-bg);color:var(--choice-ink)}
.quick-income-choices [data-income-choice="product"]{--choice-bg:#eef7f3;--choice-border:#cde7dc;--choice-ink:#076e57;--choice-icon:#d7eee3}
.quick-income-choices [data-income-choice="service"]{--choice-bg:#fff8e9;--choice-border:#f0dfb4;--choice-ink:#875500;--choice-icon:#ffedbf}
.quick-income-choices [data-income-choice="other"]{--choice-bg:#eff4fb;--choice-border:#d5e1f1;--choice-ink:#23558b;--choice-icon:#dce8f7}
.quick-income-choices .pick-thumb{width:44px;height:44px;background:var(--choice-icon);color:var(--choice-ink)}
.quick-income-choices .pick-thumb svg{width:26px;height:26px}
.quick-income-choices .pick-name{flex:0;font-weight:700}
.quick-income-choices .pick-list>li:last-child>button{flex-direction:row;min-height:72px}
.quick-income-choices .pick-row:hover{filter:brightness(.97)}
.quick-income-choices .pick-row:focus-visible{outline:2px solid var(--choice-ink);outline-offset:2px}
.quick-category-picker .pick-list{max-height:min(46dvh,420px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:2px 4px 2px 2px}
.quick-confirm[data-kind="income"] [data-confirm-yes]{background:#07856f}
.quick-confirm[data-kind="expense"] [data-confirm-yes]{background:#c0392b}
.pick-register{display:flex;align-items:center;justify-content:center;min-height:44px;border-radius:12px;background:#fdf1d3;color:#8a5a00;font-weight:700;text-decoration:none}
.pick-register[hidden]{display:none}
.pick-empty{text-align:center;margin:4px 0}

.pick-row.group{width:100%;text-align:left;font:inherit;cursor:pointer}
.pick-caret{color:#07856f;font-size:1.1rem}
.pick-sublist{list-style:none;margin:6px 0 0 14px;padding:0 0 0 10px;border-left:3px solid #dfe9e6;display:grid;gap:6px}
.pick-sublist .pick-row{min-height:46px}
.down-payment{border:1px dashed #dfe9e6;border-radius:12px;padding:8px 12px}
.down-payment[hidden]{display:none}
.down-payment summary{cursor:pointer;font-weight:700;color:#60726f}
.down-payment input{width:100%;margin-top:6px}
.confirm-hint{margin:0;color:#8a5a00;background:#fdf1d3;border-radius:10px;padding:8px 10px;font-weight:700}
.confirm-hint[hidden]{display:none}

/* Seletor de mês: painel compacto, centralizado e responsivo (até 320px) */
.workspace .period-popover{width:min(300px,calc(100vw - 24px));padding:14px;gap:12px;border:1px solid var(--brand-line);border-radius:20px;box-shadow:0 18px 50px #00484d33}
.workspace .period-popover-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-2px 0 2px;color:var(--brand-navy);font-size:15px}
.workspace .period-popover-close{display:grid;width:36px;height:36px;place-items:center;flex:0 0 auto;border:0;border-radius:50%;background:#eff6f2;color:var(--brand-navy);cursor:pointer}
.workspace .period-popover-close:hover{background:#dcece6}
.workspace .period-popover-close .ui-icon{width:18px;height:18px}
.period-step{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:8px;align-items:center}
.period-step-btn{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:#eff6f2;color:#066d5d}
.period-step-btn:hover{background:#dcece6}
.period-step-btn[aria-disabled]{opacity:.35;pointer-events:none}
.period-step-btn .ui-icon{width:18px;height:18px}
.workspace .period-popover input[type="month"]{min-height:44px;text-align:center;border-color:var(--brand-line);border-radius:12px;padding:8px}
.period-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:center}
.period-actions .current-month-link{min-height:44px;border:1px solid var(--brand-line);border-radius:12px;font-weight:600;text-decoration:none}
.period-actions .button-primary{min-height:44px;width:100%;margin:0}
@media (max-width:600px){
  .workspace .period-picker{position:static}
  .workspace .period-popover{position:fixed;z-index:30;top:calc(env(safe-area-inset-top,0px) + 76px);left:50%;transform:translateX(-50%);width:min(340px,calc(100vw - 24px))}
}
@media (max-width:360px){
  .workspace .period-popover{padding:12px}
  .period-step{grid-template-columns:40px minmax(0,1fr) 40px;gap:6px}
  .period-step-btn{width:44px;height:44px}
}
/* Cabeçalho e seletor de mês com mais respiro entre 380px e 520px */
@media (max-width:520px){
  .workspace .dashboard-header{grid-template-columns:44px minmax(0,1fr) 44px;gap:6px}
  .workspace .dashboard-header .month-switcher>.month-arrow{display:grid;width:38px;height:38px;min-height:38px}
  .workspace .dashboard-header .period-toolbar{width:100%;min-width:0}
  .workspace .dashboard-header .month-switcher{width:100%;justify-content:center}
  .workspace .dashboard-header .period-picker{width:auto;max-width:210px}
  .workspace .dashboard-header .period-picker summary{display:flex;flex-direction:row;align-items:baseline;justify-content:center;gap:5px;min-height:44px;width:100%;padding:6px 14px;border:0;border-radius:0;background:transparent;font-size:16px;white-space:nowrap}
  .workspace .dashboard-header .period-picker summary{font-variant-numeric:tabular-nums}
  .workspace .dashboard-header .period-picker summary>.ui-icon{display:block;width:14px;height:14px;align-self:center}
  .workspace .period-popover{top:calc(env(safe-area-inset-top,0px) + 72px);width:min(360px,calc(100vw - 32px));padding:18px;gap:16px;border-radius:22px}
  .period-step{grid-template-columns:48px minmax(0,1fr) 48px;gap:10px}
  .period-step-btn{width:48px;height:48px}
  .workspace .period-popover input[type="month"]{min-height:48px}
  .period-actions{gap:10px}
  .period-actions .current-month-link,.period-actions .button-primary{min-height:48px}
}
@media (max-width:380px){
  .workspace .dashboard-header .period-picker summary{padding:6px 10px;border-color:transparent;border-radius:0;background:transparent;font-size:15px}
  .workspace .period-popover{width:calc(100vw - 20px);padding:14px;gap:14px}
  .period-step{grid-template-columns:44px minmax(0,1fr) 44px;gap:8px}
  .period-step-btn{width:44px;height:44px}
}
