/* ==========================================================================
   FINANCEIRO — Coinest Palette & Bento Layout (Light + Forest Dark Mode)
   ========================================================================== */

:root,
[data-theme="light"] {
  --forest: #1A3C34;
  --forest-deep: #122B25;
  --forest-bar: #1D4037;
  --lime: #B5EF72;
  --lime-hover: #A4E55B;
  --lime-soft: #E2F8C7;
  --mint-tint: #EAF4E5;
  --sidebar-bg: #ECF4E9;
  --bg: #F6F8F6;
  --surface: #FFFFFF;
  --surface-2: #F0F4F1;
  --border: #E4ECE6;
  --text: #132A23;
  --muted: #6C7F78;
  --card-on-forest: #FFFFFF;
  --danger: #D92D20;
  --danger-soft: #FEE4E2;
  --amber: #D97706;
  --amber-soft: #FEF3C7;
  --shadow-card: 0 4px 20px rgba(26, 60, 52, 0.04);
  --shadow-hover: 0 10px 28px rgba(26, 60, 52, 0.08);
  --shadow-pop: 0 14px 38px rgba(19, 42, 35, 0.14);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --forest: #1A3C34;
  --forest-deep: #0E0E12;
  --forest-bar: #3B9B76;
  --lime: #B5EF72;
  --lime-hover: #C3F48B;
  --lime-soft: rgba(181, 239, 114, 0.14);
  --mint-tint: #1A1A20;
  --sidebar-bg: #0C0C0F;
  --bg: #08080A;
  --surface: #121216;
  --surface-2: #1A1A20;
  --border: #24242C;
  --text: #F4F4F6;
  --muted: #9496A1;
  --card-on-forest: #FFFFFF;
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.16);
  --amber: #FBBF24;
  --amber-soft: rgba(251, 191, 36, 0.16);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.42);
  --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 18px 44px rgba(0, 0, 0, 0.72);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.22s ease, color 0.22s ease;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
  padding: 0;
}

a {
  color: var(--forest-bar);
  text-decoration: none;
  font-weight: 600;
}
[data-theme="dark"] a {
  color: var(--lime);
}

button, input, select, textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* Theme Icon Visibility */
[data-theme="light"] .ico-sun { display: none; }
[data-theme="light"] .ico-moon { display: block; }
[data-theme="dark"] .ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: block; color: var(--lime); }

/* Custom Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 60, 52, 0.28) transparent;
}
[data-theme="dark"] * {
  scrollbar-color: rgba(181, 239, 114, 0.28) transparent;
}
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(108, 127, 120, 0.35);
  border-radius: 999px;
}

/* ==========================================================================
   AUTH SCREEN (Unified Centered Login / Register)
   ========================================================================== */
.auth-wrap {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  overflow: hidden;
}

.auth-wrap::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 239, 114, 0.14) 0%, transparent 68%);
  pointer-events: none;
}
[data-theme="dark"] .auth-wrap::before {
  background: radial-gradient(circle, rgba(181, 239, 114, 0.06) 0%, transparent 68%);
}

.auth-theme-btn {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 30;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 38px 34px;
  box-shadow: var(--shadow-card);
}

.auth-brand-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--mint-tint);
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .auth-logo-badge {
  color: var(--lime);
}

.auth-brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text);
}

.auth-card-head {
  text-align: center;
  margin-bottom: 26px;
}

