:root {
  color-scheme: light;
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-muted: #eef7f2;
  --text: #172233;
  --muted: #647386;
  --line: #d8e3df;
  --teal: #0f8b8d;
  --teal-dark: #0b686b;
  --blue: #3669b1;
  --green: #1f8a63;
  --red: #b42318;
  --amber: #c47a20;
  --violet: #7457c8;
  --coral: #d76654;
  --ink: #0f1c2d;
  --shadow: 0 18px 45px rgba(25, 58, 66, 0.10);
  --soft-shadow: 0 12px 30px rgba(25, 58, 66, 0.08);
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.13), transparent 30%),
    linear-gradient(315deg, rgba(215, 102, 84, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(238, 247, 242, 0.68)),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans", Arial, Helvetica, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(62px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

.auth-panel {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: center;
}

.auth-copy h1 {
  font-size: 42px;
  max-width: 520px;
}

.auth-copy {
  min-width: 0;
}

.brand-lockup,
.app-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup {
  margin-bottom: 18px;
}

.brand-lockup strong {
  font-size: 18px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--coral));
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(15, 139, 141, 0.24);
}

.brand-logo.compact {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  font-size: 13px;
}

.brand-logo.app-logo {
  width: 200px;
  height: 100px;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-visual-card {
  max-width: 560px;
  min-height: 236px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.58fr);
  gap: 12px;
  align-items: center;
  margin-top: 22px;
  padding: 14px 18px;
  overflow: hidden;
  border: 1px solid rgba(216, 227, 223, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 247, 242, 0.78)),
    repeating-linear-gradient(90deg, rgba(15, 139, 141, 0.05) 0 1px, transparent 1px 34px);
  box-shadow: var(--soft-shadow);
}

.auth-visual-card img {
  width: 100%;
  min-width: 0;
  max-height: 230px;
  object-fit: contain;
}

.auth-visual-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-left: 1px solid var(--line);
}

.auth-visual-copy strong {
  font-size: 17px;
  line-height: 1.25;
}

.auth-visual-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.auth-tab {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--text);
  color: #ffffff;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label:not(.check-row) {
  display: grid;
  gap: 6px;
}

.auth-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-form input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.check-row span {
  line-height: 1.35;
}

