:root {
  --wine: #5c1e1b;
  --wine-dark: #401411;
  --red: #b00c06;
  --red-dark: #920b06;
  --red-soft: #fff2f1;
  --red-pale: #fff8f7;
  --green: #168361;
  --green-soft: #edf8f4;
  --amber: #9b6b12;
  --amber-soft: #fff7e5;
  --ink: #292626;
  --muted: #716c6b;
  --subtle: #9a9492;
  --line: #eae5e3;
  --line-strong: #ded6d3;
  --surface: #ffffff;
  --canvas: #f7f6f5;
  --shadow: 0 8px 30px rgba(61, 35, 32, 0.055);
  --shadow-hover: 0 12px 36px rgba(61, 35, 32, 0.085);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}
html {
  font-size: 16px;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Nunito", "Montserrat", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(176, 12, 6, 0.16);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: 244px;
  padding: 24px 16px 18px;
  color: #fff;
  background: var(--wine);
  box-shadow: 6px 0 24px rgba(64, 20, 17, 0.08);
}
.brand,
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  padding: 0 8px 23px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--red);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(39, 8, 6, 0.15);
  font-size: 21px;
  font-weight: 900;
}
.brand b,
.auth-brand b {
  display: block;
  letter-spacing: 0.045em;
  font-size: 14px;
  font-weight: 800;
}
.brand b {
  color: #fff;
}
.brand span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}
.auth-brand b {
  color: var(--wine);
}
.auth-brand span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}
.nav-label {
  margin: 24px 12px 9px;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.13em;
  font-size: 10px;
  font-weight: 800;
}
.menu-close {
  display: none;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.72);
  border-radius: 13px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}
.sidebar nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}
.sidebar nav a.active {
  color: var(--wine);
  background: #fff;
  box-shadow: 0 8px 22px rgba(36, 8, 6, 0.16);
}
.icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  font-size: 17px;
  font-weight: 800;
}
.sidebar nav a.active .icon {
  color: var(--red);
  background: var(--red-soft);
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 17px 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.sidebar-foot > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--wine);
  background: #fff;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
}
.sidebar-foot b,
.sidebar-foot span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-foot b {
  font-size: 11px;
}
.sidebar-foot span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
}
.sidebar-foot > a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 18px;
}

.main {
  max-width: 1640px;
  margin-left: 244px;
  padding: 0 32px 48px;
}
.main > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  gap: 20px;
}
.main header p,
.modal-head p,
.report-hero p,
.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 900;
}
.main header h1 {
  margin: 0;
  letter-spacing: -0.025em;
  font-size: 25px;
  font-weight: 800;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.month-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 13px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 3px 12px rgba(61, 35, 32, 0.03);
  font-size: 11px;
  font-weight: 700;
}
.month-picker input {
  max-width: 124px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
  font-weight: 800;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  color: #fff;
  background: var(--red);
  box-shadow: 0 8px 20px rgba(176, 12, 6, 0.16);
}
.btn.primary:hover {
  background: var(--red-dark);
  box-shadow: 0 10px 24px rgba(176, 12, 6, 0.22);
}
.btn.secondary {
  color: var(--red);
  background: #fff;
  border: 1px solid #e7c9c7;
}
.btn.danger {
  color: #fff;
  background: var(--wine);
}
.btn.ghost {
  color: #5f5958;
  background: #f2efee;
}
.btn.small {
  min-height: 36px;
  padding: 0 13px;
  font-size: 11px;
}
.btn.full {
  width: 100%;
}
.mobile-menu {
  display: none;
}

