/* =============================================
   Kivo — Design System
   Brand: #2563EB (blue) · #10434A (green) · #DC2628 (red)
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Variables ── Light mode ─────────────── */
:root {
  --primary:       #2563EB;
  --primary-h:     #1D4ED8;
  --primary-light: #EFF6FF;
  --accent:        #10434A;
  --accent-light:  #ECFDF5;
  --danger:        #DC2628;
  --danger-light:  #FFF1F1;
  --warning:       #F59E0B;
  --warning-light: #FFFBEB;

  --income:        #10B981;
  --income-bg:     #ECFDF5;
  --expense:       #DC2628;
  --expense-bg:    #FFF1F1;

  --bg:            #F0F4FF;
  --surface:       #FFFFFF;
  --surface-2:     #F8FAFF;
  --border:        #E2E8F0;
  --text:          #0F172A;
  --text-muted:    #64748B;
  --text-subtle:   #94A3B8;

  --navbar-h:      56px;
  --sidebar-w:     220px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     6px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow:        0 2px 8px rgba(0,0,0,.07), 0 8px 24px rgba(0,0,0,.05);
  --shadow-lg:     0 8px 24px rgba(0,0,0,.10), 0 24px 56px rgba(0,0,0,.07);
}

/* ── CSS Variables ── Dark mode ──────────────── */
[data-theme="dark"] {
  --primary-light: #1E3A5F;
  --accent-light:  #0D2A1A;
  --danger-light:  #2A0A0A;
  --warning-light: #2A1E00;
  --income-bg:     #052E16;
  --expense-bg:    #2A0A0A;

  --bg:            #080C14;
  --surface:       #0F1623;
  --surface-2:     #151D2E;
  --border:        #1E2A3E;
  --text:          #F1F5F9;
  --text-muted:    #94A3B8;
  --text-subtle:   #475569;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.3);
  --shadow:        0 2px 8px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.25);
  --shadow-lg:     0 8px 24px rgba(0,0,0,.4), 0 24px 56px rgba(0,0,0,.35);
}

/* ── Base ────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  transition: background .2s, color .2s;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =============================================
   Navbar
   ============================================= */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 200;
  transition: background .2s, border-color .2s;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar__brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.03em;
}

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

/* Theme toggle button */
.navbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}

.navbar-icon-btn:hover { background: var(--surface-2); color: var(--text); }

.navbar-icon-btn svg { width: 16px; height: 16px; }

/* Show/hide sun/moon based on theme */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* Profile menu */
.profile-menu { position: relative; }

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  transition: background .15s;
}

.profile-trigger:hover { background: var(--surface-2); }

.profile-name {
  font-size: 14px;
  font-weight: 600;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron { color: var(--text-muted); transition: transform .2s; }
.profile-menu.open .chevron { transform: rotate(180deg); }

/* Avatar */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #10434A 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar--lg  { width: 40px; height: 40px; font-size: 16px; }
.avatar--xl  { width: 64px; height: 64px; font-size: 26px; }

/* Profile dropdown */
.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
  animation: dropIn .15s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile-menu.open .profile-dropdown { display: block; }

.profile-dropdown__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
}

.profile-dropdown__name  { font-size: 14px; font-weight: 700; color: var(--text); }
.profile-dropdown__email { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.profile-dropdown__divider {
  height: 1px;
  background: var(--border);
}

.profile-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  transition: background .12s;
  text-decoration: none;
}

.profile-dropdown__item:hover { background: var(--surface-2); text-decoration: none; }
.profile-dropdown__item--danger { color: var(--danger); }
.profile-dropdown__item--danger:hover { background: var(--danger-light); }
.profile-dropdown__item svg { color: var(--text-muted); flex-shrink: 0; }
.profile-dropdown__item--danger svg { color: var(--danger); }

/* =============================================
   Layout
   ============================================= */
.layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--navbar-h);
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: var(--navbar-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  transition: background .2s, border-color .2s, width .22s cubic-bezier(.4,0,.2,1);
}

