:root {
  --navy: #1e286f;
  --navy-2: #2f3b8b;
  --bg: #eceef2;
  --bg-soft: #f7f8fb;
  --card: #ffffff;
  --text: #171d2f;
  --muted: #6f7891;
  --line: #dfe4ee;
  --chip: #e2e6ed;
  --danger: #d24e45;
  --danger-soft: #fff5f4;
  --success: #1f8a4a;
  --shadow: 0 14px 34px rgba(21, 29, 50, 0.11);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Sora", "Manrope", "Segoe UI", "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

input,
select,
textarea {
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.auth-body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% -10%, #ffffff 0%, #eef1f6 45%, #e9edf5 100%);
}

.app-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #e9ecf2 0%, #eef1f7 60%, #eceff5 100%);
}

.toast-root {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 120;
  display: grid;
  gap: 8px;
}

.toast {
  border-radius: 12px;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.toast.info {
  background: #334155;
}

.toast.success {
  background: #178847;
}

.toast.error {
  background: #b42318;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 14px;
}

.auth-screen {
  width: min(560px, 100%);
}

.auth-brand {
  display: grid;
  justify-items: center;
  margin-bottom: 24px;
}

.brand-icon {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px rgba(31, 40, 107, 0.3);
}

.auth-brand h1 {
  margin: 14px 0 6px;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -1.4px;
}

.auth-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.auth-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid #e5e9f0;
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
}

.auth-switch {
  background: #dde2ea;
  border-radius: 15px;
  padding: 5px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-switch-link {
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
  font-size: 1.02rem;
  font-weight: 700;
  color: #737f93;
  background: transparent;
  transition: all 0.2s ease;
}

.auth-switch-link.active {
  color: var(--text);
  background: #f6f7fa;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

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

.auth-form input {
  width: 100%;
  border: 1px solid #d7dde7;
  border-radius: 15px;
  background: #eaedf3;
  font-size: 1.08rem;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.auth-form input:focus {
  border-color: #94a3d1;
  background: #f7f9fc;
}

.auth-extra {
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2f3853;
  font-weight: 600;
}

.remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--navy);
}

.auth-link {
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 0;
  font-weight: 700;
}

.auth-cta {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  margin-top: 2px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: var(--navy);
}

.auth-status {
  min-height: 18px;
  margin: 8px 2px 0;
  font-size: 0.85rem;
}

.auth-status.error {
  color: #b42318;
}

.auth-status.success {
  color: #15803d;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--navy);
  color: #fff;
}

.topbar-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-link {
  color: #fff;
  font-size: 2rem;
  letter-spacing: -0.7px;
  font-weight: 800;
}

.user-zone {
  position: relative;
}

.user-btn {
  border: 0;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
  font-weight: 800;
}

.user-menu {
  position: absolute;
  top: 50px;
  right: 0;
  width: 185px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.menu-link,
.user-menu button {
  width: 100%;
  display: block;
  border: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
}

.menu-link:hover,
.user-menu button:hover {
  background: #f3f5f9;
}

.container {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 18px 24px;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.entry-composer-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1360px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  z-index: 101;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.page-head h2 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.4px;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary {
  border: 0;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 12px 24px rgba(25, 35, 97, 0.26);
}

.summary .page-head {
  margin-bottom: 8px;
}

.summary .page-head h2 {
  color: #fff;
  font-size: 1.28rem;
}

.summary .page-head p {
  color: #b7c0df;
  font-size: 0.88rem;
}

.summary .label {
  color: #b7c0df;
  font-size: 0.86rem;
}

.summary .total {
  margin: 2px 0 12px;
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -1.2px;
  font-weight: 800;
}

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

.metric {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
}

.metric .icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.metric .name {
  color: #aab5d8;
  font-size: 0.8rem;
}

.metric .value {
  font-size: 1.12rem;
  font-weight: 700;
}

.summary-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-actions .btn.secondary {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.section {
  margin-top: 8px;
}

.section-head {
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.3px;
}

.section-head .right {
  color: var(--danger);
  font-size: 1.42rem;
  font-weight: 800;
}

.chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 0;
  border-radius: 999px;
  background: #eceff4;
  color: #6f7a8d;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.chip.active {
  background: var(--danger);
  color: #fff;
}

.days-input {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.days-input input {
  width: 58px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f5f7fb;
  text-align: center;
  padding: 6px;
  outline: none;
}

.list {
  display: grid;
  gap: 9px;
}

.row-item {
  border-radius: 13px;
  border: 1px solid #f0dada;
  background: var(--danger-soft);
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.row-item.white {
  background: #fff;
  border-color: var(--line);
}

.ledger-row {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.ledger-row:hover {
  border-color: #c9d4e8;
  box-shadow: 0 6px 16px rgba(22, 30, 52, 0.08);
  transform: translateY(-1px);
}

.row-title {
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.row-sub {
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--muted);
}

.row-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--danger);
}

.row-value.normal {
  color: var(--text);
}

.row-value.positive {
  color: var(--success);
}

.row-value.negative {
  color: var(--danger);
}

.empty {
  border: 1px dashed #ccd5e4;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  padding: 14px 12px;
  font-size: 0.9rem;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  border: 0;
  border-radius: 14px;
  background: var(--chip);
  color: #6f7890;
  padding: 9px 14px;
  font-size: 0.97rem;
  font-weight: 700;
}

.tab.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 40, 107, 0.23);
}

.section-block {
  border: 1px dashed #d4dbe9;
  padding: 12px;
  border-radius: 14px;
}

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

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

.entry-top-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--navy);
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  border: 1px solid #cfd6e6;
  border-radius: 999px;
  padding: 5px 10px 5px 6px;
  background: #f5f7fc;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-slider {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cfd6e6;
  position: relative;
  transition: background-color 0.2s ease;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.18);
  transition: transform 0.2s ease;
}