.welcome-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 126px;
  margin-bottom: 14px;
  padding: 24px 27px;
  overflow: hidden;
  background: linear-gradient(115deg, #fff 0%, var(--red-pale) 100%);
  border: 1px solid #f0dddb;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.welcome-banner::after {
  position: absolute;
  top: -55px;
  right: -35px;
  width: 160px;
  height: 160px;
  content: "";
  background: rgba(176, 12, 6, 0.035);
  border-radius: 50%;
}
.welcome-copy {
  position: relative;
  z-index: 2;
  max-width: 720px;
}
.welcome-kicker {
  color: var(--red);
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 900;
}
.welcome-copy h2 {
  max-width: 660px;
  margin: 7px 0 5px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 800;
}
.welcome-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.welcome-visual {
  position: relative;
  z-index: 2;
  flex: 0 0 100px;
  height: 82px;
}
.welcome-visual i {
  position: absolute;
  right: 4px;
  bottom: 5px;
  width: 74px;
  height: 74px;
  background: var(--red-soft);
  border: 1px solid #f3cfcc;
  border-radius: 24px;
  transform: rotate(7deg);
}
.bubble {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  color: var(--red);
  background: #fff;
  border: 1px solid #f0d4d1;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(92, 30, 27, 0.08);
  font-weight: 900;
}
.bubble-a {
  top: 5px;
  right: 24px;
  width: 48px;
  height: 48px;
  font-size: 14px;
}
.bubble-b {
  right: 0;
  bottom: 3px;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  font-size: 12px;
}
.bubble-c {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metric,
.card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.metric {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  transition: box-shadow 0.18s ease;
}
.metric:hover,
.card:hover {
  box-shadow: var(--shadow-hover);
}
.metric-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 900;
}
.metric-icon.green {
  color: var(--green);
  background: var(--green-soft);
}
.metric-icon.red {
  color: var(--red);
  background: var(--red-soft);
}
.metric > div:last-child {
  min-width: 0;
}
.metric span,
.metric b,
.metric small {
  display: block;
}
.metric span {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.metric b {
  overflow: hidden;
  letter-spacing: -0.03em;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 20px;
  font-weight: 900;
}
.metric small {
  margin-top: 5px;
  color: var(--subtle);
  font-size: 10px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.55fr 0.8fr;
  gap: 12px;
  margin-top: 12px;
}
.two-col.lower {
  grid-template-columns: 0.8fr 1.55fr;
}
.card {
  padding: 20px;
  border-radius: var(--radius-lg);
  transition: box-shadow 0.18s ease;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card h2 {
  margin: 0;
  letter-spacing: -0.01em;
  font-size: 16px;
  font-weight: 900;
}
.card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.legend {
  color: var(--muted);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
}
.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 3px 0 7px;
  border-radius: 50%;
}
.green-dot {
  background: var(--green);
}
.red-dot {
  background: var(--red);
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 218px;
  margin-top: 6px;
  padding: 27px 8px 0;
  background-image: linear-gradient(
    to bottom,
    transparent 32%,
    #f1eeee 33%,
    transparent 34%,
    transparent 65%,
    #f1eeee 66%,
    transparent 67%
  );
  border-bottom: 1px solid var(--line);
}
.bar-group {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 18px;
  height: 100%;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 160px;
}
.bars i {
  width: 10px;
  border-radius: 7px 7px 2px 2px;
}
.bars .income {
  background: var(--green);
}
.bars .expense {
  background: var(--red);
}
.bar-group span {
  margin: 7px 0 -18px;
  color: var(--subtle);
  white-space: nowrap;
  font-size: 9px;
}
.forecast {
  margin-top: 16px;
}
.forecast > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.forecast b {
  font-size: 14px;
  font-weight: 900;
}
.forecast-total {
  margin-top: 4px;
  border-bottom: 0 !important;
}
.forecast-total b {
  font-size: 17px;
}
.green-text,
.amount.in {
  color: var(--green);
}
.red-text,
.amount.out {
  color: var(--red);
}
.categories {
  margin-top: 14px;
}
.categories > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  margin-top: 13px;
  font-size: 11px;
}
.categories b {
  font-size: 11px;
  font-weight: 900;
}
.categories > div > div {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  background: #f0edec;
  border-radius: 999px;
}
.categories i {
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: 999px;
}
.categories i.expense-bar {
  background: var(--wine);
}
.text-btn {
  color: var(--red);
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
}

