/**
 * FinanceOS — Design System CSS Completo
 * 
 * @author    Pedro Henrique <github.com/pedroowb>
 * @copyright 2025 Pedro Henrique. Todos os direitos reservados.
 * @version   3.0.0
 *
 * Conceito: Precision Dark — Bloomberg Terminal reimaginada
 */

/* ══════════════════════════════════════════════
   CSS VARIABLES
   ══════════════════════════════════════════════ */

:root {
  /* ── Backgrounds ── */
  --bg-void: #07070d;
  --bg-base: #0d0d17;
  --bg-surface: #111122;
  --bg-raised: #161628;
  --bg-overlay: rgba(7, 7, 13, 0.85);

  /* ── Glass Layers ── */
  --glass-1: rgba(255, 255, 255, 0.03);
  --glass-2: rgba(255, 255, 255, 0.055);
  --glass-3: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-bright: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.04);

  /* ── Accent System ── */
  --accent-iris: #7b6cf6;
  --accent-iris-light: #9d91f8;
  --accent-iris-glow: rgba(123, 108, 246, 0.28);
  --accent-iris-dim: rgba(123, 108, 246, 0.12);
  --accent-iris-subtle: rgba(123, 108, 246, 0.06);

  --accent-emerald: #34d399;
  --accent-emerald-glow: rgba(52, 211, 153, 0.22);
  --accent-emerald-dim: rgba(52, 211, 153, 0.10);

  --accent-rose: #fb7185;
  --accent-rose-glow: rgba(251, 113, 133, 0.22);
  --accent-rose-dim: rgba(251, 113, 133, 0.10);

  --accent-amber: #fbbf24;
  --accent-amber-glow: rgba(251, 191, 36, 0.22);
  --accent-amber-dim: rgba(251, 191, 36, 0.10);

  --accent-sky: #38bdf8;
  --accent-sky-dim: rgba(56, 189, 248, 0.10);

  /* ── Typography ── */
  --text-primary: #eeeef8;
  --text-secondary: #8888aa;
  --text-muted: #44445a;
  --text-data: #c4c4e0;

  /* ── Semantic Aliases ── */
  --income: var(--accent-emerald);
  --expense: var(--accent-rose);
  --warning: var(--accent-amber);
  --info: var(--accent-sky);
  --brand: var(--accent-iris);
}

/* ══════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}

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

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 16px !important;
  -webkit-appearance: none;
  appearance: none;
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════
   TIPOGRAFIA FINANCEIRA
   ══════════════════════════════════════════════ */

.font-display { font-family: 'Syne', sans-serif; }

