:root {
  --bg: #f8f4ea;
  --ink: #19212b;
  --card: rgba(255, 255, 255, 0.84);
  --line: rgba(25, 33, 43, 0.12);
  --income: #1e8859;
  --expense: #c44536;
  --accent: #005f73;
  --accent-soft: #83c5be;
  --warning: #ffd166;
  --radius: 20px;
  --shadow: 0 18px 40px rgba(25, 33, 43, 0.12);
}

article.card.card-expense {
    background: #db9198;
    color: #fff;
}

article.card.card-expense  h2 {
    color: #fff;
}
article.card.card-income ~ article.card.card-income {
    background: #7d82cc;
}

article.card.card-income h2 {
    color: #fff;
}
article.card.card-income {
    background: #20a6da;
    color: #fff;
}

.choice-group-a .choice-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}



* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    font-family: "Manrope", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 10% 5%, #ffe8b6 0, transparent 28%),
              radial-gradient(circle at 90% 15%, #bee3db 0, transparent 25%),
              linear-gradient(160deg, #f8f4ea, #f4efe3 55%, #e8f6f3);
    overflow-x: hidden;
    padding: 5px;
}

body.theme-dark  .bg-shape-2 {
    background: #002d28;
}
body.theme-dark  .bg-shape-1 {
    background: #001837;
}


body.theme-dark {
    --bg: #0f141b;
    --ink: #e8edf4;
    --card: rgba(21, 29, 38, 0.86);
    --line: rgba(232, 237, 244, 0.16);
    --accent: #3fb7c3;
    --accent-soft: #2c6f76;
    --shadow: 0 18px 40px rgb(0 0 0 / 44%);
    background: radial-gradient(circle at 10% 5%, rgb(0 0 0) 0, #00000000 28%), radial-gradient(circle at 90% 15%, rgba(131, 197, 190, 0.2) 0, #5d494900 25%), linear-gradient(160deg, #455b7b, #0c121b 55%, #0b1d21);
}

.theme-toggle {
    position: fixed;
    top: 15px;
    left: 10px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #1b2835;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(25, 33, 43, 0.14);
    width: 38px;
    height: 38px;
}
.theme-toggle  .matrix-table .col-meta {
    background: #141c25;
    min-width: 120px;
    color: #fff;
}
.theme-toggle i {
    font-size: 15px;
    line-height: 1;
}

.logout-form {
  position: fixed;
  top: 15px;
  right: 10px;
  z-index: 30;
  margin: 0;
}

.logout-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #1b2835;
  box-shadow: 0 10px 22px rgba(25, 33, 43, 0.14);
}

.logout-button:hover {
  filter: brightness(1.04);
}

.install-app-button {
  position: fixed;
  right: 10px;
  bottom: 14px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(145deg, #20a6da, #7d82cc);
  color: #fff;
  box-shadow: 0 10px 24px rgba(25, 33, 43, 0.22);
  font-size: 14px;
}

.install-app-button[hidden] {
  display: none !important;
}

.install-app-button i {
  font-size: 14px;
  line-height: 1;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-shell {
  width: min(100%, 420px);
}

.auth-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.auth-panel h1 {
  margin: 0;
  font: 800 42px / 1 "IBM Plex Sans Condensed", sans-serif;
}

.auth-panel p {
  margin: 0;
  color: #465163;
  font-weight: 700;
}

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

.auth-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body.theme-dark .logout-button {
  background: rgb(48 73 105 / 94%);
  color: #e8edf4;
}

body.theme-dark .install-app-button {
  box-shadow: 0 10px 24px rgb(0 0 0 / 42%);
}

body.theme-dark .theme-toggle {
    border-color: rgb(255 255 255);
    background: rgb(48 73 105 / 94%);
    color: #e8edf4;
}

body.theme-dark tr.matrix-summary-row th,
body.theme-dark tr.matrix-summary-row.matrix-average-row th {
  background: #15202c;
  color: #e8edf4;
}

tr.matrix-summary-row th, tr.matrix-summary-row.matrix-average-row th {
    background: #ffffff;
    color: #111;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.45;
  animation: drift 12s ease-in-out infinite alternate;
}

.bg-shape-1 {
  width: 320px;
  height: 320px;
  right: -80px;
  top: -80px;
  background: #ffd166;
}

.bg-shape-2 {
  width: 260px;
  height: 260px;
  left: -100px;
  bottom: -60px;
  background: #83c5be;
  animation-duration: 16s;
}

.container {
    width: 96%;
    margin: 36px auto 64px;
    max-width: 1700px;
}

.hero {
  margin-bottom: 26px;
  animation: rise 0.65s ease;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
}

.hero h1 {
  margin: 8px 0;
  font: 800 clamp(30px, 5vw, 54px) / 1.05 "IBM Plex Sans Condensed", sans-serif;
}

.subtitle {
  margin: 0;
  max-width: 70ch;
  color: #38414e;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-weight: 700;
}

.flash-success {
  background: rgba(30, 136, 89, 0.14);
  border: 1px solid rgba(30, 136, 89, 0.28);
}

.flash-error {
  background: rgba(196, 69, 54, 0.12);
  border: 1px solid rgba(196, 69, 54, 0.3);
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 20px;
  animation: rise 0.75s ease;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(8px);
}

.card h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4e5968;
}

.card h2 i {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: transparent;
    font-size: 16px;
    line-height: 1;
}

.amount {
    margin: 10px 0 0;
    font-size: clamp(20px, 2.4vw, 29px);
    font-weight: 800;
    font-size: 22px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(7px);
  animation: rise 0.8s ease;
}

.panel.panel-switching {
  pointer-events: none;
  animation: panelSwitchOut 0.18s ease forwards;
}

main.container.ajax-updated .hero,
main.container.ajax-updated .summary-grid,
main.container.ajax-updated .panel {
  animation: none !important;
}

main.container.ajax-updated .panel.panel-refresh-in {
  animation: panelRefreshIn 0.22s ease !important;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
}

.tx-form {
  display: grid;
  gap: 10px;
}

.choice-group {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(25, 33, 43, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
}
body.theme-dark .choice-group {
    border: 1px solid rgb(0 0 0 / 16%);
       background: rgb(22 36 51);
}


.choice-label {
  font-size: 13px;
  font-weight: 700;
  color: #465163;
}

.checkbox-grid {
  display: grid;
  gap: 6px;
}

.choice-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    cursor: pointer;
}

.choice-item input[type="checkbox"],
.choice-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-item span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border-radius: 999px;
    border: 1px solid rgba(25, 33, 43, 0.2);
    background: rgba(255, 255, 255, 0.92);
    color: #1b2835;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    border-radius: 8px;
}
body.theme-dark .choice-item span {
    border: 1px solid rgba(25, 33, 43, 0.2);
    background: rgb(15 22 30);
    color: #ffffff;
}

.choice-item span::before {
    content: "\f0c8";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
    line-height: 1;
    color: #e3e3e3;
    border-color: transparent;
    box-shadow: none;
}

.choice-item input[type="radio"] + span::before {
  border-radius: 999px;
}

.choice-group-a .choice-item input[type="radio"] + span::before {
  display: none;
}

.choice-group-a .choice-item span i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: #0a7b93;
  transition: color 0.2s ease;
}