.toggle-labels {
  display: inline-flex;
  gap: 8px;
  color: #6c7891;
  font-size: 0.8rem;
  font-weight: 700;
}

.toggle-state {
  color: #6c7891;
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 26px;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--navy);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(18px);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f8fc;
  padding: 10px 11px;
  outline: none;
}

.field input[readonly] {
  background: #eef2f8;
  color: #4b556b;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #97a7d3;
  background: #fff;
}

.field textarea {
  resize: vertical;
  min-height: 88px;
}

.span-2 {
  grid-column: span 2;
}

.actions {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  background: var(--navy);
  color: #fff;
}

.btn.secondary {
  border-color: var(--line);
  background: #f4f6fa;
  color: #334155;
}

.btn.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.mini-btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fc;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
}

.mini-btn.primary {
  border-color: rgba(31, 40, 107, 0.25);
  background: #ecf0ff;
  color: var(--navy);
}

.mini-btn.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.account-list {
  display: grid;
  gap: 9px;
}

.account-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 11px;
}

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

.account-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #edf1f9;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 800;
}

.account-meta {
  min-width: 0;
}

.account-name {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-sub {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.account-side {
  text-align: right;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.account-amount {
  font-size: 1.14rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.account-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.account-row.inactive {
  opacity: 0.72;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ecfdf3;
  color: #0f7b3a;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-pill.closed {
  background: #f3f4f6;
  border-color: #e2e8f0;
  color: #475569;
}

.status-pill.warn {
  background: #fff4f2;
  border-color: #fecaca;
  color: #b42318;
}

.profile-grid {
  display: grid;
  gap: 14px;
}

.profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8f9fc;
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-user .avatar {
  color: var(--navy);
  border-color: #d7dff2;
  background: #eef2fc;
}

.profile-name {
  margin: 0;
  font-size: 1.14rem;
}

.profile-email {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.income-type-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.income-type-btn {
  border: 1px solid #d7deea;
  border-radius: 11px;
  background: #f7f8fb;
  color: #6f7991;
  font-weight: 700;
  padding: 9px 8px;
}

.income-type-btn.active {
  background: #eef2ff;
  border-color: #a6b3dd;
  color: var(--navy);
}

.bottom-nav-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
}

.bottom-nav {
  width: min(1180px, 100%);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bottom-nav a {
  color: #768198;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 5px;
  font-size: 0.79rem;
  font-weight: 700;
}

.bottom-nav .icon {
  font-size: 1.04rem;
}

.bottom-nav a.active {
  color: var(--navy);
}

.fab {
  position: fixed;
  right: 16px;
  bottom: 88px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 12px 24px rgba(31, 40, 107, 0.38);
  font-size: 2rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 14px;
  background: rgba(15, 23, 42, 0.45);
}

.modal-backdrop.show {
  display: grid;
}

.modal {
  width: min(760px, 100%);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
  max-height: 88vh;
  overflow: auto;
}

.confirm-modal {
  width: min(460px, 100%);
}

.confirm-body {
  color: #475569;
  font-size: 0.95rem;
  margin: 6px 0 10px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.18rem;
}

.icon-btn {
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f2f5fb;
  color: #344155;
}

.loading-bar {
  margin-top: 10px;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}

.loading-bar > span {
  display: block;
  width: 34%;
  height: 100%;
  background: #f8fafc;
  animation: load 1s linear infinite;
}

.analytics-panel {
  display: grid;
  gap: 12px;
}

.analytics-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.analytics-periods {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.period-chip {
  border: 0;
  border-radius: 999px;
  background: #e7ebf2;
  color: #6f7991;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 10px;
}

.period-chip.active {
  background: var(--navy);
  color: #fff;
}

.search-row {
  width: 100%;
}

.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f8fc;
  padding: 10px 11px;
  outline: none;
}

.search-input:focus {
  border-color: #97a7d3;
  background: #fff;
}

.entries-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.entries-head {
  margin-bottom: 0;
}

.entries-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.entries-filter-bar .search-input {
  flex: 1;
}

.entries-advanced-filters {
  border: 1px dashed #cdd6e8;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}

.entries-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.entries-filter-label {
  color: #66738f;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 62px;
}

.chip-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #f6f8fc;
  color: #4f5d79;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.chip-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.analytics-kpi-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 11px;
}

.analytics-kpi-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.analytics-kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 2px;
}

.analytics-kpi-value.positive {
  color: #0f9f64;
}

.analytics-kpi-value.negative {
  color: #e2342e;
}

.analytics-category-wrap {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
}

.analytics-donut {
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: conic-gradient(#25328f 0deg 360deg);
  position: relative;
  margin: 0 auto;
}

.analytics-donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #edf0f7;
}

.analytics-legend {
  display: grid;
  gap: 8px;
}

.analytics-legend-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.analytics-legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.analytics-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.analytics-legend-name {
  font-size: 0.82rem;
  color: #3d465d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-legend-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2937;
}

.analytics-bars {
  display: grid;
  gap: 11px;
}

.analytics-bar-row {
  display: grid;
  gap: 5px;
}

.analytics-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
}

.analytics-bar-name {
  color: #334155;
  font-weight: 700;
}

.analytics-bar-value {
  color: #4b5563;
  font-weight: 700;
  font-size: 0.76rem;
}

.analytics-bar-track {
  height: 8px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}

.analytics-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #25328f;
}

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

.analytics-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 11px;
}

.analytics-list-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.analytics-rank {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  display: grid;
  place-items: center;
  font-size: 0.63rem;
  font-weight: 700;
  flex-shrink: 0;
}

.analytics-list-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1f2937;
}

