/* LUMÉA Next · Caderno de gestão
   Presentation only. Existing views, permissions and form contracts are preserved.
   Loaded after legacy styles; scoped to the application, never the public login. */

body.lumea-next:not(.control-center) #app-shell {
  --next-sidebar-width: 15.75rem;
  --next-workspace-gap: clamp(1.2rem, 2.7vw, 3rem);
  grid-template-columns: var(--next-sidebar-width) minmax(0, 1fr);
  background: var(--next-paper);
  color: var(--next-ink);
}
body.lumea-next:not(.control-center) #app-shell .workspace { background: var(--next-paper); }
body.lumea-next:not(.control-center) #app-shell .sidebar {
  padding: 1.2rem .85rem .85rem;
  background: #173f36;
  color: #f7f4ec;
  border: 0;
  border-right: 1px solid #34594f;
  box-shadow: none;
  backdrop-filter: none;
}
body.lumea-next:not(.control-center) #app-shell .sidebar-head {
  min-height: 5.3rem;
  gap: .75rem;
  padding: .2rem .65rem 1.35rem;
  border-color: #426258;
}
body.lumea-next:not(.control-center) #app-shell .sidebar-head .brand-mark {
  width: 2.4rem;
  height: 2.8rem;
  border: 0;
  border-radius: 0;
  background: transparent url('/assets/logo.svg') center / contain no-repeat;
  color: #f7f4ec;
  font-family: var(--next-heading);
  font-size: 0;
  font-weight: 400;
  box-shadow: none;
}
body.lumea-next:not(.control-center) #app-shell .sidebar-head strong {
  color: #fffefa;
  font-family: var(--next-heading);
  font-size: 1.42rem;
  font-weight: 400;
  letter-spacing: .055em;
}
body.lumea-next:not(.control-center) #app-shell .sidebar-head small {
  margin-top: .22rem;
  color: #c0d1c8;
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
body.lumea-next:not(.control-center) #app-shell .sidebar nav {
  gap: .16rem;
  padding: .7rem .1rem 1.25rem;
  scrollbar-color: #718d80 transparent;
}
body.lumea-next:not(.control-center) #app-shell .nav-section-label {
  margin: 1.25rem .7rem .4rem;
  color: #b0c7bb;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .17em;
}
body.lumea-next:not(.control-center) #app-shell .nav-section-label:first-child { margin-top: .3rem; }
body.lumea-next:not(.control-center) #app-shell .nav-item {
  min-height: 2.7rem;
  padding: .65rem .75rem;
  gap: .7rem;
  border-radius: .35rem;
  border: 1px solid transparent;
  background: transparent;
  color: #d5e0d8;
  font-size: .8rem;
  font-weight: 500;
  box-shadow: none;
  transform: none;
}
body.lumea-next:not(.control-center) #app-shell .nav-item > span:first-child {
  width: 1.2rem;
  height: 1.2rem;
  flex-basis: 1.2rem;
  background: none;
  border-radius: 0;
  color: #b6cbbc;
  font-size: 1rem;
}
body.lumea-next:not(.control-center) #app-shell .nav-item:hover {
  background: #254e42;
  color: #fffefa;
  transform: none;
}
body.lumea-next:not(.control-center) #app-shell .nav-item.active {
  background: #f1eddf;
  color: #173f36;
  font-weight: 650;
  box-shadow: none;
}
body.lumea-next:not(.control-center) #app-shell .nav-item.active::before { display: none; }
body.lumea-next:not(.control-center) #app-shell .nav-item.active > span:first-child {
  background: none;
  color: #24584d;
}
body.lumea-next:not(.control-center) #app-shell .sidebar-foot {
  gap: .5rem;
  padding: .85rem .35rem .3rem;
  border-color: #426258;
}
body.lumea-next:not(.control-center) #app-shell .salon-chip {
  background: #244a3f;
  color: #f7f4ec;
  border: 1px solid #426258;
  border-radius: .35rem;
  padding: .75rem;
}
body.lumea-next:not(.control-center) #app-shell .salon-chip small { color: #c0d1c8; }
body.lumea-next:not(.control-center) #app-shell .sidebar-foot .ghost {
  border-color: #426258;
  background: transparent;
  color: #f0d5c7;
  text-align: left;
  border-radius: .35rem;
  font-size: .75rem;
  font-weight: 500;
}
body.lumea-next:not(.control-center) #app-shell .sidebar-foot .ghost.danger { color: #f0d5c7; }
body.lumea-next:not(.control-center) #app-shell .admin-link a { color: #d7e4db; }
body.lumea-next:not(.control-center) #app-shell .sidebar :focus-visible {
  outline: 2px solid #e3c0a0;
  outline-offset: 3px;
}

