/* public_html/assets/app.css (light minimal) */

/* =========================
   Theme
   ========================= */
:root{
  --bg:#f6f7f9;
  --panel:#ffffff;
  --panel2:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;

  --accent:#2563eb; /* azul sobrio */
  --ok:#16a34a;
  --warn:#d97706;
  --bad:#dc2626;

  --r:8px;          /* poco redondeado */
  --r2:6px;
  --shadow: 0 1px 2px rgba(0,0,0,.06);

  /* altura topbar (puede ser dinámica con JS) */
  --topbar-h: 100px;
}

*{box-sizing:border-box}
html,body{height:100%}
html, body { overflow-x: hidden; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  display:flex;
}

/* =========================
   Sidebar (base)
   ========================= */
.sidebar{
  width:260px;
  background:var(--panel);
  border-right:1px solid var(--line);

  /* Desktop sidebar layout */
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

/* Si adoptas .sidebar-scroll + footer (recomendado),
   en desktop el scroll puede ir en .sidebar-scroll también */
.sidebar-scroll{
  display:flex;
  flex-direction:column;
  gap:16px;
  min-width:0;
}
.sidebar-footer{margin-top:auto;display:flex;flex-direction:column;gap:6px}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:40px;height:40px;border-radius:var(--r2);
  background:#f3f4f6;
  border:1px solid var(--line);
  display:grid;place-items:center;
  font-weight:800;
}
.brand-title{font-weight:800}
.brand-sub{font-size:12px;color:var(--muted)}

.nav{display:flex;flex-direction:column;gap:6px;margin-top:6px}
.nav-item{
  padding:10px 10px;
  border-radius:var(--r2);
  color:var(--text);
  text-decoration:none;
  border:1px solid transparent;
}
.nav-item:hover{background:#f3f4f6}
.nav-item.active{
  border-color:#dbeafe;
  background:#eff6ff;
  color:#1d4ed8;
}

.pill{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font-size:13px;
  box-shadow: var(--shadow);
}
.muted{color:var(--muted);font-size:12px}

/* =========================
   Main / Topbar
   ========================= */
.main{flex:1;display:flex;flex-direction:column;min-width:0}

.topbar{
  height:100px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
  border-bottom:1px solid var(--line);
  background:var(--panel);
  padding-top:40px;
  padding-bottom:25px;
}
.topbar h1{font-size:16px;margin:0;font-weight:700}

.btn{
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  padding:8px 12px;
  border-radius:var(--r2);
  cursor:pointer;
  box-shadow: var(--shadow);
}
.btn:hover{background:#f9fafb}
.btn.primary{
  border-color:#bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
}
.btn.ghost{background:transparent; box-shadow:none}

/* Fix: topbar select overflow (mobile) */
.topbar-right { min-width: 0; }
#workspaceSelect { max-width: 100%; min-width: 0; }

@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar-left, .topbar-right { width: 100%; min-width: 0; }
  .topbar-right { display: flex; gap: 10px; align-items: center; }
  #workspaceSelect {
    flex: 1 1 auto;
    width: 100% !important;
    max-width: 100% !important;
  }
  #btnNewAccount { flex: 0 0 auto; white-space: nowrap; }
}

/* =========================
   Content / Cards
   ========================= */
.content{padding:18px;min-width:0}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}

