:root {
  --bg: #f4efe6;
  --bg-strong: #efe4d2;
  --panel: rgba(255, 252, 246, 0.78);
  --panel-strong: #fffaf2;
  --line: rgba(70, 48, 27, 0.12);
  --text: #26190f;
  --muted: #6e5c4d;
  --accent: #c96f2d;
  --accent-strong: #9d4f18;
  --income: #1f8a5c;
  --expense: #c54b42;
  --balance: #3c57b5;
  --shadow: 0 22px 60px rgba(67, 42, 18, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

:root[data-theme="dark"] {
  --bg: #15120f;
  --bg-strong: #211a14;
  --panel: rgba(38, 31, 25, 0.88);
  --panel-strong: #2a211a;
  --line: rgba(245, 225, 201, 0.14);
  --text: #fff4e7;
  --muted: #d0baaa;
  --accent: #ef9958;
  --accent-strong: #ffb276;
  --income: #66c89b;
  --expense: #f08378;
  --balance: #9db1ff;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Outfit", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(201, 111, 45, 0.18), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(60, 87, 181, 0.1), transparent 24%),
    linear-gradient(180deg, #f8f1e7 0%, #f1e4d2 100%);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(239, 153, 88, 0.18), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(126, 148, 255, 0.14), transparent 24%),
    linear-gradient(180deg, #17120e 0%, #0f0d0b 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.3;
  pointer-events: none;
}

:root[data-theme="dark"] body::before {
  background-image:
    linear-gradient(rgba(255, 239, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 239, 220, 0.05) 1px, transparent 1px);
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .site-header,
:root[data-theme="dark"] .login-card {
  background: rgba(35, 28, 22, 0.9);
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .ai-form input,
:root[data-theme="dark"] .online-sheet-row input,
:root[data-theme="dark"] .online-sheet-row select {
  border-color: rgba(255, 232, 207, 0.16);
  background: rgba(15, 12, 10, 0.55);
  color: var(--text);
}

:root[data-theme="dark"] .button-secondary,
:root[data-theme="dark"] .entry-item,
:root[data-theme="dark"] .tips-card,
:root[data-theme="dark"] .inventory-item,
:root[data-theme="dark"] .business-item,
:root[data-theme="dark"] .inventory-history-item,
:root[data-theme="dark"] .ai-message.is-assistant,
:root[data-theme="dark"] .toggle-field,
:root[data-theme="dark"] .online-sheet-row {
  background: rgba(48, 38, 30, 0.72);
}

:root[data-theme="dark"] .sidebar-link:hover,
:root[data-theme="dark"] .sidebar-link:focus-visible,
:root[data-theme="dark"] .menu-toggle,
:root[data-theme="dark"] .sidebar-collapse {
  background: rgba(255, 242, 226, 0.1);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at bottom right, rgba(31, 138, 92, 0.12), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.26), transparent 45%);
}

.login-screen {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(244, 239, 230, 0.7);
  backdrop-filter: blur(10px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.login-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-content {
  display: none;
}

.app-content.is-visible {
  display: block;
}

.login-card {
  width: min(100%, 430px);
  margin: auto;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.login-view.is-hidden {
  display: none;
}

.login-brand {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #e9aa55);
  color: #fffdf7;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
}

.login-card h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(2rem, 7vw, 2.8rem);
}

.login-intro {
  margin: 12px 0 26px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
}

.forgot-password {
  justify-self: start;
  color: var(--accent-strong);
  font-weight: 700;
}

.forgot-password:hover,
.forgot-password:focus-visible {
  text-decoration: underline;
}

.login-message {
  min-height: 1.4em;
  margin: -4px 0 0;
  color: var(--income);
  font-size: 0.9rem;
}

.entry-message {
  min-height: 1.3em;
  margin: -4px 0 0;
  color: var(--income);
  font-size: 0.88rem;
}

.entry-message.is-error {
  color: var(--expense);
}

.login-submit,
.login-create {
  width: 100%;
}

.site-header,
.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  margin-top: 18px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 249, 240, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #e9aa55);
  color: #fffdf7;
  font-family: "Sora", sans-serif;
  font-weight: 800;
}

.brand strong,
.nav-links a,
.summary-card strong,
.entry-title,
.category-row strong,
.tips-card strong {
  font-family: "Sora", sans-serif;
}

.brand div {
  display: grid;
  gap: 3px;
}

.brand span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.page-shell {
  padding: 30px 0 48px;
}

.hero,
.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.hero-copy,
.hero-card,
.summary-card,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-card,
.panel {
  border-radius: var(--radius-xl);
}

.hero-copy {
  padding: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  line-height: 1.02;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  max-width: 12ch;
}

.hero-text {
  max-width: 60ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.day-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.day-metric {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
}

.day-metric strong {
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.15;
}

.day-metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.day-metric.income { border-color: rgba(49, 130, 91, 0.28); }
.day-metric.income strong { color: var(--income); }
.day-metric.expense { border-color: rgba(197, 75, 66, 0.28); }
.day-metric.expense strong { color: var(--expense); }
.day-metric.inventory { border-color: rgba(193, 123, 35, 0.3); }
.day-metric.inventory strong { color: var(--accent-strong); }
.day-metric.goal { border-color: rgba(57, 91, 136, 0.25); }

.day-attention {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.day-attention .eyebrow { margin-bottom: 0; }

.day-attention-list {
  display: grid;
  gap: 8px;
}

.day-attention-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.day-attention-item::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.day-attention-item.is-danger::before { background: var(--expense); }
.day-attention-item.is-warning::before { background: var(--accent); }
.day-attention-item.is-positive::before { background: var(--income); }

.sales-target-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.6fr);
  gap: 22px;
  margin: 18px 0;
  padding: 26px 30px;
  border: 1px solid rgba(193, 123, 35, 0.28);
  border-radius: var(--radius-xl);
  background: linear-gradient(115deg, rgba(250, 235, 207, 0.78), rgba(255, 255, 255, 0.58));
  box-shadow: var(--shadow);
}

.sales-target-heading {
  align-self: center;
}

.sales-target-heading .eyebrow {
  margin-bottom: 8px;
}

.sales-target-heading h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.sales-target-heading p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.sales-target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sales-target-grid article {
  display: grid;
  gap: 7px;
  min-height: 106px;
  padding: 15px;
  border: 1px solid rgba(133, 94, 45, 0.14);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.72);
}

.sales-target-grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.35;
}

.sales-target-grid strong {
  align-self: end;
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.38rem);
  line-height: 1.18;
}

.sales-target-grid .sales-target-daily {
  grid-column: span 2;
  background: var(--accent-strong);
}

.sales-target-grid .sales-target-daily span,
.sales-target-grid .sales-target-daily strong {
  color: #fffdf8;
}

.button,
.delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.button:hover,
.delete-button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #e8a152);
  color: #fffdf8;
  font-weight: 700;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.48);
  border-color: var(--line);
  color: var(--text);
}

