/* =============================================
   CÉREBRO FINANCEIRO - style.css
   Material 3 inspired, Mobile First
   ============================================= */

:root {
  --bg-deep:    #070C1A;
  --bg-surface: #0D1525;
  --bg-card:    #131D30;
  --bg-card2:   #182135;
  --bg-elevated:#1E2840;

  --primary:    #4DFFB4;
  --primary-dim:#2ECC8A;
  --secondary:  #5B8DEF;
  --accent:     #F7C94B;
  --danger:     #FF6B6B;
  --warning:    #FF9F45;
  --purple:     #A78BFA;

  --text-1:     #EAEFF8;
  --text-2:     #8899BB;
  --text-3:     #556380;

  --border:     rgba(255,255,255,0.07);
  --shadow:     0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm:  0 2px 12px rgba(0,0,0,0.35);

  --radius-sm:  12px;
  --radius-md:  18px;
  --radius-lg:  24px;
  --radius-xl:  32px;

  --font: 'Sora', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --nav-h: 72px;
  --bar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-1);
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

/* =============================================
   SPLASH SCREEN
   ============================================= */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.splash.hidden { opacity: 0; pointer-events: none; transform: scale(1.05); }
.splash-inner { text-align: center; }

.splash-icon {
  width: 96px; height: 96px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 0 60px rgba(77,255,180,0.3);
  animation: splashPulse 1.5s ease infinite;
}
.splash-icon .material-icons-round { font-size: 48px; color: var(--bg-deep); }

@keyframes splashPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(77,255,180,0.2); }
  50% { box-shadow: 0 0 80px rgba(77,255,180,0.5); }
}

.splash-title {
  font-size: 28px; font-weight: 700; line-height: 1.2;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 32px;
}

.splash-loader {
  width: 48px; height: 3px; background: var(--bg-elevated);
  border-radius: 99px; overflow: hidden; margin: 0 auto;
}
.splash-loader div {
  height: 100%; width: 40%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 99px;
  animation: loaderSlide 1.2s ease infinite;
}
@keyframes loaderSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* =============================================
   APP LAYOUT
   ============================================= */
.app {
  display: flex; flex-direction: column;
  height: 100dvh;
  transition: opacity 0.4s ease;
}
.app.hidden { opacity: 0; }

/* TOP BAR */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: calc(var(--bar-h) + var(--safe-top));
  padding: var(--safe-top) 8px 0;
  background: rgba(7,12,26,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.top-bar-left, .top-bar-right { display: flex; align-items: center; gap: 4px; }
.top-bar-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 600; color: var(--text-1);
}
.top-bar-logo { font-size: 22px; color: var(--primary); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: background var(--transition), color var(--transition);
}
.icon-btn:active { background: var(--bg-elevated); color: var(--text-1); }

/* MAIN CONTENT */
.main-content {
  flex: 1; overflow: hidden; position: relative;
}