.muninn-name {
  font-size: 25px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-card-sub {
  font-size: 13.8px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

/* ==========================================================================
   MAIN LAYOUT & AUTO-HIDE SIDEBAR (Opens smoothly on hover)
   ========================================================================== */
.layout {
  display: flex;
  min-height: 100vh;
  padding-left: 68px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  width: 68px;
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.24s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.24s ease,
              background-color 0.22s ease;
}

.sidebar:hover {
  width: 232px;
  box-shadow: var(--shadow-pop);
}

.side-head {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 72px;
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.side-logo {
  width: 44px;
  height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--forest);
}
[data-theme="dark"] .side-logo {
  color: var(--lime);
}

.side-brand {
  margin-left: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text);
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.2s ease;
}

.sidebar:hover .side-brand {
  opacity: 1;
  transform: translateX(0);
}

.side-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-entry {
  width: 100%;
}

.side-item {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.side-item:hover {
  background: rgba(26, 60, 52, 0.07);
  color: var(--text);
}
[data-theme="dark"] .side-item:hover {
  background: rgba(181, 239, 114, 0.10);
  color: var(--text);
}

.side-item.active {
  background: var(--lime);
  color: #132A23;
  font-weight: 700;
}
.side-item.active:hover {
  background: var(--lime-hover);
  color: #132A23;
}

.side-ico {
  width: 44px;
  height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.side-label {
  padding-left: 4px;
  padding-right: 16px;
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.2s ease;
}

.sidebar:hover .side-label {
  opacity: 1;
  transform: translateX(0);
}

/* Bottom Sidebar Widget: Modo Privacidade + Saldo Acumulado Geral (Flat, borderless, lock-only interaction) */
.side-promo {
  width: 100%;
  margin: 0;
  padding: 8px 16px 18px;
  border: none;
  box-shadow: none;
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-promo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
}

.side-promo-lock {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 36px;
  padding: 0;
  flex: none;
  border-radius: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  outline: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.side-promo-lock:hover {
  background: rgba(26, 60, 52, 0.08);
  color: var(--text);
}
[data-theme="dark"] .side-promo-lock:hover {
  background: rgba(181, 239, 114, 0.12);
  color: var(--text);
}

.side-promo-lock:active {
  transform: scale(0.93);
}

.side-promo-lock .ico-locked {
  display: none;
}
.side-promo-lock .ico-unlocked {
  display: block;
}

[data-privacy="1"] .side-promo-lock {
  background: var(--lime);
  color: #132A23;
}
[data-privacy="1"] .side-promo-lock:hover {
  background: var(--lime-hover);
  color: #132A23;
}
[data-privacy="1"] .side-promo-lock .ico-unlocked {
  display: none;
}
[data-privacy="1"] .side-promo-lock .ico-locked {
  display: block;
}

.side-promo-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--muted);
  white-space: nowrap;
  user-select: none;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.16s ease, transform 0.18s ease, color 0.16s ease;
}

.sidebar:hover .side-promo-badge {
  opacity: 1;
  transform: translateX(0);
}

[data-privacy="1"] .side-promo-badge {
  color: var(--text);
  font-weight: 700;
}

.side-promo-body {
  display: flex;
  flex-direction: column;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
  transition: max-height 0.22s ease, opacity 0.18s ease, margin-top 0.2s ease;
}

.sidebar:hover .side-promo-body {
  max-height: 64px;
  opacity: 1;
  margin-top: 8px;
}

.side-promo-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-val {
  display: inline-block;
}

.side-promo-val {
  display: block;
  width: fit-content;
  max-width: 100%;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-promo-val.is-negative {
  color: var(--danger);
}

/* Global Privacy Mode Blur for Monetary Values */
.money-val,
.kpi-num,
#donut-total-val,
.cat-row-val,
.plans-total-val {
  transition: filter 0.18s ease, opacity 0.18s ease;
}

[data-privacy="1"] .money-val,
[data-privacy="1"] .kpi-num,
[data-privacy="1"] #donut-total-val,
[data-privacy="1"] .cat-row-val,
[data-privacy="1"] .plans-total-val {
  filter: blur(7px);
  user-select: none;
}

/* ==========================================================================
   TOPBAR & MAIN CONTAINER
   ========================================================================== */
.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 72px;
  padding: 0 clamp(18px, 2.5vw, 32px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.topbar .spacer {
  flex: 1;
}

.topbar-search-wrap {
  position: relative;
  width: min(290px, 28vw);
}

.topbar-search {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.16s, background-color 0.16s, box-shadow 0.16s;
}
.topbar-search::placeholder {
  color: var(--muted);
}
.topbar-search:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--forest-bar);
  box-shadow: 0 0 0 3px var(--mint-tint);
}

.topbar-search-ico {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.icon-circle {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--mint-tint);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: transform 0.14s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.icon-circle:hover {
  background: var(--lime);
  color: #132A23;
  border-color: var(--lime);
  transform: translateY(-1px);
}
[data-theme="dark"] .icon-circle:hover .ico-sun {
  color: #132A23;
}

.btn-logout-circle {
  background: var(--surface);
}
.btn-logout-circle:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-soft);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}
.user-meta strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.user-meta span {
  font-size: 11.5px;
  color: var(--muted);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--lime);
  color: #132A23;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  flex: none;
}

