/* GASCA · CRM › «Panel» con alertas útiles de BEKOSU (INC-00290) — gasca_crm_panel.js */
#crm-panel-bk { --crp-bg: var(--bg-card, #fff); --crp-line: var(--border-color, #e2e8f0); --crp-mut: var(--text-secondary, #64748b); --crp-ink: var(--text-primary, #0f172a);
  display: grid; gap: 14px; margin-bottom: 18px; }
.crp-cargando, .crp-error { display: flex; gap: 10px; align-items: center; padding: 26px; color: var(--crp-mut); border: 1px dashed var(--crp-line); border-radius: 14px; }
.crp-error { color: #b91c1c; flex-wrap: wrap; }
.crp-spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #cbd5e1; border-top-color: #2563eb; animation: cpgira .8s linear infinite; }
@keyframes cpgira { to { transform: rotate(360deg); } }

.crp-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, #0b3c73 0%, #1d4ed8 55%, #0891b2 100%); box-shadow: 0 8px 22px rgba(11, 60, 115, .18); }
.crp-anillo { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.crp-anillo > div { width: 62px; height: 62px; border-radius: 50%; background: #0b3c73; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.crp-anillo b { font-size: 1.05rem; }
.crp-anillo span { font-size: .52rem; opacity: .85; text-transform: uppercase; letter-spacing: .02em; }
.crp-head-tx { flex: 1 1 260px; min-width: 0; }
.crp-head-tx h3 { margin: 0; font-size: 1.12rem; font-weight: 800; color: #fff; }   /* INC-00300: el h3 general lo pintaba azul oscuro sobre azul */
.crp-head-tx h3 i { color: #fde68a; }
.crp-head-tx p { margin: 3px 0 0; font-size: .8rem; opacity: .85; }
.crp-head-ac { display: flex; gap: 8px; align-items: center; }
.crp-sel { height: 36px; border-radius: 10px; border: 0; padding: 0 10px; font-size: .84rem; max-width: 280px; color: #0f172a; background: #fff; }
.crp-btn { height: 36px; border: 1px solid var(--crp-line); background: var(--crp-bg); color: var(--crp-ink); border-radius: 10px; padding: 0 12px; font-weight: 700; font-size: .8rem;
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.crp-head .crp-btn { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .15); color: #fff; }

.crp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.crp-tile { position: relative; overflow: hidden; text-align: left; border: 1px solid var(--crp-line); background: var(--crp-bg); color: var(--crp-ink); border-radius: 14px;
  padding: 12px 14px 12px 14px; cursor: pointer; display: grid; gap: 1px; transition: transform .12s, box-shadow .12s; }
.crp-tile::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.crp-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 23, 42, .1); }
.crp-tile i { position: absolute; right: 12px; top: 12px; font-size: 1.3rem; color: var(--c); opacity: .85; }
.crp-tile b { font-size: 1.65rem; line-height: 1.1; color: var(--c); font-variant-numeric: tabular-nums; }
.crp-tile-t { font-weight: 800; font-size: .8rem; }
.crp-tile-s { font-size: .7rem; color: var(--crp-mut); }

.crp-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; }
.crp-grid-b { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .crp-grid, .crp-grid-b { grid-template-columns: 1fr; } }
.crp-card { border: 1px solid var(--crp-line); background: var(--crp-bg); border-radius: 14px; padding: 14px; min-width: 0; scroll-margin-top: 80px; }
.crp-card h4 { margin: 0 0 10px; font-size: .92rem; font-weight: 800; color: var(--crp-ink); display: flex; gap: 8px; align-items: center; }
.crp-flash { animation: cpflash 1.2s ease; }
@keyframes cpflash { 0%, 60% { box-shadow: 0 0 0 3px rgba(37, 99, 235, .45); } 100% { box-shadow: none; } }
.crp-vacio { color: var(--crp-mut); font-size: .84rem; padding: 10px 4px; display: flex; gap: 8px; align-items: center; }
.crp-nota { margin: 8px 0 0; font-size: .72rem; color: var(--crp-mut); }

.crp-dia { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--crp-line); }
.crp-dia:first-of-type { border-top: 0; }
.crp-dia-h { font-weight: 800; font-size: .8rem; text-transform: capitalize; color: var(--crp-ink); display: grid; align-content: start; }
.crp-dia-h span { font-weight: 600; font-size: .72rem; color: var(--crp-mut); }
.crp-dia.hoy .crp-dia-h { color: #2563eb; }
.crp-dia-h em { font-style: normal; justify-self: start; margin-top: 3px; font-size: .66rem; font-weight: 800; background: rgba(37, 99, 235, .12); color: #2563eb; border-radius: 999px; padding: 1px 7px; }
.crp-ag { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.crp-ag:hover { background: rgba(37, 99, 235, .07); }
.crp-ag-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; background: #2563eb; font-size: .8rem; }
.crp-ag.vencida .crp-ag-ic { background: #dc2626; }
.crp-ag.seguimiento .crp-ag-ic { background: #7c3aed; }
.crp-ag-tx { display: grid; min-width: 0; }
.crp-ag-tx b { font-size: .83rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--crp-ink); }
.crp-ag-tx small { font-size: .72rem; color: var(--crp-mut); }
.crp-sub { margin: 12px 0 4px; font-weight: 800; font-size: .82rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.crp-sub small { font-weight: 500; color: var(--crp-mut); font-size: .72rem; }
.crp-sub-rojo { color: #dc2626; }
.crp-sub-mor { color: #7c3aed; }
.crp-mas { border: 0; background: none; color: #2563eb; font-weight: 700; font-size: .78rem; cursor: pointer; padding: 4px 8px; }

.crp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.crp-chips button { border: 1px solid var(--crp-line); background: var(--crp-bg); color: var(--crp-mut); border-radius: 999px; padding: 4px 10px; font-size: .74rem; font-weight: 700; cursor: pointer; }
.crp-chips button.on { background: #ea580c; border-color: #ea580c; color: #fff; }
.crp-pr { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; cursor: pointer; border-top: 1px solid var(--crp-line); }
.crp-pr:hover { background: rgba(234, 88, 12, .07); }
.crp-dot { width: 12px; height: 12px; border-radius: 50%; }
.crp-pr-tx { display: grid; min-width: 0; }
.crp-pr-tx b { font-size: .83rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--crp-ink); }
.crp-pr-tx small, .crp-pr-cub small { font-size: .7rem; color: var(--crp-mut); }
.crp-pr-cub { display: grid; text-align: right; line-height: 1.1; }
.crp-pr-cub b { font-size: .9rem; color: var(--crp-ink); }
.crp-pr-hace { font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; color: #fff; background: #94a3b8; }
.crp-pr-hace.rojo { background: #dc2626; }

.crp-ley { display: flex; flex-wrap: wrap; gap: 12px; font-size: .72rem; color: var(--crp-mut); margin-bottom: 8px; }
.crp-ley i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.crp-tb { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 44px; gap: 8px; align-items: center; margin: 5px 0; }
.crp-tb-t { font-size: .78rem; font-weight: 700; color: var(--crp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crp-tb-bar { display: flex; height: 20px; border-radius: 6px; overflow: hidden; }
.crp-tb-bar i { display: grid; place-items: center; color: #fff; font-size: .66rem; font-style: normal; font-weight: 800; min-width: 3px; }
.crp-tb-n { font-size: .78rem; text-align: right; color: var(--crp-mut); font-variant-numeric: tabular-nums; }

.crp-rv { display: grid; grid-template-columns: 30px 1fr; gap: 4px 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--crp-line); }
.crp-rv:first-of-type { border-top: 0; }
.crp-rv > i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(15, 118, 110, .12); color: #0f766e; }
.crp-rv > span { display: grid; font-size: .82rem; color: var(--crp-ink); }
.crp-rv b { font-size: .95rem; }
.crp-rv small { font-size: .72rem; color: var(--crp-mut); }
.crp-rv-ej { grid-column: 2; display: flex !important; flex-wrap: wrap; gap: 6px; }
.crp-rv-ej a { font-size: .72rem; color: #0f766e; background: rgba(15, 118, 110, .08); padding: 2px 8px; border-radius: 999px; cursor: pointer; }
#crm-panel-bk .crp-card > .crp-btn { margin-top: 10px; }

.crp-origen { margin: 0; font-size: .74rem; color: var(--crp-mut); background: rgba(148, 163, 184, .1); border-radius: 10px; padding: 8px 12px; }
.crp-origen code { font-size: .7rem; }

/* El embudo de oportunidades de Victoria que había antes sigue debajo, plegable */
.crm-embudo { margin-top: 4px; }
.crm-embudo > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px; font-weight: 800; font-size: .9rem; color: var(--text-primary, #0f172a); background: var(--bg-card, #fff); }
.crm-embudo > summary::-webkit-details-marker { display: none; }
.crm-embudo > summary small { font-weight: 500; color: var(--text-secondary, #64748b); font-size: .76rem; }
.crm-embudo > summary .fa-chevron-down { margin-left: auto; transition: transform .2s; }
.crm-embudo[open] > summary .fa-chevron-down { transform: rotate(180deg); }
.crm-embudo[open] > summary { margin-bottom: 14px; }