.page {
  display: none; position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.page.active { display: block; }
.page-scroll { padding: 16px 16px 0; }

/* Animação de transição de página */
.page.entering {
  animation: pageEnter 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* BOTTOM NAV */
.bottom-nav {
  display: flex;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(13,21,37,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: relative; z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); font-size: 10px; font-family: var(--font);
  font-weight: 500; letter-spacing: 0.3px;
  transition: color var(--transition);
  position: relative; padding: 8px 0;
}
.nav-item .material-icons-round { font-size: 22px; transition: transform var(--transition); }
.nav-item.active { color: var(--primary); }
.nav-item.active .material-icons-round { transform: scale(1.1); }
.nav-item.active::before {
  content: '';
  position: absolute; top: 4px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(77,255,180,0.12);
}

/* FAB */
.fab {
  position: fixed; right: 20px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  width: 60px; height: 60px; border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(77,255,180,0.35), 0 2px 8px rgba(0,0,0,0.4);
  z-index: 200; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
.fab .material-icons-round { font-size: 28px; color: var(--bg-deep); font-weight: 700; }
.fab:active { transform: scale(0.92); box-shadow: 0 4px 12px rgba(77,255,180,0.25); }
.fab.rotated .material-icons-round { transform: rotate(45deg); }

/* =============================================
   CARDS & COMPONENTS
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 12px; padding: 0 2px;
}
.section-header h2 { font-size: 15px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.8px; }
.text-btn { background: none; border: none; color: var(--primary); font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 0; }

/* HERO CARD */
.hero-card {
  background: linear-gradient(135deg, #0E2040 0%, #162D4A 50%, #0E2040 100%);
  border: 1px solid rgba(77,255,180,0.15);
  border-radius: var(--radius-xl);
  padding: 28px 24px 24px;
  position: relative; overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.hero-card::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(77,255,180,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.hero-amount {
  font-family: var(--mono);
  font-size: 38px; font-weight: 500; color: var(--text-1);
  letter-spacing: -1px; margin-bottom: 6px;
  line-height: 1;
}
.hero-sub { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }
.hero-progress-wrap { display: flex; align-items: center; gap: 10px; }
.hero-progress-bar {
  flex: 1; height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 99px; overflow: hidden;
}
.hero-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 99px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-progress-label { font-size: 11px; font-family: var(--mono); color: var(--text-3); white-space: nowrap; }

/* SUMMARY GRID */
.summary-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 20px;
}
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.summary-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
}
.summary-card[data-color="red"]::before   { background: var(--danger); }
.summary-card[data-color="orange"]::before { background: var(--warning); }
.summary-card[data-color="green"]::before  { background: var(--primary); }
.summary-card[data-color="blue"]::before   { background: var(--secondary); }
.summary-card .material-icons-round { font-size: 20px; }
.summary-card[data-color="red"] .material-icons-round   { color: var(--danger); }
.summary-card[data-color="orange"] .material-icons-round { color: var(--warning); }
.summary-card[data-color="green"] .material-icons-round  { color: var(--primary); }
.summary-card[data-color="blue"] .material-icons-round   { color: var(--secondary); }
.summary-value { font-family: var(--mono); font-size: 17px; font-weight: 500; color: var(--text-1); }
.summary-label { font-size: 11px; color: var(--text-3); font-weight: 500; }

/* CHART CARD */
.chart-card { padding: 20px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* HORIZONTAL SCROLL (parcelas finalizando) */
.horizontal-scroll {
  display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  scrollbar-width: none;
  margin: 0 -16px; padding-left: 16px; padding-right: 16px;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

.mini-parcel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  min-width: 160px; flex-shrink: 0;
  scroll-snap-align: start;
}
.mpc-name { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpc-progress {
  height: 4px; background: rgba(255,255,255,0.08);
  border-radius: 99px; overflow: hidden; margin-bottom: 8px;
}
.mpc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--warning), var(--primary));
  border-radius: 99px;
}
.mpc-info { font-size: 11px; color: var(--text-3); }
.mpc-finish { font-size: 12px; font-weight: 600; color: var(--primary); margin-top: 4px; }

/* PREVIEW CARD */
.preview-card { padding: 18px; }
.preview-loading { color: var(--text-3); font-size: 13px; text-align: center; padding: 10px 0; }
.preview-month { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.preview-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.preview-item .material-icons-round { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.preview-item-text { font-size: 13px; color: var(--text-2); }
.preview-item-text strong { color: var(--primary); }

/* =============================================
   FATIAMENTO PAGE
   ============================================= */
.config-card { padding: 20px; margin-bottom: 16px; }
.config-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--text-1);
  margin-bottom: 20px;
}
.config-title .material-icons-round { color: var(--primary); }

.slice-items { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.slice-item {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.slice-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.slice-item-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.slice-item-val { font-family: var(--mono); font-size: 13px; color: var(--primary); }
.slice-range { width: 100%; accent-color: var(--primary); cursor: pointer; }

/* =============================================
   PARCELAS PAGE
   ============================================= */
.item-list { display: flex; flex-direction: column; gap: 12px; }

.parcel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.parcel-card-top {
  padding: 16px 16px 12px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.parcel-name { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.parcel-meta { font-size: 12px; color: var(--text-3); }
.parcel-badge {
  background: rgba(247,201,75,0.15);
  color: var(--accent);
  border-radius: 99px; padding: 3px 10px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.parcel-badge.done { background: rgba(77,255,180,0.12); color: var(--primary); }
.parcel-bar-wrap { padding: 0 16px; margin-bottom: 4px; }
.parcel-bar-bg {
  height: 8px; background: rgba(255,255,255,0.06);
  border-radius: 99px; overflow: hidden;
}
.parcel-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.parcel-card-bottom {
  padding: 10px 16px 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.parcel-stat { text-align: center; }
.parcel-stat-val { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text-1); }
.parcel-stat-label { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.parcel-card-actions { display: flex; gap: 4px; }
.action-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-elevated); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); transition: all var(--transition);
}
.action-btn:active { background: rgba(255,107,107,0.2); color: var(--danger); }
.action-btn .material-icons-round { font-size: 16px; }

/* =============================================
   TIMELINE PAGE
   ============================================= */
.timeline-header-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(91,141,239,0.15), rgba(77,255,180,0.08));
  border: 1px solid rgba(91,141,239,0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.timeline-header-card .material-icons-round { font-size: 36px; color: var(--secondary); }
.tl-title { font-size: 17px; font-weight: 700; color: var(--text-1); }
.tl-sub { font-size: 13px; color: var(--text-3); margin-top: 3px; }

.timeline-container { position: relative; }
.timeline-line {
  position: absolute; left: 20px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--secondary), var(--primary), transparent);
  opacity: 0.25;
}

.tl-month {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 16px; position: relative;
  animation: fadeSlide 0.4s ease backwards;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tl-dot {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px; position: relative; z-index: 1;
}
.tl-dot.current { background: rgba(77,255,180,0.2); border: 2px solid var(--primary); }
.tl-dot.future  { background: var(--bg-elevated); border: 2px solid var(--border); }
.tl-dot.past    { background: rgba(255,255,255,0.04); border: 2px solid rgba(255,255,255,0.06); }
.tl-dot .material-icons-round { font-size: 18px; }
.tl-dot.current .material-icons-round { color: var(--primary); }
.tl-dot.future  .material-icons-round { color: var(--text-3); }

.tl-content { flex: 1; }
.tl-month-name { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 8px; }
.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.tl-event {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.tl-event:last-child { border-bottom: none; padding-bottom: 0; }
.tl-event .material-icons-round { font-size: 16px; flex-shrink: 0; }
.tl-event.finish .material-icons-round { color: var(--primary); }
.tl-event.bill   .material-icons-round { color: var(--warning); }
.tl-event.gain   .material-icons-round { color: var(--accent); }
.tl-event-text strong { color: var(--primary); }
.tl-free {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.tl-free-label { font-size: 12px; color: var(--text-3); }
.tl-free-val { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--primary); }

/* =============================================
   DINHEIRO LIVRE PAGE
   ============================================= */
.livre-hero {
  background: linear-gradient(160deg, #0B2A1F 0%, #0A1F30 100%);
  border: 1px solid rgba(77,255,180,0.12);
  border-radius: var(--radius-xl);
  padding: 32px 24px 28px;
  text-align: center;
  margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.livre-hero::after {
  content: '';
  position: absolute; bottom: -60px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(77,255,180,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.livre-emoji { font-size: 40px; margin-bottom: 12px; }
.livre-label { font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.livre-amount {
  font-family: var(--mono); font-size: 42px; font-weight: 500;
  color: var(--primary); margin-bottom: 6px; letter-spacing: -1px;
}
.livre-sub { font-size: 13px; color: var(--text-3); margin-bottom: 24px; }
.livre-bar-wrap { text-align: left; }
.livre-bar {
  height: 8px; background: rgba(255,255,255,0.07);
  border-radius: 99px; overflow: hidden; margin-bottom: 6px;
}
.livre-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.livre-bar-label { font-size: 11px; color: var(--text-3); font-family: var(--mono); }

/* Quick form */
.quick-form { padding: 18px; margin-bottom: 0; }
.quick-row { display: flex; gap: 12px; }
.flex1 { flex: 1; }

/* Gastos list (livre + fixos) */
.expense-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.expense-icon {
  width: 40px; height: 40px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  background: var(--bg-elevated);
}
.expense-info { flex: 1; }
.expense-name { font-size: 14px; font-weight: 500; color: var(--text-1); }
.expense-cat  { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.expense-amount { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--danger); }

.fixo-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.fixo-info { display: flex; align-items: center; gap: 12px; }
.fixo-icon { font-size: 22px; }
.fixo-name { font-size: 14px; font-weight: 500; color: var(--text-1); }
.fixo-cat  { font-size: 11px; color: var(--text-3); }
.fixo-right { text-align: right; }
.fixo-val { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--danger); }
.fixo-del { background: none; border: none; cursor: pointer; color: var(--text-3); display: flex; align-items: center; margin-top: 4px; justify-content: flex-end; }
.fixo-del .material-icons-round { font-size: 18px; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-3); font-size: 14px; }
.empty-state .material-icons-round { font-size: 48px; margin-bottom: 12px; display: block; opacity: 0.3; }

/* =============================================
   FORMS
   ============================================= */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-1); font-family: var(--font); font-size: 15px;
  outline: none; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(77,255,180,0.12);
}
.form-input::placeholder { color: var(--text-3); }
select.form-input { cursor: pointer; }
input[type="month"].form-input { cursor: pointer; }
.large-input { font-size: 28px; font-family: var(--mono); text-align: center; padding: 16px; }

/* CHIPS */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 99px;
  background: var(--bg-elevated); border: 1.5px solid var(--border);
  color: var(--text-2); font-family: var(--font); font-size: 13px;
  cursor: pointer; transition: all var(--transition);
}
.chip.active {
  background: rgba(77,255,180,0.12);
  border-color: var(--primary); color: var(--primary);
}

/* BUTTONS */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 24px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none; color: var(--bg-deep); font-family: var(--font);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  letter-spacing: 0.2px;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.btn-ghost {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--radius-md);
  background: transparent; border: 1.5px solid var(--border);
  color: var(--text-2); font-family: var(--font);
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
}
.btn-ghost:active { background: var(--bg-elevated); }
.full-width { width: 100%; }

/* =============================================
   MODAIS
   ============================================= */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  align-items: flex-end;
  animation: overlayIn 0.25s ease forwards;
}
.modal-overlay.open { display: flex; }
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-sheet {
  background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid var(--border);
  padding: 12px 20px calc(24px + var(--safe-bottom));
  width: 100%;
  max-height: 92dvh; overflow-y: auto;
  animation: sheetUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.modal-large { max-height: 96dvh; }
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-handle {
  width: 40px; height: 4px; border-radius: 99px;
  background: var(--bg-elevated); margin: 0 auto 20px;
}
.modal-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: var(--text-1);
  margin-bottom: 20px;
}
.modal-title .material-icons-round { color: var(--primary); }

/* INFO PREVIEW CARD */
.info-preview {
  background: rgba(91,141,239,0.08);
  border-color: rgba(91,141,239,0.2) !important;
  padding: 14px; margin-bottom: 14px;
}
.preview-row { display: flex; align-items: flex-start; gap: 10px; }
.preview-row .material-icons-round { color: var(--secondary); flex-shrink: 0; }

/* =============================================
   SNACKBAR
   ============================================= */
.snackbar {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  left: 16px; right: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px; font-weight: 500; color: var(--text-1);
  box-shadow: var(--shadow);
  z-index: 2000;
  transform: translateY(120%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; align-items: center; gap: 10px;
}
.snackbar.show { transform: translateY(0); }
.snackbar .material-icons-round { font-size: 20px; flex-shrink: 0; }
.snackbar.success .material-icons-round { color: var(--primary); }
.snackbar.error   .material-icons-round { color: var(--danger); }

/* =============================================
   UTILITIES
   ============================================= */
.hidden { display: none !important; }
.text-green  { color: var(--primary); }
.text-red    { color: var(--danger); }
.text-orange { color: var(--warning); }
.text-blue   { color: var(--secondary); }
.text-yellow { color: var(--accent); }

/* Canvas */
canvas { max-width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 0; height: 0; }

/* Pulse animation for live values */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.pulse { animation: pulse 2s ease infinite; }