/* The title and tools sit directly on the page, like an editorial masthead. */
body.lumea-next:not(.control-center) #app-shell .topbar {
  min-height: 7.2rem;
  height: auto;
  margin: 0;
  padding: 1.45rem var(--next-workspace-gap);
  gap: 1rem;
  background: var(--next-paper);
  border: 0;
  border-bottom: 1px solid var(--next-border);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
body.lumea-next:not(.control-center) #app-shell .topbar > div:first-of-type { gap: .35rem; }
body.lumea-next:not(.control-center) #app-shell .topbar h2 {
  font-family: var(--next-heading);
  font-size: clamp(1.7rem, 2.35vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.1;
  color: var(--next-ink);
}
body.lumea-next:not(.control-center) #app-shell .eyebrow {
  color: var(--next-muted);
  font-size: .63rem;
  font-weight: 650;
  letter-spacing: .15em;
}
body.lumea-next:not(.control-center) #app-shell .top-actions { gap: .4rem; }
/* The sidebar already carries the release and the PWA status is authoritative. */
body.lumea-next:not(.control-center) #app-shell :is(#predeploy-badge, #connection-indicator) { display: none; }
body.lumea-next:not(.control-center) #app-shell .top-actions .icon-btn,
body.lumea-next:not(.control-center) #app-shell #lum-sidebar-toggle {
  width: 2.6rem;
  height: 2.6rem;
  min-height: 2.6rem;
  border-radius: .35rem;
  background: transparent;
  border: 1px solid var(--next-border);
  color: var(--next-ink);
  box-shadow: none;
}
body.lumea-next:not(.control-center) #app-shell .top-actions select {
  min-width: 8.1rem;
  min-height: 2.6rem;
  border-radius: .35rem;
  background: var(--next-surface);
  font-size: .77rem;
}
body.lumea-next:not(.control-center) #app-shell #quick-add {
  min-height: 2.6rem;
  border-radius: .35rem;
  padding-inline: .95rem;
  background: var(--next-brand);
  color: var(--next-on-brand, #fffefa);
  box-shadow: none;
  font-size: .77rem;
  font-weight: 600;
}
body.lumea-next:not(.control-center) #app-shell .content {
  width: 100%;
  max-width: 100rem;
  padding: 1.75rem var(--next-workspace-gap) 3rem;
  gap: 1.4rem;
}
body.lumea-next:not(.control-center) #app-shell .grid { gap: 1.15rem; }
body.lumea-next:not(.control-center) #app-shell .card {
  padding: clamp(1.1rem, 1.8vw, 1.75rem);
  background: var(--next-surface);
  border: 1px solid var(--next-border);
  border-radius: .55rem;
  box-shadow: none;
  backdrop-filter: none;
  transition: border-color 140ms ease;
}
body.lumea-next:not(.control-center) #app-shell .card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--next-brand) 25%, var(--next-border));
  box-shadow: none;
}
body.lumea-next:not(.control-center) #app-shell .card-head {
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: center;
}
body.lumea-next:not(.control-center) #app-shell .card h3 {
  font-family: var(--next-heading);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.25;
}
body.lumea-next:not(.control-center) #app-shell .card-head .eyebrow { margin-bottom: .5rem; }
body.lumea-next:not(.control-center) #app-shell .grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--next-border);
  border-radius: .5rem;
  overflow: hidden;
  background: var(--next-surface);
}
body.lumea-next:not(.control-center) #app-shell .grid.metrics > :is(.card, .metric) {
  min-height: 9.1rem;
  padding: 1.45rem 1.3rem;
  gap: .65rem;
  background: var(--next-surface);
  border: 0;
  border-right: 1px solid var(--next-border);
  border-radius: 0;
  box-shadow: none;
  align-content: center;
}
body.lumea-next:not(.control-center) #app-shell .grid.metrics > :last-child { border-right: 0; }
body.lumea-next:not(.control-center) #app-shell .grid.metrics > :is(.card, .metric)::after { display: none; }
body.lumea-next:not(.control-center) #app-shell .metric small {
  color: var(--next-muted);
  font-size: .72rem;
  font-weight: 500;
}
body.lumea-next:not(.control-center) #app-shell .metric strong {
  font-family: var(--next-heading);
  font-size: clamp(1.6rem, 2.15vw, 2.3rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
body.lumea-next:not(.control-center) #app-shell .trend {
  display: block;
  width: auto;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--next-muted);
  font-size: .67rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