.container {
  width: 100%;
  padding: 6px clamp(18px, 2.5vw, 32px) 36px;
}

/* ==========================================================================
   COINEST BENTO DASHBOARD GRID
   ========================================================================== */
.coinest-bento {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: start;
}

.bento-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.c-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: background-color 0.22s ease, border-color 0.22s ease;
}

.c-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.c-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* 1. Virtual Bank Balance Card (Deep Forest Green) */
.virtual-card {
  background: linear-gradient(140deg, #1D433A 0%, #132D27 100%);
  border-radius: 22px;
  padding: 22px;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(19, 42, 35, 0.18);
}
[data-theme="dark"] .virtual-card {
  border: 1px solid rgba(181, 239, 114, 0.22);
}

.virtual-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 239, 114, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.vc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.vc-logo {
  color: var(--lime);
  display: inline-flex;
}

.vc-nfc {
  color: rgba(255, 255, 255, 0.72);
  display: inline-flex;
}

.vc-holder {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.95);
}

.vc-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.vc-bal-lbl {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 4px;
}

.vc-bal-num {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #FFFFFF;
}

.vc-meta-cols {
  display: flex;
  gap: 14px;
  text-align: right;
}
.vc-meta-cols small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
  margin-bottom: 2px;
}
.vc-meta-cols strong {
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
}

/* 2. Quick Actions Strip */
.quick-actions {
  background: var(--mint-tint);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.qa-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  border-radius: 14px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.qa-btn:hover {
  background: var(--surface);
  transform: translateY(-2px);
}

.qa-ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--surface);
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .qa-ico {
  color: var(--lime);
}

/* 3. Comprometimento / Spending Limit Progress Card */
.limit-stats {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12.5px;
}

.limit-stats strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.limit-stats .muted {
  color: var(--muted);
  font-size: 11.5px;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--lime);
  overflow: hidden;
}
[data-theme="dark"] .progress-track {
  background: rgba(181, 239, 114, 0.25);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--forest);
  transition: width 0.35s ease;
}
[data-theme="dark"] .progress-fill {
  background: var(--lime);
}

/* 4. Saving Plans / Recorrências Fixas Card */
.plans-total-lbl {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.plans-total-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

.link-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--forest-bar);
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
}
[data-theme="dark"] .link-btn {
  color: var(--lime);
}
.link-btn:hover {
  background: var(--mint-tint);
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-item {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 16px;
  padding: 12px 14px;
}

.plan-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.plan-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--mint-tint);
  color: var(--forest-bar);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
[data-theme="dark"] .plan-ico {
  color: var(--lime);
}

.plan-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 7px;
}
.plan-meta strong {
  color: var(--text);
}

/* 5. Center Top: 3 KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.kpi-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.kpi-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--mint-tint);
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .kpi-ico {
  color: var(--lime);
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}
.trend-badge.up {
  background: var(--lime-soft);
  color: #1A3C34;
}
[data-theme="dark"] .trend-badge.up {
  color: var(--lime);
}
.trend-badge.down {
  background: var(--danger-soft);
  color: var(--danger);
}

.kpi-num {
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.kpi-lbl {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

/* 6. Cashflow Card & Month Pill Selector */
.period-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
}

.period-pill button {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background-color 0.14s;
}
.period-pill button:hover {
  background: var(--lime);
  color: #132A23;
}

.period-pill span {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  min-width: 112px;
  text-align: center;
}