.choice-group-a .choice-item input[type="radio"]:checked + span i {
  color: #fff;
}

.choice-item:hover span {
  border-color: rgba(0, 95, 115, 0.45);
}

.choice-item input[type="checkbox"]:checked + span, .choice-item input[type="radio"]:checked + span {
    background: #7d82cc;
    border-color: #7d81cb;
    box-shadow: 0 6px 16px rgba(0, 95, 115, 0.16);
    color: #fff;
}

.choice-item input[type="checkbox"]:checked + span::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
  color: #fff;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.choice-item input[type="radio"]:checked + span::before {
  content: "\f192";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.choice-item input[type="checkbox"]:focus-visible + span,
.choice-item input[type="radio"]:focus-visible + span {
  outline: none;
}

.choice-item input[type="checkbox"]:disabled + span,
.choice-item input[type="radio"]:disabled + span {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.choice-item input[type="checkbox"]:disabled + span::before,
.choice-item input[type="radio"]:disabled + span::before {
  border-color: rgba(25, 33, 43, 0.26);
}

.checkbox-grid .choice-item {
  width: 100%;
}

.checkbox-grid .choice-item span {
  width: 100%;
  justify-content: flex-start;
}

.choice-group > .choice-item {
  margin-right: 4px;
}

.choice-group > .choice-item:last-child {
  margin: 0;
}

label {
    display: grid;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #465163;
}

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

body.theme-dark input, 
body.theme-dark select, 
body.theme-dark textarea {
    background: rgb(15 22 30);
    color: #fff;
}

input, select, textarea {
    width: 100%;
    border-radius: 12px;
    border: 0;
    padding: 10px 12px;
    background: rgb(243 243 243);
    outline: none;
    box-shadow: none;
    font-size: 20px;
    font-weight: 500;
}

input:focus,
input:focus-visible,
input:active,
select:focus,
select:focus-visible,
select:active,
textarea:focus,
textarea:focus-visible,
textarea:active,
button:focus,
button:focus-visible,
button:active {
  outline: none;
  box-shadow: none;
}

button {
    border: 0;
    border-radius: 12px;
    background: linear-gradient(145deg, #22a6da, #7d82cc);
    color: #fff;
    font-weight: 800;
    padding: 11px 14px;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

input::placeholder, 
select::placeholder, 
textarea::placeholder {color:#757575;opacity:0.3;}


button:hover {
  
  filter: brightness(1.04);
}

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

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(25, 33, 43, 0.24);
  background: rgba(255, 255, 255, 0.92);
  color: #233140;
  font-weight: 700;
  padding: 10px 12px;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}

.button-secondary:focus,
.button-secondary:focus-visible,
.button-secondary:active {
  outline: none;
  box-shadow: none;
}

.button-secondary:hover {
  
  background: rgba(255, 255, 255, 1);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.month-filter {
  display: flex;
  gap: 8px;
  align-items: end;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.icon-button i {
  font-size: 12px;
  line-height: 1;
}

.month-filter label {
  min-width: 180px;
  gap: 7px;
}

.month-filter .select-shell {
  position: relative;
  display: inline-block;
}

.month-filter .select-shell::after {
  content: "\f078";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-48%);
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
  color: #0a7b93;
  pointer-events: none;
  transition: transform 0.18s ease, color 0.18s ease;
}

.month-filter .select-shell:hover::after {
  color: #055f72;
}

.month-filter .select-shell:focus-within::after {
  transform: translateY(-48%) rotate(180deg);
}

.month-filter .select-shell select {
  min-width: 180px;
  padding-right: 36px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(238, 249, 251, 0.94));
  outline: none;
  box-shadow: none;
  color: #112635;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.month-filter .select-shell select:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

.month-select,
.year-select {
  position: relative;
  min-width: 180px;
}

.month-native-select,
.year-native-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.month-select-toggle, .year-select-toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(238, 249, 251, 0.94));
    box-shadow: none;
    color: #112635;
    font-weight: 700;
    padding: 10px 12px;
    border: 1px solid #d1d1d1;
}

.month-select-toggle:focus,
.month-select-toggle:focus-visible,
.month-select-toggle:active,
.year-select-toggle:focus,
.year-select-toggle:focus-visible,
.year-select-toggle:active,
.column-chooser-toggle:focus,
.column-chooser-toggle:focus-visible,
.column-chooser-toggle:active {
  outline: none;
  box-shadow: none;
}

.month-select-toggle i,
.year-select-toggle i {
  font-size: 12px;
  color: #0a7b93;
  transition: transform 0.18s ease;
}

.month-select.is-open .month-select-toggle i,
.year-select.is-open .year-select-toggle i {
  transform: rotate(180deg);
}

.month-select-menu,
.year-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(25, 33, 43, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 24px rgba(25, 33, 43, 0.16);
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.month-select-menu::-webkit-scrollbar,
.year-select-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.month-select-option,
.year-select-option {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #112635;
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
}

.month-select-option:hover,
.year-select-option:hover {
  background: rgba(10, 147, 150, 0.1);
}

.month-select-option.is-active,
.year-select-option.is-active {
  background: rgba(10, 147, 150, 0.18);
  border-color: rgba(10, 147, 150, 0.35);
}

body.theme-dark .month-select-toggle,
body.theme-dark .year-select-toggle {
  border-color: rgba(232, 237, 244, 0.2);
  background: linear-gradient(155deg, rgba(20, 29, 39, 0.98), rgba(16, 24, 34, 0.94));
  color: #e8edf4;
}

body.theme-dark .month-select-toggle i,
body.theme-dark .year-select-toggle i {
  color: #8fd4dc;
}

body.theme-dark .month-select-menu,
body.theme-dark .year-select-menu {
  border-color: rgba(232, 237, 244, 0.2);
  background: rgba(18, 26, 36, 0.98);
}

body.theme-dark .month-select-option,
body.theme-dark .year-select-option {
  color: #e8edf4;
}

body.theme-dark .month-select-option:hover,
body.theme-dark .year-select-option:hover {
  background: rgba(143, 212, 220, 0.14);
}

body.theme-dark .month-select-option.is-active,
body.theme-dark .year-select-option.is-active {
  background: rgba(143, 212, 220, 0.2);
  border-color: rgba(143, 212, 220, 0.4);
}

.column-chooser {
  position: relative;
}

.column-chooser-toggle {
  min-height: 44px;
}

.column-chooser-menu {
    position: absolute;
    left: auto;
    right: 0;
    /* transform: translateX(calc(-100% - 8px)); */
    top: calc(100% + 6px);
    z-index: 25;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: grid;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(25, 33, 43, 0.16);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 24px rgba(25, 33, 43, 0.16);
}

.column-chooser-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.column-chooser-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #10202d;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.column-chooser-option:hover {
  background: rgba(10, 147, 150, 0.1);
}

.column-chooser-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.column-chooser-option span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.column-chooser-option span::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(25, 33, 43, 0.35);
  background: rgba(255, 255, 255, 0.86);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 10px;
  line-height: 1;
  color: transparent;
  transition: all 0.18s ease;
}

.column-chooser-option input:checked + span::before {
  content: "\f00c";
  border-color: rgba(10, 147, 150, 0.85);
  background: linear-gradient(145deg, #0a9396, #005f73);
  color: #fff;
}

.column-chooser-option input:checked + span {
  color: #0f2f39;
}

.column-chooser-option input:focus-visible + span {
  outline: none;
  border-radius: 8px;
}

.matrix-table .is-hidden-column {
  display: none;
}

body.theme-dark .column-chooser-menu {
  border-color: rgba(232, 237, 244, 0.2);
  background: rgba(18, 26, 36, 0.98);
}

body.theme-dark .column-chooser-option {
  color: #e8edf4;
}

body.theme-dark .column-chooser-option:hover {
  background: rgba(143, 212, 220, 0.14);
}

body.theme-dark .column-chooser-option span::before {
  border-color: rgba(232, 237, 244, 0.38);
  background: rgba(15, 23, 34, 0.85);
}

body.theme-dark .column-chooser-option input:checked + span::before {
  border-color: rgba(143, 212, 220, 0.86);
  background: linear-gradient(145deg, #2f9eb2, #246f7d);
}

body.theme-dark .column-chooser-option input:checked + span {
  color: #c7eff3;
}

.table-wrap {
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.matrix-panel {
  overflow: hidden;
}

.matrix-wrap {
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

ul.category-list,
ul.trend-list {
    margin: 0;
    padding: 0;
    gap: 10px;
    display: grid;
}

.table-wrap::-webkit-scrollbar,
.matrix-wrap::-webkit-scrollbar {
  width: 0;
  height: 0;
}
body.theme-dark .button-edit {
    color: #e1e1e1;
}
.matrix-table {
    width: 100%;
    min-width: 1500px;
    border-collapse: collapse;
    cursor: grab;
    user-select: none;
}

.matrix-table th, .matrix-table td {
    border: 1px solid #214862;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    padding: 8px 10px;
    color: #111;
}
.category-list li, 
.trend-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    border-radius: 12px;
    background: #0f1821;
    padding: 10px;
}

.category-list .category-item-income {
  background: rgba(30, 136, 89, 0.16);
  border: 1px solid rgba(30, 136, 89, 0.35);
}

.category-list .category-item-income span,
.category-list .category-item-income strong {
  color: #0f5e3d;
}

.category-list .category-item-expense {
  background: rgba(196, 69, 54, 0.14);
  border: 1px solid rgba(196, 69, 54, 0.32);
}

.category-list .category-item-expense span,
.category-list .category-item-expense strong {
  color: #7b271d;
}

body.theme-dark .category-list li, 
body.theme-dark .trend-list li {
    background: #0f1821;
}

body.theme-dark .category-list .category-item-income {
  background: rgba(30, 136, 89, 0.24);
  border-color: rgba(90, 192, 138, 0.42);
}

body.theme-dark .category-list .category-item-income span,
body.theme-dark .category-list .category-item-income strong {
  color: #b7f5d5;
}

body.theme-dark .category-list .category-item-expense {
  background: rgba(196, 69, 54, 0.26);
  border-color: rgba(235, 128, 116, 0.42);
}

body.theme-dark .category-list .category-item-expense span,
body.theme-dark .category-list .category-item-expense strong {
  color: #ffd4cf;
}


.matrix-table thead th {
  text-transform: none;
  letter-spacing: 0;
  color: #10202d;
}

.matrix-summary-row th {
  font-size: 20px;
  font-weight: 800;
}

.matrix-average-row th {
  font-size: 14px;
}

.matrix-table .col-meta {
  background: #f3f3f3;
  min-width: 120px;
}

.matrix-table .col-month-ua,
.matrix-table .col-month-ru {
  min-width: 110px;
  background: #88d84d;
}

.matrix-table .col-month-ru {
  background: #7fcb42;
}

.matrix-table .col-food {
  background: #84c44d;
}

.matrix-table .col-reserve {
  background: #4d87de;
}

.matrix-table .col-card {
  background: #4f8233;
  color: #f5fff2;
}

.matrix-table .col-outing {
  background: #89b3d9;
}

.matrix-table .col-revenue {
  background: #20a6da;
}

.matrix-table .col-income {
  background: #7d83cc;
  color: #f6f7ff;
}

.matrix-table .col-expense {
  background: #dc9197;
}

.matrix-table .col-party {
  background: #ffcf00;
}

.matrix-table .col-online {
  background: #ecd067;
}

.matrix-table .col-rent {
  background: #e8a87b;
}

.matrix-table .col-shopping {
  background: #f0d66a;
}

.matrix-table .col-currency-uah,
.matrix-table .col-currency-usd {
  background: #ecd06b;
}

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

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

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #506174;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge-income {
  background: rgba(30, 136, 89, 0.12);
  color: var(--income);
}

.badge-expense {
  background: rgba(196, 69, 54, 0.12);
  color: var(--expense);
}

.money {
  font-weight: 800;
}

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

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

.tx-actions {
    display: flex;
    gap: 6px;
    justify-content: end;
}

.tx-actions .delete-form {
  margin: 0;
}

.button-inline {
  padding: 8px 11px;
  font-size: 12px;
}

.button-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(0, 95, 115, 0.45);
  background: linear-gradient(145deg, rgba(0, 95, 115, 0.12), rgba(10, 147, 150, 0.18));
  color: #0c4453;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 8px 11px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
}

.button-edit:hover {
  border-color: rgba(0, 95, 115, 0.68);
  box-shadow: 0 6px 14px rgba(0, 95, 115, 0.22);
  filter: brightness(1.03);
}

.button-edit:focus-visible {
  outline: none;
  box-shadow: none;
}

button.danger {
  background: linear-gradient(145deg, #ad2e24, #c44536);
  padding: 8px 11px;
  font-size: 12px;
}

body.theme-dark .category-list,
body.theme-dark .trend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}


.category-list li, 
.trend-list li {
    background: #0e161e;
}
.category-list li, .trend-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    border-radius: 12px;
    background: #f3f3f3;
    padding: 10px;
}

.trend-list li {
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  font-size: 14px;
}

.month {
  font-weight: 800;
}

.empty {
  margin: 0;
  color: #586273;
}

@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes drift {
  from {
    transform: translateY(0) translateX(0);
  }
  to {
    transform: translateY(-18px) translateX(16px);
  }
}

@keyframes panelSwitchOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0.45;
    transform: translateY(4px) scale(0.995);
  }
}

@keyframes panelRefreshIn {
  from {
    opacity: 0.55;
    transform: translateY(4px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1000px) {
  .hero {
    margin-bottom: 65px;
}
  table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}
.table-wrap {
    max-width: 81vw;
    overflow: scroll;
    display: block;
}
  .choice-group-a .choice-items {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .trend-list li {
    grid-template-columns: 1fr;
    justify-content: start;
  }
}

@media (max-width: 640px) {
  .container {
    margin-top: 20px;
  }

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

  .month-filter {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

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