body.lumea-next:not(.control-center) #app-shell :is(.health-grid, .payment-summary, .detail-grid) > div,
body.lumea-next:not(.control-center) #app-shell :is(.account-card, .tag-card, .template-card, .note-box) {
  border: 1px solid var(--next-border);
  border-radius: .4rem;
  background: var(--next-paper);
  box-shadow: none;
}
body.lumea-next:not(.control-center) #app-shell .account-card {
  padding: 1.25rem;
  gap: .8rem;
  border-top: 3px solid var(--next-brand);
}
body.lumea-next:not(.control-center) #app-shell .account-card span {
  font-family: var(--next-heading);
  font-weight: 400;
  font-size: 1.75rem;
}
body.lumea-next:not(.control-center) #app-shell :is(.chart-wrap, .cashflow-chart) {
  padding: .85rem 0;
  border: 0;
  border-radius: 0;
  background: none;
}
body.lumea-next:not(.control-center) #app-shell .trend-chart {
  height: 14rem;
  padding-top: 1rem;
  border-color: var(--next-border);
  gap: .65rem;
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--next-border) calc(25% - 1px), var(--next-border) 25%);
}
body.lumea-next:not(.control-center) #app-shell .trend-bar { border-radius: 2px 2px 0 0; background: var(--next-brand); }
body.lumea-next:not(.control-center) #app-shell .trend-bar.expense { background: var(--next-copper); }
body.lumea-next:not(.control-center) #app-shell .chart-legend { justify-content: flex-start; padding-top: 1rem; }
body.lumea-next:not(.control-center) #app-shell .progress { height: .35rem; border-radius: 0; background: var(--next-border); }
body.lumea-next:not(.control-center) #app-shell .progress > span { border-radius: 0; background: var(--next-brand); }
body.lumea-next:not(.control-center) #app-shell .empty {
  min-height: 9rem;
  padding: 2rem 1rem;
  gap: .6rem;
  color: var(--next-muted);
  font-size: .84rem;
  line-height: 1.6;
}
body.lumea-next:not(.control-center) #app-shell .empty strong { font-weight: 600; color: var(--next-ink); }
body.lumea-next:not(.control-center) #app-shell :is(.notice, .formula-help) {
  border-radius: .35rem;
  padding: 1rem 1.1rem;
  font-size: .8rem;
  line-height: 1.6;
  box-shadow: none;
}
body.lumea-next:not(.control-center) #app-shell :is(.notice.info, .formula-help) {
  background: var(--next-paper);
  border-color: var(--next-border);
}
body.lumea-next:not(.control-center) #app-shell .notice.info { border-left: 3px solid var(--next-brand); }