.hero-card {
  padding: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.hero-card-top,
.entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.85rem;
  color: var(--muted);
}

.field input,
.field select {
  min-height: 50px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(70, 48, 27, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(201, 111, 45, 0.55);
  box-shadow: 0 0 0 4px rgba(201, 111, 45, 0.1);
}

.field-full {
  grid-column: 1 / -1;
}

.budget-progress {
  display: grid;
  gap: 12px;
}

.budget-progress-bar {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(70, 48, 27, 0.09);
}

.budget-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--balance), var(--accent));
  transition: width 220ms ease;
}

.budget-progress-copy {
  display: grid;
  gap: 4px;
}

.budget-progress-copy strong {
  font-family: "Sora", sans-serif;
}

.budget-progress-copy span {
  color: var(--muted);
  line-height: 1.6;
}

.summary-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.summary-card {
  padding: 22px;
  border-radius: var(--radius-lg);
}

.summary-card span,
.summary-card p {
  color: var(--muted);
}

.summary-card strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.summary-card p {
  margin: 0;
  line-height: 1.6;
}

.summary-card.income strong {
  color: var(--income);
}

.summary-card.expense strong {
  color: var(--expense);
}

.summary-card.balance strong {
  color: var(--balance);
}

.insights-dashboard {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 2.05fr);
  gap: 14px;
  margin-top: 18px;
}

.health-card,
.insight-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.health-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 10%, rgba(232, 161, 82, 0.3), transparent 35%),
    linear-gradient(150deg, #213e34, #2f624e);
  color: #f8f3e9;
}

.health-card .eyebrow,
.health-card p,
.health-card small {
  color: rgba(248, 243, 233, 0.76);
}

.health-card h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.35rem;
}

.health-card p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.health-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.health-score strong {
  font-family: "Sora", sans-serif;
  font-size: clamp(3rem, 6vw, 4.5rem);
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.health-score span {
  color: rgba(248, 243, 233, 0.7);
  font-weight: 700;
}

.health-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.health-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4c56e, #8ee1ad);
  transition: width 280ms ease;
}