.analytics-list-sub {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 1px;
}

.analytics-list-value {
  color: #e2342e;
  font-size: 0.88rem;
  font-weight: 800;
}

.analytics-chart {
  border: 1px solid #eef2f8;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.analytics-chart-bars {
  height: 170px;
  display: flex;
  align-items: end;
  justify-content: space-around;
  gap: 10px;
  border-bottom: 1px solid #d8dde8;
  padding: 8px 4px 10px;
}

.analytics-chart-group {
  width: 56px;
  display: grid;
  justify-items: center;
  gap: 5px;
}

.analytics-chart-pair {
  width: 40px;
  height: 130px;
  display: grid;
  align-items: end;
  gap: 3px;
  grid-template-columns: repeat(2, 1fr);
}

.analytics-chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.analytics-chart-bar.income {
  background: #0f9f64;
}

.analytics-chart-bar.expense {
  background: #e2342e;
}

.analytics-chart-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.analytics-chart-legend {
  margin-top: 9px;
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 0.72rem;
  color: #475569;
}

.analytics-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.analytics-legend-chip::before {
  content: "";
  width: 10px;
  height: 6px;
  border-radius: 2px;
  display: inline-block;
}

.analytics-legend-chip.income::before {
  background: #0f9f64;
}

.analytics-legend-chip.expense::before {
  background: #e2342e;
}

.analytics-day-chart {
  height: 150px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  border-bottom: 1px solid #d8dde8;
  padding: 8px 4px 10px;
}

.analytics-day-item {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.analytics-day-bar {
  width: 18px;
  border-radius: 6px 6px 0 0;
  background: #f39a2b;
  min-height: 4px;
}

.analytics-day-label {
  color: var(--muted);
  font-size: 0.68rem;
}

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

.analytics-mini-card {
  padding: 12px;
}

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

.analytics-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.analytics-type-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.analytics-type-name {
  font-size: 0.82rem;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-type-count {
  color: #475569;
  font-weight: 700;
  font-size: 0.8rem;
}

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

.analytics-udhar-box {
  border-radius: 11px;
  padding: 11px;
  border: 1px solid transparent;
}

.analytics-udhar-box.receive {
  background: #eef8f2;
  border-color: #d8f3e3;
}

.analytics-udhar-box.pay {
  background: #fdf1f1;
  border-color: #fed7d7;
}

.analytics-udhar-net {
  margin: 10px 0 0;
  text-align: center;
  font-weight: 800;
  color: #e2342e;
  font-size: 0.95rem;
}

@keyframes load {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(320%);
  }
}

@media (max-width: 980px) {
  .topbar-inner {
    padding: 14px 12px;
  }

  .container {
    padding: 12px 12px 24px;
  }

  .summary .total {
    font-size: 2.2rem;
  }

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

@media (max-width: 760px) {
  .brand-link {
    font-size: 1.8rem;
  }

  .user-btn {
    font-size: 0.95rem;
  }

  .avatar {
    width: 36px;
    height: 36px;
  }

  .grid,
  .metric-grid,
  .income-type-row {
    grid-template-columns: 1fr;
  }

  .analytics-kpi-grid {
    grid-template-columns: 1fr;
  }

  .analytics-kpi-grid-two {
    grid-template-columns: 1fr;
  }

  .analytics-mini-grid {
    grid-template-columns: 1fr;
  }

  .analytics-category-wrap {
    grid-template-columns: 1fr;
  }

  .analytics-periods {
    width: 100%;
  }

  .analytics-filters .btn.secondary {
    width: 100%;
  }

  .span-2 {
    grid-column: span 1;
  }

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

  .account-side {
    justify-items: start;
    text-align: left;
  }

  .account-actions {
    justify-content: flex-start;
  }

  .section-head h2 {
    font-size: 1.25rem;
  }

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

  .entries-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .entries-filter-actions {
    width: 100%;
  }

  .entries-filter-actions .btn {
    flex: 1;
  }
}