.sidebar__nav {
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s, color .12s;
}

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover  { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
[data-theme="dark"] .nav-item.active { background: #1a2d5a; }

.sidebar__footer-note {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.kivo-version { font-size: 11px; color: var(--text-subtle); }

/* ── Sidebar collapsed (desktop: icon-only rail) */
:root { --sidebar-collapsed-w: 52px; }

.layout.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w);
  overflow: visible; /* allow flyout to escape */
}
.layout.sidebar-collapsed .main {
  margin-left: var(--sidebar-collapsed-w);
}

/* Hide text labels and structural elements when collapsed */
.layout.sidebar-collapsed .nav-text,
.layout.sidebar-collapsed .nav-badge,
.layout.sidebar-collapsed .nav-group__chevron,
.layout.sidebar-collapsed .sidebar__label-only {
  display: none;
}

/* Center all nav items to icon-only */
.layout.sidebar-collapsed .nav-group__header {
  justify-content: center;
  padding: 9px 0;
  gap: 0;
}
.layout.sidebar-collapsed .nav-group__left {
  gap: 0;
}
.layout.sidebar-collapsed .nav-item,
.layout.sidebar-collapsed .nav-item--sub {
  justify-content: center;
  padding: 9px 0;
  gap: 0;
}
.layout.sidebar-collapsed .sidebar__nav {
  padding: 16px 6px;
  align-items: stretch;
}
.layout.sidebar-collapsed .sidebar__footer-note {
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Nav group items: always hidden when sidebar is collapsed */
.layout.sidebar-collapsed .nav-group__items {
  display: none !important;
}

/* Sidebar collapse button (inside footer) */
.sidebar__collapse-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.sidebar__collapse-btn:hover { background: var(--surface-2); color: var(--text); }
.sidebar__collapse-icon {
  flex-shrink: 0;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}
.layout.sidebar-collapsed .sidebar__collapse-icon { transform: rotate(180deg); }
.layout.sidebar-collapsed .sidebar__collapse-btn {
  width: auto;
  margin: 0 0 8px;
  padding: 7px;
  justify-content: center;
}
.layout.sidebar-collapsed .sidebar__collapse-label { display: none; }

/* ── Main ────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-height: calc(100vh - var(--navbar-h)); transition: margin-left .22s cubic-bezier(.4,0,.2,1); }
.content { padding: 20px 28px 32px; }

/* =============================================
   Page header
   ============================================= */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-title { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }

/* =============================================
   Cards grid
   ============================================= */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background .2s, border-color .2s;
}

.card__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.card__value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1.1;
}

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

/* ── MEI card ────────────────────────────────── */
.card--mei  { margin-bottom: 24px; }
.card--warning { border-color: var(--warning); background: var(--warning-light); }
.card--danger  { border-color: var(--expense);  background: var(--expense-bg); }

.mei-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.mei-values { display: flex; align-items: baseline; gap: 4px; }
.mei-current { font-size: 16px; font-weight: 700; color: var(--text); }
.mei-sep     { color: var(--text-muted); }
.mei-limit   { font-size: 13px; color: var(--text-muted); }
.mei-pct     { font-size: 12px; color: var(--text-muted); margin-top: 7px; display: block; }

/* ── Progress bar ────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--income);
  border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.progress-bar__fill--warning { background: var(--warning); }
.progress-bar__fill--danger  { background: var(--expense); }

/* =============================================
   Section header
   ============================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title { font-size: 16px; font-weight: 700; }

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.link-muted    { font-size: 13px; color: var(--text-muted); }

/* =============================================
   Table
   ============================================= */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
  transition: background .2s, border-color .2s;
}

/* Transaction description cell */
.tx-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.tx-meta {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.table { width: 100%; border-collapse: collapse; font-size: 14px; }

.table th {
  background: var(--surface-2);
  padding: 9px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface-2); transition: background .1s; }

.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-income  { color: var(--income);  font-weight: 700; }
.text-expense { color: var(--expense); font-weight: 700; }

/* =============================================
   Badges
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--income  { background: var(--income-bg);   color: #065f46; }
.badge--expense { background: var(--expense-bg);  color: #991b1b; }
.badge--warning { background: var(--warning-light); color: #92400e; }
.badge--module  { background: var(--primary-light); color: var(--primary); }

[data-theme="dark"] .badge--income  { color: #6ee7b7; }
[data-theme="dark"] .badge--expense { color: #fca5a5; }
[data-theme="dark"] .badge--warning { color: #fcd34d; }
[data-theme="dark"] .badge--module  { color: #93c5fd; }

/* =============================================
   Buttons
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  transition: background .15s, box-shadow .15s, border-color .15s;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--primary-h);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  text-decoration: none;
  color: #fff;
}

.btn--secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--secondary:hover { background: var(--border); text-decoration: none; }

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.btn--full { width: 100%; justify-content: center; padding: 11px 18px; }
.btn--sm   { padding: 5px 12px; font-size: 13px; }

.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background .12s, color .12s, border-color .12s;
  flex-shrink: 0;
}

.btn-icon--edit {
  color: var(--text-muted);
}
.btn-icon--edit:hover  {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-icon--danger {
  color: var(--expense);
  opacity: .7;
}
.btn-icon--danger:hover {
  background: var(--expense-bg);
  color: var(--expense);
  border-color: var(--expense);
  opacity: 1;
}

/* Inline row action group */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Danger button variant */
.btn--danger {
  background: var(--expense);
  color: #fff;
  border: none;
}
.btn--danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 14px rgba(220,38,40,.3);
  text-decoration: none;
  color: #fff;
}

/* =============================================
   Forms
   ============================================= */
.form { display: flex; flex-direction: column; gap: 12px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 4px; }

