:root {
  --paper: #f4eee3;
  --paper-deep: #ebe1d2;
  --sheet: #fbf7f1;
  --sheet-strong: #f6f0e7;
  --ledger: #e1d6c6;
  --ledger-strong: #c9bba6;
  --ink: #22313f;
  --ink-soft: #5f6d78;
  --ink-faint: #8d97a0;
  --vault: #1f5a47;
  --vault-strong: #184837;
  --mint: #dfeadf;
  --brass: #bd8b3c;
  --terracotta: #b15e43;
  --terracotta-soft: #f6e6dd;
  --good: #1f5a47;
  --bad: #b15e43;
  --info: #4a667c;
  --surface-0: rgba(251, 247, 241, 0.92);
  --surface-1: rgba(255, 252, 248, 0.96);
  --surface-2: #f7f1e8;
  --surface-3: #efe5d7;
  --control: #f8f2e8;
  --control-hover: #f2eadf;
  --focus: rgba(31, 90, 71, 0.18);
  --shadow-soft: 0 20px 45px rgba(46, 37, 26, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(189, 139, 60, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(31, 90, 71, 0.11), transparent 26%),
    linear-gradient(180deg, #f7f2e8 0%, #efe6d9 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(143, 125, 100, 0.04) 0, rgba(143, 125, 100, 0.04) 1px, transparent 1px, transparent 42px);
  opacity: 0.25;
}

button,
input,
select,
table {
  font: inherit;
}

.app-shell {
  position: relative;
  display: block;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  background: rgba(31, 90, 71, 0.96);
  border-bottom: 1px solid rgba(24, 72, 55, 0.32);
  backdrop-filter: blur(12px);
}

.tabs.top-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 42px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong,
.shell-copy h1,
.panel-copy h2,
.card h2,
.invoice-header h2,
.pulse-card h2,
.modal-card h2,
.tile h3 {
  font-family: "Fraunces", Georgia, serif;
}

.brand-text strong {
  font-size: 1.36rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #f8f3ec;
}

.brand-text span {
  margin-top: 3px;
  color: rgba(248, 243, 236, 0.72);
  font-size: 0.84rem;
  font-weight: 700;
}

.tabs-kicker,
.flow-kicker,
.shell-kicker,
.eyebrow,
.section-kicker {
  display: inline-block;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  appearance: none;
  position: relative;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.tab::before {
  content: "";
  position: absolute;
  inset: auto 12px 4px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: none;
}

.tab.active::before {
  background: #f6d88a;
}

.sidebar-flow,
.overview-pill,
.story-step-card,
.summary-card,
.invoice-item,
.modal-card,
.card-focus,
.panel-hero,
.pulse-card,
.story-card {
  position: relative;
  overflow: hidden;
}

.sidebar-flow,
.overview-pill,
.story-card,
.pulse-card,
.card,
.summary-card,
.tile,
.mini-card,
.invoice-item,
.modal-card {
  background: var(--surface-1);
  border: 1px solid rgba(110, 90, 65, 0.14);
  box-shadow: var(--shadow-soft);
}

.sidebar-flow::before,
.overview-pill::before,
.story-card::before,
.pulse-card::before,
.summary-card::before,
.invoice-item::before,
.modal-card::before,
.card-focus::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brass), rgba(189, 139, 60, 0.4) 34%, rgba(31, 90, 71, 0.7) 72%, rgba(31, 90, 71, 0.24));
}

.sidebar-flow {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.95), rgba(244, 236, 223, 0.95));
}

.flow-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-top: 12px;
  border-top: 1px dashed rgba(110, 90, 65, 0.18);
}

.flow-step:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.flow-step strong,
.story-step-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--vault-strong);
  background: rgba(223, 234, 223, 0.72);
  border: 1px solid rgba(31, 90, 71, 0.14);
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", Consolas, monospace;
}

.flow-step span {
  display: block;
  margin-bottom: 3px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink);
}

.flow-step small {
  display: block;
  color: var(--ink-soft);
  line-height: 1.45;
}

.shell {
  padding: 28px 24px 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.shell-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.shell-copy {
  max-width: 760px;
}

.shell-copy h1 {
  margin: 8px 0 10px;
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--vault-strong);
}

.shell-copy p {
  margin: 0;
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.shell-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  min-width: min(480px, 100%);
}

.overview-pill {
  border-radius: 18px;
  padding: 18px 18px 16px;
}

.overview-pill span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overview-pill strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
}

.panel {
  display: none;
  position: relative;
}

.panel.active {
  display: block;
}

.panel-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px 24px 22px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(31, 90, 71, 0.96), rgba(72, 110, 92, 0.94));
  color: #f9f5ef;
}

.panel-copy {
  max-width: 780px;
}

.eyebrow {
  margin-bottom: 10px;
  color: rgba(249, 245, 239, 0.7);
}

.panel-copy h2 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.panel-copy p {
  margin: 10px 0 0;
  max-width: 860px;
  font-size: 0.98rem;
  line-height: 1.62;
  color: rgba(249, 245, 239, 0.84);
}

.panel-hero.sand {
  background:
    radial-gradient(circle at top right, rgba(242, 210, 149, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(92, 62, 44, 0.98), rgba(122, 92, 68, 0.95));
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
}

.hero-chip.soft {
  background: rgba(255, 255, 255, 0.08);
}

.reminder-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.reminder-stat-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(245, 238, 226, 0.98));
  border: 1px solid rgba(124, 98, 73, 0.14);
  box-shadow: 0 12px 26px rgba(74, 56, 38, 0.08);
}

.reminder-stat-card.soft {
  background: linear-gradient(180deg, rgba(253, 249, 242, 0.98), rgba(246, 239, 229, 0.96));
}

.reminder-stat-card.good {
  background: linear-gradient(180deg, rgba(232, 246, 239, 0.98), rgba(218, 239, 229, 0.96));
}

.reminder-stat-card.warn {
  background: linear-gradient(180deg, rgba(255, 243, 225, 0.98), rgba(250, 232, 200, 0.96));
}

.reminder-stat-card small {
  display: block;
  color: rgba(78, 61, 44, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.reminder-stat-card strong {
  display: block;
  margin-top: 8px;
  color: #2f2319;
  font-size: 1.9rem;
  line-height: 1;
}

.reminder-dashboard-grid {
  align-items: start;
}

.reminder-surface {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(250, 245, 236, 0.96));
  border: 1px solid rgba(124, 98, 73, 0.12);
}

.reminder-card-list,
.reminder-timeline,
.reminder-dispatch-list {
  display: grid;
  gap: 12px;
}

.reminder-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(124, 98, 73, 0.12);
}

.reminder-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.reminder-card-top h3 {
  margin: 0;
  color: #2e2319;
  font-size: 1rem;
}

