@import './tokens.css';

/* ==========================================================================
   IMPECCABLE DESKTOP FINTECH DASHBOARD STYLES (MiBudget UTP)
   Figma / Bento Grid Architecture & Obsidian Glassmorphism
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg-canvas);
  color-scheme: dark light;
}

body.co-dashboard-body {
  background: var(--bg-canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Tipografía de cifras tabulares */
.cifra {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   DESKTOP APP SHELL (SIDEBAR + MAIN COLUMN)
   ========================================================================== */
.co-desktop-layout {
  display: flex;
  min-height: 100dvh;
  width: 100%;
}

/* Sidebar Vertical Compacto */
.co-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100dvh;
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  z-index: 40;
}

.co-sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.co-sidebar-brand {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--bg-card-raised);
  color: var(--gold-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border-gold);
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.15);
}

.co-sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}

.co-nav-btn {
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.co-nav-btn:hover {
  background: var(--bg-card-raised);
  color: var(--ink);
  border-color: var(--card-border);
  transform: translateY(-1px);
}

.co-nav-btn.is-active {
  background: var(--bg-card-raised);
  color: var(--gold-accent);
  border-color: var(--card-border-gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.co-sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Columna Principal */
.co-main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  min-height: 100dvh;
}

/* ==========================================================================
   TOPBAR HEADER (ESTILO FIGMA DASHBOARD)
   ========================================================================== */
.co-header {
  height: var(--topbar-h);
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.co-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* User Workspace Pill */
.co-user-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card-raised);
  border: 1px solid var(--card-border);
  border-radius: var(--r-pill);
  padding: 4px 14px 4px 4px;
}

.co-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-canvas);
  color: var(--gold-accent);
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
}

.co-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.co-user-name {
  font-weight: 750;
  font-size: 0.85rem;
  color: var(--ink);
}

.co-user-role {
  font-size: 0.7rem;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.co-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--verde);
  box-shadow: 0 0 8px var(--verde);
}

/* Global Search Bar */
.co-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card-raised);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 0 0.85rem;
  width: 280px;
  height: 38px;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.co-search-box:focus-within {
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  width: 340px;
}

.co-search-icon {
  color: var(--ink-tertiary);
  flex-shrink: 0;
}

.co-search-input {
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  width: 100%;
  outline: none;
}

.co-search-input::placeholder {
  color: var(--ink-tertiary);
}

.co-kbd {
  font-family: monospace;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-secondary);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Header Right Actions */
.co-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Quincena Pill Stepper */
.co-quincena-pill {
  display: flex;
  align-items: center;
  background: var(--bg-card-raised);
  border: 1px solid var(--card-border);
  border-radius: var(--r-pill);
  padding: 3px 6px;
  gap: 3px;
}

.co-step-arrow {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.co-step-arrow:hover {
  background: var(--bg-card);
  color: var(--ink);
}

.co-header-date {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  padding: 2px 4px;
  max-width: 110px;
}

/* Round Circle Icon Buttons */
.co-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card-raised);
  border: 1px solid var(--card-border);
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.co-circle-btn:hover {
  background: var(--bg-card);
  color: var(--ink);
}

.co-header-ghost-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-raised);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 0 0.85rem;
  height: 38px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.co-header-ghost-btn:hover {
  background: var(--bg-card);
  color: var(--ink);
  border-color: var(--card-border-hover);
}

/* BOTÓN PRINCIPAL DE ACCIÓN: REGISTRAR GASTO */
.co-primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #fef08a 0%, #eab308 100%);
  color: #1e1b07;
  border: 1px solid #fde047;
  border-radius: var(--r-pill);
  padding: 0 1.25rem;
  height: 38px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.35);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.co-primary-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.45);
  filter: brightness(1.05);
}

/* ==========================================================================
   VIEWPORT Y GREETING ROW
   ========================================================================== */
.co-dashboard-viewport {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: var(--dashboard-max-w);
  width: 100%;
  margin: 0 auto;
}

.co-dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.co-greeting-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.co-greeting-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
}

.co-greeting-sub {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  margin-top: 0.25rem;
}

.co-quick-filters {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.co-filter-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-secondary);
}

/* Banners de Aviso */
.co-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
}