.health-card small {
  line-height: 1.5;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.insight-card {
  min-height: 148px;
  padding: 18px;
  border-radius: 20px;
  background: var(--panel);
}

.insight-card span,
.insight-card p {
  color: var(--muted);
}

.insight-card span {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.insight-card strong {
  display: block;
  overflow: hidden;
  margin: 12px 0 8px;
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.insight-card.profit strong,
.insight-card.category strong {
  color: var(--income);
}

.insight-card.expense-category strong {
  color: var(--expense);
}

.insight-card.comparison strong,
.insight-card.forecast strong {
  color: var(--balance);
}

.insight-card.forecast {
  grid-column: 1 / -1;
  min-height: 0;
  background: linear-gradient(135deg, rgba(222, 232, 255, 0.78), var(--panel));
}

:root[data-theme="dark"] .insight-card.forecast {
  background: linear-gradient(135deg, rgba(63, 82, 130, 0.55), var(--panel));
}

.cashflow-panel {
  margin-top: 18px;
  overflow: hidden;
}

.cashflow-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.cashflow-heading h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.cashflow-heading > div > p:last-child {
  max-width: 62ch;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.cashflow-current {
  display: grid;
  flex-shrink: 0;
  gap: 4px;
  min-width: 160px;
  padding: 14px 16px;
  border: 1px solid rgba(60, 87, 181, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(222, 232, 255, 0.72), var(--panel));
}

.cashflow-current span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cashflow-current strong {
  color: var(--balance);
  font-family: "Sora", sans-serif;
  font-size: 1.1rem;
}

.cashflow-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  min-height: 230px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    repeating-linear-gradient(to top, transparent 0, transparent 49px, rgba(70, 48, 27, 0.07) 50px),
    rgba(255, 255, 255, 0.32);
}

.cashflow-period {
  display: grid;
  grid-template-rows: 148px auto auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.cashflow-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 7px;
  height: 148px;
}

.cashflow-bar {
  display: block;
  width: min(22px, 24%);
  min-height: 4px;
  border-radius: 8px 8px 3px 3px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.1);
  transition: height 280ms ease;
}

.cashflow-bar.is-income {
  background: linear-gradient(180deg, #76d9a6, var(--income));
}

.cashflow-bar.is-expenses {
  background: linear-gradient(180deg, #f59a8f, var(--expense));
}

.cashflow-bar.is-balance {
  background: linear-gradient(180deg, #9db1ff, var(--balance));
}

.cashflow-bar.is-balance.is-negative {
  background: linear-gradient(180deg, #f3ba7d, var(--expense));
}

.cashflow-period > strong {
  text-align: center;
  font-family: "Sora", sans-serif;
  font-size: 0.9rem;
}

.cashflow-period > p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cashflow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.cashflow-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cashflow-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.cashflow-income-dot {
  background: var(--income);
}

.cashflow-expense-dot {
  background: var(--expense);
}

.cashflow-balance-dot {
  background: var(--balance);
}

:root[data-theme="dark"] .cashflow-current {
  background: linear-gradient(135deg, rgba(63, 82, 130, 0.55), var(--panel));
}

:root[data-theme="dark"] .cashflow-chart {
  background:
    repeating-linear-gradient(to top, transparent 0, transparent 49px, rgba(255, 255, 255, 0.08) 50px),
    rgba(17, 29, 25, 0.45);
}

.sales-panel {
  margin-top: 18px;
}

.sales-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.sales-badge {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid rgba(31, 138, 92, 0.2);
  border-radius: 999px;
  background: rgba(31, 138, 92, 0.1);
  color: var(--income);
  font-size: 0.78rem;
  font-weight: 800;
}

.sales-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 20px;
}

.sales-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(31, 138, 92, 0.2);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(227, 241, 230, 0.78), var(--panel));
}

.sales-availability {
  margin: -2px 0 0;
  color: var(--income);
  font-size: 0.88rem;
  font-weight: 700;
}

.sales-history {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.36);
}

.sales-history h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.sales-history-list {
  display: grid;
  gap: 10px;
}

.sales-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.sales-history-item div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sales-history-item p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-history-item > strong {
  flex-shrink: 0;
  color: var(--income);
  font-family: "Sora", sans-serif;
}

.schedule-hint {
  margin: -2px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--balance);
  border-radius: 0 12px 12px 0;
  background: rgba(60, 87, 181, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.recurring-manager {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.recurring-manager h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.recurring-list {
  display: grid;
  gap: 10px;
}

.recurring-entry-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
}

.recurring-entry-item div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.recurring-entry-item p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-stop-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--expense);
}

:root[data-theme="dark"] .sales-form {
  background: linear-gradient(145deg, rgba(34, 92, 67, 0.34), var(--panel));
}

:root[data-theme="dark"] .sales-history {
  background: rgba(17, 29, 25, 0.45);
}

.content-grid,
.list-panel,
.management-grid {
  margin-top: 18px;
}

.panel {
  padding: 26px;
}

.panel-heading {
  margin-bottom: 20px;
}

.panel-heading-inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.compact-field {
  width: min(220px, 100%);
}

.category-summary,
.entries-list {
  display: grid;
  gap: 12px;
}

.category-row,
.entry-item,
.tips-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.54);
}

.category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.category-row div {
  display: grid;
  gap: 4px;
}

.category-row span,
.entry-meta,
.empty-state,
.tips-card p {
  color: var(--muted);
}

.tips-card {
  margin-top: 18px;
  padding: 18px;
}

.tips-card p {
  margin: 8px 0 0;
  line-height: 1.65;
}

.spreadsheet-tools {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(60, 87, 181, 0.18);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(231, 237, 255, 0.76), rgba(255, 253, 248, 0.72));
}

.spreadsheet-tools h3,
.inventory-history h3,
.business-manager h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.spreadsheet-tools > p:not(.entry-message) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.spreadsheet-tools .button {
  justify-self: start;
}

.ai-assistant {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(59, 108, 88, 0.2);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(227, 241, 230, 0.86), rgba(255, 253, 248, 0.8));
}

.ai-assistant-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-assistant h3 {
  margin: 4px 0 0;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.ai-badge {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--income);
  color: #fff;
  font-family: "Sora", sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
}

.ai-messages {
  display: grid;
  gap: 8px;
  max-height: 230px;
  margin: 16px 0 12px;
  overflow-y: auto;
}