.reminder-card-top p {
  margin: 4px 0 0;
  color: rgba(78, 61, 44, 0.7);
  font-size: 0.88rem;
}

.reminder-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reminder-meta-grid span {
  display: block;
  margin-bottom: 4px;
  color: rgba(78, 61, 44, 0.66);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reminder-meta-grid strong {
  color: #2e2319;
  font-size: 0.94rem;
  line-height: 1.45;
}

.reminder-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(124, 98, 73, 0.1);
  color: rgba(78, 61, 44, 0.72);
  font-size: 0.82rem;
}

.reminder-timeline-item,
.reminder-dispatch-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(124, 98, 73, 0.12);
}

.reminder-timeline-time strong,
.reminder-dispatch-row strong {
  display: block;
  color: #2e2319;
}

.reminder-timeline-time span {
  color: rgba(78, 61, 44, 0.72);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
}

.reminder-timeline-copy strong {
  display: block;
  color: #2e2319;
  font-size: 0.95rem;
}

.reminder-timeline-copy p,
.reminder-dispatch-row p {
  margin: 4px 0 0;
  color: rgba(78, 61, 44, 0.72);
  font-size: 0.84rem;
}

.reminder-dispatch-row {
  grid-template-columns: 1fr auto;
}

.reminder-dispatch-row span {
  color: rgba(78, 61, 44, 0.72);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
}

.hero-chip.good {
  background: rgba(223, 234, 223, 0.92);
  border-color: rgba(31, 90, 71, 0.14);
  color: var(--good);
}

.hero-chip.warn {
  background: rgba(250, 233, 191, 0.92);
  border-color: rgba(189, 139, 60, 0.18);
  color: #8a6524;
}

.hero-chip.bad {
  background: rgba(246, 230, 221, 0.92);
  border-color: rgba(177, 94, 67, 0.14);
  color: var(--bad);
}

.story-grid,
.grid,
.summary-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.story-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.summary-card,
.tile,
.mini-card {
  border-radius: var(--radius-lg);
}

.card {
  padding: 18px;
}

.story-card,
.pulse-card {
  padding: 20px;
}

.story-steps {
  display: grid;
  gap: 12px;
}

.story-step-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(248, 243, 235, 0.8);
  border: 1px solid rgba(110, 90, 65, 0.1);
}

.story-step-card span,
.pulse-metrics span,
.focus-metrics span,
.metric span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.story-step-card span {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 1rem;
}

.story-step-card small,
.pulse-card p {
  color: var(--ink-soft);
  line-height: 1.5;
}