.alert-danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-warning { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }
.alert-info { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.alert-success { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }

/* ==========================================================================
   BENTO GRID ARCHITECTURE (REFERENCIA FIGMA)
   ========================================================================== */
.co-bento-grid {
  display: grid;
  grid-template-columns: 360px 1fr 340px;
  grid-template-rows: auto auto;
  gap: var(--bento-gap);
}

@media (max-width: 1300px) {
  .co-bento-grid {
    grid-template-columns: 1fr 1fr;
  }
  .co-bento-chart {
    grid-column: 1 / 3;
  }
  .co-bento-transactions {
    grid-column: 1 / 3;
  }
}

@media (max-width: 900px) {
  .co-bento-grid {
    grid-template-columns: 1fr;
  }
  .co-bento-chart,
  .co-bento-transactions,
  .co-bento-limits,
  .co-bento-banner {
    grid-column: 1 / 2;
  }
}

/* Tarjeta Base Bento */
.co-card {
  background: var(--bg-card);
  background-image: var(--bg-card-glow);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  box-shadow: var(--sombra-card);
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.co-card:hover {
  border-color: var(--card-border-hover);
}

.co-card-label {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-secondary);
}

/* --------------------------------------------------------------------------
   BENTO CARD 1: HERO BALANCE & MY WALLET
   -------------------------------------------------------------------------- */
.co-bento-balance {
  grid-column: 1 / 2;
  gap: 1.25rem;
}

.co-balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.co-icon-btn-ghost {
  background: var(--bg-card-raised);
  border: 1px solid var(--card-border);
  color: var(--gold-accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
}

.co-balance-figure-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.co-balance-currency {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-top: 0.2rem;
}

.co-balance-amount {
  font-family: var(--font-display);
  font-size: 2.85rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.04em;
}

.co-btn-eye {
  background: transparent;
  border: none;
  color: var(--ink-tertiary);
  cursor: pointer;
  margin-top: 0.6rem;
  margin-left: 0.35rem;
}

.co-balance-change {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.co-trend-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trend-up { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.trend-warn { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.co-balance-hint {
  font-size: 0.75rem;
  color: var(--ink-tertiary);
}

/* My Wallet Stack */
.co-wallet-stack {
  background: var(--bg-card-subtle);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.co-wallet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.co-badge-xs {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-secondary);
}

.co-stacked-cards {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.co-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-bg-navy { background: #1c273a; color: #93c5fd; }
.card-bg-slate { background: #262e3d; color: #cbd5e1; }
.card-bg-gold { background: #332b1a; color: #fef08a; border-color: rgba(234, 179, 8, 0.3); }

.co-mini-card-name { font-size: 0.78rem; font-weight: 650; }
.co-mini-card-val { font-size: 0.85rem; font-weight: 700; }

/* --------------------------------------------------------------------------
   BENTO CARD 2: FINANCIAL FLOW & BAR CHART
   -------------------------------------------------------------------------- */
.co-bento-chart {
  grid-column: 2 / 3;
  gap: 1.5rem;
}

.co-chart-metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.co-metric-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.co-metric-val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
}

.co-metric-lbl {
  font-size: 0.75rem;
  color: var(--ink-secondary);
}

.co-metric-divider {
  width: 1px;
  height: 38px;
  background: var(--card-border);
}

/* Gráfico de Barras Puro */
.co-chart-container {
  height: 180px;
  display: flex;
  align-items: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border-subtle);
}

.co-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  gap: 8px;
}

.co-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  justify-content: flex-end;
  flex: 1;
}

.co-bar {
  width: 100%;
  max-width: 28px;
  background: var(--bg-card-raised);
  border-radius: 6px;
  transition: height 0.4s ease, background 0.2s ease;
}

.co-bar:hover {
  background: rgba(255, 255, 255, 0.2);
}

.co-bar.is-active {
  background: linear-gradient(180deg, #fef08a 0%, #eab308 100%);
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.4);
}

.h-35 { height: 35%; }
.h-40 { height: 40%; }
.h-45 { height: 45%; }
.h-50 { height: 50%; }
.h-55 { height: 55%; }
.h-60 { height: 60%; }
.h-65 { height: 65%; }
.h-70 { height: 70%; }
.h-85 { height: 85%; }

.co-bar-label {
  font-size: 0.7rem;
  color: var(--ink-tertiary);
}

/* --------------------------------------------------------------------------
   BENTO CARD 3: BUDGET REMAINING & LIMITS
   -------------------------------------------------------------------------- */
.co-bento-limits {
  grid-column: 3 / 4;
  gap: 1.15rem;
}

.co-limits-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.co-limits-sub {
  font-size: 0.75rem;
  color: var(--ink-secondary);
}

.co-pct-badge {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--verde);
}

.co-limits-tabs {
  display: flex;
  background: var(--bg-card-subtle);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}

.co-tab-pill {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--ink-secondary);
  padding: 6px 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.co-tab-pill.is-active {
  background: var(--bg-card-raised);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.co-period-toggles {
  display: flex;
  gap: 4px;
}

.co-time-toggle {
  flex: 1;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  color: var(--ink-tertiary);
  font-size: 0.7rem;
  font-weight: 650;
  padding: 4px 0;
  cursor: pointer;
}

.co-time-toggle.is-active {
  background: var(--bg-card-raised);
  color: var(--ink);
  border-color: var(--card-border-hover);
}

.co-limits-numbers {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--card-border-subtle);
}

.co-limit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.co-limit-label {
  color: var(--ink-secondary);
}

/* --------------------------------------------------------------------------
   BENTO CARD 4: STRATEGIC 15K ROADMAP BANNER (READY TO BREAK FREE)
   -------------------------------------------------------------------------- */
.co-bento-banner {
  grid-column: 1 / 2;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #181d28 0%, #0d1017 100%);
  border-color: rgba(255, 255, 255, 0.12);
  justify-content: space-between;
  min-height: 240px;
}

.co-banner-bg-texture {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
}

.co-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.co-banner-hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
}

.co-banner-hero-sub {
  font-size: 0.8rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.co-banner-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
}

.co-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.co-banner-cta:hover {
  background: rgba(255, 255, 255, 0.18);
}

.co-banner-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.co-banner-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-accent);
}

.co-banner-desc {
  font-size: 0.68rem;
  color: var(--ink-tertiary);
}

/* --------------------------------------------------------------------------
   BENTO CARD 5: TRANSACTIONS & MOVIMIENTOS TABLE
   -------------------------------------------------------------------------- */
.co-bento-transactions {
  grid-column: 2 / 4;
  gap: 1.25rem;
}

.co-trans-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.co-trans-title {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 1.25rem;
  color: var(--ink);
}

.co-trans-sub {
  font-size: 0.75rem;
  color: var(--ink-secondary);
}

.co-btn-cta-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card-raised);
  border: 1px solid var(--card-border-gold);
  color: var(--gold-accent);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.co-btn-cta-gold:hover {
  background: var(--gold-accent);
  color: #0e1117;
}