.text-financial-xl {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.text-financial-lg {
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.text-financial-md {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.text-financial-sm {
  font-size: 0.95rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.text-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   GLASS CARDS
   ══════════════════════════════════════════════ */

.glass-card {
  background: var(--glass-1);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    0 1px 0 0 var(--glass-border-bright) inset,
    0 -1px 0 0 rgba(0,0,0,0.2) inset,
    0 20px 60px rgba(0,0,0,0.4);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.glass-card:active {
  background: var(--glass-2);
}

.glass-card-elevated {
  background: var(--glass-2);
  border-color: var(--glass-border-bright);
  box-shadow:
    0 1px 0 0 rgba(255,255,255,0.12) inset,
    0 32px 80px rgba(0,0,0,0.5),
    0 0 0 1px var(--accent-iris-dim);
}

/* ── Accent Card (hero de saldo) ── */
.accent-card {
  background: linear-gradient(135deg,
    rgba(123, 108, 246, 0.18) 0%,
    rgba(123, 108, 246, 0.06) 50%,
    rgba(52, 211, 153, 0.08) 100%
  );
  border: 1px solid rgba(123, 108, 246, 0.28);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.accent-card::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(ellipse at 30% 30%,
    rgba(123,108,246,0.10) 0%,
    transparent 65%
  );
  animation: heroGlow 10s ease-in-out infinite alternate;
  pointer-events: none;
}

.accent-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse,
    rgba(52,211,153,0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* Versão negativa do accent card (saldo negativo) */
.accent-card.negative {
  background: linear-gradient(135deg,
    rgba(251, 113, 133, 0.18) 0%,
    rgba(251, 113, 133, 0.06) 50%,
    rgba(251, 113, 133, 0.03) 100%
  );
  border-color: rgba(251, 113, 133, 0.28);
}

.accent-card.negative::before {
  background: radial-gradient(ellipse at 30% 30%,
    rgba(251,113,133,0.10) 0%,
    transparent 65%
  );
}

@keyframes heroGlow {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(5%, 5%) scale(1.05); }
}

/* ══════════════════════════════════════════════
   PROGRESS BARS
   ══════════════════════════════════════════════ */

.progress-track {
  height: 4px;
  background: var(--glass-3);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--accent-emerald);
  width: 0%;
}

.progress-fill.warning { background: var(--accent-amber); }
.progress-fill.danger  { background: var(--accent-rose); }

.progress-track.thick { height: 6px; }
.progress-track.thicker { height: 8px; border-radius: 4px; }

/* ══════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-iris    { background: var(--accent-iris-dim);    color: var(--accent-iris-light); }
.badge-emerald { background: var(--accent-emerald-dim); color: var(--accent-emerald); }
.badge-rose    { background: var(--accent-rose-dim);    color: var(--accent-rose); }
.badge-amber   { background: var(--accent-amber-dim);   color: var(--accent-amber); }
.badge-sky     { background: var(--accent-sky-dim);     color: var(--accent-sky); }

/* ══════════════════════════════════════════════
   SHIMMER LOADING
   ══════════════════════════════════════════════ */

@keyframes shimmer {
  from { background-position: -400px 0; }
  to   { background-position: 400px 0; }
}

.shimmer {
  background: linear-gradient(90deg,
    var(--glass-1) 0%,
    var(--glass-3) 50%,
    var(--glass-1) 100%
  );
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: 8px;
}

/* ══════════════════════════════════════════════
   BOTTOM SHEET
   ══════════════════════════════════════════════ */

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.bottom-sheet-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg-raised);
  border-top: 1px solid var(--glass-border-bright);
  border-radius: 28px 28px 0 0;
  padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  z-index: 1200;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90dvh;
  overflow-y: auto;
}

.bottom-sheet.open { transform: translateY(0); }

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--glass-3);
  border-radius: 999px;
  margin: 0 auto 20px;
}

/* ══════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 40px);
  max-width: 390px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border-bright);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.toast.success {
  background: rgba(52,211,153,0.15);
  border-color: rgba(52,211,153,0.25);
  color: var(--accent-emerald);
}

.toast.error {
  background: rgba(251,113,133,0.15);
  border-color: rgba(251,113,133,0.25);
  color: var(--accent-rose);
}

.toast.info {
  background: rgba(123,108,246,0.15);
  border-color: rgba(123,108,246,0.25);
  color: var(--accent-iris-light);
}

.toast.warning {
  background: rgba(251,191,36,0.15);
  border-color: rgba(251,191,36,0.25);
  color: var(--accent-amber);
}

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

/* ══════════════════════════════════════════════
   MOBILE LAYOUT
   ══════════════════════════════════════════════ */

.app-container {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg-base);
  position: relative;
  overflow-x: hidden;
}

.page-content {
  padding-bottom: calc(80px + env(safe-area-inset-bottom) + 8px);
  padding-top: 16px;
  padding-left: 16px;
  padding-right: 16px;
}

/* ── Mobile Topbar ── */
.mobile-topbar {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-void);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent-iris);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: white;
}

.logo-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.topbar-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.topbar-actions button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.topbar-actions button:hover {
  background: var(--glass-1);
  color: var(--text-primary);
}

/* ── Mobile Bottom Nav ── */
.mobile-bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(7, 7, 13, 0.95);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-item.active { color: var(--accent-iris); }

.nav-item.active i {
  filter: drop-shadow(0 0 6px var(--accent-iris));
}

.nav-item i {
  width: 22px;
  height: 22px;
}

.nav-fab-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav-fab {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-iris), #5b4fcf);
  box-shadow: 0 8px 24px rgba(123,108,246,0.45), 0 0 0 1px rgba(255,255,255,0.1) inset;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.nav-fab:active {
  transform: scale(0.93);
  box-shadow: 0 4px 12px rgba(123,108,246,0.3);
}

.nav-fab i {
  width: 24px;
  height: 24px;
  color: white;
}

/* ══════════════════════════════════════════════
   DESKTOP LAYOUT
   ══════════════════════════════════════════════ */

.desktop-layout {
  display: flex;
  min-height: 100vh;
}

.desktop-sidebar {
  width: 280px;
  min-height: 100vh;
  background: var(--bg-void);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  padding: 24px 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 8px;
}