/* Ledger tables: quiet headers, generous rows, always keep financial semantics. */
body.lumea-next:not(.control-center) #app-shell .toolbar {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  gap: .5rem;
}
body.lumea-next:not(.control-center) #app-shell .finance-filterbar {
  padding: 1rem 1.1rem;
  gap: .75rem;
  background: var(--next-surface);
  border: 1px solid var(--next-border);
  border-radius: .45rem;
  box-shadow: none;
}
body.lumea-next:not(.control-center) #app-shell :is(.custom-range, .bulk-toolbar) {
  border-color: var(--next-border);
  border-radius: .35rem;
  background: var(--next-paper);
}
body.lumea-next:not(.control-center) #app-shell .table-wrap {
  border: 1px solid var(--next-border);
  border-radius: .35rem;
  background: var(--next-surface);
  box-shadow: none;
}
body.lumea-next:not(.control-center) #app-shell table { font-variant-numeric: tabular-nums; }
body.lumea-next:not(.control-center) #app-shell th {
  height: 2.8rem;
  padding: .8rem 1rem;
  background: var(--next-paper);
  color: var(--next-muted);
  border-bottom: 1px solid var(--next-border);
  font-size: .61rem;
  font-weight: 600;
  letter-spacing: .09em;
}
body.lumea-next:not(.control-center) #app-shell td {
  height: 3.8rem;
  padding: .9rem 1rem;
  border-color: var(--next-border);
  font-size: .8rem;
}
body.lumea-next:not(.control-center) #app-shell tbody tr:hover { background: color-mix(in srgb, var(--next-brand) 4%, var(--next-surface)); }
body.lumea-next:not(.control-center) #app-shell td strong { font-weight: 600; }
body.lumea-next:not(.control-center) #app-shell .amount { font-weight: 600; letter-spacing: -.01em; }
body.lumea-next:not(.control-center) #app-shell .pill {
  min-height: 1.45rem;
  padding: .2rem .55rem;
  border-radius: .25rem;
  font-size: .65rem;
  font-weight: 600;
}
body.lumea-next:not(.control-center) #app-shell .list-row {
  padding: .95rem 0;
  border-color: var(--next-border);
  font-size: .82rem;
}
body.lumea-next:not(.control-center) #app-shell .pagination { padding-top: .5rem; font-size: .73rem; }