.ai-message {
  width: fit-content;
  max-width: 94%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 13px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.ai-message.is-assistant {
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
}

.ai-message.is-user {
  justify-self: end;
  background: var(--income);
  color: #fff;
}

.ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ai-form input {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
}

.ai-submit {
  min-height: 0;
  padding: 0 14px;
}

.ai-disclaimer {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.entry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.entry-main,
.entry-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-main {
  min-width: 0;
}

.entry-main > div:last-child {
  min-width: 0;
}

.entry-title,
.entry-meta {
  overflow-wrap: anywhere;
}

.entry-badge {
  min-width: 82px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(60, 87, 181, 0.1);
  color: var(--balance);
  font-size: 0.82rem;
  font-weight: 700;
}

.entry-item[data-type="expense"] .entry-badge {
  background: rgba(197, 75, 66, 0.1);
  color: var(--expense);
}

.entry-meta {
  margin: 4px 0 0;
}

.entry-side {
  flex-shrink: 0;
}

.entry-value {
  font-family: "Sora", sans-serif;
}

.positive {
  color: var(--income);
}

.negative {
  color: var(--expense);
}

.delete-button {
  min-height: 38px;
  padding: 0 14px;
  border-color: rgba(197, 75, 66, 0.2);
  background: rgba(197, 75, 66, 0.08);
  color: var(--expense);
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(70, 48, 27, 0.18);
  border-radius: 20px;
  text-align: center;
  line-height: 1.7;
}

.page-shell > section[hidden],
#investimentos [hidden] {
  display: none !important;
}

.investment-page-top, .investment-jump-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.investment-page-top { margin-bottom: 28px; }
.investment-back, .investment-jump-nav a, .investment-sources a, .investment-option-card a {
  color: var(--text);
  text-underline-offset: 4px;
  font-size: .9rem;
}
.investments-heading h1 { font-family: "Sora", sans-serif; font-size: clamp(2rem, 4vw, 3.2rem); margin: 0 0 12px; letter-spacing: -.05em; }
.investment-jump-nav { justify-content: flex-start; padding: 22px 0; margin-bottom: 24px; border-block: 1px solid var(--line); }
.investment-jump-nav a { padding: 8px 14px; border-radius: 8px; text-decoration: none; background: var(--panel); }
.investment-jump-nav a:hover { box-shadow: inset 0 -2px var(--accent); }
.investment-section-title { margin-bottom: 22px; }
.investment-section-title h2 { margin: 6px 0 10px; font-size: clamp(1.35rem, 2vw, 1.8rem); }
.investment-section-title p:not(.eyebrow) { color: var(--muted); max-width: 75ch; line-height: 1.6; }
.investment-planner, .investment-options { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.investment-question-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; border: 0; padding: 0; margin: 0; min-width: 0; }
.investment-question-grid .field { min-width: 0; }
.investment-question-grid input, .investment-question-grid select, .investment-question-grid textarea { min-width: 0; max-width: 100%; font: inherit; font-size: 1rem; }
.investment-question-grid select { text-overflow: ellipsis; }
.investment-question-grid textarea { width: 100%; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; resize: vertical; }
.investment-question-grid small { font-size: .875rem; color: var(--muted); line-height: 1.5; }
.investment-question-grid :focus-visible, .investment-option-card a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.investment-intent { padding: 24px; background: var(--panel); border-left: 3px solid var(--accent); border-radius: 0 16px 16px 0; }
.investment-intent h3 { margin: 0 0 8px; font-size: 1.2rem; }
.investment-intent > p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.investment-analysis-summary { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; padding: 26px; border-radius: 16px; background: var(--text); color: var(--bg); margin: 20px 0; }
.investment-analysis-summary h3 { font-size: 1.55rem; margin: 12px 0; }
.investment-analysis-summary p { line-height: 1.65; margin: 0; }
.investment-analysis-summary .eyebrow { color: inherit; }
.investment-plan-amount { border-left: 1px solid currentColor; padding-left: 24px; align-self: center; font-size: 1.05rem; }
.investment-cautions { display: grid; gap: 10px; margin-bottom: 24px; }
.investment-cautions p { margin: 0; padding: 16px 20px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; line-height: 1.65; }
.investment-recommendation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.investment-option-card { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); min-width: 0; }
.investment-option-card h3 { font-family: "Sora", sans-serif; font-size: 1.2rem; line-height: 1.4; margin: 16px 0 12px; }
.investment-option-card p, .investment-option-card dd { font-size: 1rem; line-height: 1.65; color: var(--muted); }
.investment-option-card dt { font-size: .9rem; font-weight: 600; margin-top: 20px; }
.investment-option-card dd { margin: 6px 0 0; }
.investment-option-card a { display: inline-block; margin-top: 14px; }
.investment-preference-review { margin-top: 24px; padding: 24px; border: 1px solid var(--accent); border-radius: 16px; }
.investment-preference-review h3 { font-size: 1.3rem; margin: 10px 0; }
.investment-preference-review p, .investment-preference-review li { line-height: 1.65; }
.investment-preference-review li + li { margin-top: 10px; }
.investment-client-notes { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 2px solid var(--line); padding-left: 20px; line-height: 1.6; }
.investment-disclaimer { color: var(--muted); font-size: .875rem; line-height: 1.7; margin: 24px 0 0; }
.investment-sources { margin-top: 18px; font-size: .9rem; line-height: 1.65; }
.investment-sources summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.investment-sources div { display: flex; gap: 18px; flex-wrap: wrap; }
.investment-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.investment-profile-overview { display: grid; grid-template-columns: 1fr 1.5fr; gap: 28px; padding: 28px; margin: 20px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.investment-profile-label { border-right: 1px solid var(--line); padding-right: 24px; }
.investment-profile-label h3 { font-family: "Sora", sans-serif; font-size: 2rem; letter-spacing: -.04em; margin: 12px 0; }
.investment-profile-label p { font-size: .9rem; line-height: 1.65; color: var(--muted); margin-bottom: 0; }
.investment-profile-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 0; align-content: center; }
.investment-profile-summary dt { font-size: .875rem; color: var(--muted); margin-bottom: 6px; }
.investment-profile-summary dd { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.investment-risk-score { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin: 20px 0; }
.investment-risk-score > span { width: 14px; height: 9px; background: var(--line); border: 1px solid var(--muted); border-radius: 2px; }
.investment-risk-score > span.is-filled { background: var(--accent); border-color: var(--accent); }
.investment-risk-score small { flex-basis: 100%; margin-top: 6px; color: var(--muted); font-size: .875rem; }
.investment-option-card h4 { font-size: .95rem; margin: 16px 0 4px; }
.investment-option-card h4 + p { margin-top: 6px; }
.investment-option-card .investment-card-compare { display: block; margin-top: 20px; font-weight: 600; }
.investment-intent-facts { display: grid; grid-template-columns: minmax(120px, 1fr) 3fr; gap: 12px 24px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); line-height: 1.65; }
.investment-intent-facts dt { font-weight: 600; }
.investment-intent-facts dd { margin: 0; }
.investment-tools-section { min-width: 0; padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.investment-compare-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.investment-compare-controls .field { min-width: 0; }
.investment-compare-controls select { min-width: 0; max-width: 100%; text-overflow: ellipsis; font-size: 1rem; }
.investment-table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; margin-top: 18px; }
.investment-compare-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.investment-compare-table caption { text-align: left; padding: 18px; color: var(--muted); line-height: 1.5; }
.investment-compare-table th, .investment-compare-table td { padding: 20px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 230px; line-height: 1.65; }
.investment-compare-table th:first-child { min-width: 160px; }
.investment-compare-table thead th { background: var(--text); color: var(--bg); font-family: "Sora", sans-serif; font-size: 1rem; }
.investment-compare-table tbody th { font-size: .9rem; font-weight: 600; }
.investment-compare-table tbody tr:nth-child(2n) { background: var(--panel); }
.investment-compare-table .investment-comparison-caution { box-shadow: inset 0 3px var(--accent); }
.investment-simulation-rates { min-width: 0; margin: 26px 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.investment-simulation-rates legend { font-size: .95rem; font-weight: 600; padding: 0 8px; }
.investment-simulation-rates > p { margin: 0 0 20px; color: var(--muted); line-height: 1.65; }
.investment-use-profile { margin-top: 18px; }
.investment-scenario-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.investment-scenario-card { padding: 24px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 14px; background: var(--panel); min-width: 0; }
.investment-scenario-card p { line-height: 1.65; color: var(--muted); }
.investment-scenario-card .investment-scenario-amount { display: block; font-family: "Sora", sans-serif; font-size: clamp(1.3rem, 2.3vw, 2rem); letter-spacing: -.04em; overflow-wrap: anywhere; }
.investment-scenario-card dl { margin-top: 24px; line-height: 1.6; }
.investment-scenario-card dt { margin: 18px 0 4px; font-size: .875rem; color: var(--muted); }
.investment-scenario-card dd { margin: 0; font-weight: 500; }
.investment-scenario-card meter { width: 100%; height: 16px; margin-top: 14px; accent-color: var(--accent); }
.investment-scenario-card .investment-scenario-warning { border-top: 1px solid var(--line); padding-top: 16px; font-size: .875rem; }
#investmentSimulationTitle { margin: 30px 0 20px; font-size: 1.25rem; line-height: 1.5; }
@media (max-width: 1100px) {
  .investment-scenario-grid { grid-template-columns: 1fr; }
  .investment-profile-overview { grid-template-columns: 1fr; }
  .investment-profile-label { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 22px; }
}
@media (max-width: 760px) {
  .investment-compare-controls { grid-template-columns: 1fr; }
  .investment-profile-overview { padding: 18px; }
  .investment-profile-summary { grid-template-columns: 1fr; gap: 16px; }
  .investment-intent-facts { grid-template-columns: 1fr; gap: 8px; }
  .investment-intent-facts dd { margin-bottom: 12px; }
}
#investimentos { scroll-margin-top: 24px; }
#investimentos :is(#investmentProfile, #investmentOptions, #investmentPortfolio) { scroll-margin-top: 24px; }
#investimentos .entry-message.is-error { color: var(--expense); }
#investimentos button:disabled, #investmentProfileFields:disabled { opacity: .65; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .investment-question-grid, .investment-analysis-summary { grid-template-columns: minmax(0, 1fr); }
  .investment-intent, .investment-analysis-summary, .investment-option-card, .investment-preference-review { padding: 18px; }
  .investment-plan-amount { border-left: 0; border-top: 1px solid currentColor; padding: 18px 0 0; }
  .investment-jump-nav { gap: 8px; }
  .investment-jump-nav a { padding: 10px; }
  .investment-actions { justify-content: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  .investment-option-card { animation: investment-reveal .35s ease both; }
  .investment-option-card:nth-child(2) { animation-delay: .07s; }
  .investment-option-card:nth-child(3) { animation-delay: .14s; }
  @keyframes investment-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}

.investments-panel {
  margin-top: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(215, 164, 56, 0.17), transparent 24rem),
    linear-gradient(145deg, rgba(253, 249, 233, 0.9), rgba(255, 255, 255, 0.72));
}