.tx-list {
  margin-top: 12px;
}
.tx {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 0;
  border-top: 1px solid #f0edec;
}
.tx form {
  margin: 0;
}
.tx-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-weight: 900;
}
.tx-icon.in,
.type-icon.in {
  color: var(--green);
  background: var(--green-soft);
}
.tx-icon.out,
.type-icon.out {
  color: var(--red);
  background: var(--red-soft);
}
.tx-main {
  min-width: 0;
  flex: 1;
}
.tx-main b,
.tx-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-main b {
  font-size: 12px;
  font-weight: 800;
}
.tx-main span {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
}
.amount {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}
.status {
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 900;
}
.status.paid {
  color: var(--green);
  background: var(--green-soft);
}
.status.pending {
  color: var(--amber);
  background: var(--amber-soft);
}
.delete,
.edit {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  color: #9c9694;
  background: #f7f4f3;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
}
.delete:hover,
.edit:hover {
  color: var(--red);
  background: var(--red-soft);
}
.tx-method {
  min-width: 88px;
  color: var(--muted);
  font-size: 10px;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 185px;
  color: var(--subtle);
  text-align: center;
}
.empty div {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 15px;
  font-size: 21px;
}
.empty b {
  margin-top: 10px;
  color: #696261;
  font-size: 12px;
}
.empty span {
  margin-top: 4px;
  font-size: 10px;
}
.empty.compact {
  height: 135px;
}
.table-page {
  min-height: 520px;
}
.balance-chip {
  padding: 9px 13px;
  color: var(--wine);
  background: var(--red-soft);
  border-radius: 11px;
  font-size: 11px;
}
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.accounts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.report-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: 27px 30px;
  color: var(--ink);
  background: linear-gradient(110deg, #fff, var(--red-pale));
  border: 1px solid #f0dddb;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.report-hero p {
  color: var(--red);
}
.report-hero h2 {
  margin: 4px 0;
  color: var(--wine);
  letter-spacing: -0.035em;
  font-size: 31px;
  font-weight: 900;
}
.report-hero span {
  color: var(--muted);
  font-size: 11px;
}
.report-pair {
  display: flex;
  gap: 38px;
}
.report-pair span,
.report-pair b {
  display: block;
}
.report-pair b {
  margin-top: 6px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}
.dre {
  margin-top: 15px;
}
.dre div {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.dre div:last-child {
  border-bottom: 0;
  font-size: 14px;
  font-weight: 900;
}

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-wrap[hidden] {
  display: none;
}
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(44, 28, 26, 0.46);
  border: 0;
  backdrop-filter: blur(4px);
}
.modal-wrap > .backdrop {
  z-index: -1;
}
.modal {
  width: min(680px, 100%);
  max-height: 94vh;
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: 0 28px 90px rgba(38, 20, 18, 0.24);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 25px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.type-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  font-weight: 900;
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}
.modal-head button {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--muted);
  background: #f5f2f1;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-size: 21px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 22px 25px;
}
.form-grid label,
.login-form label {
  color: #4f4948;
  font-size: 12px;
  font-weight: 800;
}
.form-grid .wide {
  grid-column: 1 / -1;
}
.form-grid input,
.form-grid select,
.form-grid textarea,
.login-form input,
.import-content textarea {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 7px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfaf9;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.15s ease,
    border 0.15s ease,
    box-shadow 0.15s ease;
}
.form-grid input:hover,
.form-grid select:hover,
.form-grid textarea:hover,
.login-form input:hover {
  background: #fff;
  border-color: #cfc5c2;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.login-form input:focus,
.import-content textarea:focus {
  background: #fff;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(176, 12, 6, 0.075);
}
.form-grid textarea {
  height: 78px;
  padding-top: 12px;
  resize: vertical;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 25px 20px;
  border-top: 1px solid var(--line);
}
.import-content {
  padding: 22px 25px;
}
.import-content p {
  color: #5c5554;
  font-size: 13px;
}
.import-content code {
  display: block;
  padding: 13px;
  color: var(--wine);
  background: var(--red-soft);
  border-radius: 12px;
  font-size: 11px;
}
.import-content .example {
  color: var(--muted);
  font-size: 11px;
}
.import-content textarea {
  height: 185px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}
.import-content small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}
.alert {
  margin: 15px 0;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}
.alert.success {
  color: #12684d;
  background: var(--green-soft);
}
.alert.error {
  color: #8d1713;
  background: var(--red-soft);
}
.alert.floating {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  max-width: 370px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  box-shadow: 0 10px 35px rgba(34, 34, 34, 0.12);
}
.alert.floating.error {
  border-left-color: var(--red);
}