/* Tabla Estilizada de Transacciones */
.co-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.co-transactions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.co-transactions-table th {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-tertiary);
  padding: 0.5rem 1rem;
  text-align: left;
}

.co-transactions-table th.co-th-check {
  width: 36px;
  padding-right: 0;
}

.co-tr-row {
  background: var(--bg-card-subtle);
  border-radius: var(--r-md);
  transition: all 0.15s ease;
}

.co-tr-row:hover {
  background: var(--bg-card-raised);
}

.co-tr-row.is-row-settled {
  opacity: 0.65;
}

.co-tr-row.is-row-settled .co-concept-name {
  text-decoration: line-through;
}

.co-tr-row td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

.co-td-check {
  width: 36px;
  padding-right: 0 !important;
}

/* Checkbox Personalizado Impeccable */
.co-check-label {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.co-check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.co-check-custom {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: all 0.15s ease;
  background: transparent;
}

.co-check-custom svg {
  transform: scale(0);
  transition: transform 0.15s ease;
}

.co-check-input:checked + .co-check-custom {
  background: var(--verde);
  border-color: var(--verde);
}

.co-check-input:checked + .co-check-custom svg {
  transform: scale(1);
}

.co-concept-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.co-squircle {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.co-squircle.cat-blue { background: var(--cat-blue-bg); color: var(--cat-blue-text); border: 1px solid var(--cat-blue-border); }
.co-squircle.cat-coral { background: var(--cat-coral-bg); color: var(--cat-coral-text); border: 1px solid var(--cat-coral-border); }
.co-squircle.cat-emerald { background: var(--cat-emerald-bg); color: var(--cat-emerald-text); border: 1px solid var(--cat-emerald-border); }
.co-squircle.cat-amber { background: var(--cat-amber-bg); color: var(--cat-amber-text); border: 1px solid var(--cat-amber-border); }
.co-squircle.cat-purple { background: var(--cat-purple-bg); color: var(--cat-purple-text); border: 1px solid var(--cat-purple-border); }
.co-squircle.cat-teal { background: var(--cat-teal-bg); color: var(--cat-teal-text); border: 1px solid var(--cat-teal-border); }
.co-squircle.cat-misc { background: rgba(255, 255, 255, 0.06); color: var(--ink-secondary); border: 1px solid var(--card-border); }

.co-concept-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}

.co-concept-cat {
  font-size: 0.72rem;
  color: var(--ink-tertiary);
}

.co-date-text {
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

.co-pill-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
}

.status-success { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.status-success .co-status-dot { background: #34d399; }

.status-pending { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.status-pending .co-status-dot { background: #fbbf24; }

.co-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.co-action-trash {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.co-action-trash:hover {
  color: var(--rojo);
  background: rgba(239, 68, 68, 0.12);
}

/* ==========================================================================
   MODAL PARA REGISTRAR NUEVO GASTO MANUAL
   ========================================================================== */
.co-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.5rem;
}

.co-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.co-modal-dialog {
  background: #171b24;
  border: 1px solid var(--card-border-gold);
  border-radius: var(--r-xl);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--sombra-float);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateY(15px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.co-modal-backdrop.is-open .co-modal-dialog {
  transform: translateY(0);
}

.co-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.co-modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.co-modal-sub {
  font-size: 0.8rem;
  color: var(--ink-secondary);
  margin-top: 0.2rem;
}

.co-modal-close {
  background: transparent;
  border: none;
  color: var(--ink-secondary);
  cursor: pointer;
  padding: 4px;
}

.co-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.co-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.co-form-row {
  display: flex;
  gap: 0.85rem;
}

.co-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-secondary);
}

.co-input, .co-select {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 0.65rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: all 0.15s ease;
}

.co-input:focus, .co-select:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2);
}

.co-input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.co-prefix {
  position: absolute;
  left: 12px;
  font-weight: 700;
  color: var(--ink-tertiary);
}

.pl-8 { padding-left: 2rem !important; }

.co-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.co-btn-secondary {
  background: var(--bg-card-raised);
  border: 1px solid var(--card-border);
  color: var(--ink-secondary);
  border-radius: var(--r-pill);
  padding: 0.55rem 1.15rem;
  font-weight: 650;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ==========================================================================
   VISTAS SECUNDARIAS (SOBRES, MAESTRÍA, SOCIEDAD, SIMULADOR)
   ========================================================================== */
.co-envelopes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.co-envelope-card {
  padding: 1.25rem;
  gap: 0.65rem;
}

.co-envelope-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.co-envelope-name {
  font-weight: 750;
  font-size: 1rem;
  color: var(--ink);
  margin-top: 0.35rem;
}

.co-envelope-cat {
  font-size: 0.72rem;
  color: var(--ink-secondary);
}

.co-envelope-val {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 0.5rem;
}

.co-grid-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .co-grid-2cols {
    grid-template-columns: 1fr;
  }
}

.co-mod-pill {
  background: var(--cat-blue-bg);
  color: var(--cat-blue-text);
  border: 1px solid var(--cat-blue-border);
  font-size: 0.72rem;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: var(--r-pill);
}

.co-mod-pill-sm {
  background: var(--bg-card-raised);
  border: 1px solid var(--card-border);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.co-tercios-grid-desk {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.co-tercio-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  gap: 0.85rem;
}

.co-tercio-box.is-paid {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.co-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--card-border-subtle);
  gap: 0.85rem;
}

.co-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-card-subtle);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.co-progress-bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 0.4s ease;
}