.investments-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.investments-heading h2 {
  margin: 4px 0 8px;
  font-family: "Sora", sans-serif;
}

.investments-heading p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.investment-badge {
  flex-shrink: 0;
  padding: 8px 11px;
  border: 1px solid rgba(173, 119, 20, 0.24);
  border-radius: 999px;
  background: rgba(255, 244, 202, 0.72);
  color: #80570b;
  font-size: 0.76rem;
  font-weight: 700;
}

.investment-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.investment-kpis article {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(173, 119, 20, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
}

.investment-kpis span,
.investment-kpis small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.investment-kpis strong {
  display: block;
  margin: 7px 0 3px;
  overflow-wrap: anywhere;
  font-family: "Sora", sans-serif;
  font-size: 1.15rem;
}

.investment-kpis strong.is-negative {
  color: var(--expense);
}

.investment-kpis strong.is-positive {
  color: var(--income);
}

.investment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(173, 119, 20, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
}

.investment-form .button {
  min-height: 46px;
  white-space: nowrap;
}

.investment-message {
  grid-column: 1 / -1;
  margin: 0;
}

.investment-notice, .investment-context, .investment-methodology { margin: 24px 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); line-height: 1.65; }
.investment-notice { border-left: 3px solid var(--accent); }
.investment-notice h3, .investment-context h3, .investment-methodology h3 { margin: 0 0 12px; }
.investment-notice p:last-child, .investment-methodology p:last-child { margin-bottom: 0; }
.investment-attention-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-bottom: 0; }
.investment-attention-grid dt { font-weight: 600; }
.investment-attention-grid dd { color: var(--muted); margin: 6px 0 0; }
.investment-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.investment-card-actions .button { font-size: .9rem; white-space: normal; }
.investment-category-details { margin-top: 18px; border-top: 1px solid var(--line); }
.investment-mode-field, .investment-owner-filter { margin: 20px 0; max-width: 36rem; }
.investment-simulation-rates .investment-sources { margin: 0 0 20px; }
.investment-form .field { min-width: 0; }
.investment-form :is(input, select, textarea) { width: 100%; min-width: 0; max-width: 100%; font: inherit; }
.investment-form textarea { padding: 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--panel); resize: vertical; }
.investment-form small, .investment-owner-filter small, .investment-mode-field small { color: var(--muted); line-height: 1.5; }
.investment-record-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.investment-item > div { min-width: 0; overflow-wrap: anywhere; }
.investment-education-footer { padding: 28px 0 0; margin-top: 32px; border-top: 1px solid var(--line); line-height: 1.7; color: var(--muted); }
.investment-education-footer h3 { color: var(--text); }
.investment-education-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
#investimentos :is(a, button, select, input, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#investimentos :is(.investment-education-footer, .investment-disclaimer, .investment-compare-table) a { color: var(--text); text-underline-offset: 4px; }
@media (max-width: 1100px) { .investment-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .investment-attention-grid { grid-template-columns: 1fr; }
  .investment-notice, .investment-context, .investment-methodology { padding: 18px; }
  .investment-form .button { white-space: normal; }
}