/* Financial inputs and body-level dialogs share the same visual language. */
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) :is(input, select, textarea) {
  min-height: 2.75rem;
  padding: .7rem .8rem;
  border: 1px solid var(--next-border);
  border-radius: .35rem;
  background: var(--next-surface);
  color: var(--next-ink);
  box-shadow: none;
  font-size: .83rem;
}
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) input:is([type="checkbox"], [type="radio"]) {
  min-height: 1rem;
  width: 1rem;
  height: 1rem;
  padding: 0;
  accent-color: var(--next-brand);
}
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) label { color: var(--next-ink); font-size: .75rem; font-weight: 600; }
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) :is(.primary, .ghost, .tiny, .icon-btn) {
  border-radius: .35rem;
  box-shadow: none;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease;
}
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) .primary { background: var(--next-brand); color: var(--next-on-brand, #fffefa); }
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) :is(.ghost, .tiny, .icon-btn) {
  background: var(--next-surface);
  border: 1px solid var(--next-border);
  color: var(--next-ink);
}
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) :is(.ghost, .tiny).danger { color: var(--bad); }
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) .primary:hover:not(:disabled) { background: color-mix(in srgb, var(--next-brand) 88%, var(--next-ink)); }
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) :is(.ghost, .tiny, .icon-btn):hover:not(:disabled) { border-color: var(--next-brand); }
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) :focus-visible {
  outline: 2px solid var(--next-brand);
  outline-offset: 3px;
  box-shadow: none;
}
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) :is(input, select, textarea):focus {
  border-color: var(--next-brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--next-brand) 15%, transparent);
}
body.lumea-next:not(.control-center) :is(#app-shell, .dialog) :disabled { cursor: not-allowed; opacity: .5; }
body.lumea-next:not(.control-center) > .dialog {
  padding: 1.75rem;
  border: 1px solid var(--next-border);
  border-radius: .65rem;
  background: var(--next-surface);
  color: var(--next-ink);
  box-shadow: 0 24px 90px #0a241f40;
  backdrop-filter: none;
}
body.lumea-next:not(.control-center) > .dialog::backdrop { background: #0a241f99; backdrop-filter: blur(4px); }
body.lumea-next:not(.control-center) > .dialog .dialog-head { border-color: var(--next-border); padding-bottom: 1.1rem; }
body.lumea-next:not(.control-center) > .dialog .dialog-head h3 { font-family: var(--next-heading); font-size: 1.65rem; font-weight: 400; letter-spacing: -.035em; }
body.lumea-next:not(.control-center) > .dialog .dialog-actions { border-color: var(--next-border); padding-top: 1.1rem; background: var(--next-surface); }
body.lumea-next:not(.control-center) > .dialog :is(.detail-grid, .payment-summary) > div {
  background: var(--next-paper);
  border-color: var(--next-border);
  border-radius: .35rem;
}

/* Agenda: calendar folios, ink rules and status edges. */
body.lumea-next:not(.control-center) #app-shell .agenda-root { gap: 1.3rem; }
body.lumea-next:not(.control-center) #app-shell :is(.agenda-toolbar, .agenda-filters) {
  padding: 1.1rem;
  border: 1px solid var(--next-border);
  border-radius: .4rem;
  background: var(--next-surface);
  box-shadow: none;
}
body.lumea-next:not(.control-center) #app-shell :is(.agenda-tabs, .segmented) {
  gap: .2rem;
  padding: .25rem;
  border: 1px solid var(--next-border);
  border-radius: .35rem;
  background: var(--next-paper);
}
body.lumea-next:not(.control-center) #app-shell :is(.agenda-tabs, .segmented) button {
  border: 0;
  border-radius: .2rem;
  background: transparent;
  padding: .6rem .9rem;
  color: var(--next-muted);
  font-size: .77rem;
  font-weight: 500;
}
body.lumea-next:not(.control-center) #app-shell :is(.agenda-tabs, .segmented) button.active { background: var(--next-brand); color: var(--next-on-brand, #fffefa); }
body.lumea-next:not(.control-center) #app-shell .agenda-day-column {
  padding: .8rem;
  background: var(--next-paper);
  border-color: var(--next-border);
  border-radius: .4rem;
}
body.lumea-next:not(.control-center) #app-shell .agenda-day-column > header {
  padding: .45rem .2rem 1rem;
  margin-bottom: .25rem;
  border-bottom: 1px solid var(--next-border);
}
body.lumea-next:not(.control-center) #app-shell .agenda-day-column > header strong { font-family: var(--next-heading); font-size: 1.1rem; font-weight: 400; }
body.lumea-next:not(.control-center) #app-shell .agenda-event {
  padding: .9rem .75rem;
  border-radius: .3rem;
  background: var(--next-surface);
  border-top-color: var(--next-border);
  border-right-color: var(--next-border);
  border-bottom-color: var(--next-border);
  box-shadow: none;
  font-size: .78rem;
}
body.lumea-next:not(.control-center) #app-shell .agenda-month-grid { gap: 0; border: 1px solid var(--next-border); border-radius: .35rem; overflow: hidden; }
body.lumea-next:not(.control-center) #app-shell .agenda-month-day {
  min-height: 7.3rem;
  padding: .75rem;
  border: 0;
  border-right: 1px solid var(--next-border);
  border-bottom: 1px solid var(--next-border);
  border-radius: 0;
  background: var(--next-surface);
}
body.lumea-next:not(.control-center) #app-shell .agenda-month-day:nth-child(7n) { border-right: 0; }
body.lumea-next:not(.control-center) #app-shell .agenda-month-day > span { font-family: var(--next-heading); font-size: 1.2rem; font-weight: 400; }
body.lumea-next:not(.control-center) #app-shell .agenda-month-day.today { box-shadow: inset 0 3px 0 var(--next-brand); background: color-mix(in srgb, var(--next-brand) 5%, var(--next-surface)); }
body.lumea-next:not(.control-center) #app-shell :is(.agenda-prof-card, .agenda-week-rules > div) {
  border-color: var(--next-border);
  border-radius: .4rem;
  background: var(--next-paper);
}
body.lumea-next:not(.control-center) #app-shell .agenda-free-day { border-radius: .3rem; border-color: var(--next-border); font-size: .78rem; }