.cashflow-sub {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.cf-bal small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.cf-bal strong {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.cf-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.cf-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}
.cf-dot.inc { background: var(--forest-bar); }
.cf-dot.exp { background: var(--lime); }

/* 7. Coinest Tables (Mint Header Row) */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

thead tr {
  background: var(--mint-tint);
}

thead th {
  padding: 12px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
thead th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
thead th:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-2);
}

.tx-title-cell strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.tx-title-cell small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

tfoot td {
  padding: 14px;
  border-top: 2px solid var(--border);
  font-size: 14px;
}

/* Status & Category Pills */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.pill-green {
  background: var(--lime-soft);
  color: #1A3C34;
}
[data-theme="dark"] .pill-green {
  color: var(--lime);
}

.pill-red {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill-muted {
  background: var(--surface-2);
  color: var(--muted);
}

.amount-positive {
  color: #1E7E48;
  font-weight: 700;
}
[data-theme="dark"] .amount-positive {
  color: var(--lime);
}

.amount-negative {
  color: var(--danger);
  font-weight: 700;
}

/* 8. Right Column: Statistic Donut Card + Tabs */
.stat-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}

.stat-tab {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 10px 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  transition: color 0.15s;
}

.stat-tab.active {
  color: var(--text);
  font-weight: 700;
}

.stat-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 3px;
  border-radius: 999px;
  background: var(--forest-bar);
}
[data-theme="dark"] .stat-tab.active::after {
  background: var(--lime);
}

.donut-wrap {
  position: relative;
  height: 195px;
  width: 100%;
  margin-bottom: 18px;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.donut-center small {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.donut-center strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.cat-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.cat-pct {
  min-width: 44px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
}

.cat-row-name {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-row-val {
  font-weight: 700;
  color: var(--text);
}

/* 9. Right Bottom: Activity Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.tl-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lime);
  color: #132A23;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 12px;
  font-weight: 800;
}

.tl-body {
  flex: 1;
  min-width: 0;
}

.tl-body p {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.4;
}

.tl-body small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* ==========================================================================
   TRANSACTIONS & CATEGORIES VIEWS
   ========================================================================== */
.view-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar input,
.toolbar select {
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 0 16px;
  font-size: 13.5px;
}
.toolbar input:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--forest-bar);
}

.row-actions {
  display: inline-flex;
  gap: 6px;
}

.icon-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--lime);
  border-color: var(--lime);
  color: #132A23;
}

.icon-btn.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger-soft);
  color: var(--danger);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.cat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-card-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--mint-tint);
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .cat-card-ico {
  color: var(--lime);
}

.cat-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   BUTTONS, FORMS & MODALS
   ========================================================================== */
.btn {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s ease, background-color 0.16s ease, filter 0.16s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--forest);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: #235046;
}
[data-theme="dark"] .btn-primary {
  background: var(--lime);
  color: #132A23;
}
[data-theme="dark"] .btn-primary:hover {
  background: var(--lime-hover);
}

.btn-lime {
  background: var(--lime);
  color: #132A23;
}
.btn-lime:hover {
  background: var(--lime-hover);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--mint-tint);
  border-color: var(--forest-bar);
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}
.btn-danger:hover {
  filter: brightness(1.08);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
  padding: 13px 20px;
  margin-top: 8px;
}

/* Form Fields */
.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.16s, box-shadow 0.16s, background-color 0.16s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--forest-bar);
  box-shadow: 0 0 0 3px var(--mint-tint);
}

.color-picker {
  width: 100%;
  height: 43px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
}

.type-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.seg-option {
  margin: 0 !important;
  cursor: pointer;
}
.seg-option input {
  display: none;
}
.seg-option span {
  display: block;
  text-align: center;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.15s ease;
}
.seg-option input:checked + span {
  background: var(--lime);
  color: #132A23;
}

.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--mint-tint);
  color: var(--text) !important;
  margin-bottom: 0 !important;
}
.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--forest);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  padding: 20px;
  background: rgba(9, 18, 15, 0.58);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 1000;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
  overflow-y: auto;
}
.modal.modal-sm {
  max-width: 420px;
}