.auth-body {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
  overflow: hidden;
  background: #f7f5f4;
}
.auth-body::before {
  position: fixed;
  top: -180px;
  right: -150px;
  width: 430px;
  height: 430px;
  content: "";
  background: var(--red-soft);
  border-radius: 50%;
}
.auth-bubble {
  position: fixed;
  border-radius: 50%;
  background: var(--wine);
  opacity: 0.035;
}
.auth-bubble-one {
  top: -110px;
  right: -70px;
  width: 330px;
  height: 330px;
}
.auth-bubble-two {
  bottom: -150px;
  left: -90px;
  width: 390px;
  height: 390px;
}
.login-card,
.install-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(63, 39, 35, 0.105);
}
.install-card {
  width: min(780px, 100%);
}
.auth-brand {
  margin-bottom: 30px;
}
.login-card h1,
.install-card h1 {
  margin: 6px 0 8px;
  letter-spacing: -0.03em;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 900;
}
.auth-intro {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}
.login-form {
  display: grid;
  gap: 17px;
}
.login-form input {
  height: 50px;
  border-radius: 13px;
  font-size: 13px;
}
.login-form .btn {
  margin-top: 5px;
}
.install-form fieldset {
  margin: 16px 0;
  padding: 4px 2px 2px;
  border: 1px solid var(--line);
  border-radius: 17px;
}
.install-form legend {
  margin-left: 13px;
  padding: 0 8px;
  color: var(--wine);
  font-size: 12px;
  font-weight: 900;
}
.install-form .form-grid {
  padding: 17px;
}
.menu-backdrop {
  display: none;
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .two-col,
  .two-col.lower {
    grid-template-columns: 1fr;
  }
  .header-actions .secondary {
    display: none;
  }
}