/* Plans and clients keep the same financial and identity information. */
body.lumea-next:not(.control-center) #app-shell .billing-switch { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
body.lumea-next:not(.control-center) #app-shell .plan-grid { gap: 1rem; }
body.lumea-next:not(.control-center) #app-shell .plan {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1.75rem 1.35rem;
  border-top: 3px solid var(--next-border);
  border-radius: .35rem;
}
body.lumea-next:not(.control-center) #app-shell .plan.current { outline: 0; border-color: var(--next-brand); background: color-mix(in srgb, var(--next-brand) 4%, var(--next-surface)); }
body.lumea-next:not(.control-center) #app-shell .plan > .pill { align-self: flex-start; margin-bottom: 1rem; }
body.lumea-next:not(.control-center) #app-shell .plan h3 { margin-top: .45rem; font-size: 2rem; }
body.lumea-next:not(.control-center) #app-shell .plan-price { font-family: var(--next-heading); font-size: 1.7rem; font-weight: 400; letter-spacing: -.04em; margin: 1.2rem 0; }
body.lumea-next:not(.control-center) #app-shell .plan-limits { border-top: 1px solid var(--next-border); padding-top: 1rem; line-height: 1.7; }
body.lumea-next:not(.control-center) #app-shell .plan ul { flex: 1; padding-left: 1.1rem; font-size: .78rem; line-height: 1.65; }
body.lumea-next:not(.control-center) #app-shell .plan li { padding-left: .2rem; margin: .65rem 0; }
body.lumea-next:not(.control-center) #app-shell .plan li::marker { color: var(--next-copper); }
body.lumea-next:not(.control-center) #app-shell :is(.pg-value, .pg-inline-compare, .pg-gate-context) { border-color: var(--next-border); border-radius: .35rem; background: var(--next-paper); }
body.lumea-next:not(.control-center) #app-shell .pg-recommend { border-radius: .25rem; background: color-mix(in srgb, var(--next-brand) 10%, var(--next-surface)); color: var(--next-brand); }
body.lumea-next:not(.control-center) #app-shell .pg-track { border-radius: 0; background: var(--next-border); }
body.lumea-next:not(.control-center) #app-shell .pg-track span { border-radius: 0; background: var(--next-brand); }
body.lumea-next:not(.control-center) #app-shell .feedback-fab { border: 1px solid var(--next-border); border-radius: .35rem; background: var(--next-surface); color: var(--next-ink); box-shadow: 0 5px 18px #173f3614; }
body.lumea-next:not(.control-center) #app-shell .lum-network-status { border-color: var(--next-border); border-radius: .3rem; background: var(--next-surface); color: var(--next-muted); }