.card{
  border:1px solid var(--line);
  border-radius:var(--r);
  background:var(--panel);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card-title{padding:12px 14px;border-bottom:1px solid var(--line);font-weight:700}
.card-body{padding:14px}
.card.span-2{grid-column: span 2}

.row{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px dashed #e5e7eb}
.row:last-child{border-bottom:none}
.k{color:var(--muted)}
.v{font-weight:600}

.log{
  height:200px; overflow:auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size:12px; line-height:1.5;
  padding:10px;
  border:1px solid var(--line);
  border-radius:var(--r2);
  background:#fafafa;
}

/* =========================
   Responsive base
   ========================= */
@media (max-width: 920px){
  body{flex-direction:column}
  .sidebar{width:100%}
  .grid{grid-template-columns:1fr}
  .card.span-2{grid-column:auto}
}

/* =========================
   Custom Modal (NO Bootstrap)
   ========================= */
.cc-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1040; /* <- debajo de Bootstrap modal (1055) */
  padding: 16px;
}

.cc-modalbox{
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  overflow: hidden;
}

.cc-modal-header, .cc-modal-footer{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.cc-modal-footer{
  border-bottom: 0;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.cc-modal-title{ font-weight: 700; }
.cc-modal-body{ padding: 14px; }

.grid2{
  display:grid;
  grid-template-columns: 1fr !important;
  gap: 12px;
}
@media (max-width: 700px){
  .grid2{ grid-template-columns: 1fr; }
}

.field-label{ font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.input{
  width: 100%;
  max-width:100%;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

/* =========================
   Animations
   ========================= */
.cc-flash-up { animation: ccUp 420ms ease; }
.cc-flash-down { animation: ccDown 420ms ease; }

@keyframes ccUp {
  0% { transform: translateY(0); }
  35% { transform: translateY(-1px); }
  100% { transform: translateY(0); }
}
@keyframes ccDown {
  0% { transform: translateY(0); }
  35% { transform: translateY(1px); }
  100% { transform: translateY(0); }
}

.cc-row-enter { opacity: 0; transform: translateY(-4px); }
.cc-row-enter-active {
  animation: ccRowIn 520ms cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes ccRowIn {
  to { opacity: 1; transform: translateY(0); }
}

.cc-row-ping { animation: ccPing 900ms ease; }
@keyframes ccPing {
  0% { box-shadow: 0 0 0 0 rgba(80, 160, 255, .35); }
  70% { box-shadow: 0 0 0 8px rgba(80, 160, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(80, 160, 255, 0); }
}

/* =========================
   Mobile fixes: Dashboard KPIs + overflow
   ========================= */
#dashActivos, #dashPasivos, #dashPatrimonio {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
  #dashActivos, #dashPasivos, #dashPatrimonio {
    font-size: clamp(18px, 6vw, 24px) !important;
    line-height: 1.1;
  }
}

@media (max-width: 680px) {
  #viewDashboard .card-body > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #viewDashboard .card-body > div:nth-of-type(3) {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

#viewDashboard, #viewAccounts, #viewTx {
  -webkit-tap-highlight-color: transparent;
}

.btn, select, input, button {
  touch-action: manipulation;
}

@media (max-width: 680px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* =========================
   Mobile sidebar (off-canvas) + iOS SAFE scroll
   ========================= */
.sidebar-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 40;
}

/* Desktop */
@media (min-width: 901px) {
  .sidebar { position: sticky; top: 0; height: 100vh; }
}

/* Mobile: el contenedor se mueve con transform, pero NO scrollea.
   El scroll vive en .sidebar-scroll (sin transform) -> iOS Safari OK */
@media (max-width: 900px) {
  .sidebar{
    position: fixed;
    left: 0;
    width: min(86vw, 320px);

    top: var(--topbar-h);
    bottom: 0;                      /* ✅ mejor que height:100vh/dvh en iOS */

    transform: translateX(-105%);
    transition: transform 220ms ease;
    z-index: 50;
    box-shadow: 0 10px 40px rgba(0,0,0,.18);

    overflow: hidden;               /* ✅ el contenedor NO scrollea */
    padding: 0;                     /* ✅ padding pasa a .sidebar-scroll */
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--panel);
    border-right: 1px solid var(--line);
  }

  .sidebar.is-open{
    transform: translateX(0);
  }

  .sidebar-scroll{
    flex: 1 1 auto;
    min-height: 0;                  /* 🔥 CLAVE para overflow en flex (iOS) */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px;
  }

  /* Footer siempre visible */
  .sidebar-footer{
    flex: 0 0 auto;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--panel);
  }

  .main{
    margin-left: 0 !important;
  }
}

/* =========================
   Scroll container app layout (topbar sticky + content scroll)
   ========================= */
body {
  height: 100vh;
  overflow: hidden;     /* evita scroll del body */
}

main.main {
  height: 100vh;
  overflow: hidden;     /* el scroll NO aquí */
  display: flex;
  flex-direction: column;
  min-width: 0;
}

section.content {
  flex: 1;
  overflow: auto;
  min-height: 0;        /* CLAVE en flex para que overflow funcione */
}

header.topbar{
  position: sticky;
  top: 0;
  z-index: 50;

  /* 🎨 glass effect */
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);

  border-bottom: 1px solid rgba(0,0,0,.08);

  /* evita glitches al hacer scroll */
  will-change: backdrop-filter;

  /* mantiene altura estable */
  min-height: 80px;
}


/* Si estás usando clase para bloquear fondo cuando sidebar abierto */
body.sidebar-open {
  overflow: hidden;
}

/* =========================
   Bootstrap Modal inner layout (Categorías)
   ========================= */
.cc-modal .cc-modal-header{
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.cc-modal .cc-modal-body{
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: hidden;
}

.cc-card{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  height: 100%;
}

.cc-card-h{
  font-weight: 600;
  margin-bottom: 10px;
}

.cc-list{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  overflow-y: auto;
  max-height: 360px;
}

.cc-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  cursor: pointer;
}

.cc-item:last-child{ border-bottom: none; }
.cc-item:hover{ background: rgba(0,0,0,.03); }
.cc-item.is-active{ background: rgba(13,110,253,.08); }

.cc-item .cc-name{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cc-item .cc-name span{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-item .cc-actions{
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.cc-item .cc-actions button{
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 12px;
}
.cc-item .cc-actions button:hover{ background: rgba(0,0,0,.04); }

.cc-breadcrumb{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70vw;
}

.modal-backdrop { z-index: 1050 !important; }
.modal { z-index: 1055 !important; }

.cc-mini-btn{
  border: 1px solid rgba(0,0,0,.12);
  background:#fff;
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.cc-mini-btn:hover{ background: rgba(0,0,0,.04); }

.cc-modal .cc-head-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap: wrap;
}
.cc-tree-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px;
  border-bottom:1px solid rgba(0,0,0,.06);
  cursor:pointer;
}
.cc-tree-row:hover{ background: rgba(0,0,0,.03); }
.cc-tree-row.is-active{ background: rgba(13,110,253,.08); }

.cc-tree-left{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.cc-tree-name{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cc-tree-indent{ width: 16px; flex: 0 0 16px; }
.cc-tree-caret{
  width:18px;
  text-align:center;
  color: var(--muted);
  font-weight: 700;
}
.cc-edit.is-hidden { display: none; }
.cc-saldo-cell { cursor: pointer; }
.cc-saldo-cell:hover { background: rgba(0,0,0,.02); }

.cc-iconpick{
  display:flex;
  gap:12px;
  align-items:flex-start;
  flex-wrap:wrap;
}
.cc-iconprev{
  width:64px;
  height:64px;
  border:1px solid var(--line);
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:#fff;
}
.cc-iconprev img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.cc-link { color: inherit; }
.cc-link:hover { text-decoration: underline !important; }

/* Toasts */
#toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  background: #111;
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-size: 13px;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(10px);
  transition: all .25s ease;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  background: #0f172a;
  border: 1px solid rgba(255,255,255,.08);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: #064e3b; }
.toast.info    { background: #0b3c5d; }
.toast.warn    { background: #78350f; }
.toast.error   { background: #842029; }
.toast.ink     { background: #0b1220; }
.toast.violet  { background: #312e81; }
.toast.neutral { background: #111827; }

.toast .title {
  font-weight: 600;
  margin-bottom: 2px;
}

.toast .msg {
  opacity: .95;
}
.toast.hide{
  opacity: 0;
  transform: translateY(10px);
}

/* FAB */
.fab-add{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  color:#111;
  font-size: 28px;
  line-height: 48px;
  text-align:center;
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
  cursor: pointer;
  z-index: 1050;
}
.fab-add:hover{ transform: translateY(-1px); }
.fab-add:active{ transform: translateY(0px); }

/* ===== TOPBAR móvil: título + (+) arriba, select abajo ===== */
@media (max-width: 640px){
  .topbar{
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "left plus"
      "select select";
    gap: 8px 10px;
    align-items: center;
  }

  .topbar-left{ grid-area: left; }

  .topbar-right{
    display: contents !important;
  }

  #btnNewTxGlobal{
    grid-area: plus;
    padding: 8px 12px;
    border-radius: 12px;
    justify-self: end;
  }

  #workspaceSelect{
    grid-area: select;
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Filtros de movimientos */
#txFilters{ display:none; }
#txFilters.is-open{ display:flex; }

/* Montos por tipo */
.tx-amount{
  font-weight: 600;
  white-space: nowrap;
}
.tx-amount.ingreso{ color: #16a34a; }
.tx-amount.gasto{ color: #dc2626; }
.tx-amount.transferencia{ color: #374151; }

/* Reports layout */
.rep-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 900px){
  .rep-grid{ grid-template-columns: 1fr; }
  #repMainChart{ height: 260px !important; }
  #repDetailChart{ height: 220px !important; }
}

/* Aside session info */
.aside-session {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7f8fa;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom:10px;
}
.aside-user { font-weight: 600; color: #111; }
.aside-meta { color: #666; font-size: 12px; }

/* Campana push */
#btnEnablePush {
  font-size: 18px;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
#btnEnablePush.push-off{
  color:#9ca3af !important;
  background:transparent !important;
  border-color: var(--line) !important;
}
#btnEnablePush.push-on{
  color:#2563eb !important;
  background:#eff6ff !important;
  border-color:#bfdbfe !important;
}
#btnEnablePush.push-pulse{
  animation: pushPulse .6s ease;
}
@keyframes pushPulse{
  0%{transform:scale(1)}
  50%{transform:scale(1.25) rotate(-12deg)}
  100%{transform:scale(1)}
}

/* Topbar branding */
.topbar-logo{
  width:34px;
  height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:#111827;
  color:#fff;
  font-weight:800;
  font-size:13px;
  letter-spacing:.5px;
}
.topbar-app{
  font-size:15px;
  color:#111;
}

/* Dashboard: Top cuentas */
.dash-acc-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  background: #fff;
}
.dash-acc-fallback {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #f3f4f6;
  font-weight: 800;
  font-size: 12px;
  color: #111827;
}
.acc-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
}
.acc-icon-wrap img {
  max-width: 26px;
  max-height: 26px;
  object-fit: contain;
  display: block;
}
.acc-icon-fallback {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #e5e7eb;
}
.acc-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.acc-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-drag-handle{
  cursor: grab;
  user-select: none;
  touch-action: none;
  font-size: 16px;
  line-height: 1;
  opacity: .75;
}
tr.dragging{ opacity: .55; }
.acc-ghost{
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
/* ===== Reports Layout ===== */
.rep-grid{
  display: grid;
  grid-template-columns: 1fr; /* 1 columna (sin panel derecho) */
  gap: 14px;
}

.rep-panel{
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.rep-panel-head{
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f3f4f6;
  font-weight: 700;
}

.rep-panel-body{
  padding: 12px;
}

.rep-breadcrumb{
  margin-bottom: 10px;
}

.rep-breadcrumb a{
  color: inherit;
  text-decoration: underline;
}

/* ===== Bars container modes ===== */
.rep-bars.horizontal{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Desktop: columnas verticales */
@media (min-width: 1024px){
  .rep-bars.vertical{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 18px;
    align-items: end;
    height: 460px;
    padding: 10px;
  }
}

/* ===== Shared bar style (container always full size) ===== */
.rep-bar{
  position: relative;
  width: 100%;
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
}

/* Mobile horizontal sizing */
.rep-bars.horizontal .rep-bar{
  min-height: 40px;      /* 👈 antes 76 */
  padding: 8px 12 14px;   /* opcional */
}
.rep-bar .fill{
  border-radius: 14px;   /* que empate con la barra */
}


/* Desktop vertical sizing */
.rep-bars.vertical .rep-bar{
  height: 100%;
  min-height: 220px;
  padding: 10px;
  display: flex;
  align-items: flex-end;
  
}

/* Fill that represents percentage */
.rep-bar .fill{
  position: absolute;
  inset: 0;
  border-radius: 16px;
  transform-origin: left center;
  will-change: transform;
}

/* Content over the fill */
.rep-bar .content{
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Horizontal text */
.rep-bars.horizontal .left{
  font-weight: 500;
  font-size: 16px;
  color: #0b1220;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rep-bars.horizontal .right{
  font-weight: 900;
  font-size: 20px;
  white-space: nowrap;
  color: #0b1220;
}

/* Vertical text (centered, smaller) */
@media (min-width: 1024px){
  .rep-bars.vertical{
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 140px;     /* 👈 ancho FIJO de cada barra */
    gap: 18px;
    align-items: end;
    height: 460px;
    padding: 10px;
    overflow-x: auto;             /* 👈 si hay muchas categorías, scroll horizontal */
    overflow-y: hidden;
  }

  .rep-bars.vertical .rep-bar{
    height: 100%;
    min-height: 220px;
    padding: 10px;
     border-radius: 14px 14px 0 0;
    overflow: hidden;
  }

  /* fill crecerá hacia arriba */
  .rep-bars.vertical .rep-bar .fill{
    transform-origin: bottom center;
    border-radius: 14px 14px 0 0;
  }

  .rep-bars.vertical .rep-bar .content{
    position: absolute;
    inset: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  .rep-bars.vertical .left{
    font-weight: 800;
    font-size: 14px;
    color: #0b1220;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rep-bars.vertical .right{
    font-weight: 900;
    font-size: 16px;
    color: #0b1220;
    white-space: nowrap;
  }
}


/* Subtle interactions */
.rep-bar:hover{ filter: brightness(0.985); }
.rep-bar:active{ transform: scale(0.995); }

/* Optional: smooth fill animation */
.rep-bar .fill{
  transition: transform 220ms ease;
}
@media (min-width: 1024px){

  /* Texto de categoría en vertical */
  .rep-bars.vertical .left{
    writing-mode: vertical-rl;     /* texto vertical */
    text-orientation: mixed;       /* letras normales */
    transform: rotate(180deg);     /* para leer de abajo hacia arriba */
    
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    
    white-space: nowrap;
    overflow: visible;             /* 👈 permite más texto */
    text-overflow: unset;
    
    max-height: 100%;
  }

  /* Ajuste del monto para que quede horizontal */
  .rep-bars.vertical .right{
    writing-mode: horizontal-tb;
    transform: none;
  }
}
/* Móvil: nombre más chico + 2 líneas */
@media (max-width: 640px){
  .rep-bars.horizontal .left{f
    font-size: 16px;          /* antes ~30px */
    line-height: 1.1;
    font-weight: 500;

    /* en vez de 1 línea con ... , usamos 2 líneas */
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .rep-bars.horizontal .right{
    font-size: 18px;          /* opcional para balance */
  }
}
.tx-pending { opacity: .75; }
.cc-pending-badge{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  border:1px dashed var(--line);
  color:var(--muted);
  background:#fafafa;
}
/* ================================
   Modal TX: scroll interno seguro
================================ */
.cc-modalbox {
  max-height: calc(100vh - 40px); /* deja aire arriba/abajo */
  display: flex;
  flex-direction: column;
}

/* El cuerpo es el que scrollea */
.cc-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS suave */
  padding-bottom: 16px;
}

/* Footer SIEMPRE visible */
.cc-modal-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 2;
}
/* Scroll real para Movimientos */
#txScrollWrap {
  max-height: calc(100vh - var(--topbar-h) - 160px);
  overflow-y: auto;
}