.co-progress-bar-fill.cat-teal { background: var(--cat-teal); }
.co-progress-bar-fill.cat-amber { background: var(--cat-amber); }

.co-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.co-stat-box {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card-subtle);
  border-radius: var(--r-md);
  border: 1px solid var(--card-border);
}

.co-stat-box.highlight-box {
  border-color: var(--card-border-gold);
}

/* Toast */
.co-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e2532;
  color: #ffffff;
  border: 1px solid var(--card-border-gold);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 650;
  box-shadow: var(--sombra-float);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 120;
}

.co-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.co-toast.is-error {
  background: var(--rojo);
  border-color: #fca5a5;
}

/* Skeleton Loading */
.co-loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.co-skeleton-box {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  animation: pulse 1.5s infinite ease-in-out;
}

.h-40 { height: 120px; }
.h-64 { height: 260px; }

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

/* Utilidades */
.text-gold { color: var(--gold-accent) !important; }
.text-green { color: var(--verde) !important; }
.text-red { color: var(--rojo) !important; }
.text-amber { color: var(--ambar) !important; }
.text-teal { color: var(--cat-teal) !important; }
.text-muted { opacity: 0.5; }
.text-secondary { color: var(--ink-secondary); }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-right { text-align: right; }
.flex-1 { flex-1; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.w-full { width: 100%; }
.border-amber { border-color: var(--cat-amber) !important; }