.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.modal-body {
  padding: 22px 24px;
}

.modal-helper {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.close-x {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.close-x:hover {
  background: var(--mint-tint);
  color: var(--text);
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--lime);
  border: 2px solid var(--lime);
  font-size: 26px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-pop);
  z-index: 90;
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.fab:hover {
  transform: scale(1.07);
  background: var(--lime);
  color: #132A23;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--forest);
  color: #FFFFFF;
  border: 1px solid rgba(181, 239, 114, 0.35);
  border-left: 5px solid var(--lime);
  border-radius: 14px;
  padding: 13px 20px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.err {
  border-left-color: var(--danger);
}

/* ==========================================================================
   HOUSEHOLD, PERSON ATTRIBUTION & AUDITABILITY
   ========================================================================== */
.household-pill-btn {
  appearance: none;
  -webkit-appearance: none;
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  transition: transform 0.14s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.household-pill-btn:hover {
  background: var(--lime);
  color: #132A23;
  border-color: var(--lime);
  transform: translateY(-1px);
}

.user-chip-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  font-family: inherit;
  text-align: right;
  transition: background-color 0.15s ease;
}

.user-chip-btn:hover {
  background: var(--mint-tint);
}

/* Dashboard Top Person Filter Bar */
.dash-person-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.person-tabs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
  box-shadow: var(--shadow-card);
}

.person-tab {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.person-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.person-tab.active {
  background: var(--forest);
  color: #FFFFFF;
}

[data-theme="dark"] .person-tab.active {
  background: var(--lime);
  color: #132A23;
}

/* Dashboard Left Column: Gastos por Pessoa Card */
.person-split-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.person-split-row {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.person-split-row:hover {
  border-color: var(--forest-bar);
  transform: translateY(-1px);
}

.person-split-row.is-selected {
  border-color: var(--forest-bar);
  background: var(--mint-tint);
}

[data-theme="dark"] .person-split-row.is-selected {
  border-color: var(--lime);
}

.person-split-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--mint-tint);
  color: var(--forest);
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

[data-theme="dark"] .person-split-ava {
  color: var(--lime);
}

.person-split-ava.shared {
  background: var(--lime-soft);
  color: #1A3C34;
}

[data-theme="dark"] .person-split-ava.shared {
  color: var(--lime);
}

.person-split-info {
  flex: 1;
  min-width: 0;
}

.person-split-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.person-split-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-split-amt {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.person-split-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.person-split-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.person-split-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--forest-bar);
  transition: width 0.3s ease;
}

[data-theme="dark"] .person-split-bar-fill {
  background: var(--lime);
}

.person-split-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  min-width: 32px;
  text-align: right;
}

/* Person Chip inside Tables */
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--mint-tint);
  color: var(--forest);
  white-space: nowrap;
}

[data-theme="dark"] .person-chip {
  color: var(--lime);
}

.person-chip.shared {
  background: var(--surface-2);
  color: var(--muted);
}

/* Transaction Modal Audit Note */
.tx-audit-note {
  margin-top: 4px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

.installment-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.installment-summary {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.installment-summary strong {
  color: var(--text);
}

.inst-badge {
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 10.5px;
  vertical-align: middle;
}

/* Household Modal Elements */
.invite-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--mint-tint);
  border: 1px solid var(--border);
}

.invite-code-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 3px;
}

.invite-code-val {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.member-ava {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lime);
  color: #132A23;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.member-info small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.member-id-badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.household-subform {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.subform-title {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.join-code-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 15px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.join-code-input:focus {
  outline: none;
  border-color: var(--forest-bar);
  background: var(--surface);
}

/* ==========================================================================
   CARTÕES & BANCOS VIEW
   ========================================================================== */
.acc-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.acc-section-head h3 {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text);
}

.acc-section-head span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.acc-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.acc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.acc-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--acc-color, var(--forest));
}