.logo-mark-lg {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-iris), #5b4fcf);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 16px rgba(123,108,246,0.3);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 450;
  transition: all 0.15s;
  margin-bottom: 2px;
  text-decoration: none;
}

.sidebar-item:hover {
  background: var(--glass-1);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--accent-iris-dim);
  color: var(--accent-iris-light);
  font-weight: 500;
}

.sidebar-item.active i {
  filter: drop-shadow(0 0 4px var(--accent-iris));
}

.sidebar-item i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

.ai-phrase-mini {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.4;
}

.copyright-text {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.desktop-main {
  margin-left: 280px;
  flex: 1;
  min-height: 100vh;
  background: var(--bg-base);
}

.desktop-topbar {
  height: 60px;
  padding: 0 32px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 13, 23, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.breadcrumb i {
  width: 14px;
  height: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.month-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--glass-1);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.month-badge i {
  width: 14px;
  height: 14px;
}

.quick-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.desktop-content {
  padding: 32px;
  max-width: 1400px;
}

/* Desktop Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.col-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.col-aside {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: none;
}

.col-aside::-webkit-scrollbar { display: none; }

/* ══════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════ */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass-1);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-iris);
  box-shadow: 0 0 0 3px var(--accent-iris-dim);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass-1);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  transition: border-color 0.2s;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238888aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-select:focus {
  border-color: var(--accent-iris);
  box-shadow: 0 0 0 3px var(--accent-iris-dim);
}

.form-select option {
  background: var(--bg-raised);
  color: var(--text-primary);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass-1);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  border-color: var(--accent-iris);
  box-shadow: 0 0 0 3px var(--accent-iris-dim);
}

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-iris), #5b4fcf);
  color: white;
  box-shadow: 0 4px 16px rgba(123,108,246,0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(123,108,246,0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(123,108,246,0.25);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald), #10b981);
  color: white;
  box-shadow: 0 4px 16px rgba(52,211,153,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-rose), #e11d48);
  color: white;
  box-shadow: 0 4px 16px rgba(251,113,133,0.3);
}

.btn-ghost {
  background: var(--glass-1);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--glass-2);
  color: var(--text-primary);
  border-color: var(--glass-border-bright);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  border-radius: 10px;
  min-height: 36px;
}

.btn-block {
  width: 100%;
}

.btn-sticky {
  position: sticky;
  bottom: calc(72px + env(safe-area-inset-bottom) + 16px);
  z-index: 50;
}

/* ══════════════════════════════════════════════
   TRANSACTION LIST
   ══════════════════════════════════════════════ */

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  transition: transform 0.3s ease;
}