.pulse-card h2 {
  margin: 2px 0 10px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.pulse-card p {
  margin: 0 0 18px;
}

.pulse-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pulse-metrics div,
.focus-metrics div,
.metric {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(245, 239, 229, 0.88);
  border: 1px solid rgba(110, 90, 65, 0.1);
}

.section-head,
.invoice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-kicker {
  margin-bottom: 6px;
}

.card h2,
.invoice-header h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-copy {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  background: rgba(252, 248, 243, 0.9);
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  appearance: none;
  border: 1px solid rgba(110, 90, 65, 0.16);
  border-radius: 14px;
  background: var(--control);
  color: var(--ink);
  padding: 0 13px;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

input:hover,
select:hover {
  background: var(--control-hover);
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(31, 90, 71, 0.34);
  box-shadow: 0 0 0 4px var(--focus);
}

.btn {
  appearance: none;
  border: 1px solid rgba(110, 90, 65, 0.16);
  border-radius: 14px;
  min-height: 44px;
  padding: 0 15px;
  background: rgba(255, 252, 247, 0.96);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.btn:hover,
.page-btn:hover:not(:disabled),
.invoice-item:hover {
  transform: translateY(-1px);
}

.btn:hover,
.page-btn:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(110, 90, 65, 0.22);
}

.btn.primary {
  border-color: rgba(31, 90, 71, 0.18);
  background: linear-gradient(180deg, #edf5ed, #d8e8d8);
  color: var(--vault-strong);
}

.btn.danger {
  color: var(--bad);
  background: #fff8f4;
  border-color: rgba(177, 94, 67, 0.2);
}

.btn.icon-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(247, 241, 232, 0.94);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
  border: 1px solid rgba(110, 90, 65, 0.14);
}

.topbar .status-pill {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.16);
}

.topbar .btn.primary {
  background: #f6d88a;
  border-color: rgba(246, 216, 138, 0.65);
  color: #214536;
}

.summary-card {
  padding: 18px 18px 18px 20px;
}

.summary-card::after {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 5px;
  border-radius: 0 999px 999px 0;
}

.summary-card.good::after {
  background: var(--good);
}

.summary-card.bad::after {
  background: var(--terracotta);
}

.summary-card.accent::after {
  background: var(--info);
}

.summary-card.warm::after {
  background: var(--brass);
}

.summary-card span,
.summary-card small {
  display: block;
}

.summary-card span {
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-card strong,
.tile > strong,
.focus-total,
.invoice-item-total,
.mini-card strong,
.metric strong,
.pulse-metrics strong,
.focus-metrics strong {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.summary-card strong {
  display: block;
  margin: 14px 0 6px;
  font-size: 1.72rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.summary-card small {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(110, 90, 65, 0.12);
  border-radius: 18px;
  background: rgba(255, 252, 248, 0.9);
}

table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 16px;
  text-align: left;
  color: var(--ink-faint);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(110, 90, 65, 0.14);
  background: rgba(248, 243, 235, 0.98);
}

tbody td {
  padding: 16px;
  border-top: 1px solid rgba(110, 90, 65, 0.08);
  vertical-align: top;
  font-size: 0.93rem;
}

tbody tr:hover {
  background: rgba(241, 236, 228, 0.5);
}

.muted {
  color: var(--ink-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge.income,
.badge.paid {
  background: rgba(223, 234, 223, 0.8);
  color: var(--good);
  border-color: rgba(31, 90, 71, 0.1);
}

.badge.expense,
.badge.late {
  background: rgba(246, 230, 221, 0.85);
  color: var(--bad);
  border-color: rgba(177, 94, 67, 0.08);
}

.badge.card,
.badge.open {
  background: rgba(228, 235, 241, 0.85);
  color: var(--info);
  border-color: rgba(74, 102, 124, 0.1);
}

.badge.transfer {
  background: rgba(246, 216, 138, 0.2);
  color: #8a6524;
  border-color: rgba(189, 139, 60, 0.2);
}

.cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.tile {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.selected-card {
  border-color: rgba(31, 90, 71, 0.25);
  background: linear-gradient(180deg, rgba(250, 247, 242, 0.98), rgba(239, 246, 239, 0.96));
}

.category-tile {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.category-meta {
  display: grid;
  gap: 6px;
}

.tile h3 {
  margin: 0 0 2px;
  font-size: 1.24rem;
  font-weight: 700;
}

.tile > strong {
  font-size: 1.54rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.metric strong {
  font-size: 0.92rem;
  font-weight: 600;
}

.card-actions,
.modal-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-wrap .card-actions {
  flex-wrap: nowrap;
}

.card-actions input {
  min-width: 120px;
  flex: 1 1 140px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.summary-mini {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.invoice-workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.card-focus {
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 242, 233, 0.96), rgba(238, 245, 238, 0.92));
  border: 1px solid rgba(110, 90, 65, 0.14);
}

.card-focus.empty {
  color: var(--ink-soft);
  background: rgba(246, 239, 228, 0.8);
}

.focus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.focus-head strong {
  display: block;
  font-size: 1.05rem;
}

.focus-total {
  color: var(--vault-strong);
  font-size: 1.08rem;
  font-weight: 600;
}

.focus-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.focus-metrics strong {
  font-size: 0.92rem;
  font-weight: 600;
}

.invoice-list {
  display: grid;
  gap: 12px;
}

.invoice-item {
  appearance: none;
  width: 100%;
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.invoice-item:hover {
  border-color: rgba(110, 90, 65, 0.2);
}

.invoice-item.active {
  border-color: rgba(31, 90, 71, 0.22);
  background: linear-gradient(180deg, rgba(250, 247, 242, 0.98), rgba(237, 244, 237, 0.98));
}

.invoice-item-head,
.invoice-item-meta,
.invoice-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.invoice-item-head {
  margin-bottom: 10px;
}

.invoice-item-meta,
.invoice-item-actions {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.invoice-item-total {
  margin: 14px 0 10px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.invoice-item-cta {
  font-size: 0.75rem;
  color: var(--organize-green-dark);
  font-weight: 600;
  opacity: 0;
  transition: opacity 100ms ease;
}

.invoice-item:hover .invoice-item-cta {
  opacity: 1;
}

/* ── Invoice grid ───────────────────────────────────────────────── */

.invoice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 4px 0 8px;
}

/* ── Invoice detail modal ───────────────────────────────────────── */

.imodal-summary {
  margin-bottom: 18px;
}

.imodal-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.imodal-tile {
  background: var(--surface-2, #f6f0e8);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.imodal-tile span {
  font-size: 0.76rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.imodal-tile strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

/* Table wrap inside invoice modal: fills modal body without extra scroll */
.imodal-table-wrap {
  max-height: calc(100% - 4px);
  overflow-y: auto;
}

/* Inline delete button inside table rows */
.btn-icon-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #c0392b;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
}
.btn-icon-danger:hover {
  opacity: 1;
  background: rgba(192, 57, 43, 0.1);
}

/* ── Transfer mode toggle ───────────────────────────────────────── */

.transfer-mode-toggle {
  display: flex;
  gap: 0;
  background: var(--surface-2, #f0ebe2);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
}

.transfer-mode-btn {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.transfer-mode-btn.active {
  background: var(--surface-1, #fff);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.transfer-mode-btn:hover:not(.active) {
  color: var(--ink);
}

/* ── imodal skeleton ── */

.imodal-skeleton {
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 8px 0;
}

/* ── Icon-only buttons ──────────────────────────────────────────── */

.btn.icon-btn {
  padding: 0 10px;
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.icon-btn svg {
  display: block;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.page-btn {
  appearance: none;
  border: 1px solid rgba(110, 90, 65, 0.16);
  border-radius: 12px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  background: rgba(255, 252, 247, 0.96);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.page-btn.active {
  background: var(--vault);
  border-color: var(--vault);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.mini-card {
  padding: 16px;
  background: rgba(252, 248, 243, 0.9);
}

.mini-card strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
}

.mini-card small {
  color: var(--ink-soft);
}

.good {
  color: var(--good);
}

.bad {
  color: var(--bad);
}

canvas {
  width: 100% !important;
  height: 260px !important;
}

.empty {
  padding: 28px !important;
  text-align: center;
  color: var(--ink-soft);
}

.hidden {
  display: none !important;
}

/* ── Modal base ─────────────────────────────────────────────────── */

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes modal-out {
  from { opacity: 1; transform: translateY(0)    scale(1); }
  to   { opacity: 0; transform: translateY(8px)  scale(0.98); }
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(10, 20, 30, 0.48);
  backdrop-filter: blur(4px);
  z-index: 100;
  overscroll-behavior: contain;
}

@media (min-width: 600px) {
  .modal {
    align-items: center;
    padding: 20px;
  }
}

.modal.open {
  display: flex;
}

.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 96dvh;
  border-radius: 16px 16px 0 0;
  background: #fff;
  border: 1px solid var(--organize-border);
  box-shadow: 0 24px 60px rgba(10, 20, 30, 0.22);
  animation: modal-in 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

@media (min-width: 600px) {
  .modal-card {
    border-radius: 14px;
    max-height: calc(100vh - 40px);
    max-width: 520px;
    width: 100%;
  }
  .modal-card.modal-lg {
    max-width: 780px;
  }
}

.modal-card.closing {
  animation: modal-out 140ms ease both;
}

/* Width variants */
.modal-card.modal-sm  { max-width: 420px; }
.modal-card.modal-md  { max-width: 560px; }
.modal-card.modal-lg  { max-width: 760px; }
.modal-card.modal-xl  { max-width: min(1100px, 95vw); max-height: min(90vh, 800px); }

/* ── Modal header ───────────────────────────────────────────────── */

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--organize-border);
  flex: 0 0 auto;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  background: #f1f3ed;
  color: var(--organize-green-dark);
}

.modal-icon.red   { background: #fff0f2; color: var(--organize-red); }
.modal-icon.blue  { background: #eef2ff; color: var(--organize-blue); }
.modal-icon.gray  { background: #f2f4f6; color: #6e7782; }
.modal-icon.teal  { background: #e8f4f0; color: var(--organize-green-dark, #1f5a47); }

.modal-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.modal-title-copy h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--organize-ink);
  line-height: 1.2;
}

.modal-title-copy p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: #8e959f;
  line-height: 1.3;
}

.modal-close {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 0;
  border-radius: 6px;
  background: #f2f4f6;
  color: #8e959f;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms, color 120ms;
}

.modal-close:hover {
  background: #e8eaed;
  color: var(--organize-ink);
}

/* ── Modal body ─────────────────────────────────────────────────── */

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px;
  overscroll-behavior: contain;
}

/* ── Form sections within modal ─────────────────────────────────── */

.form-section {
  margin-bottom: 16px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a8aeb6;
}

.field-row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.field-row:last-child {
  margin-bottom: 0;
}

.field-row.cols-1 { grid-template-columns: 1fr; }
.field-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row.cols-1-2 { grid-template-columns: 1fr 2fr; }
.field-row.cols-2-1 { grid-template-columns: 2fr 1fr; }

@media (max-width: 480px) {
  .field-row.cols-2,
  .field-row.cols-3,
  .field-row.cols-1-2,
  .field-row.cols-2-1 {
    grid-template-columns: 1fr;
  }
}

/* ── Modal footer ───────────────────────────────────────────────── */

.config-contact-list {
  display: grid;
  gap: 12px;
}

.config-contact-empty {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(110, 90, 65, 0.16);
  background: rgba(248, 243, 235, 0.7);
  color: var(--ink-soft);
}

.config-contact-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(110, 90, 65, 0.1);
  background: rgba(248, 243, 235, 0.7);
}

.config-contact-row .btn {
  height: 42px;
}

.config-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.config-status-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(110, 90, 65, 0.1);
  background: rgba(248, 243, 235, 0.72);
}

.config-status-card strong {
  font-size: 1.02rem;
}

.config-qr-wrap {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(110, 90, 65, 0.16);
  background: rgba(248, 243, 235, 0.6);
}

.config-qr-wrap img {
  width: 220px;
  max-width: 100%;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(110, 90, 65, 0.1);
  background: #fff;
}

@media (max-width: 960px) {
  .config-contact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-contact-row .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .config-contact-row,
  .config-status-grid {
    grid-template-columns: 1fr;
  }
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 14px;
  border-top: 1px solid var(--organize-border);
  flex: 0 0 auto;
  background: #fafafa;
}

.modal-footer .btn {
  min-width: 80px;
}

.modal-footer .btn.primary {
  min-width: 100px;
}

/* ── Modal card overrides in organize theme ─────────────────────── */

.modal-card h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #cfbfa7;
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 1240px) {
  .shell-header,
  .story-grid,
  .summary-grid,
  .grid.three,
  .summary-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shell-header {
    display: grid;
  }

  .shell-overview {
    min-width: 0;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .tabs.top-tabs,
  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 14px;
  }

  .shell {
    padding: 16px 14px 18px;
  }

  .panel-hero,
  .section-head,
  .invoice-header,
  .shell-header {
    flex-direction: column;
    align-items: stretch;
  }

  .shell-overview,
  .summary-grid,
  .grid.two,
  .grid.three,
  .invoice-workspace,
  .summary-mini,
  .cards-list,
  .story-grid,
  .pulse-metrics,
  .focus-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .tabs.top-tabs,
  .toolbar,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .tabs.top-tabs {
    display: flex;
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-actions,
  .card-actions,
  .modal-actions {
    flex-direction: column;
  }

  .topbar .btn,
  .topbar .status-pill,
  .card-actions .btn,
  .card-actions input,
  .modal-actions .btn,
  .toolbar .btn {
    width: 100%;
  }

  .panel-copy h2 {
    font-size: 1.72rem;
  }

  .shell-copy h1 {
    font-size: 2rem;
  }
}

:root {
  --organize-green: #1fc64b;
  --organize-green-dark: #16b03f;
  --organize-page: #f1f3ed;
  --organize-surface: #ffffff;
  --organize-border: #ece8df;
  --organize-muted: #9da3ad;
  --organize-ink: #1c2430;
  --organize-yellow: #f3c64f;
  --organize-red: #ed4054;
  --organize-blue: #4d74f1;
  --organize-gray: #a9b0b8;
}

body {
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  background: var(--organize-page);
  color: var(--organize-ink);
}

body::before {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 20px;
  min-height: 54px;
  background: var(--organize-green);
  border-bottom: 0;
  backdrop-filter: none;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.04);
}

.brand-lockup {
  gap: 10px;
}

.brand-badge {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.brand-badge span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
}

.brand-text strong {
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #fff;
}

.brand-text span,
.shell-header,
.overview-pill,
.tabs-kicker,
.flow-kicker {
  display: none;
}

.tabs.top-tabs {
  gap: 2px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs.top-tabs::-webkit-scrollbar {
  display: none;
}

.topbar .tab {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 54px;
  border-radius: 0;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  font-weight: 700;
  background: transparent;
}

.topbar .tab:hover,
.topbar .tab.active {
  background: transparent;
  color: #fff;
}

.topbar .tab::before {
  inset: auto 10px 0;
  height: 3px;
}

.topbar .tab.active::before {
  background: #fff;
}

.topbar-actions {
  gap: 10px;
}

.topbar-icon,
.topbar-avatar {
  width: 28px;
  height: 28px;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.topbar-icon svg,
.topbar-avatar svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.topbar-avatar {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}

.topbar .btn.primary,
.topbar .status-pill {
  display: none;
}

.planbar {
  background: #f8f7f2;
  border-bottom: 1px solid #ebe8df;
}

.planbar-inner {
  max-width: 100%;
  min-height: 44px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.planbar-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #2d3742;
  font-size: 0.92rem;
}

.planbar-copy strong {
  font-weight: 800;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #7d7d7d;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.planbar-progress {
  height: 14px;
  border-radius: 999px;
  background: #e9e9e7;
  overflow: hidden;
}

.planbar-progress span {
  display: block;
  width: 88%;
  height: 100%;
  border-radius: 999px;
  background: var(--organize-yellow);
}

.planbar-link {
  color: #80858e;
  font-weight: 700;
  text-decoration: none;
}

.shell {
  max-width: 100%;
  padding: 20px 20px 28px;
}

#tab-dashboard.panel.active {
  display: block;
}

.welcome-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  gap: 20px;
  padding: 18px 22px 16px;
  margin-bottom: 16px;
  background: var(--organize-surface);
  border: 1px solid var(--organize-border);
  border-radius: 10px;
  box-shadow: none;
}

.welcome-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.welcome-greeting span {
  display: block;
  color: #6e7782;
  font-size: 0.85rem;
}

.welcome-greeting strong {
  display: block;
  margin-top: 2px;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--organize-ink);
}

.welcome-greeting small {
  display: inline-block;
  margin-top: 6px;
  color: var(--organize-muted);
  font-size: 0.82rem;
}

.welcome-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0;
}

.welcome-stat {
  padding: 0 12px;
  text-align: center;
}

.welcome-stat + .welcome-stat {
  border-left: 1px solid #e8e4db;
}

.welcome-stat span {
  display: block;
  color: #9aa1aa;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.welcome-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 1.05rem;
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  font-weight: 700;
}

.welcome-stat.positive strong {
  color: var(--organize-green-dark);
}

.welcome-stat.negative strong {
  color: var(--organize-red);
}

.welcome-stat strong.good {
  color: var(--organize-green-dark);
}

.welcome-stat strong.bad {
  color: var(--organize-red);
}

.stat-sub {
  display: block;
  margin-top: 5px;
  color: #a5acb5;
  font-size: 0.82rem;
}

.welcome-mini {
  width: 58px;
  height: 48px;
  margin-left: auto;
  border: 1px solid #ece8df;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-mini svg {
  width: 28px;
  height: 28px;
  fill: #2c333a;
}

.quick-access {
  padding-left: 20px;
  border-left: 1px solid var(--organize-border);
}

.quick-access h2 {
  margin: 0 0 10px;
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9aa1aa;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.quick-action {
  min-height: 68px;
  border: 1px solid var(--organize-border);
  border-radius: 8px;
  background: #fafaf9;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  color: #8a9099;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.quick-action:hover {
  background: #f4f5f1;
  border-color: #c8ccd4;
}

.quick-action span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
}

.quick-action small {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.quick-action.expense { color: var(--organize-red); }
.quick-action.income { color: var(--organize-green-dark); }
.quick-action.transfer { color: #6e7baa; }
.quick-action.import { color: var(--organize-blue); }

/* ── Forecast banner ────────────────────────────────────────────── */
.dash-forecast-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 16px;
  color: #fff;
}

.dash-forecast-left {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-forecast-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

.dash-forecast-need {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: .95rem;
  color: rgba(255,255,255,.8);
}

.dash-forecast-need strong {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  font-family: "Fraunces", Georgia, serif;
}

.dash-forecast-need strong.good { color: #4ade80; }
.dash-forecast-need strong.bad  { color: #f87171; }

.dash-forecast-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-ftile {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}

.dash-ftile span {
  font-size: .7rem;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.dash-ftile strong {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.dash-ftile.good strong { color: #4ade80; }

/* ── Dashboard grid ─────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* ── Dash card (new style) ──────────────────────────────────────── */
.dash-card {
  background: var(--surface-1, #fff);
  border: 1px solid var(--border, #e8e2d9);
  border-radius: 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.dash-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border, #e8e2d9);
}

.dash-card-header > div:nth-child(2) {
  flex: 1;
}

.dash-card-header h3 {
  font-size: .9rem;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--ink, #222);
}

.dash-card-sub {
  font-size: .73rem;
  color: var(--fg-muted, #888);
}

.dash-card-total {
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
  align-self: center;
}

.dash-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-card-icon svg { width: 17px; height: 17px; }
.dash-card-icon.invoices  { background: rgba(239,68,68,.12); color: #ef4444; }
.dash-card-icon.expenses  { background: rgba(245,158,11,.12); color: #d97706; }
.dash-card-icon.accounts  { background: rgba(59,130,246,.12); color: #3b82f6; }
.dash-card-icon.income    { background: rgba(34,197,94,.12);  color: #16a34a; }

.dash-card-list {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  max-height: 220px;
}

.dash-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  cursor: default;
  transition: background .12s;
}

.dash-list-row:last-child { border-bottom: none; }
.dash-list-row:hover { background: rgba(0,0,0,.025); }
.dash-list-row[onclick] { cursor: pointer; }

.dash-list-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.dash-list-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink, #222);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-list-sub {
  font-size: .72rem;
  color: var(--fg-muted, #888);
}

.dash-row-overdue .dash-list-name { color: #ef4444; }
.dash-row-overdue .dash-list-sub  { color: #f87171; }
.dash-row-closed { opacity: .9; }

/* ── Category breakdown rows ── */
.dash-cat-row {
  padding: 7px 16px;
  border-bottom: 1px solid var(--border, #f0f0f0);
}
.dash-cat-row:last-child { border-bottom: none; }

.dash-cat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.dash-cat-top .dash-list-name {
  font-size: .82rem;
  font-weight: 600;
}
.dash-cat-top strong {
  font-size: .82rem;
  white-space: nowrap;
  margin-left: 8px;
}

.dash-cat-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-cat-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #f87171;
  min-width: 2px;
  max-width: 100%;
  transition: width .3s ease;
}
.dash-cat-pct {
  font-size: .68rem;
  color: var(--fg-muted, #aaa);
  white-space: nowrap;
  width: 28px;
  text-align: right;
}

.dash-empty {
  display: block;
  font-size: .82rem;
  color: var(--fg-muted, #aaa);
  text-align: center;
  padding: 14px 16px;
}

.dash-card-link {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: right;
  font-size: .76rem;
  font-weight: 600;
  color: var(--accent, #c17c3a);
  background: var(--surface-2, #faf7f3);
  border: none;
  border-top: 1px solid var(--border, #e8e2d9);
  cursor: pointer;
  transition: background .12s;
}

.dash-card-link:hover { background: var(--surface-1, #fff5eb); }

/* ── Inputs e labels no tema organize ───────────────────────────── */

input,
select {
  background: #fff;
  border-color: #dde0e6;
  border-radius: 8px;
  min-height: 38px;
  font-size: 0.9rem;
  color: var(--organize-ink);
}

input:hover,
select:hover {
  background: #f9f9f8;
  border-color: #c8ccd4;
}

input:focus,
select:focus {
  border-color: var(--organize-green);
  box-shadow: 0 0 0 3px rgba(31, 198, 75, 0.12);
}

label {
  color: #6e7782;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 5px;
}

.btn {
  border-radius: 8px;
  min-height: 38px;
  font-size: 0.88rem;
  border-color: #dde0e6;
  background: #fff;
  color: var(--organize-ink);
}

.btn:hover,
.page-btn:hover:not(:disabled) {
  background: #f6f7f5;
  border-color: #c8ccd4;
  transform: none;
}

.btn.primary {
  background: var(--organize-green);
  border-color: var(--organize-green);
  color: #fff;
}

.btn.primary:hover {
  background: var(--organize-green-dark);
  border-color: var(--organize-green-dark);
}

.btn.danger {
  color: var(--organize-red);
  background: #fff4f5;
  border-color: rgba(237, 64, 84, 0.18);
}

.btn.danger:hover {
  background: #ffecee;
}

.table-wrap {
  border-radius: 8px;
  border-color: var(--organize-border);
}

thead th {
  background: #f8f8f6;
  border-color: var(--organize-border);
  color: #8e959f;
  font-size: 0.72rem;
}

tbody td {
  border-color: var(--organize-border);
  font-size: 0.9rem;
  padding: 12px 14px;
}

tbody tr:hover {
  background: #f9f9f7;
}

.modal-card {
  border-radius: 12px;
  border-color: var(--organize-border);
  padding: 20px;
}

.modal-card h2 {
  font-size: 1.1rem;
  margin: 0 0 14px;
}

.modal {
  background: rgba(10, 20, 30, 0.32);
}

/* ── Dashboard cards ────────────────────────────────────────────── */

.organize-card {
  padding: 14px 16px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--organize-border);
  box-shadow: none;
}

.organize-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-header {
  position: relative;
  padding-left: 12px;
}

.metric-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 999px;
  background: var(--organize-green-dark);
}

.metric-header span {
  display: block;
  color: #8e959f;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-header strong {
  display: block;
  color: var(--organize-ink);
  font-size: 1rem;
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  font-weight: 700;
}

.eye-mark {
  color: #9aa1aa;
  font-size: 0.8rem;
}

.organize-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--organize-border);
}

.organize-card h3 {
  margin: 0 0 10px;
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--organize-ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.organize-empty,
.organize-center-copy {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #adb3bb;
  font-size: 0.96rem;
}

.organize-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  color: #7a818b;
  font-size: 0.86rem;
  border-top: 1px solid #f2f2f0;
}

.organize-list-row:first-child {
  border-top: 0;
}

.organize-list-row strong {
  color: var(--organize-ink);
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.soft-action {
  width: 100%;
  margin-top: 10px;
  min-height: 32px;
  border-radius: 6px;
  border: 1px solid var(--organize-border);
  background: #f8f8f6;
  color: #8e959f;
  font-size: 0.8rem;
  font-weight: 700;
}

.soft-action:hover {
  background: #fbfbfa;
  transform: none;
}

.soft-icon-action {
  width: 38px;
  height: 38px;
  margin-top: 10px;
  margin-left: auto;
  border: 1px solid var(--organize-border);
  border-radius: 999px;
  background: #f8f8f6;
  color: #7f8792;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.soft-icon-action svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.soft-icon-action:hover {
  background: #fbfbfa;
  transform: none;
}

.filter-select {
  min-width: 140px;
  min-height: 36px;
  border-radius: 8px;
  font-size: 0.84rem;
  background: #fff;
}

.organize-card .soft-action,
.soft-icon-action,
.quick-action,
.planbar-link,
.topbar .tab,
.topbar-icon,
.topbar-avatar {
  transition: none;
}

.panel-hero {
  background: var(--organize-ink);
  color: #f0f2f4;
  border: 0;
  box-shadow: none;
  padding: 18px 20px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.panel-copy h2 {
  font-size: 1.4rem;
  color: #fff;
}

.panel-copy p {
  color: rgba(240, 242, 244, 0.72);
  font-size: 0.88rem;
}

.eyebrow {
  color: rgba(240, 242, 244, 0.52);
  font-size: 0.7rem;
}

.hero-chip {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.9);
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.hero-chip.soft {
  background: rgba(255,255,255,0.06);
}

.panel-copy h2,
.invoice-header h2,
.card h2,
.tile h3,
.modal-card h2 {
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
}

.hero-chip {
  background: #f4f5f1;
  border-color: #ece8df;
  color: #68717c;
}

.panel-copy p {
  color: #7e8690;
}

.card,
.tile,
.mini-card,
.modal-card,
.invoice-item,
.card-focus,
.toolbar {
  border-radius: 8px;
  border-color: var(--organize-border);
  box-shadow: none;
  background: #fff;
}

.card {
  padding: 14px 16px;
}

.card.toolbar {
  padding: 12px 14px;
  gap: 10px;
}

.grid.two {
  gap: 12px;
  margin-bottom: 0;
}

.story-grid,
.grid,
.summary-grid {
  gap: 12px;
  margin-bottom: 12px;
}

.section-head {
  margin-bottom: 12px;
}

.card h2,
.invoice-header h2 {
  font-size: 1rem;
  color: var(--organize-ink);
}

.section-kicker {
  color: #9aa1aa;
  font-size: 0.7rem;
}

.section-copy {
  font-size: 0.88rem;
  color: #8e959f;
  margin-top: 4px;
}

.invoice-item {
  padding: 12px 14px;
  border-radius: 8px;
}

.invoice-list {
  gap: 8px;
}

.pagination {
  margin-top: 10px;
  gap: 6px;
}

.page-btn {
  min-width: 34px;
  min-height: 34px;
  border-radius: 6px;
  font-size: 0.82rem;
  border-color: var(--organize-border);
  background: #fff;
}

.page-btn.active {
  background: var(--organize-green);
  border-color: var(--organize-green);
  color: #fff;
}

.badge {
  min-height: 22px;
  padding: 0 8px;
  font-size: 0.7rem;
  border-radius: 6px;
}

.status-pill {
  min-height: 34px;
  background: #f4f5f1;
  color: #7a818b;
  border-color: var(--organize-border);
  border-radius: 8px;
  font-size: 0.82rem;
}

.card::before,
.summary-card::before,
.modal-card::before,
.card-focus::before,
.invoice-item::before,
.sidebar-flow::before {
  display: none;
}

/* Tiles and cards in organize theme */
.tile,
.mini-card {
  padding: 12px 14px;
  border-radius: 8px;
}

.tile h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.cards-list {
  gap: 10px;
}

.category-tile {
  padding: 10px 12px;
}

/* Form grid tighter */
.form-grid {
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.toolbar {
  background: #f8f8f6;
  border-color: var(--organize-border);
  border-radius: 8px;
}

.card-actions {
  gap: 6px;
}

.inline-actions {
  gap: 6px;
}

/* card-focus */
.card-focus {
  background: #f9f9f7;
  border-color: var(--organize-border);
  padding: 12px 14px;
  border-radius: 8px;
}

/* summary-mini tighter */
.summary-mini {
  gap: 8px;
  margin: 10px 0;
}

/* invoice-item-total */
.invoice-item-total {
  font-size: 1.05rem;
  margin: 10px 0 8px;
}

.btn.primary {
  background: var(--organize-green);
  color: #fff;
  border-color: var(--organize-green);
}

.status-pill {
  background: #f7f7f4;
  color: #858c95;
  border-color: var(--organize-border);
}

@media (max-width: 1160px) {
  /* Com sidebar 220px, content fica ~940px — já precisa empilhar */
  .welcome-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .quick-access {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--organize-border);
    padding-top: 14px;
  }

  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .planbar-inner,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .welcome-main {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
  }

  .welcome-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    gap: 12px;
  }

  .topbar-actions {
    justify-self: end;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 12px;
    grid-template-columns: 1fr auto;
    min-height: 50px;
  }

  .planbar-inner {
    padding: 10px 12px;
    gap: 10px;
  }

  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .welcome-card {
    padding: 14px 14px 12px;
  }

  .welcome-stat {
    padding: 0 8px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 14px 12px 20px;
  }
}

@media (max-width: 640px) {
  .planbar-copy {
    flex-wrap: wrap;
    gap: 6px;
  }

  .planbar-link {
    justify-self: start;
  }

  .welcome-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .welcome-stat {
    padding: 0 6px;
  }

  .welcome-stat strong {
    font-size: 0.9rem;
  }

  .welcome-mini {
    margin: 0 auto;
  }

  .welcome-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .quick-action {
    min-height: 58px;
    gap: 4px;
  }

  .quick-action span {
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .shell {
    padding: 12px 10px 20px;
  }

  .welcome-card {
    padding: 12px 12px 10px;
  }

  .welcome-greeting strong {
    font-size: 1.3rem;
  }

  /* Keep 4 columns but more compact */
  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .quick-action {
    min-height: 52px;
    border-radius: 6px;
    gap: 3px;
  }

  .quick-action small {
    font-size: 0.6rem;
  }

  /* Hide decorative progress bar on very small screens */
  .planbar-progress {
    display: none;
  }

  .planbar-inner {
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 1100px) {
  .grid.three,
  .summary-grid,
  .summary-mini,
  .focus-metrics,
  .pulse-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .invoice-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .grid.two,
  .grid.three,
  .summary-grid,
  .summary-mini,
  .cards-list,
  .invoice-workspace,
  .focus-metrics,
  .pulse-metrics,
  .toolbar,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .invoice-header,
  .card-actions,
  .modal-actions,
  .inline-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .card-actions .btn,
  .card-actions input,
  .modal-actions .btn,
  .inline-actions .btn,
  .inline-actions select,
  .toolbar .btn {
    width: 100%;
  }

  .card-actions .icon-btn {
    width: 36px !important;
    min-width: 36px;
    height: 36px;
  }

  .table-wrap .card-actions {
    flex-direction: row;
    align-items: center;
  }

  .cards-list {
    gap: 12px;
  }

  .tile,
  .card,
  .modal-card {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  table {
    min-width: 560px;
  }

  .shell {
    max-width: 100%;
  }

  .card,
  .tile,
  .organize-card,
  .welcome-card {
    border-radius: 8px;
  }
}

/* ── Sidebar layout ─────────────────────────────────────────────── */

:root {
  --sidebar-w: 220px;
}

.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - 54px);
  align-items: start;
}

/* Planbar now sits inside content-wrap, not full-width */
.content-wrap {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 54px;
  height: calc(100vh - 54px);
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--organize-border);
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 10;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

/* Context switcher: Pessoal | Empresa */
.context-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 12px 16px;
  padding: 4px;
  background: #f1f3ed;
  border-radius: 8px;
}

.context-btn {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 7px 0;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #7a818b;
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  text-align: center;
  white-space: nowrap;
}

.context-btn:hover {
  color: var(--organize-ink);
}

.context-btn.active {
  background: #fff;
  color: var(--organize-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Sidebar nav section label */
.sidebar-section {
  display: block;
  padding: 0 16px 6px;
  margin-top: 8px;
  color: #b0b6bf;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 0 6px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  width: calc(100% - 12px);
  text-align: left;
  color: #5e6672;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.nav-item:hover {
  background: #f4f5f1;
  color: var(--organize-ink);
}

.nav-item.active {
  background: #eaf3ea;
  color: var(--organize-green-dark);
  font-weight: 700;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 16px;
  opacity: 0.75;
}

.nav-item.active svg {
  opacity: 1;
}

/* Empresa-only items hidden by default */
.nav-empresa {
  display: none;
}

.context-empresa .nav-empresa {
  display: flex;
}

/* ── Hamburger / close button (mobile) ─────────────────────────── */

.hamburger {
  display: none;
  width: 32px;
  height: 32px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
}

.hamburger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}


/* ── Sidebar overlay (mobile) ───────────────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 25;
}

.sidebar-overlay.open {
  display: block;
}

/* ── Responsive sidebar ─────────────────────────────────────────── */

@media (max-width: 860px) {
  .app-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    z-index: 30;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .hamburger {
    display: inline-flex;
  }

}

/* AIARA Inline Workspace */
.aiara-inline {
  width: min(400px, calc(100% - 24px));
  margin: 0;
  position: fixed;
  top: 58px;
  right: 18px;
  bottom: 16px;
  z-index: 32;
  animation: aiaraReveal 180ms ease;
}

.aiara-inline-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(255, 251, 245, 0.98);
  border: 1px solid rgba(110, 90, 65, 0.14);
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(73, 57, 40, 0.12);
  overflow: hidden;
}

.aiara-inline-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(110, 90, 65, 0.12);
}

.aiara-inline-copy {
  min-width: 0;
}

.aiara-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(31, 90, 71, 0.09);
  color: var(--vault);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aiara-inline-copy h2 {
  margin: 8px 0 4px;
  font-size: 1.04rem;
  line-height: 1.2;
  color: var(--ink);
}

.aiara-inline-copy p {
  margin: 0;
  color: var(--ink-soft);
  max-width: none;
  font-size: 0.82rem;
  line-height: 1.45;
}

.aiara-inline-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.aiara-inline .btn {
  min-height: 31px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: none;
}

.aiara-inline .btn.ghost {
  background: rgba(255, 247, 238, 0.92);
}

.aiara-inline .btn svg {
  width: 14px;
  height: 14px;
}

.aiara-inline-grid {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.aiara-inline-rail {
  flex: 0 0 auto;
  padding: 0 14px 10px;
  background: transparent;
  border-right: 0;
}

.aiara-inline-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(249, 242, 232, 0.84);
  border: 1px solid rgba(110, 90, 65, 0.12);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.aiara-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--vault);
  box-shadow: 0 0 0 4px rgba(31, 90, 71, 0.1);
}

.aiara-inline-note {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(249, 242, 232, 0.64);
  border: 1px solid rgba(110, 90, 65, 0.12);
}

.aiara-inline-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.78rem;
}

.aiara-inline-note p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
  font-size: 0.8rem;
}

.aiara-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.aiara-chip {
  appearance: none;
  border: 1px solid rgba(110, 90, 65, 0.14);
  background: rgba(255, 252, 248, 0.88);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.aiara-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 90, 71, 0.22);
  background: rgba(31, 90, 71, 0.08);
}

.aiara-inline-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 14px 14px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.chat-bubble {
  max-width: 88%;
  padding: 9px 11px;
  border-radius: 14px;
  font-size: 0.83rem;
  line-height: 1.45;
  word-break: break-word;
}

.chat-bubble p { margin: 0; }
.chat-bubble p + p { margin-top: 4px; }

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--vault), var(--vault-strong));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.bot {
  align-self: flex-start;
  background: rgba(255, 252, 248, 0.9);
  color: var(--ink);
  border: 1px solid rgba(110, 90, 65, 0.14);
  border-bottom-left-radius: 4px;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: chatDot 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes chatDot {
  0%, 80%, 100% { transform: scale(.72); opacity: .38; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(110, 90, 65, 0.12);
  position: sticky;
  bottom: 0;
  background: rgba(255, 251, 245, 0.98);
}

.chat-input {
  flex: 1;
  resize: none;
  border: 1px solid rgba(110, 90, 65, 0.16);
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-family: inherit;
  background: rgba(255, 252, 248, 0.92);
  color: var(--ink);
  outline: none;
  line-height: 1.45;
  min-height: 42px;
  max-height: 110px;
  overflow-y: auto;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.chat-input:focus {
  border-color: rgba(31, 90, 71, 0.28);
  box-shadow: 0 0 0 4px rgba(31, 90, 71, 0.08);
  background: #fffdf9;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--terracotta), #c77049);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  transition: transform 120ms ease, opacity 120ms ease;
}

.chat-send-btn svg { fill: #fff; width: 16px; height: 16px; }

.chat-send-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

@keyframes aiaraReveal {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .aiara-inline {
    width: min(360px, calc(100% - 16px));
    right: 12px;
    bottom: 12px;
  }

  .reminder-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reminder-card-foot,
  .reminder-timeline-item,
  .reminder-dispatch-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .aiara-inline {
    width: 100%;
    position: relative;
    right: auto;
    top: auto;
    margin-bottom: 16px;
    z-index: 8;
  }

  .aiara-inline-head-actions {
    justify-content: flex-start;
  }

  .chat-bubble {
    max-width: 100%;
  }

  .chat-input-wrap {
    align-items: stretch;
  }

  .reminder-stat-grid,
  .reminder-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Badges de status Asaas ─────────────────────────────────── */
.badge-green  { background: rgba(223,234,223,.8);  color: var(--good, #1f5a47); border: 1px solid rgba(31,90,71,.1); display:inline-flex;align-items:center;padding:0 10px;border-radius:999px;font-size:.74rem;font-weight:800;white-space:nowrap; }
.badge-yellow { background: rgba(246,216,138,.35); color: #8a6524;              border: 1px solid rgba(189,139,60,.2); display:inline-flex;align-items:center;padding:0 10px;border-radius:999px;font-size:.74rem;font-weight:800;white-space:nowrap; }
.badge-red    { background: rgba(246,230,221,.85); color: var(--bad, #b15e43);  border: 1px solid rgba(177,94,67,.08); display:inline-flex;align-items:center;padding:0 10px;border-radius:999px;font-size:.74rem;font-weight:800;white-space:nowrap; }
.badge-gray   { background: rgba(220,220,220,.4);  color: #666;                 border: 1px solid rgba(0,0,0,.07); display:inline-flex;align-items:center;padding:0 10px;border-radius:999px;font-size:.74rem;font-weight:800;white-space:nowrap; }

/* ── Chat inline cobranças ──────────────────────────────────── */
.charges-chat-wrap { display:flex; gap:8px; align-items:center; }

/* ── Modal de confirmação PIX ───────────────────────────────── */
.pix-owner-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(135deg, rgba(0,160,110,.06) 0%, rgba(0,160,110,.02) 100%);
  border: 1px solid rgba(0,160,110,.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.pix-owner-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #00a06e;
}
.pix-owner-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg, #222);
}
.pix-owner-meta {
  font-size: .8rem;
  color: var(--fg-muted, #888);
}

.pix-confirm-box {
  border: 1px solid var(--border, #e8e2d9);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.pix-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e8e2d9);
  font-size: .9rem;
}
.pix-confirm-row:last-child { border-bottom: none; }
.pix-confirm-row span { color: var(--fg-muted, #888); }
.pix-confirm-value { background: rgba(0,0,0,.02); }
.pix-confirm-value strong { font-size: 1.15rem; color: var(--accent); }
.pix-confirm-warning {
  font-size: .82rem;
  color: var(--fg-muted, #888);
  text-align: center;
  margin: 0 0 4px;
}
.btn.danger {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}
.btn.danger:hover { background: #a93226; }

/* ── Barra de seleção em massa ── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #1f5a47;
  color: #fff;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: .9rem;
  font-weight: 500;
}
.bulk-bar .btn {
  font-size: .82rem;
  padding: 5px 12px;
}
.bulk-bar .btn.danger {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}
.bulk-bar .btn:not(.danger) {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.3);
  color: #fff;
}
#bulk-count-label { margin-right: 4px; }

/* ── Checkboxes customizados da tabela de lançamentos ── */
.cb-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.cb-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}
.cb-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid #c8c2b8;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  box-sizing: border-box;
}
.cb-box:hover {
  border-color: #1f5a47;
  box-shadow: 0 0 0 3px rgba(31,90,71,.1);
}
.cb-box svg { display: none; pointer-events: none; }

/* Checked */
input[type="checkbox"]:checked + .cb-box {
  background: #1f5a47;
  border-color: #1f5a47;
}
input[type="checkbox"]:checked + .cb-box svg { display: block; }

/* Indeterminate (select-all parcial) */
input[type="checkbox"]:indeterminate + .cb-box {
  background: #1f5a47;
  border-color: #1f5a47;
}
input[type="checkbox"]:indeterminate + .cb-box .cb-dash { display: block; }
input[type="checkbox"]:indeterminate + .cb-box .cb-check { display: none; }

.cb-dash { display: none; width: 10px; height: 2px; background: #fff; border-radius: 1px; }

/* ── Login Overlay ─────────────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--paper, #f4eee3);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--sheet, #fbf7f1);
  border: 1px solid var(--ledger, #e1d6c6);
  border-radius: 16px;
  padding: 40px 36px 36px;
  width: 100%; max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
}
.login-brand {
  display: flex; align-items: center; gap: 10px;
  justify-content: center; margin-bottom: 8px;
  font-size: 22px; color: var(--ink, #22313f);
}
.login-brand .brand-badge { width: 32px; height: 32px; }
.login-subtitle {
  text-align: center; color: var(--ink-soft, #5f6d78);
  font-size: 14px; margin: 0 0 28px;
}
.login-field {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft, #5f6d78);
  margin-bottom: 16px;
}
.login-field input {
  padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--ledger, #e1d6c6);
  background: var(--paper, #f4eee3);
  font-size: 15px; color: var(--ink, #22313f);
  font-family: inherit; outline: none;
  transition: border-color .15s;
}
.login-field input:focus {
  border-color: var(--vault, #1f5a47);
}
.login-error {
  background: var(--terracotta-soft, #f6e6dd);
  color: var(--terracotta, #b15e43);
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  margin-bottom: 16px; text-align: center;
}
.login-btn {
  width: 100%; padding: 12px;
  background: var(--vault, #1f5a47);
  color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: background .15s;
}
.login-btn:hover { background: var(--vault-strong, #184837); }
.login-btn:disabled { opacity: .6; cursor: wait; }