.consent-disclosure {
  max-height: 120px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-form button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-form .link-action-button {
  height: auto;
  background: transparent;
  color: var(--teal);
  padding: 2px 0;
  text-align: center;
}

.auth-status {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-status.success {
  color: var(--green);
}

.auth-status.error {
  color: var(--red);
}

.shell {
  width: min(1380px, calc(100% - 24px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) env(safe-area-inset-right) max(62px, env(safe-area-inset-bottom)) env(safe-area-inset-left);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.legal-footer {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 8px;
  z-index: 45;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px 8px 12px;
  border: 1px solid rgba(216, 227, 223, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(25, 58, 66, 0.07);
}

.legal-footer strong {
  color: var(--text);
}

.legal-footer a {
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.legal-footer a:hover {
  text-decoration: underline;
}

.legal-footer strong {
  margin-right: auto;
}

.studio-watermark {
  position: fixed;
  right: 22px;
  bottom: 17px;
  z-index: 46;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  opacity: 0.22;
  pointer-events: none;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 108px;
}

.user-menu {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.user-menu span {
  max-width: 150px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu button {
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 10px;
}

.user-menu button:hover {
  color: var(--red);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 210px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-dropdown button {
  width: 100%;
  justify-content: start;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.profile-dropdown button:hover {
  background: var(--surface-muted);
  color: var(--teal);
}

.tabs-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: stretch;
  margin-top: 10px;
}

.section-menu-button {
  display: none;
  align-items: center;
  gap: 10px;
  height: 44px;
  min-width: 148px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.section-menu-button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-muted);
  font-size: 17px;
  font-weight: 900;
}

.section-menu-button strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-menu {
  min-width: 132px;
  justify-content: space-between;
}

.notification-menu {
  position: relative;
  display: grid;
  align-items: stretch;
}

.notification-button {
  position: relative;
  min-width: 46px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.notification-button small {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 31;
  width: 320px;
  max-height: min(420px, calc(100vh - 140px));
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notification-dropdown[hidden] {
  display: none;
}

.notification-dropdown > strong {
  font-size: 13px;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.notification-item strong,
.notification-item span {
  display: block;
}

.notification-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
  line-height: 1.25;
}

.toolbar,
.tabs {
  display: inline-grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.toolbar {
  grid-template-columns: repeat(3, 1fr);
  min-width: 210px;
}

.language-select {
  height: 44px;
  display: grid;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.language-select select {
  height: 34px;
  min-width: 68px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
}

.tabs {
  flex: 0 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  width: 100%;
}

.currency-button,
.tab-button {
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab-button {
  min-width: 0;
  padding: 0 14px;
}

.currency-button.active,
.tab-button.active {
  background: var(--text);
  color: #ffffff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.alerts-panel {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.alerts-panel:empty {
  display: none;
}

.alert-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border: 1px solid #f3c6bd;
  border-radius: 8px;
  background: #fff6f4;
  color: var(--red);
  box-shadow: var(--shadow);
}

.alert-card.warning {
  border-color: #f4d59c;
  background: #fffaef;
  color: var(--amber);
}

.alert-card strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 13px;
}

.alert-card span {
  font-size: 12px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  min-height: 92px;
  padding: 14px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.96)),
    var(--surface);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 92px;
  height: 42px;
  background: linear-gradient(135deg, transparent, rgba(15, 139, 141, 0.09));
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.metric-icon {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f2f2;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.metric-icon.cash {
  background: #e6f4ee;
  color: var(--green);
}

.metric-icon.debt {
  background: #fff4db;
  color: var(--amber);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
  line-height: 1.15;
}

.metric-card small {
  color: var(--muted);
  font-size: 11px;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.warning-text {
  color: var(--amber);
}

.tab-panel {
  display: none;
  min-height: 0;
}

.tab-panel.active {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  margin-top: 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.dashboard-grid .panel-header {
  min-height: 76px;
  padding: 16px 18px;
}

.dashboard-grid .panel-header p {
  display: none;
}

.dashboard-quick-actions {
  display: block;
  margin-top: 10px;
  padding: 12px 14px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  min-width: 0;
}

.quick-action-button {
  min-height: 44px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 139, 141, 0.13);
}

.quick-action-button.danger-action {
  border-color: var(--red);
  background: var(--red);
}

.quick-action-button.secondary {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--text);
  box-shadow: none;
}

.quick-action-button:hover,
.panel-action-button:hover,
.report-button:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.calculated-field {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.calculated-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calculated-field strong {
  display: block;
  margin-top: 6px;
  color: var(--teal-dark);
  font-size: 18px;
}

.dashboard-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 0;
  padding: 14px 18px 18px;
  overflow: auto;
}

.dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-row:first-child {
  padding-top: 0;
}

.dashboard-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.dashboard-row.compact {
  min-height: 32px;
}

.dashboard-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-row .record-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 11px;
}

.dashboard-row-main.no-mark {
  display: block;
}

.dashboard-row-main strong {
  display: block;
  overflow: hidden;
  margin-bottom: 2px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-row-main span span,
.dashboard-row-main.no-mark {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-row-main b {
  font-weight: 800;
}

.dashboard-row-side {
  display: grid;
  justify-items: end;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
}

.dashboard-row .pay-button {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.monthly-flow-panel {
  flex: 0 0 auto;
}

.dashboard-top-flow {
  margin-top: 10px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    repeating-linear-gradient(90deg, rgba(15, 139, 141, 0.06) 0 1px, transparent 1px 42px),
    var(--surface);
}

.dashboard-top-flow .panel-header {
  padding: 12px 18px;
}

.dashboard-top-flow .panel-header p {
  display: none;
}

.monthly-flow-chart {
  flex: 0 0 auto;
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(500px, 1fr);
  gap: 20px;
  align-items: center;
  padding: 18px 22px 22px;
  overflow: visible;
}

.current-month-stats {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
}

.current-month-stats article {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.current-month-stats span,
.current-month-pie-center span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.current-month-stats strong {
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.08;
}

.current-month-pie-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(260px, 1fr);
  gap: 24px;
  align-items: center;
  justify-content: end;
}

.current-month-actions {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-content: center;
}

.current-month-actions .quick-action-button {
  width: 100%;
  min-height: 82px;
  padding: 12px 16px;
  font-size: 16px;
  white-space: normal;
}

.current-month-pie {
  position: relative;
  width: min(260px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(
      var(--green) 0 var(--income),
      var(--amber) var(--expense-start) var(--expense-end),
      var(--red) var(--expense-end) var(--spending-end),
      rgba(15, 139, 141, 0.18) var(--spending-end) 360deg
    );
  box-shadow: 0 26px 46px rgba(25, 58, 66, 0.12);
}

.current-month-pie::before {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(216, 227, 223, 0.86);
}

.current-month-pie-center {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  text-align: center;
}

.current-month-pie-center strong {
  color: var(--teal-dark);
  font-size: 20px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.monthly-flow-legend {
  display: grid;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.monthly-flow-legend span {
  display: grid;
  grid-template-columns: 10px minmax(80px, auto) minmax(80px, 1fr);
  align-items: center;
  gap: 7px;
}

.monthly-flow-legend strong {
  justify-self: end;
  color: var(--text);
  font-size: 12px;
}

.legend-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--teal);
}

.legend-dot.income {
  background: var(--green);
}

.legend-dot.expense {
  background: var(--red);
}

.legend-dot.fixed-expense {
  background: var(--amber);
}

.monthly-flow-columns {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(72px, 1fr));
  gap: 14px;
  align-items: end;
}

.monthly-flow-column {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: center;
}

.monthly-column-bars {
  width: 100%;
  height: 82px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 7px;
  padding: 8px 8px 0;
  border-radius: 8px;
  background: #f4f7f8;
}

.monthly-column-bar {
  width: 13px;
  min-height: 5px;
  border-radius: 999px 999px 2px 2px;
  background: var(--teal);
}

.monthly-column-bar.income {
  background: var(--green);
}

.monthly-column-bar.expense,
.monthly-column-bar.net.negative {
  background: var(--red);
}

.monthly-column-bar.net.positive {
  background: var(--teal);
}

.monthly-flow-column strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.monthly-flow-column > span {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.add-panel,
.list-panel {
  margin-top: 16px;
}

.tab-panel.active > .list-panel {
  flex: 1 1 auto;
  margin-top: 10px;
}

.tab-panel[data-panel="liabilities"].active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 10px;
}

.tab-panel[data-panel="liabilities"].active > .list-panel {
  margin-top: 0;
}

.status-pill,
.count-pill {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.status-pill {
  color: var(--muted);
}

.status-pill.success {
  background: #e6f4ee;
  color: var(--green);
}

.status-pill.error {
  background: #fbeaea;
  color: var(--red);
}

.count-pill {
  color: var(--teal);
}

.panel-actions,
.modal-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.period-select-label {
  display: grid;
  flex: 0 0 154px;
  gap: 4px;
}

.period-select-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: none;
}

.period-select-label select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 0 10px;
}

.expense-filter-panel {
  display: grid;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(238, 247, 242, 0.72), rgba(255, 255, 255, 0.9)),
    var(--surface);
}

.expense-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(5, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.expense-filter-grid label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.expense-filter-grid span,
.expense-total-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.expense-filter-grid input,
.expense-filter-grid select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  outline: none;
  padding: 0 10px;
}

.expense-filter-grid input:focus,
.expense-filter-grid select:focus {
  border-color: rgba(15, 139, 141, 0.68);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.12);
}

.filter-clear-button {
  height: 38px;
  min-width: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.expense-total-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.expense-total-strip div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.expense-total-strip strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-action-button,
.modal-close-button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.panel-action-button {
  min-width: 112px;
  padding: 0 14px;
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.modal-close-button {
  width: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.modal-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-content: center;
  justify-items: center;
  overflow-y: auto;
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: rgba(24, 33, 47, 0.48);
  box-shadow: none;
}

.modal-panel[hidden] {
  display: none !important;
}

.modal-panel > .panel-header,
.modal-panel > .entry-form,
.modal-panel > .settings-layout {
  width: min(920px, 100%);
  background: var(--surface);
}

.modal-panel > .panel-header {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow);
}

.modal-panel > .entry-form {
  max-height: calc(100vh - 176px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
}

.modal-panel > .settings-layout {
  max-height: calc(100vh - 176px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
}

.settings-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-muted);
}

.settings-side-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.settings-side-button.active,
.settings-side-button:hover {
  background: var(--text);
  color: #ffffff;
}

.settings-content {
  min-height: 330px;
  overflow-y: auto;
  padding: 22px;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: grid;
  gap: 16px;
}

.settings-section h3 {
  margin: 0;
  font-size: 17px;
}

.settings-section p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-form-grid label,
.settings-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wide-setting {
  grid-column: 1 / -1;
}

.settings-form-grid label.language-select {
  height: auto;
  align-items: stretch;
  padding: 0;
  border: 0;
  background: transparent;
}

.settings-form-grid input,
.settings-form-grid select {
  height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  padding: 0 11px;
}

.settings-form-grid input[readonly] {
  background: var(--surface-muted);
}

.settings-currency-buttons {
  width: 100%;
  min-width: 0;
}

.view-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.view-mode-button {
  display: grid;
  gap: 5px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 13px 14px;
  text-align: left;
}

.view-mode-button strong {
  font-size: 14px;
  line-height: 1.25;
}

.view-mode-button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.view-mode-button.active {
  border-color: var(--teal);
  background: #eef8f6;
  box-shadow: inset 0 0 0 1px rgba(18, 149, 148, 0.35);
}

.settings-save-button {
  height: 40px;
  align-self: end;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.danger-zone {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  background: rgba(180, 35, 24, 0.06);
}

.danger-zone h4 {
  margin: 0 0 5px;
  color: var(--red);
  font-size: 14px;
}

.danger-zone p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.danger-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  padding: 0 14px;
}

#deleteAccountStatus {
  grid-column: 1 / -1;
  margin: 0;
}

#profileSettingsStatus {
  align-self: end;
  margin: 0;
}

.about-box {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
}

.about-box strong {
  color: var(--text);
  font-size: 16px;
}

.modal-panel .entry-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-panel .entry-form button[type="submit"] {
  grid-column: 1 / -1;
}

.modal-panel .form-actions {
  grid-column: 1 / -1;
}

.entry-form {
  display: grid;
  gap: 12px;
  padding: 18px 22px 22px;
}

.portfolio-form {
  grid-template-columns: 1.1fr 1.4fr 1fr 0.8fr 0.9fr 1fr 1fr auto;
}

.liability-form {
  grid-template-columns: 1.25fr 1fr 0.75fr 1fr 1fr 1fr 0.9fr 0.9fr 0.9fr auto;
}

.income-form {
  grid-template-columns: 1.4fr 1fr 0.75fr 1fr 1fr 0.9fr auto;
}

.card-form {
  grid-template-columns: 1.2fr 1.2fr 0.9fr 0.75fr 0.9fr 0.9fr auto;
}

.expense-form {
  grid-template-columns: 1.3fr 1fr 0.9fr 0.75fr 1fr 1.2fr 0.7fr 0.9fr auto;
}

.quick-cash-form {
  grid-template-columns: 1fr 0.65fr auto;
}

.payment-form {
  grid-template-columns: 1fr 1fr 0.8fr 1fr 1fr auto;
}

.sell-form {
  grid-template-columns: 1fr 1fr 1fr 0.8fr auto;
}

.entry-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.entry-form .wide-field {
  grid-column: 1 / -1;
}

.entry-form .check-row {
  align-self: end;
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.entry-form .check-row span {
  color: var(--text);
  font-size: 14px;
}

.entry-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.entry-form input,
.entry-form select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 0 11px;
}

.entry-form input:focus,
.entry-form select:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 139, 141, 0.16);
}

.entry-form button {
  align-self: end;
  height: 42px;
  min-width: 126px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.form-actions button {
  flex: 1 0 auto;
}

.secondary-button {
  background: var(--surface-muted) !important;
  color: var(--text) !important;
}

.entry-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.positions-panel,
.list-panel,
.report-panel,
.cash-movements-panel,
.dashboard-list-panel,
.quick-actions-panel,
.monthly-flow-panel,
.cash-panel,
.allocation-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-header p {
  display: none;
}

.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.finance-table {
  min-width: 1040px;
}

.income-table {
  min-width: 820px;
}

.payment-table {
  min-width: 720px;
}

.card-table {
  min-width: 980px;
}

.expense-table {
  min-width: 940px;
}

.admin-users-table {
  min-width: 980px;
}

.admin-email-form {
  grid-template-columns: minmax(0, 1fr) 150px;
  padding: 16px 22px;
}

.admin-email-form button {
  align-self: end;
}

.compact-table-wrap {
  max-height: 220px;
  border-top: 1px solid var(--line);
}

.admin-email-table {
  min-width: 1040px;
}

.admin-email-table td {
  padding-top: 11px;
  padding-bottom: 11px;
}

.admin-users-table .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 6px 10px;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

td {
  font-size: 14px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.asset-cell,
.record-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.asset-mark,
.record-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f2f2;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.record-mark.debt {
  background: #fbeaea;
  color: var(--red);
}

.record-mark.income {
  background: #e6f4ee;
  color: var(--green);
}

.record-mark.card {
  background: #e7ecf8;
  color: var(--blue);
}

.record-mark.expense {
  background: #fff4db;
  color: var(--amber);
}

.asset-name,
.record-name {
  display: block;
  margin-bottom: 3px;
  font-weight: 800;
}

.asset-symbol,
.source-text,
.record-meta {
  color: var(--muted);
  font-size: 12px;
}

.source-text,
.record-meta {
  display: block;
  max-width: 230px;
  line-height: 1.35;
}

.value-strong {
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.debt {
  background: #fbeaea;
  color: var(--red);
}

.badge.recurring {
  background: #fff4db;
  color: var(--amber);
}

.badge.income {
  background: #e6f4ee;
  color: var(--green);
}

.badge.paid {
  background: #e6f4ee;
  color: var(--green);
}

.badge.overdue {
  background: #fbeaea;
  color: var(--red);
}

.badge.due-soon {
  background: #fff4db;
  color: var(--amber);
}

.badge.upcoming {
  background: #e7f2f2;
  color: var(--teal);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
}

.icon-button,
.pay-button,
.sell-button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.icon-button {
  width: 34px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.pay-button,
.sell-button {
  padding: 0 12px;
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.sell-button {
  background: var(--red);
  border-color: var(--red);
}

.pay-button.danger {
  background: var(--red);
  border-color: var(--red);
}

.pay-button:disabled,
.sell-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.cash-movements-table td,
.cash-movements-table th {
  white-space: nowrap;
}

#cardsBody tr[data-card-id] {
  cursor: pointer;
}

#cardsBody tr[data-card-id]:hover {
  background: rgba(15, 139, 141, 0.05);
}

.cash-movements-table td:nth-child(2) {
  width: 100%;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-detail {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px 22px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.movement-detail-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.movement-detail-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.movement-detail-row strong {
  color: var(--text);
  font-size: 14px;
}

.allocation-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
  overflow: auto;
}

.cash-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 18px 22px 22px;
  overflow: auto;
}

.cash-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cash-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cash-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cash-meta strong {
  font-size: 15px;
}

.cash-meta span {
  color: var(--muted);
  font-size: 12px;
}

.cash-movement-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 18px 22px 22px;
  overflow: auto;
}

.cash-movement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cash-movement-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cash-movement-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cash-movement-meta strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash-movement-meta span {
  color: var(--muted);
  font-size: 12px;
}

.cash-movement-amount {
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.undo-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.undo-button:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.cash-movements-panel .cash-movement-list {
  gap: 0;
}

.allocation-row {
  display: grid;
  gap: 8px;
}

.allocation-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.allocation-meta strong {
  font-size: 14px;
}

.bar-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebef;
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.bar-fill.crypto {
  background: var(--blue);
}

.bar-fill.metal {
  background: var(--amber);
}

.bar-fill.currency {
  background: var(--teal);
}

.bar-fill.fund {
  background: var(--green);
}

.bar-fill.stock {
  background: var(--violet);
}

.report-command-panel {
  flex: 0 0 auto;
  margin-top: 16px;
}

.report-button {
  flex: 0 0 auto;
  height: 42px;
  min-width: 140px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.report-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.report-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  overflow: hidden;
}

.chart-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
  overflow: auto;
}

.chart-row {
  display: grid;
  gap: 8px;
}

.chart-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
}

.chart-row-meta strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-row-meta span {
  flex: 0 0 auto;
  font-weight: 800;
}

.report-track {
  height: 12px;
}

.report-fill.positive {
  background: var(--green);
}

.report-fill.negative {
  background: var(--red);
}

.empty-chart {
  min-height: 104px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.empty-state {
  min-height: 126px;
  padding-top: 92px !important;
  background: url("/assets/empty-finance.svg") center 10px / 128px 86px no-repeat;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-copy h1 {
    font-size: 34px;
  }

  .auth-visual-card {
    max-width: none;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-form,
  .liability-form,
  .income-form,
  .card-form,
  .expense-form,
  .quick-cash-form,
  .payment-form,
  .sell-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entry-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs-row {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .section-menu-button {
    display: inline-flex;
  }

  .tabs-row .tabs {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 28;
    width: min(360px, calc(100vw - 24px));
    display: none;
    grid-template-columns: 1fr;
    padding: 8px;
    box-shadow: var(--shadow);
  }

  .tabs-row.menu-open .tabs {
    display: grid;
  }

  .tabs-row .tab-button {
    height: 40px;
    justify-content: start;
    padding: 0 12px;
    text-align: left;
  }

  .toolbar {
    width: 100%;
  }

  .user-menu {
    justify-content: space-between;
  }

  .notification-dropdown {
    right: auto;
    left: 0;
    width: min(320px, calc(100vw - 24px));
  }

  .dashboard-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-form,
  .liability-form,
  .income-form,
  .card-form,
  .expense-form,
  .payment-form,
  .sell-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-actions {
    grid-column: 1 / -1;
  }

  .panel-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-action-button,
  .period-select-label,
  .panel-actions .count-pill {
    width: 100%;
  }

  .expense-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-clear-button {
    width: 100%;
  }

  .expense-total-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-shell {
    align-items: start;
    padding: 18px 12px 78px;
  }

  .auth-copy h1 {
    font-size: 28px;
  }

  .auth-visual-card {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 12px;
  }

  .auth-visual-card img {
    max-height: 176px;
  }

  .auth-visual-copy {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .auth-card {
    padding: 14px;
  }

  .shell {
    width: min(100% - 20px, 1240px);
    padding-top: 18px;
  }

  .legal-footer {
    left: 8px;
    right: 8px;
    bottom: 7px;
    min-height: 54px;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 7px 92px 7px 10px;
    font-size: 10px;
  }

  .studio-watermark {
    right: 18px;
    bottom: 22px;
    font-size: 12px;
  }

  h1 {
    font-size: 28px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 126px;
  }

  .metric-card strong {
    font-size: 25px;
  }

  .portfolio-form,
  .liability-form,
  .income-form,
  .card-form,
  .expense-form,
  .payment-form,
  .sell-form {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabs-row .tabs {
    grid-template-columns: 1fr;
  }

  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-row-side {
    justify-items: start;
  }

  .monthly-flow-chart {
    grid-template-columns: 1fr;
    min-height: 0;
    overflow: visible;
  }

  .current-month-stats {
    order: 2;
    grid-template-columns: 1fr;
  }

  .current-month-pie-wrap {
    order: 1;
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .current-month-pie {
    width: min(230px, 78vw);
  }

  .current-month-actions {
    width: min(100%, 360px);
    grid-template-columns: 1fr;
    align-content: start;
    justify-content: stretch;
  }

  .current-month-actions .quick-action-button {
    min-height: 64px;
  }

  .monthly-flow-columns {
    grid-template-columns: repeat(6, minmax(68px, 1fr));
    min-width: 520px;
  }

  .cash-movement-row {
    grid-template-columns: 1fr;
  }

  .cash-movement-amount {
    text-align: left;
  }

  .modal-panel {
    align-content: start;
    padding: 12px;
  }

  .modal-panel .entry-form {
    grid-template-columns: 1fr;
  }

  .movement-detail {
    grid-template-columns: 1fr;
  }

  .modal-panel > .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-side-button {
    text-align: center;
  }

  .settings-form-grid {
    grid-template-columns: 1fr;
  }

  .danger-zone {
    grid-template-columns: 1fr;
  }

  .danger-button {
    width: 100%;
  }

  .admin-email-form {
    grid-template-columns: 1fr;
  }

  .view-mode-options {
    grid-template-columns: 1fr;
  }

  .expense-filter-grid,
  .expense-total-strip {
    grid-template-columns: 1fr;
  }

  .alert-card {
    align-items: flex-start;
    flex-direction: column;
  }
}