.acc-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.acc-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.acc-badge-ico {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.acc-badge-ico svg {
  width: 62%;
  height: 62%;
  display: block;
}

.acc-fav-img {
  width: 64%;
  height: 64%;
  object-fit: contain;
  border-radius: 5px;
  background: #FFFFFF;
  padding: 2px;
}

.acc-top-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.card-net-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1;
  flex: none;
}

.card-net-badge.visa {
  padding: 0 7px;
  background: rgba(26, 31, 113, 0.09);
  color: #1A1F71;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.6px;
}

[data-theme="dark"] .card-net-badge.visa {
  background: rgba(92, 141, 255, 0.16);
  color: #82A8FF;
}

.card-net-badge.elo {
  padding: 0 4px;
  background: var(--surface-2);
  color: var(--text);
}

.card-net-badge.amex {
  padding: 0 6px;
  background: #006FCF;
  color: #FFFFFF;
  font-size: 9.5px;
}

.card-net-badge.hiper {
  padding: 0 6px;
  background: #B3131B;
  color: #FFFFFF;
  font-size: 9.5px;
}

.acc-titles {
  min-width: 0;
}

.acc-titles strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-titles small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.acc-main-metric {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 15px;
}

.acc-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.acc-metric-head span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.acc-metric-head small {
  font-size: 11px;
  color: var(--muted);
}

.acc-big-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
}

.acc-limit-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-limit-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.acc-limit-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--forest-bar);
  transition: width 0.35s ease;
}

[data-theme="dark"] .acc-limit-fill {
  background: var(--lime);
}

.acc-limit-fill.is-warn {
  background: var(--amber) !important;
}

.acc-limit-fill.is-danger {
  background: var(--danger) !important;
}

.acc-limit-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.acc-limit-meta strong {
  color: var(--text);
  font-weight: 700;
}

.acc-limit-total {
  font-size: 11.5px;
  color: var(--muted);
}

.acc-limit-total strong {
  color: var(--text);
}

.acc-bank-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.acc-bank-stat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 10px 12px;
}

.acc-bank-stat-box small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.acc-bank-stat-box strong {
  font-size: 13.5px;
  font-weight: 800;
}

.acc-card-foot {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.acc-foot-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* Modal Live Brand Preview Strip, Swatches & Transaction Account Tag */
.brand-preview-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 11px 14px;
  margin-bottom: 15px;
}

.brand-preview-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-preview-texts {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-preview-texts > strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-preview-detected {
  font-size: 11.5px;
  color: var(--forest-bar);
  font-weight: 600;
}

[data-theme="dark"] .brand-preview-detected {
  color: var(--lime);
}

.brand-preview-hint {
  font-size: 11.5px;
  color: var(--muted);
}

.brand-preview-right {
  flex: none;
  display: inline-flex;
  align-items: center;
}

.account-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-color-input {
  width: 46px !important;
  flex: none;
}

.bank-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bank-swatch {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.bank-swatch:hover {
  transform: scale(1.16);
  border-color: var(--text);
}

.tx-acc-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--text);
  vertical-align: middle;
}

.tx-acc-tag .acc-badge-ico {
  box-shadow: none;
}

.tx-acc-tag i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1220px) {
  .coinest-bento {
    grid-template-columns: 270px minmax(0, 1fr);
  }
  .bento-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
}

@media (max-width: 920px) {
  .coinest-bento {
    grid-template-columns: 1fr;
  }
  .bento-right {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    padding-left: 0;
  }
  .sidebar,
  .sidebar:hover {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
  }
  .side-head {
    width: auto;
    height: 58px;
  }
  .side-brand,
  .side-label {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
  }
  .side-entry {
    width: auto;
    flex: none;
  }
  .side-promo,
  .sidebar:hover .side-promo {
    width: auto;
    flex: none;
    margin: 0 10px 0 4px;
    padding: 5px;
    border-radius: 12px;
  }
  .side-promo-badge,
  .side-promo-body {
    display: none !important;
  }
  .topbar-search-wrap,
  .user-meta,
  #topbar-household-lbl {
    display: none;
  }
  .household-pill-btn {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  opacity: .65;
}