.investments-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.investment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.investment-item > div {
  min-width: 0;
}

.investment-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: "Sora", sans-serif;
}

.investment-item p,
.investment-item small {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.investment-item-side {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: right;
}

.investment-item-side strong.is-negative {
  color: var(--expense);
}

.investment-item-side strong.is-positive {
  color: var(--income);
}

:root[data-theme="dark"] .investments-panel {
  background:
    radial-gradient(circle at 92% 8%, rgba(215, 164, 56, 0.15), transparent 24rem),
    linear-gradient(145deg, rgba(64, 51, 22, 0.42), var(--panel));
}

:root[data-theme="dark"] .investment-kpis article,
:root[data-theme="dark"] .investment-form,
:root[data-theme="dark"] .investment-item {
  background: rgba(24, 31, 27, 0.58);
}

.management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.management-panel:last-child {
  grid-column: 1 / -1;
}

.panel-description {
  margin: -8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.inventory-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.inventory-adjustment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.65fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(60, 87, 181, 0.18);
  border-radius: 20px;
  background: rgba(232, 238, 255, 0.48);
}

.inventory-adjustment.is-hidden {
  display: none;
}

.inventory-adjustment strong {
  font-family: "Sora", sans-serif;
}

.inventory-adjustment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-history,
.business-manager {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.section-heading-inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.inventory-history-list,
.business-list {
  display: grid;
  gap: 10px;
}

.inventory-history-item,
.business-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.inventory-history-item strong,
.business-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: "Sora", sans-serif;
  font-size: 0.9rem;
}

.inventory-history-item p,
.business-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.business-item.is-active {
  border-color: rgba(201, 111, 45, 0.34);
  background: rgba(201, 111, 45, 0.1);
}

.business-item .button {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 14px;
}

.business-manager .entry-form {
  margin-top: 18px;
}

.inventory-item,
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.54);
}

.inventory-item > div,
.danger-zone > div {
  min-width: 0;
}

.inventory-item strong,
.danger-zone strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: "Sora", sans-serif;
}

.inventory-item p,
.danger-zone p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.inventory-status {
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(31, 138, 92, 0.11);
  color: var(--income);
  font-size: 0.76rem;
  font-weight: 800;
}

.inventory-item.is-low .inventory-status {
  background: rgba(197, 75, 66, 0.11);
  color: var(--expense);
}

.inventory-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.inventory-replenish-button {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.online-spreadsheet-panel {
  margin-top: 26px;
  overflow: hidden;
}

.online-sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.online-sheet-heading h2,
.online-sheet-list-heading h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.online-sheet-heading p:not(.eyebrow) {
  max-width: 660px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.online-sheet-sync {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(31, 138, 92, 0.1);
  color: var(--income);
  font-size: 0.8rem;
  font-weight: 800;
}

.online-sheet-sync span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(31, 138, 92, 0.13);
}

.online-sheet-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.online-sheet-kpis article {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(246, 238, 226, 0.48));
}

.online-sheet-kpis span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.online-sheet-kpis strong {
  font-family: "Sora", sans-serif;
  font-size: 1.08rem;
}

.online-sheet-form {
  display: grid;
  grid-template-columns: 132px minmax(190px, 1.5fr) 150px 130px minmax(210px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid rgba(201, 111, 45, 0.2);
  border-radius: 22px;
  background: rgba(201, 111, 45, 0.055);
}

.online-sheet-form .field {
  gap: 6px;
}

.online-sheet-form .field span {
  font-size: 0.76rem;
}

.online-sheet-add {
  min-height: 46px;
  padding: 0 15px;
  white-space: nowrap;
}

.online-sheet-message {
  grid-column: 1 / -1;
  margin: 0;
}

.online-sheet-list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 14px;
}

.online-sheet-list-heading .eyebrow {
  margin-bottom: 4px;
}

.online-sheet-filter {
  width: min(180px, 100%);
}

.online-sheet-table {
  display: grid;
  gap: 9px;
}

.online-sheet-table-header,
.online-sheet-row {
  display: grid;
  grid-template-columns: 112px minmax(150px, 1.25fr) 126px 120px minmax(170px, 1.5fr) 122px auto;
  gap: 9px;
  align-items: center;
}

.online-sheet-table-header {
  padding: 0 12px 7px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.online-sheet-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
}

.online-sheet-row.is-complete {
  opacity: 0.72;
  background: rgba(31, 138, 92, 0.045);
}

.online-sheet-row input,
.online-sheet-row select {
  min-width: 0;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
}