.transaction-item:last-child {
  border-bottom: none;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.transaction-icon i {
  width: 18px;
  height: 18px;
}

.transaction-info {
  flex: 1;
  min-width: 0;
}

.transaction-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.transaction-value {
  text-align: right;
  flex-shrink: 0;
}

.transaction-amount {
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.transaction-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.text-income { color: var(--accent-emerald); }
.text-expense { color: var(--accent-rose); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-iris { color: var(--accent-iris); }
.text-emerald { color: var(--accent-emerald); }
.text-rose { color: var(--accent-rose); }
.text-amber { color: var(--accent-amber); }
.text-sky { color: var(--accent-sky); }

/* Swipe delete background */
.swipe-delete-bg {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: var(--accent-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 12px 12px 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.swipe-delete-bg.visible { opacity: 1; }

/* ══════════════════════════════════════════════
   DATE GROUP
   ══════════════════════════════════════════════ */

.date-group-header {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 4px;
}

/* ══════════════════════════════════════════════
   METRICS GRID
   ══════════════════════════════════════════════ */

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-card {
  padding: 16px;
}

.metric-card .metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.metric-card .metric-icon i {
  width: 16px;
  height: 16px;
}

.metric-card .metric-value {
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.metric-card .metric-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.metric-card .metric-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════
   CATEGORY BAR CHART (CSS)
   ══════════════════════════════════════════════ */

.category-bar-item {
  margin-bottom: 14px;
}

.category-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.category-bar-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.category-bar-name i {
  width: 14px;
  height: 14px;
}

.category-bar-value {
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-data);
}

.category-bar-track {
  height: 6px;
  background: var(--glass-2);
  border-radius: 999px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.category-bar-pct {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 8px;
}

/* ══════════════════════════════════════════════
   CARD CAROUSEL (horizontal scroll)
   ══════════════════════════════════════════════ */

.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  display: flex;
  gap: 12px;
  padding-bottom: 4px;
}

.scroll-x::-webkit-scrollbar { display: none; }

.snap-item {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   CREDIT CARD VISUAL
   ══════════════════════════════════════════════ */

.credit-card-visual {
  width: 280px;
  min-height: 160px;
  border-radius: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.credit-card-visual::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 150%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.credit-card-bandeira {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
  text-align: right;
}

.credit-card-nome {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.credit-card-disponivel-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 12px;
}

.credit-card-disponivel {
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════
   SCORE CIRCLE (SVG)
   ══════════════════════════════════════════════ */

.score-circle-container {
  width: 140px;
  height: 140px;
  position: relative;
}

.score-circle-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-circle-bg {
  fill: none;
  stroke: var(--glass-2);
  stroke-width: 8;
}

.score-circle-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-number {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.score-label-text {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════
   ACCORDION
   ══════════════════════════════════════════════ */

.accordion-item {
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--glass-1);
}

.accordion-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 44px;
}

.accordion-header:hover {
  background: var(--glass-2);
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-header-left i {
  width: 18px;
  height: 18px;
  color: var(--accent-iris);
}

.accordion-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.accordion-chevron {
  transition: transform 0.3s;
}

.accordion-item.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-item.open .accordion-body {
  max-height: 2000px;
}

.accordion-content {
  padding: 0 20px 20px;
}

/* ══════════════════════════════════════════════
   TYPE SELECTOR (entrada/saida toggle)
   ══════════════════════════════════════════════ */

.type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.type-option {
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--glass-border);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--glass-1);
}

.type-option:hover {
  border-color: var(--glass-border-bright);
}

.type-option.selected-entrada {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-dim);
  box-shadow: 0 0 24px var(--accent-emerald-glow);
}

.type-option.selected-saida {
  border-color: var(--accent-rose);
  background: var(--accent-rose-dim);
  box-shadow: 0 0 24px var(--accent-rose-glow);
}

.type-option i {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
}

.type-option-label {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ══════════════════════════════════════════════
   FILTER PILLS
   ══════════════════════════════════════════════ */

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.filter-pills::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--glass-1);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-pill:hover {
  background: var(--glass-2);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--accent-iris-dim);
  border-color: var(--accent-iris);
  color: var(--accent-iris-light);
}

/* ══════════════════════════════════════════════
   TOGGLE SWITCH
   ══════════════════════════════════════════════ */

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--glass-3);
  border-radius: 999px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: transform 0.3s;
}

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

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

/* ══════════════════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════════════════ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.section-action {
  font-size: 0.8rem;
  color: var(--accent-iris);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-action i {
  width: 14px;
  height: 14px;
}

/* ══════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 0.85rem;
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════
   INSIGHTS PAGE
   ══════════════════════════════════════════════ */

.insight-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-iris);
  box-shadow: 0 0 0 0 var(--accent-iris-glow);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-iris-glow); }
  70% { box-shadow: 0 0 0 12px rgba(123,108,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(123,108,246,0); }
}

.loading-text {
  animation: fadeText 1.5s ease-in-out infinite;
}

@keyframes fadeText {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ══════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════ */

.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }

.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }

.relative { position: relative; }
.z-10 { z-index: 10; }

.rounded-12 { border-radius: 12px; }
.rounded-16 { border-radius: 16px; }
.rounded-20 { border-radius: 20px; }

.hidden { display: none !important; }

/* Tap targets */
button, a, [role="button"] {
  min-height: 44px;
  min-width: 44px;
}

/* Smooth iOS scroll */
.scroll-x {
  -webkit-overflow-scrolling: touch;
}

/* Desktop modal */
.modal-box {
  background: var(--bg-raised);
  border: 1px solid var(--glass-border-bright);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  animation: modalIn 0.25s ease forwards;
}

@keyframes modalIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
}

/* Keyboard shortcut hints */
.kbd-hint {
  font-size: 0.65rem;
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-muted);
  font-family: monospace;
}

/* ══════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════ */

@media print {
  .mobile-topbar,
  .mobile-bottomnav,
  .desktop-sidebar,
  .desktop-topbar,
  .nav-fab-trigger {
    display: none !important;
  }

  body {
    background: white;
    color: #111;
  }

  .glass-card,
  .accent-card {
    background: white;
    border: 1px solid #ddd;
    box-shadow: none;
    backdrop-filter: none;
  }
}