.form-label { font-size: 13px; font-weight: 600; color: var(--text); }

.required-mark { color: var(--expense); font-size: 12px; }

.field-error {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  color: var(--expense);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.form-group--validatable {
  position: relative;
  padding-bottom: 16px;
}
.form-input--error {
  border-color: var(--expense) !important;
  padding-left: 30px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 8px center;
  background-size: 14px;
}
/* Amount field has R$ prefix — icon on the right instead */
.input-prefix-wrapper .form-input--error {
  padding-left: 36px !important; /* preserve R$ space */
  background-position: right 8px center;
}

.form-input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  width: 100%;
  appearance: none;
  transition: border-color .15s, box-shadow .15s, background .2s;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-input:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Custom arrow for <select> elements */
select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

[data-theme="dark"] select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

select.form-input option {
  background: var(--surface);
  color: var(--text);
}

/* Error state */
.has-error .form-input,
.has-error .form-input:focus {
  border-color: #FCA5A5;
  background: var(--danger-light);
  box-shadow: 0 0 0 3px rgba(220,38,40,.08);
}

.field-error {
  font-size: 12px;
  color: var(--expense);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.field-error::before { content: '⚠'; font-size: 11px; }

.field-hint { font-size: 12px; color: var(--text-muted); }

/* ── Info tooltip ─────────────────────────────── */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  cursor: default;
  vertical-align: middle;
}
.info-tooltip__icon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text-subtle);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s;
}
.info-tooltip:hover .info-tooltip__icon { background: var(--primary); }
.info-tooltip__text {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  white-space: normal;
  text-align: center;
  max-width: min(240px, calc(100vw - 32px));
  z-index: 100;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.info-tooltip__text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}
.info-tooltip:hover .info-tooltip__text { display: inline-block; }

/* Portal mode — positioned via JS with fixed coords to escape clipping
   ancestors (scrollable cards/modals). Arrow is hidden since it can't
   reliably point at the icon once detached from normal flow. */
.info-tooltip__text--portal {
  position: fixed;
  bottom: auto;
  left: 0;
  transform: none;
}
.info-tooltip__text--portal::after { display: none; }

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Config page sections */
.config-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.config-section__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.config-grid--full { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .config-grid { grid-template-columns: 1fr; }
  .config-grid--full { grid-column: 1; }
}

/* Form card */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  transition: background .2s, border-color .2s;
}

.form-card__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* Profile page grid */
.profile-page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.profile-avatar-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.avatar-hint { font-size: 13px; font-weight: 600; }

/* Compound split input (ex: Cidade / UF) */
.input-split {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.input-split:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
.input-split input {
  border: none;
  background: transparent;
  outline: none;
  padding: 9px 10px;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
}
.input-split__sep {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
  pointer-events: none;
}
.input-split__uf {
  width: 36px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-left: 4px !important;
  padding-right: 10px !important;
}

/* Password toggle */
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper .form-input { padding-right: 42px; }

.input-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color .12s;
}
.input-toggle:hover { color: var(--text); }
.eye-icon { width: 18px; height: 18px; }

/* R$ prefix */
.input-prefix-wrapper { position: relative; display: flex; align-items: center; }
.input-prefix {
  position: absolute;
  left: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}
.input-with-prefix { padding-left: 36px; }