@media (min-width: 861px) {
  body.lumea-next.lum-sidebar-collapsed:not(.control-center) #app-shell { grid-template-columns: 5rem minmax(0, 1fr); }
  body.lumea-next.lum-sidebar-collapsed:not(.control-center) #app-shell .sidebar-head { justify-content: center; padding-inline: 0; }
  body.lumea-next.lum-sidebar-collapsed:not(.control-center) #app-shell .sidebar-head > div:last-child,
  body.lumea-next.lum-sidebar-collapsed:not(.control-center) #app-shell .nav-section-label { display: none; }
  body.lumea-next.lum-sidebar-collapsed:not(.control-center) #app-shell .sidebar-foot .ghost { font-size: 0; }
  body.lumea-next.lum-sidebar-collapsed:not(.control-center) #app-shell .nav-item { font-size: 0; justify-content: center; }
}
@media (max-width: 1280px) {
  body.lumea-next:not(.control-center) #app-shell { --next-sidebar-width: 14.5rem; --next-workspace-gap: 1.35rem; }
  body.lumea-next:not(.control-center) #app-shell .topbar { flex-wrap: wrap; }
  body.lumea-next:not(.control-center) #app-shell .topbar h2 { font-size: 1.85rem; }
  body.lumea-next:not(.control-center) #app-shell .grid.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.lumea-next:not(.control-center) #app-shell .grid.metrics > :is(.card, .metric) { border-bottom: 1px solid var(--next-border); }
  body.lumea-next:not(.control-center) #app-shell .grid.metrics > :nth-child(2n) { border-right: 0; }
  body.lumea-next:not(.control-center) #app-shell .grid.metrics > :nth-last-child(-n + 2) { border-bottom: 0; }
}
@media (max-width: 860px) {
  body.lumea-next:not(.control-center) #app-shell { display: block; --next-workspace-gap: 1.15rem; }
  body.lumea-next:not(.control-center) #app-shell .sidebar { width: min(84vw, 18rem); left: 0; height: 100dvh; transform: translateX(-105%); }
  body.lumea-next:not(.control-center) #app-shell .sidebar.open { left: 0; transform: translateX(0); box-shadow: 14px 0 50px #0a241f55; }
  body.lumea-next:not(.control-center) #app-shell .sidebar-backdrop { background: #0a241f88; }
  body.lumea-next:not(.control-center) #app-shell .topbar { min-height: 5.5rem; padding-block: 1rem; grid-template-columns: 2.6rem minmax(0, 1fr) auto; }
  body.lumea-next:not(.control-center) #app-shell .topbar > div:first-of-type { max-width: none; }
  body.lumea-next:not(.control-center) #app-shell .topbar h2 { font-size: 1.55rem; }
  body.lumea-next:not(.control-center) #app-shell .top-actions { gap: .3rem; margin-left: auto; }
  body.lumea-next:not(.control-center) #app-shell :is(#privacy-btn, #refresh-data, #period-filter, #lum-intelligence-button, .lum-network-status) { display: none; }
  body.lumea-next:not(.control-center) #app-shell .lum-observability-button {
    width: 2.6rem;
    min-width: 2.6rem;
    min-height: 2.6rem;
    padding: 0;
    font-size: 0;
  }
  body.lumea-next:not(.control-center) #app-shell .lum-observability-button::after { content: '●'; font-size: .72rem; }
  body.lumea-next:not(.control-center) #app-shell #quick-add { width: 2.6rem; min-width: 2.6rem; padding: 0; font-size: 0; }
  body.lumea-next:not(.control-center) #app-shell #quick-add::after { content: '+'; font-size: 1.4rem; font-weight: 400; }
  body.lumea-next:not(.control-center) #app-shell .content { padding-top: 1.2rem; }
  body.lumea-next:not(.control-center) #app-shell .grid.two-col { grid-template-columns: minmax(0, 1fr); }
  body.lumea-next:not(.control-center) #app-shell .billing-switch { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 700px) {
  /* Legacy experience styles force one column; preserve a compact two-column summary. */
  body.lumea-next:not(.control-center) #app-shell .grid.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 620px) {
  body.lumea-next:not(.control-center) #app-shell { --next-workspace-gap: .9rem; }
  body.lumea-next:not(.control-center) #app-shell .topbar { min-height: 4.7rem; gap: .55rem; padding: .85rem .8rem; }
  body.lumea-next:not(.control-center) #app-shell .topbar > div:first-of-type { min-width: 0; flex: 1 1 auto; }
  body.lumea-next:not(.control-center) #app-shell .topbar h2 { max-width: 100%; font-size: 1.35rem; }
  body.lumea-next:not(.control-center) #app-shell .topbar .eyebrow { display: none; }
  body.lumea-next:not(.control-center) #app-shell .top-actions { gap: .3rem; margin-left: auto; }
  body.lumea-next:not(.control-center) #app-shell .content { gap: 1rem; padding-bottom: 2rem; }
  body.lumea-next:not(.control-center) #app-shell .card { padding: 1.05rem; border-radius: .4rem; }
  body.lumea-next:not(.control-center) #app-shell .card h3 { font-size: 1.25rem; }
  body.lumea-next:not(.control-center) #app-shell .grid.metrics > :is(.card, .metric) { min-height: 8rem; padding: 1.15rem .95rem; gap: .5rem; }
  body.lumea-next:not(.control-center) #app-shell .metric strong { font-size: 1.45rem; }
  body.lumea-next:not(.control-center) #app-shell .metric small { font-size: .66rem; }
  body.lumea-next:not(.control-center) #app-shell .trend { font-size: .63rem; }
  body.lumea-next:not(.control-center) #app-shell .finance-filterbar { padding: .8rem; }
  body.lumea-next:not(.control-center) #app-shell .table-wrap:has(.responsive-table) { border: 0; background: transparent; }
  body.lumea-next:not(.control-center) #app-shell .responsive-table tr { background: var(--next-surface); border: 1px solid var(--next-border); border-radius: .35rem; box-shadow: none; margin-bottom: .65rem; }
  body.lumea-next:not(.control-center) #app-shell .responsive-table td { min-height: 2.65rem; height: auto; padding: .7rem .75rem; }
  body.lumea-next:not(.control-center) #app-shell .agenda-month-day { min-height: 4.5rem; padding: .45rem; }
  body.lumea-next:not(.control-center) #app-shell .agenda-month-day > span { font-size: 1.1rem; }
  body.lumea-next:not(.control-center) #app-shell .lum-mobile-nav {
    left: 0;
    right: 0;
    bottom: 0;
    padding: .3rem .6rem max(.4rem, env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid var(--next-border);
    border-radius: 0;
    background: var(--next-surface);
    box-shadow: 0 -5px 20px #173f3608;
    backdrop-filter: none;
  }
  body.lumea-next:not(.control-center) #app-shell .lum-mobile-nav button { border-radius: .3rem; color: var(--next-muted); }
  body.lumea-next:not(.control-center) #app-shell .lum-mobile-nav button.active { background: color-mix(in srgb, var(--next-brand) 9%, var(--next-surface)); color: var(--next-brand); }
  body.lumea-next:not(.control-center) #app-shell .lum-mobile-nav .lum-mobile-label { font-size: .59rem; font-weight: 600; }
  body.lumea-next:not(.control-center) > .dialog { padding: 1.2rem; border-radius: .6rem .6rem .3rem .3rem; }
  body.lumea-next:not(.control-center) > .dialog .dialog-head h3 { font-size: 1.4rem; }
  body.lumea-next:not(.control-center) > .dialog .dialog-actions { margin-inline: -1.2rem; margin-bottom: -1.2rem; padding: .85rem 1.2rem max(.85rem, env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 360px) {
  body.lumea-next:not(.control-center) #app-shell .grid.metrics { grid-template-columns: minmax(0, 1fr) !important; }
  body.lumea-next:not(.control-center) #app-shell .grid.metrics > :is(.card, .metric) { border-right: 0; border-bottom: 1px solid var(--next-border); }
  body.lumea-next:not(.control-center) #app-shell .grid.metrics > :last-child { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body.lumea-next:not(.control-center) #app-shell *,
  body.lumea-next:not(.control-center) > .dialog * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  body.lumea-next:not(.control-center) #app-shell { display: block; background: white; color: black; }
  body.lumea-next:not(.control-center) #app-shell .content { padding: 0; }
  body.lumea-next:not(.control-center) #app-shell :is(.workspace, .card, .grid.metrics, .grid.metrics > .metric) { background: white; color: black; box-shadow: none; }
}