@media (max-width: 780px) {
  .sidebar {
    width: min(282px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar .menu-close {
    display: block;
    margin-left: auto;
    color: #fff;
    background: none;
    border: 0;
    font-size: 24px;
  }
  .menu-backdrop.open {
    display: block;
  }
  .main {
    margin-left: 0;
    padding: 0 14px 34px;
  }
  .main > header {
    flex-wrap: wrap;
    min-height: 84px;
    padding: 14px 0;
    gap: 11px;
  }
  .mobile-menu {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--wine);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .page-heading {
    margin-right: auto;
  }
  .main header h1 {
    font-size: 20px;
  }
  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .month-picker {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
  .header-actions .secondary {
    display: flex;
  }
  .welcome-banner {
    min-height: 142px;
    padding: 21px;
    border-radius: 20px;
  }
  .welcome-copy {
    max-width: calc(100% - 75px);
  }
  .welcome-copy h2 {
    font-size: 19px;
  }
  .welcome-copy p {
    font-size: 11px;
  }
  .welcome-visual {
    position: absolute;
    right: 10px;
    transform: scale(0.78);
  }
  .summary-grid {
    gap: 10px;
  }
  .metric {
    padding: 15px;
  }
  .metric b {
    font-size: 18px;
  }
  .two-col {
    margin-top: 10px;
  }
  .card {
    padding: 16px;
  }
  .accounts-grid {
    grid-template-columns: 1fr;
  }
  .legend {
    display: none;
  }
  .report-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    padding: 23px;
  }
  .report-pair {
    width: 100%;
    justify-content: space-between;
  }
  .tx-method {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  .modal {
    border-radius: 20px;
  }
  .modal-head {
    padding: 19px 20px 16px;
  }
  .modal-actions {
    padding: 14px 20px 18px;
  }
  .modal-actions .btn {
    flex: 1;
  }
  .bar-chart {
    overflow-x: auto;
  }
  .bar-group {
    min-width: 28px;
  }
  .inline-actions {
    align-items: flex-end;
    flex-direction: column;
  }
  .install-card {
    padding: 24px;
  }
  .install-form .form-grid {
    padding: 14px;
  }
  .alert.floating {
    top: 12px;
    right: 14px;
    left: 14px;
  }
}

@media (max-width: 500px) {
  .welcome-banner {
    min-height: 150px;
  }
  .welcome-copy {
    max-width: calc(100% - 40px);
  }
  .welcome-copy p {
    max-width: 255px;
  }
  .welcome-visual {
    right: -31px;
    opacity: 0.7;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .metric {
    align-items: center;
  }
  .metric small {
    display: block;
  }
  .tx {
    gap: 7px;
  }
  .tx-icon {
    width: 30px;
    height: 30px;
  }
  .amount {
    font-size: 11px;
  }
  .status {
    width: 27px;
    height: 27px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }
  .status::before {
    content: "•";
    font-size: 15px;
  }
  .delete {
    display: none;
  }
  .login-card {
    padding: 26px 23px;
  }
  .card-head {
    flex-wrap: wrap;
  }
  .tx-main span {
    max-width: 150px;
  }
  .page-heading p {
    display: none;
  }
}

/* v8 — configurações e temas */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.theme-toggle [data-theme-icon] { font-size: 17px; line-height: 1; }
.auth-theme-toggle { position: fixed; z-index: 5; top: 20px; right: 20px; }

.settings-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 24px 26px;
  color: var(--ink);
  background: linear-gradient(120deg, var(--surface) 0%, var(--surface) 62%, var(--red-pale) 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.settings-intro > div:first-child > span {
  display: block;
  margin-bottom: 5px;
  color: var(--red);
  letter-spacing: .11em;
  font-size: 10px;
  font-weight: 900;
}
.settings-intro h2 { margin: 0; letter-spacing: -.02em; font-size: 21px; }
.settings-intro p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.settings-theme-card {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 3px 12px;
  min-width: 210px;
  padding: 13px 14px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.settings-theme-card > span { color: var(--subtle); font-size: 10px; font-weight: 800; }
.settings-theme-card > b { font-size: 13px; }
.settings-theme-card .btn { grid-row: 1 / span 2; grid-column: 2; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.settings-card { margin: 0; min-width: 0; padding: 0; overflow: hidden; }
.settings-head { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.settings-title { display: flex; align-items: center; gap: 11px; }
.settings-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
}
.settings-icon.in { color: var(--green); background: var(--green-soft); }
.settings-icon.out { color: var(--red); background: var(--red-soft); }
.settings-icon.pay { color: var(--wine); background: var(--red-pale); }
.option-list { display: grid; max-height: 430px; overflow: auto; }
.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 9px 13px 9px 18px;
  border-bottom: 1px solid var(--line);
}
.option-row.inactive { opacity: .58; }
.option-edit-form { display: flex; align-items: center; min-width: 0; gap: 6px; }
.option-edit-form input,
.option-add-form input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
}
.option-edit-form input:hover { background: var(--canvas); border-color: var(--line); }
.option-edit-form input:focus,
.option-add-form input:focus { background: var(--surface); border-color: var(--red); outline: 0; box-shadow: 0 0 0 3px rgba(176,12,6,.08); }
.option-save {
  min-height: 32px;
  padding: 0 9px;
  color: var(--red);
  background: var(--red-soft);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}
.option-save:disabled { display: none; }
.option-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 64px;
  padding: 0;
  color: var(--subtle);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}
.option-toggle i { position: relative; width: 27px; height: 16px; background: var(--line-strong); border-radius: 999px; }
.option-toggle i::after { position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; content: ""; background: #fff; border-radius: 50%; transition: transform .18s ease; }
.option-toggle.active { color: var(--green); }
.option-toggle.active i { background: var(--green); }
.option-toggle.active i::after { transform: translateX(11px); }
.option-add-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 14px 16px 16px; background: var(--canvas); }
.option-add-form input { height: 36px; background: var(--surface); border-color: var(--line); font-size: 12px; }

html[data-theme="dark"] {
  color-scheme: dark;
  background: #171516 !important;
  --canvas: #171516;
  --surface: #211e1f;
  --ink: #f4eff0;
  --muted: #b9b0b2;
  --subtle: #91888a;
  --line: #383235;
  --line-strong: #4c4447;
  --red-soft: #3a1e1e;
  --red-pale: #2b1b1c;
  --green-soft: #18372e;
  --amber-soft: #3b301c;
  --shadow: 0 7px 24px rgba(0,0,0,.18);
  --shadow-hover: 0 10px 30px rgba(0,0,0,.26);
}
html[data-theme="dark"] body { color: var(--ink); background: var(--canvas) !important; }
html[data-theme="dark"] .sidebar { color: var(--ink); background: #1d1a1b; border-right-color: var(--line); }
html[data-theme="dark"] .brand { border-bottom-color: var(--line); }
html[data-theme="dark"] .brand-mark { color: #fff; background: var(--red); }
html[data-theme="dark"] .brand b,
html[data-theme="dark"] .sidebar-foot b { color: var(--ink); }
html[data-theme="dark"] .brand span,
html[data-theme="dark"] .sidebar-foot span,
html[data-theme="dark"] .sidebar-foot > a,
html[data-theme="dark"] .nav-label { color: var(--subtle); }
html[data-theme="dark"] .sidebar nav a { color: #bdb5b7; }
html[data-theme="dark"] .sidebar nav a:hover { color: #fff; background: #292426; }
html[data-theme="dark"] .sidebar nav a.active { color: #fff; background: #3b2021; }
html[data-theme="dark"] .sidebar-foot { border-top-color: var(--line); }
html[data-theme="dark"] .avatar { color: #fff; background: var(--red); }
html[data-theme="dark"] .month-picker,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .theme-toggle { color: var(--ink); background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .welcome-banner,
html[data-theme="dark"] .report-hero { color: var(--ink); background: linear-gradient(120deg, var(--surface), #2b1c1d); border-color: var(--line); }
html[data-theme="dark"] .welcome-visual .bubble { background: #2c2829; border-color: #4b3738; }
html[data-theme="dark"] .btn.secondary { color: #ff8e88; background: var(--surface); border-color: #663a3a; }
html[data-theme="dark"] .btn.ghost { color: #d4cdcf; background: #302b2d; }
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .form-grid textarea,
html[data-theme="dark"] .login-form input,
html[data-theme="dark"] .import-content textarea { color: var(--ink); background: #191718; border-color: var(--line-strong); }
html[data-theme="dark"] .form-grid input:hover,
html[data-theme="dark"] .form-grid select:hover,
html[data-theme="dark"] .form-grid textarea:hover { border-color: #655c60; }
html[data-theme="dark"] .form-grid input:focus,
html[data-theme="dark"] .form-grid select:focus,
html[data-theme="dark"] .form-grid textarea:focus { background: #191718; border-color: #e45751; }
html[data-theme="dark"] select option { color: var(--ink); background: #211e1f; }
html[data-theme="dark"] .modal-head,
html[data-theme="dark"] .modal-actions,
html[data-theme="dark"] .card-head,
html[data-theme="dark"] .settings-head,
html[data-theme="dark"] .option-row,
html[data-theme="dark"] .forecast > div,
html[data-theme="dark"] .tx { border-color: var(--line); }
html[data-theme="dark"] .option-add-form,
html[data-theme="dark"] .settings-theme-card { background: #191718; }
html[data-theme="dark"] .option-edit-form input:hover { background: #2a2627; }
html[data-theme="dark"] .option-edit-form input:focus,
html[data-theme="dark"] .option-add-form input:focus { background: #191718; }
html[data-theme="dark"] .bar-chart { border-bottom-color: var(--line); }
html[data-theme="dark"] .categories > div > div { background: #373234; }
html[data-theme="dark"] .status.paid { color: #6ed6b0; background: var(--green-soft); }
html[data-theme="dark"] .status.pending { color: #e2b45c; background: var(--amber-soft); }
html[data-theme="dark"] .edit,
html[data-theme="dark"] .delete { color: var(--subtle); background: #2d292a; }
html[data-theme="dark"] .auth-body { background: #171516; }
html[data-theme="dark"] .auth-body::before { background: #2b1b1c; }
html[data-theme="dark"] .auth-brand b { color: var(--ink); }

@media (max-width: 1180px) {
  .settings-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  .theme-toggle [data-theme-label] { display: none; }
  .theme-toggle { width: 44px; padding: 0; }
  .settings-intro { align-items: flex-start; flex-direction: column; padding: 20px; }
  .settings-theme-card { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card { margin-top: 0; }
  .auth-theme-toggle { top: 14px; right: 14px; }
}
@media (max-width: 500px) {
  .settings-intro h2 { font-size: 19px; }
  .option-row { padding-left: 12px; }
  .option-toggle span { display: none; }
  .option-toggle { min-width: 28px; }
}

/* --------------------------------------------------------------------------
   CLIMCENTER UI V6 — visual leve, minimalista e sem dependência do cache v5
   -------------------------------------------------------------------------- */
:root {
  --canvas: #f5f6f7;
  --surface: #ffffff;
  --ink: #242122;
  --muted: #747071;
  --subtle: #9b9697;
  --line: #ebe8e8;
  --line-strong: #ddd7d7;
  --red-soft: #fff1f0;
  --red-pale: #fff8f7;
  --shadow: 0 2px 10px rgba(52, 37, 37, 0.035);
  --shadow-hover: 0 8px 24px rgba(52, 37, 37, 0.075);
}

body {
  background: var(--canvas);
  letter-spacing: -0.005em;
}

.sidebar {
  width: 232px;
  padding: 22px 14px 16px;
  color: var(--ink);
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.brand {
  padding: 0 9px 22px;
  border-bottom-color: var(--line);
}
.brand-mark {
  width: 40px;
  height: 40px;
  color: #fff;
  background: var(--red);
  border-radius: 13px;
  box-shadow: 0 7px 16px rgba(176, 12, 6, 0.16);
}
.brand b { color: var(--wine); }
.brand span { color: var(--muted); }
.nav-label {
  margin: 22px 12px 8px;
  color: var(--subtle);
  letter-spacing: 0.11em;
}
.sidebar nav a {
  min-height: 45px;
  color: #686364;
  border-radius: 12px;
}
.sidebar nav a:hover {
  color: var(--wine);
  background: var(--red-pale);
  transform: none;
}
.sidebar nav a.active {
  color: var(--red);
  background: var(--red-soft);
  box-shadow: none;
}
.icon {
  color: #918b8c;
  font-size: 16px;
}
.sidebar nav a.active .icon {
  color: var(--red);
  background: #fff;
  box-shadow: 0 2px 8px rgba(176, 12, 6, 0.08);
}
.sidebar-foot {
  border-top-color: var(--line);
}
.avatar {
  color: var(--red);
  background: var(--red-soft);
  box-shadow: none;
}
.sidebar-foot b { color: var(--ink); }
.sidebar-foot span { color: var(--subtle); }
.sidebar-foot > a { color: var(--subtle); }

.main {
  max-width: 1660px;
  margin-left: 232px;
  padding: 0 34px 52px;
}
.main > header {
  min-height: 88px;
  padding: 12px 0;
  border-bottom: 1px solid transparent;
}
.page-heading p {
  margin-bottom: 3px;
  color: var(--subtle);
  letter-spacing: 0.11em;
}
.main header h1 {
  font-size: 23px;
  font-weight: 900;
}
.month-picker {
  min-height: 44px;
  background: #fff;
  border-color: var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
}
.btn {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 13px;
  box-shadow: none;
}
.btn.primary {
  background: var(--red);
  box-shadow: 0 7px 15px rgba(176, 12, 6, 0.14);
}
.btn.primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}
.btn.secondary {
  color: var(--wine);
  background: #fff;
  border-color: var(--line-strong);
}
.btn.ghost { background: #f4f2f2; }

.welcome-banner {
  min-height: 154px;
  margin-bottom: 16px;
  padding: 28px 30px;
  color: var(--ink);
  background: linear-gradient(120deg, #fff 0%, #fff 58%, #fff5f4 100%);
  border: 1px solid var(--line);
  border-radius: 21px;
  box-shadow: var(--shadow);
}
.welcome-banner::before {
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--red);
  border-radius: 21px 0 0 21px;
  opacity: 1;
}
.welcome-copy { max-width: 650px; }
.welcome-kicker { color: var(--red); }
.welcome-copy h2 {
  max-width: 620px;
  margin: 7px 0 8px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}
.welcome-copy p {
  color: var(--muted);
  font-size: 12px;
}
.welcome-visual {
  right: 33px;
  width: 152px;
  height: 112px;
  opacity: 0.95;
}
.welcome-visual::before {
  background: #fff;
  border: 1px solid #f0d9d7;
  box-shadow: 0 12px 32px rgba(176, 12, 6, 0.07);
}
.welcome-visual .bubble { box-shadow: 0 6px 18px rgba(82, 32, 29, 0.08); }

.summary-grid { gap: 13px; }
.metric {
  min-height: 118px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}
.metric span { font-size: 11px; }
.metric b {
  font-size: 21px;
  font-weight: 900;
}
.metric small { color: var(--subtle); }

.two-col { gap: 13px; margin-top: 13px; }
.card {
  padding: 21px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 19px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 15px; font-weight: 900; }
.card p { font-size: 11px; }
.bar-chart { border-bottom-color: #efeded; }
.forecast > div { border-bottom-color: #f0eded; }
.tx {
  min-height: 57px;
  border-top-color: #f1eeee;
}
.tx-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}
.status { padding: 6px 9px; }
.balance-chip { border-radius: 11px; }

.report-hero {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 19px;
  box-shadow: var(--shadow);
}
.report-hero p { color: var(--red); }
.report-hero span { color: var(--muted); opacity: 1; }
.report-pair b { color: var(--ink); }

.modal-wrap { backdrop-filter: blur(3px); }
.backdrop { background: rgba(35, 28, 28, 0.34); }
.modal {
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 23px;
  box-shadow: 0 30px 90px rgba(41, 25, 24, 0.22);
}
.modal-head { padding: 21px 24px 17px; }
.form-grid {
  padding: 22px 24px;
  gap: 16px;
}
.form-grid label,
.login-form label {
  color: #575253;
  font-size: 11px;
  font-weight: 800;
}
.form-grid input,
.form-grid select,
.form-grid textarea,
.login-form input,
.import-content textarea {
  min-height: 48px;
  margin-top: 7px;
  padding: 0 14px;
  background: #fbfbfb;
  border-color: var(--line-strong);
  border-radius: 13px;
  font-size: 13px;
}
.form-grid textarea { min-height: 82px; padding-top: 13px; }
.form-grid input:hover,
.form-grid select:hover,
.form-grid textarea:hover { border-color: #cbc3c3; }
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.login-form input:focus,
.import-content textarea:focus {
  background: #fff;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(176, 12, 6, 0.075);
}
.modal-actions { padding: 15px 24px 20px; }

.login-card,
.install-card {
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(63, 39, 35, 0.09);
}

@media (max-width: 780px) {
  .sidebar { width: min(282px, 86vw); }
  .sidebar .menu-close { color: var(--wine); }
  .main { margin-left: 0; padding: 0 13px 34px; }
  .main > header { padding-top: 12px; }
  .mobile-menu { color: var(--red); }
  .welcome-banner { padding: 22px; }
  .welcome-copy { max-width: calc(100% - 72px); }
  .welcome-copy h2 { font-size: 19px; }
  .metric { min-height: 108px; }
}

@media (max-width: 500px) {
  .welcome-banner {
    min-height: 162px;
    padding: 20px 19px 18px 23px;
  }
  .welcome-copy { max-width: calc(100% - 30px); }
  .welcome-visual { right: -38px; opacity: 0.42; }
  .metric { min-height: auto; }
  .form-grid input,
  .form-grid select,
  .login-form input { min-height: 50px; }
}

html[data-theme="dark"] .form-grid label,
html[data-theme="dark"] .login-form label { color: #d5ced0; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #7f7679; }

/* --------------------------------------------------------------------------
   V9 — correção da navegação no celular
   -------------------------------------------------------------------------- */
.page-heading {
  margin-right: auto;
}

.header-actions:empty {
  display: none;
}

@media (max-width: 780px) {
  body.menu-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .sidebar {
    z-index: 70;
    display: flex;
    width: min(300px, 88vw);
    height: 100vh;
    height: 100dvh;
    padding-top: max(22px, env(safe-area-inset-top));
    overflow-y: auto;
    transform: translateX(-105%);
    box-shadow: 18px 0 54px rgba(36, 24, 24, 0.2);
    visibility: hidden;
    transition: transform .24s ease, visibility 0s linear .24s;
  }

  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
    transition-delay: 0s;
  }

  .menu-backdrop,
  .menu-backdrop.open {
    position: fixed;
    inset: 0;
    z-index: 60;
    border: 0;
    background: rgba(25, 20, 20, 0.54);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .menu-backdrop {
    display: none;
  }

  .menu-backdrop.open {
    display: block;
  }

  .sidebar .menu-close {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    color: var(--wine);
    background: var(--red-soft);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
  }

  .main > header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    min-height: auto;
    padding: 16px 0 14px;
    gap: 10px;
  }

  .mobile-menu {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--red);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 19px;
    line-height: 1;
    touch-action: manipulation;
  }

  .page-heading {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin: 0;
  }

  .main header h1 {
    overflow: hidden;
    font-size: 21px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-theme-toggle {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .header-theme-toggle [data-theme-label] {
    display: none;
  }

  .header-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 10px;
  }

  .header-actions .month-picker {
    grid-column: 1 / -1;
  }

  .header-actions .btn {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .main > header {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .mobile-menu,
  .header-theme-toggle {
    width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .main header h1 {
    font-size: 19px;
  }
}