/* =============================================
   Alerts
   ============================================= */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  border-left: 3px solid;
  animation: slideDown .2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert--success { background: var(--income-bg);    color: #065f46; border-color: var(--income);   }
.alert--danger  { background: var(--expense-bg);   color: #991b1b; border-color: var(--expense);  }
.alert--warning { background: var(--warning-light); color: #92400e; border-color: var(--warning); }
.alert--info    { background: #EFF6FF;              color: #1e40af; border-color: #3B82F6;        }

[data-theme="dark"] .alert--success { color: #6ee7b7; }
[data-theme="dark"] .alert--danger  { color: #fca5a5; }
[data-theme="dark"] .alert--warning { color: #fcd34d; }
[data-theme="dark"] .alert--info    { color: #93c5fd; }

/* =============================================
   Auth pages
   ============================================= */
.auth-wrapper {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  overflow: hidden;
}

/* ── Error pages (404, 403, 500, etc.) — standalone, sem navbar/sidebar */
.error-page-standalone {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(37,99,235,.12), transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(74,222,128,.12), transparent 45%),
    var(--bg);
}

[data-theme="dark"] .error-page-standalone {
  background:
    radial-gradient(circle at 18% 20%, rgba(37,99,235,.16), transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(74,222,128,.10), transparent 45%),
    var(--bg);
}

.error-card { text-align: center; }

.error-card__code {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.auth-card--wide { max-width: 580px; }

.auth-card__header { text-align: center; margin-bottom: 28px; }

.kivo-mark { display: block; margin: 0 auto 10px; }
.auth-title    { font-size: 22px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.auth-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.auth-footer   { text-align: center; font-size: 14px; color: var(--text-muted); margin-top: 20px; }

/* =============================================
   Modals
   ============================================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal.open { display: flex; }
/* Blur-forced modal — always visible, higher z-index than regular modals */
.modal--blur { z-index: 600; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8,12,20,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal__box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
  margin: 16px;
  animation: scaleIn .18s cubic-bezier(.4,0,.2,1);
}

.modal__box--lg  { max-width: 560px; }
.modal__box--sm  { max-width: 440px; }

/* Scrollable variant — used for tall forms (e.g. transaction modal) */
.modal__box--scroll {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.modal__box--scroll .modal__header {
  flex-shrink: 0;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.modal__box--scroll .modal__body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge */
  padding: 14px 24px;
}
.modal__box--scroll .modal__body::-webkit-scrollbar { display: none; }

.modal__box--scroll .modal__footer {
  flex-shrink: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);   }
}

/* Export modal period/format toggle buttons */
.export-period-btn,
.export-format-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, color .15s, background .15s;
  background: var(--surface);
}
.export-period-btn:hover,
.export-format-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.export-period-btn.active,
.export-format-btn.active {
  border-color: var(--primary);
  background: var(--primary-light, #EFF6FF);
  color: var(--primary);
  font-weight: 600;
}

/* CEP spinner */
.cep-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal__header h3 { font-size: 17px; font-weight: 700; }

.modal__close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  line-height: 1;
  transition: background .12s, color .12s;
}
.modal__close:hover { background: var(--surface-2); color: var(--text); }

/* =============================================
   Filter bar
   ============================================= */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; }

.filter-btn {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: all .15s;
}

.filter-btn:hover  { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* =============================================
   Pagination
   ============================================= */
/* pagination-bar wraps per-page selector + pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.per-page-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.per-page-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.per-page-input {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.per-page-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.section-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.page-btn--nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
  box-shadow: var(--shadow-sm);
}

.page-btn--nav:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.page-btn--disabled {
  opacity: .4;
  pointer-events: none;
}

.page-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 6px;
  min-width: 70px;
  text-align: center;
}

/* =============================================
   Empty state
   ============================================= */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-state__icon  { font-size: 38px; opacity: .5; }
.empty-state__title { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 4px; }
.empty-state__sub   { font-size: 14px; color: var(--text-muted); margin-bottom: 6px; }

/* =============================================
   Admin quick links
   ============================================= */
/* ── Admin dashboard layout ────────────────────────────── */
.cards-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Middle row: stat cards + growth chart */
.admin-middle-row {
  display: grid;
  grid-template-columns: 220px 220px 1fr;
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}

.admin-stat-card {
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-stat-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.admin-stat-inner svg { margin-top: 4px; flex-shrink: 0; }

.admin-growth-card {
  display: flex;
  flex-direction: column;
}
.admin-growth-card .growth-chart {
  flex: 1;
}

/* Bar chart */
.growth-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 100px;
  min-height: 80px;
}
.growth-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.growth-bar-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}
.growth-bar-track {
  flex: 1;
  width: 100%;
  background: var(--surface-2);
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: 4px;
}
.growth-bar-fill {
  width: 100%;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height .3s ease;
}
.growth-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Quick link count badge */
.quick-link-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 20px;
  padding: 2px 8px;
}

.admin-quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.quick-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background .15s, box-shadow .15s, border-color .15s;
}

.quick-link-card svg { color: var(--primary); flex-shrink: 0; }
.quick-link-card:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  box-shadow: var(--shadow);
}

/* =============================================
   Nav group (collapsible sidebar subitems)
   ============================================= */
.nav-group { display: flex; flex-direction: column; gap: 0; }

/* The trigger button — matches .nav-group__header in base.html */
.nav-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background .12s, color .12s;
}

.nav-group__header:hover { background: var(--surface-2); color: var(--text); }

/* Left portion with icon + label */
.nav-group__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Chevron arrow — rotates 180° when open */
.nav-group__chevron {
  color: var(--text-subtle);
  transition: transform .22s ease;
  flex-shrink: 0;
}

.nav-group.open .nav-group__chevron { transform: rotate(180deg); }

/* Subitems container */
.nav-group__items {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: 3px 0 4px 12px;
}

.nav-group.open .nav-group__items { display: flex; }

/* Individual subitem link — uses .nav-item.nav-item--sub in HTML */
.nav-item--sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s, color .12s;
  border-left: 2px solid transparent;
}

.nav-item--sub:hover  { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item--sub.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}
[data-theme="dark"] .nav-item--sub.active { background: #1a2d5a; }

/* Small nav icon used inside subitems */
.nav-icon-sm { width: 14px; height: 14px; flex-shrink: 0; }

/* =============================================
   Type toggle (Receita / Despesa)
   ============================================= */
.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.type-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}

.type-btn--income.active {
  background: var(--income-bg);
  border-color: var(--income);
  color: #065f46;
}
[data-theme="dark"] .type-btn--income.active { color: #6ee7b7; }

.type-btn--expense.active {
  background: var(--expense-bg);
  border-color: var(--expense);
  color: #991b1b;
}
[data-theme="dark"] .type-btn--expense.active { color: #fca5a5; }

/* Submit button variants */
.btn--income-submit {
  background: var(--income);
  color: #fff;
  width: 100%;
  justify-content: center;
  padding: 11px 18px;
  border: none;
  cursor: pointer;
}
.btn--income-submit:hover { background: #059669; box-shadow: 0 4px 14px rgba(16,185,129,.35); }

.btn--expense-submit {
  background: var(--expense);
  color: #fff;
  width: 100%;
  justify-content: center;
  padding: 11px 18px;
  border: none;
  cursor: pointer;
}
.btn--expense-submit:hover { background: #b91c1c; box-shadow: 0 4px 14px rgba(220,38,40,.35); }

/* =============================================
   Toggle switch (recurring)
   ============================================= */
.recurring-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: background .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

.recurring-options { display: flex; flex-direction: column; gap: 8px; }

/* =============================================
   Change pills (dashboard comparisons)
   ============================================= */
.card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.change-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}

.change-pill--up   { background: var(--income-bg);  color: #065f46; }
.change-pill--down { background: var(--expense-bg); color: #991b1b; }
.change-pill--flat { background: var(--surface-2);  color: var(--text-muted); }

[data-theme="dark"] .change-pill--up   { color: #6ee7b7; }
[data-theme="dark"] .change-pill--down { color: #fca5a5; }

/* =============================================
   Change pill comparisons (dashboard cards)
   ============================================= */
.card__compare {
  font-size: 11px;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
}

/* =============================================
   Forecast card
   ============================================= */
.forecast-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: background .2s, border-color .2s;
}

.forecast-card__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
  margin-bottom: 14px;
}

/* 3-column grid for the 3 forecast numbers */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.forecast-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.forecast-item__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}

.forecast-item__value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}

.forecast-item--income .forecast-item__value { color: var(--income); }
.forecast-item--expense .forecast-item__value { color: var(--expense); }
.forecast-item--negative .forecast-item__value { color: var(--expense); }

/* =============================================
   Filter card (lancamentos / auditoria)
   ============================================= */
.filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: background .2s, border-color .2s;
}

.filter-form { display: flex; flex-direction: column; gap: 12px; }

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-actions { display: flex; gap: 8px; }

/* =============================================
   Info banner
   ============================================= */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #1e40af;
  margin-bottom: 20px;
  line-height: 1.5;
}

[data-theme="dark"] .info-banner {
  background: #1a2d5a;
  border-color: #2563EB44;
  color: #93c5fd;
}

.info-banner svg { flex-shrink: 0; margin-top: 1px; }

/* =============================================
   Audit action badges
   ============================================= */
.audit-action {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.audit-action--criar   { background: var(--income-bg);   color: #065f46; border-color: transparent; }
.audit-action--editar  { background: #EFF6FF;             color: #1e40af; border-color: transparent; }
.audit-action--remover { background: var(--expense-bg);  color: #991b1b; border-color: transparent; }
.audit-action--cancelar{ background: var(--warning-light); color: #92400e; border-color: transparent; }

[data-theme="dark"] .audit-action--criar    { color: #6ee7b7; }
[data-theme="dark"] .audit-action--editar   { color: #93c5fd; }
[data-theme="dark"] .audit-action--remover  { color: #fca5a5; }
[data-theme="dark"] .audit-action--cancelar { color: #fcd34d; }

/* ── Audit action badge (generic — for global audit) ── */
.audit-action-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
  letter-spacing: .3px;
  text-transform: lowercase;
}

/* ── Impersonate banner ──────────────────────────────── */
.impersonate-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FEF3C7;
  color: #92400E;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid #FDE68A;
}
[data-theme="dark"] .impersonate-banner {
  background: #451A03;
  color: #FCD34D;
  border-color: #78350F;
}
.impersonate-banner strong { font-weight: 700; }
.impersonate-banner__exit {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.impersonate-banner__exit:hover { background: rgba(0,0,0,.08); }

/* ── Company detail two-column grid ─────────────────── */
.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .admin-detail-grid { grid-template-columns: 1fr; }
}

/* ── Page header left group ─────────────────────────── */
.page-header__left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.meta-pill {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  margin: 1px;
}

/* =============================================
   Category columns (equipe page)
   ============================================= */
.cat-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.cat-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cat-col__header {
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.cat-list {
  list-style: none;
  padding: 8px 0;
}

.cat-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

.cat-list__item:last-child { border-bottom: none; }
.cat-list__item:hover { background: var(--surface-2); }

/* =============================================
   Utility
   ============================================= */
.nowrap { white-space: nowrap; }

/* =============================================
   Toast notifications (flash messages)
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-container.toast-container--top-right {
  top: 20px;
  right: 20px;
  bottom: auto;
  left: auto;
  align-items: flex-end;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  min-width: 260px;
  max-width: 380px;
  border-left: 3px solid transparent;
  animation: toastIn .25s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.toast.toast--out {
  animation: toastOut .3s ease forwards;
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0)   scale(1);    }
  to   { opacity: 0; transform: translateY(8px) scale(.96);  }
}

.toast--success {
  background: var(--surface);
  color: #065f46;
  border-left-color: var(--income);
}
[data-theme="dark"] .toast--success { color: #6ee7b7; }

.toast--danger {
  background: var(--surface);
  color: #991b1b;
  border-left-color: var(--expense);
}
[data-theme="dark"] .toast--danger { color: #fca5a5; }

.toast--warning {
  background: var(--surface);
  color: #92400e;
  border-left-color: var(--warning);
}
[data-theme="dark"] .toast--warning { color: #fcd34d; }

.toast--info {
  background: var(--surface);
  color: #1e40af;
  border-left-color: #3B82F6;
}
[data-theme="dark"] .toast--info { color: #93c5fd; }

.toast__icon {
  font-size: 13px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast--success .toast__icon { background: var(--income-bg);   }
.toast--danger  .toast__icon { background: var(--expense-bg);  }
.toast--warning .toast__icon { background: var(--warning-light);}
.toast--info    .toast__icon { background: #EFF6FF;            }

.toast__msg  { flex: 1; line-height: 1.4; }

.toast__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-subtle);
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .12s;
}
.toast__close:hover { color: var(--text); }

/* =============================================
   Hamburger button (mobile only)
   ============================================= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 8px;
  transition: background .15s;
}
.hamburger:hover { background: var(--surface-2); }
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,12,20,.5);
  backdrop-filter: blur(2px);
  z-index: 350;
  animation: fadeIn .2s ease;
}
.sidebar-overlay.active { display: block; }

/* =============================================
   Pagination jump input
   ============================================= */
.page-jump-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-jump-input {
  width: 52px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  outline: none;
  appearance: textfield;
  transition: border-color .15s, box-shadow .15s;
}
.page-jump-input::-webkit-inner-spin-button,
.page-jump-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.page-jump-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.page-jump-sep {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* =============================================
   Responsive — Tablet (≤ 1024px)
   ============================================= */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .cards-grid { gap: 12px; }
  .cards-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 24px 20px; }
  .forecast-grid { grid-template-columns: repeat(3,1fr); gap: 10px; }
  .admin-middle-row { grid-template-columns: 1fr 1fr; }
}

/* =============================================
   Responsive — Mobile (≤ 768px)
   ============================================= */
@media (max-width: 768px) {
  /* Show hamburger, hide desktop collapse btn */
  .hamburger { display: flex; }
  .sidebar__collapse-btn { display: none; }

  /* Sidebar becomes slide-in drawer — ignore collapsed state */
  .sidebar,
  .layout.sidebar-collapsed .sidebar {
    width: var(--sidebar-w) !important;
    overflow-y: auto !important;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1) !important;
    z-index: 400;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open,
  .layout.sidebar-collapsed .sidebar.mobile-open { transform: translateX(0) !important; }

  /* Restore all nav text and structure on mobile */
  .layout.sidebar-collapsed .nav-text,
  .layout.sidebar-collapsed .nav-badge,
  .layout.sidebar-collapsed .nav-group__chevron,
  .layout.sidebar-collapsed .sidebar__label-only { display: revert; }
  .layout.sidebar-collapsed .nav-group__items { display: flex !important; flex-direction: column; position: static !important; box-shadow: none; border: none; padding: 0; min-width: unset; }
  .layout.sidebar-collapsed .nav-group__header { justify-content: space-between; padding: revert; gap: revert; }
  .layout.sidebar-collapsed .nav-group__left { gap: 10px; }
  .layout.sidebar-collapsed .nav-item,
  .layout.sidebar-collapsed .nav-item--sub { justify-content: flex-start; padding: 9px 12px; gap: 10px; }
  .layout.sidebar-collapsed .sidebar__nav { padding: 16px 10px; align-items: stretch; }
  .layout.sidebar-collapsed .sidebar__footer-note { padding: 12px 16px; align-items: stretch; flex-direction: column; }
  .layout.sidebar-collapsed .sidebar__collapse-btn { display: none; }

  /* Main takes full width */
  .main,
  .layout.sidebar-collapsed .main { margin-left: 0; }

  /* Layout stacks */
  .layout { flex-direction: column; }

  /* Cards */
  .cards-grid { grid-template-columns: 1fr; gap: 10px; }
  .cards-grid--4 { grid-template-columns: 1fr; }
  .forecast-grid { grid-template-columns: 1fr; gap: 8px; }
  .cat-columns { grid-template-columns: 1fr; }
  .admin-quick-links { grid-template-columns: 1fr; }
  .admin-middle-row { grid-template-columns: 1fr; }
  .growth-chart { height: 60px; }
  .profile-page-grid { grid-template-columns: 1fr; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .filter-row { grid-template-columns: 1fr; }

  /* Tables — already overflow-x: auto from base, just limit min-width */
  .table { min-width: 480px; }

  /* Page header wraps */
  .page-header { flex-wrap: wrap; gap: 10px; }
  .page-title { font-size: 18px; }

  /* Modals take full screen on small devices */
  .modal__box {
    margin: 0;
    max-width: 100vw;
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 92vh;
    overflow-y: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }
  .modal { align-items: flex-end; }
  .modal__box--lg { max-width: 100vw; }

  /* Content padding */
  .content { padding: 16px 12px; }
  .auth-card { padding: 24px 16px; }
  .form-card { padding: 16px; }

  /* Navbar brand name — hide on very small screens */
  .navbar__brand-name { display: none; }

  /* Profile trigger shorter */
  .profile-name { max-width: 72px; }

  /* Toast at bottom full-width */
  .toast-container { left: 12px; right: 12px; bottom: 16px; }
  .toast-container.toast-container--top-right { top: 12px; right: 12px; left: 12px; bottom: auto; }
  .toast { max-width: 100%; }

  /* Table hide less important columns */
  .table .col-hide-mobile { display: none; }

  /* Buttons smaller on mobile */
  .btn { padding: 8px 14px; font-size: 13px; }
  .btn--full { padding: 11px 14px; }

  /* Card value smaller */
  .card__value { font-size: 22px; }

  /* MEI header stacks */
  .mei-header { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Row actions always visible */
  .row-actions { gap: 6px; }

  /* Section header */
  .section-header { flex-wrap: wrap; gap: 8px; }

  /* Pagination */
  .pagination { gap: 4px; }
  .page-jump-input { width: 44px; }
}

/* =============================================
   Toggle row (label + description + switch)
   ============================================= */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-of-type { border-bottom: none; }
.toggle-row__info { display: flex; flex-direction: column; gap: 2px; }
.toggle-row__label { font-size: 14px; font-weight: 600; color: var(--text); }
.toggle-row__desc  { font-size: 12px; color: var(--text-muted); }

/* =============================================
   Modal variants & tabs
   ============================================= */
.modal--lg .modal__box   { max-width: 600px; }
.modal--inner            { z-index: 1100; }  /* stacks above edit modal */
.modal__box--sm          { max-width: 440px; }

.modal-tabs {
  display: flex;
  gap: 2px;
  margin: -8px -28px 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
}
.modal-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}
.modal-tab.active .tab-badge {
  background: #DBEAFE;
  color: var(--primary);
}

/* =============================================
   Member list rows
   ============================================= */
.member-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin: 12px 0 4px;
}
.member-group-label:first-child { margin-top: 0; }

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.member-row:hover { background: var(--surface-2); }
.member-row--add  { cursor: default; }

.owner-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
[data-theme="dark"] .owner-select-row {
  background: #422006;
  border-color: #78350F;
}

.owner-crown {
  color: #D97706;
  font-size: 13px;
}

/* =============================================
   Loading skeleton pulse
   ============================================= */
.loading-pulse {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: pulse-shimmer 1.4s infinite;
}
@keyframes pulse-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =============================================
   Responsive — Small mobile (≤ 480px)
   ============================================= */
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .navbar { padding: 0 12px; }
  .content { padding: 12px 10px; }
  .card { padding: 16px; }
  .card__value { font-size: 20px; }
  .table-card { border-radius: var(--radius-sm); }
  .filter-card { padding: 14px; }

  /* Modal: padding reduzido em telas pequenas */
  .modal__box { padding: 20px 16px; }
  .modal__box--scroll .modal__header { padding: 16px 16px 12px; }
  .modal__box--scroll .modal__body  { padding: 12px 16px; }
  .modal__box--scroll .modal__footer { padding: 12px 16px; }

  /* Dropdowns: garantir que não saiam da tela */
  .bell-dropdown    { right: -8px; }
  .profile-dropdown { right: 0; }

  /* Pagination */
  .pagination-bar { flex-wrap: wrap; gap: 8px; justify-content: center; }
}

/* ── Extra small (≤ 400px) ─────────────────────────────────── */
@media (max-width: 400px) {
  .content { padding: 10px 8px; }
  .cards-grid { gap: 8px; }
  .form-row { gap: 8px; }
  .card { padding: 14px 12px; }
  .card__value { font-size: 18px; }
  .page-title { font-size: 17px; }

  /* Modal ainda mais compacto */
  .modal__box--scroll .modal__body  { padding: 10px 12px; }
  .modal__box--scroll .modal__header { padding: 14px 12px 10px; }
  .modal__box--scroll .modal__footer { padding: 10px 12px; }
  .recurring-block { padding: 8px 10px; }
  .form { gap: 10px; }
}


/* ── Bell notification ────────────────────────────────────── */
.bell-wrapper { position: relative; }

.bell-btn { position: relative; }
.bell-btn--urgent { color: var(--expense); }
.bell-btn--urgent svg { stroke: var(--expense); }

.bell-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--warning);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.bell-badge--urgent { background: var(--expense); }

.bell-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
}
.bell-dropdown.open { display: block; }

.bell-dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.bell-dropdown__all {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.bell-dropdown__all:hover { text-decoration: underline; }

.bell-dropdown__group { padding: 8px 0; }
.bell-dropdown__group + .bell-dropdown__group { border-top: 1px solid var(--border); }

.bell-dropdown__label {
  display: block;
  padding: 4px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.bell-dropdown__label--overdue { color: var(--expense); }

.bell-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  transition: background .1s;
}
.bell-item:hover { background: var(--surface-2); }
.bell-item__info { flex: 1; min-width: 0; }
.bell-item__desc {
  display: block;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bell-item__date { font-size: 11px; color: var(--text-muted); }
.bell-item__date--overdue { color: var(--expense); font-weight: 600; }
.bell-item__amount { font-size: 13px; font-weight: 600; white-space: nowrap; }
.bell-item__amount--income  { color: var(--income); }
.bell-item__amount--expense { color: var(--expense); }

.bell-dropdown__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Page-level tabs (Config. da empresa etc.) ─────────────── */
.page-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}
.page-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  transition: color .15s, border-color .15s;
}
.page-tab:hover { color: var(--text); }
.page-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}

/* ── Sidebar nav badge ────────────────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--warning);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
}
.nav-badge--urgent { background: var(--expense); }

/* ── Toast pending (alerta de pendencias) ─────────────────── */
.toast--pending {
  background: var(--surface);
  color: #92400e;
  border-left-color: var(--warning);
  align-items: flex-start;
  max-width: 420px;
}
.toast--pending-urgent {
  color: #991b1b;
  border-left-color: var(--expense);
}
.toast--pending .toast__icon { background: var(--warning-light); font-size: 14px; margin-top: 2px; }
.toast--pending-urgent .toast__icon { background: var(--expense-bg); }
.toast__body { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.4; }
.toast__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.toast__dismiss {
  background: none;
  border: 1px solid currentColor;
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  opacity: .75;
  white-space: nowrap;
  transition: opacity .12s;
}
.toast__dismiss:hover { opacity: 1; }

/* ── Pending card on dashboard ───────────────────────────── */
.pending-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--warning-light);
  border: 1.5px solid var(--warning);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  position: relative;
}
.pending-card--urgent {
  background: var(--expense-bg);
  border-color: var(--expense);
}
.pending-card__icon {
  flex-shrink: 0;
  color: var(--warning);
  margin-top: 2px;
}
.pending-card--urgent .pending-card__icon { color: var(--expense); }
.pending-card__body { flex: 1; min-width: 0; }
.pending-card__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.pending-card__items { display: flex; flex-direction: column; gap: 6px; }
.pending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
}
.pending-item__type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.pending-item__type--in  { background: var(--income-bg);  color: #065f46; }
.pending-item__type--out { background: var(--expense-bg); color: #991b1b; }
.pending-item__desc { flex: 1; font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-item__date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.pending-item__date--overdue { color: var(--expense); font-weight: 600; }
.pending-item__amount { font-weight: 600; white-space: nowrap; }
.pending-card__link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  align-self: flex-start;
  padding-top: 2px;
}
.pending-card__link:hover { color: var(--text); }

/* ── Agenda page ─────────────────────────────────────────── */
.agenda-section { margin-bottom: 36px; }
.agenda-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.agenda-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--warning-light);
  color: #92400e;
  border: 1px solid var(--warning);
}
.agenda-badge--urgent {
  background: var(--expense-bg);
  color: #991b1b;
  border-color: var(--expense);
}
.agenda-row--overdue td:first-child { color: var(--expense); }
.overdue-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--expense);
}
.upcoming-days {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warning);
}

/* ── btn extras ──────────────────────────────────────────── */
.btn--xs {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn--xs:hover { opacity: .85; }
.btn--success {
  background: var(--income);
  color: #fff;
}
.btn-icon--pay {
  color: var(--income);
  border-color: var(--income-bg);
  background: var(--income-bg);
}
.btn-icon--pay:hover { background: var(--income); color: #fff; }
.btn-icon--active { color: var(--primary); border-color: var(--primary-light, #dbeafe); background: var(--primary-light, #dbeafe); }
.btn-icon--active:hover { background: var(--primary); color: #fff; }