.online-sheet-row input:focus,
.online-sheet-row select:focus {
  border-color: rgba(201, 111, 45, 0.5);
  outline: none;
  background: white;
}

.online-sheet-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.online-sheet-row-actions .button {
  min-height: 36px;
  padding: 0 11px;
  font-size: 0.78rem;
}

.online-sheet-delete {
  border: 0;
  background: transparent;
  color: var(--expense);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.profile-form {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(246, 238, 226, 0.5));
}

.profile-form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.profile-form-heading .eyebrow {
  margin-bottom: 4px;
}

.profile-form-heading h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.05rem;
}

.profile-form-heading p:last-child {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.profile-avatar-area {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar {
  display: grid;
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  overflow: hidden;
  place-items: center;
  border: 3px solid rgba(201, 111, 45, 0.22);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 12px 24px rgba(112, 69, 31, 0.16);
  font-family: "Sora", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-photo-button {
  min-height: 38px;
  cursor: pointer;
}

.profile-avatar-actions small {
  width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
}

.text-button {
  min-height: 38px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.toggle-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.toggle-field span {
  display: grid;
  gap: 4px;
}

.toggle-field strong {
  font-family: "Sora", sans-serif;
  font-size: 0.9rem;
}

.toggle-field small {
  color: var(--muted);
  line-height: 1.45;
}

.danger-zone {
  margin-top: 24px;
  border-color: rgba(197, 75, 66, 0.2);
}

.danger-zone .button-secondary {
  flex-shrink: 0;
  border-color: rgba(197, 75, 66, 0.2);
  color: var(--expense);
}

@media (max-width: 1040px) {
  .hero,
  .content-grid,
  .summary-grid,
  .insights-dashboard,
  .management-grid,
  .sales-target-card {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-layout {
    grid-template-columns: 1fr;
  }

  .cashflow-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .investment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .investment-name-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .online-sheet-heading,
  .online-sheet-list-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .online-sheet-kpis {
    grid-template-columns: 1fr;
  }

  .investment-kpis,
  .investment-form {
    grid-template-columns: 1fr;
  }

  .investments-heading,
  .investment-item,
  .investment-item-side {
    align-items: flex-start;
    flex-direction: column;
  }

  .investment-badge,
  .investment-item-side,
  .investment-item-side .delete-button {
    width: 100%;
  }

  .investment-item-side {
    gap: 6px;
    text-align: left;
  }

  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-target-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .online-sheet-form {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sales-form {
    grid-template-columns: 1fr;
  }

  .cashflow-chart {
    gap: 8px;
    min-height: 206px;
    padding: 12px 8px;
  }

  .cashflow-period {
    grid-template-rows: 130px auto auto;
  }

  .cashflow-bars {
    gap: 4px;
    height: 130px;
  }

  .cashflow-bar {
    width: min(18px, 28%);
  }

  .cashflow-period > p {
    font-size: 0.68rem;
  }

  .recurring-entry-item {
    grid-template-columns: 1fr auto;
  }

  .recurring-entry-item > strong {
    grid-column: 1;
  }

  .recurring-stop-button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .online-sheet-add,
  .online-sheet-filter {
    width: 100%;
  }

  .online-sheet-table-header {
    display: none;
  }

  .online-sheet-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .online-sheet-row input:nth-child(2),
  .online-sheet-row input:nth-child(5),
  .online-sheet-row-actions {
    grid-column: 1 / -1;
  }

  .profile-form {
    padding: 18px;
  }

  .profile-form-heading {
    display: grid;
    gap: 8px;
  }

  .profile-form-heading p:last-child {
    max-width: none;
  }

  .profile-fields {
    grid-template-columns: 1fr;
  }

  .login-screen {
    display: block;
    padding: 16px;
  }

  .site-header {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 28px;
  }

  .nav-links {
    justify-content: center;
  }

  .hero-copy,
  .hero-card,
  .panel,
  .summary-card {
    padding: 22px;
  }

  .hero-card-top,
  .entry-form,
  .summary-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .day-summary-grid {
    grid-template-columns: 1fr;
  }

  .sales-target-grid {
    grid-template-columns: 1fr;
  }

  .sales-target-grid .sales-target-daily {
    grid-column: auto;
  }

  .ai-form {
    grid-template-columns: 1fr;
  }

  .panel-heading-inline,
  .sales-heading,
  .entry-item,
  .entry-side {
    align-items: start;
    flex-direction: column;
  }

  .compact-field {
    width: 100%;
  }

  .management-panel:last-child {
    grid-column: auto;
  }

  .inventory-item,
  .danger-zone {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-adjustment {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .inventory-history-item,
  .business-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-adjustment-actions,
  .business-item .button {
    width: 100%;
  }

  .inventory-adjustment-actions .button {
    flex: 1;
  }

  .inventory-actions {
    width: 100%;
    justify-content: space-between;
  }

  .inventory-actions .button,
  .inventory-actions .delete-button {
    flex: 1;
  }

  .danger-zone .button-secondary {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 14vw, 4.2rem);
  }

  .login-card {
    padding: 28px 22px;
  }
}

@media (max-width: 480px) {
  .login-screen {
    padding:
      max(16px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }

  .login-card {
    border-radius: 26px;
  }

  .field input,
  .field select,
  .ai-form input {
    font-size: 16px;
  }

  .button {
    min-height: 50px;
  }

  .app-main .site-header {
    margin-right: 14px;
    margin-left: 14px;
  }

  .app-main .page-shell {
    width: calc(100% - 28px);
  }
}

@media (max-width: 360px) {
  .login-card,
  .hero-copy,
  .hero-card,
  .panel,
  .summary-card {
    padding: 18px;
  }

  .login-card h1 {
    font-size: 2rem;
  }

  .hero-actions .button,
  .spreadsheet-tools .button,
  .inventory-adjustment-actions .button {
    width: 100%;
  }
}


/* Sidebar e layout principal */
.app-content.is-visible {
  min-height: 100vh;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex: 0 0 268px;
  flex-direction: column;
  gap: 30px;
  min-height: 100vh;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.84);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
}

.sidebar-brand .brand-badge {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 15px;
}

.sidebar-brand div {
  display: grid;
  gap: 3px;
}

.sidebar-brand strong {
  font-family: "Sora", sans-serif;
  font-size: 0.98rem;
}

.sidebar-brand span:last-child {
  color: var(--muted);
  font-size: 0.8rem;
}

.sidebar-nav {
  display: grid;
  gap: 7px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: var(--muted);
  font-weight: 600;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  transform: translateX(3px);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
}

.sidebar-link.is-active {
  border-color: rgba(201, 111, 45, 0.2);
  background: linear-gradient(135deg, rgba(201, 111, 45, 0.16), rgba(233, 170, 85, 0.18));
  color: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(201, 111, 45, 0.1);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  font-size: 1.15rem;
  line-height: 1;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.sidebar-status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--income);
  box-shadow: 0 0 0 4px rgba(31, 138, 92, 0.1);
}

.sidebar-overlay {
  display: none;
}

.app-main {
  min-width: 0;
  flex: 1;
}

.app-main .site-header {
  width: auto;
  margin: 18px 28px 0;
  border-radius: 26px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-copy {
  display: grid;
  gap: 2px;
}

.header-copy .eyebrow {
  margin-bottom: 0;
}

.header-copy strong {
  font-family: "Sora", sans-serif;
  font-size: 0.96rem;
}

.header-status {
  color: var(--muted);
  font-size: 0.86rem;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  border-radius: 999px;
  background: var(--text);
}

.app-main .page-shell {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
}

@media (max-width: 900px) {
  .sidebar {
    flex-basis: 228px;
  }

  .app-main .site-header {
    margin-right: 18px;
    margin-left: 18px;
  }

  .app-main .page-shell {
    width: min(100% - 36px, 1180px);
  }
}

@media (max-width: 760px) {
  .app-layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 292px);
    min-height: 100vh;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: 20px 0 50px rgba(67, 42, 18, 0.16);
  }

  .app-layout.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 4;
    background: rgba(38, 25, 15, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .app-layout.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .app-main .site-header {
    margin-top: 14px;
    border-radius: 22px;
  }

  .menu-toggle {
    display: block;
  }

  .header-status {
    display: none;
  }

  .app-main .page-shell {
    width: calc(100% - 28px);
  }
}


.sidebar-notice {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(201, 111, 45, 0.22);
  border-radius: 13px;
  background: rgba(201, 111, 45, 0.08);
  color: var(--accent-strong);
  font-size: 0.75rem;
  line-height: 1.45;
}

.sidebar-notice.is-visible {
  display: block;
}


/* Ícones SVG e sidebar recolhível */
.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.sidebar-collapse:hover,
.sidebar-collapse:focus-visible {
  background: rgba(201, 111, 45, 0.1);
  color: var(--accent-strong);
}

.sidebar-collapse:active {
  transform: scale(0.97);
}

.collapse-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 180ms ease;
}

.nav-icon {
  width: 21px;
  height: 21px;
  min-width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-link > span:last-child,
.sidebar-brand > div,
.collapse-label,
.sidebar-footer > span:last-child {
  overflow: hidden;
  opacity: 1;
  transition: opacity 150ms ease;
}

.sidebar-link {
  white-space: nowrap;
}

.app-layout.sidebar-collapsed .sidebar {
  flex-basis: 86px;
  width: 86px;
  padding-right: 12px;
  padding-left: 12px;
}

.app-layout.sidebar-collapsed .sidebar-top {
  display: block;
}

.app-layout.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

.app-layout.sidebar-collapsed .sidebar-brand > div,
.app-layout.sidebar-collapsed .sidebar-link > span:last-child,
.app-layout.sidebar-collapsed .sidebar-footer > span:last-child,
.app-layout.sidebar-collapsed .sidebar-notice,
.app-layout.sidebar-collapsed .collapse-label {
  display: none;
}

.app-layout.sidebar-collapsed .sidebar-collapse {
  width: 100%;
  margin-top: 18px;
  padding: 0;
}

.app-layout.sidebar-collapsed .collapse-icon {
  transform: rotate(180deg);
}

.app-layout.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
}

.app-layout.sidebar-collapsed .sidebar-footer {
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
  border-top-color: transparent;
}

@media (max-width: 760px) {
  .sidebar-collapse {
    display: none;
  }

  .app-layout.sidebar-collapsed .sidebar {
    width: min(82vw, 292px);
    flex-basis: auto;
    padding-right: 18px;
    padding-left: 18px;
  }

  .app-layout.sidebar-collapsed .sidebar-top {
    display: flex;
  }

  .app-layout.sidebar-collapsed .sidebar-brand {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .app-layout.sidebar-collapsed .sidebar-brand > div,
  .app-layout.sidebar-collapsed .sidebar-link > span:last-child,
  .app-layout.sidebar-collapsed .sidebar-footer > span:last-child {
    display: block;
  }

  .app-layout.sidebar-collapsed .sidebar-link {
    justify-content: flex-start;
    padding-right: 14px;
    padding-left: 14px;
  }

  .app-layout.sidebar-collapsed .sidebar-footer {
    justify-content: flex-start;
    padding-right: 10px;
    padding-left: 10px;
    border-top-color: var(--line);
  }
}
