/* ============================================================
   dashboard.css — Dashboard v718
   FIX RAYONES DEFINITIVO:
   - Cero color-mix() en propiedades que afecten render
   - Cero CSS custom properties en border-color o background de tarjetas scroll
   - Colores sólidos hardcodeados en todos los elementos GPU-sensitivos
   - border-top reemplazado por borde izquierdo (menos compositing)
   ============================================================ */

.dsh { max-width: 1100px; margin: 0 auto; }

/* ══ HERO ══ */
.dsh-hero {
  border-radius: 12px;
  margin-bottom: 14px;
  min-height: 150px;
  display: flex;
  align-items: flex-end;
  background-color: #0C2D48;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.dsh-hero::before { display: none; }
.dsh-hero-body {
  position: relative;
  z-index: 1;
  padding: 24px 22px 20px;
  flex: 1;
  min-width: 0;
  text-shadow: 0 1px 6px rgba(0,0,0,.45);
}
.dsh-hero-eyebrow {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: rgba(255,255,255,.48); margin-bottom: 5px;
}
.dsh-hero-greeting { font-size: 20px; font-weight: 300; color: #fff; line-height: 1.25; }
.dsh-hero-greeting strong { font-weight: 700; }
.dsh-hero-date { font-size: 11px; color: rgba(255,255,255,.48); margin-top: 5px; }
.dsh-hero-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.2);
  border-radius: 99px; padding: 3px 10px;
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.88); margin-top: 10px;
}
.dsh-hero-badge svg { width: 11px; height: 11px; }

/* ══ KPI ROW — COLORES SÓLIDOS, SIN color-mix() ══ */
.dsh-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.dsh-kpi {
  background: #FFFFFF;
  border: 1px solid #DCE6EF;
  border-left: 3px solid #DCE6EF; /* se sobreescribe por variante */
  border-radius: 12px;
  padding: 14px 14px 12px;
  cursor: pointer;
}
[data-theme="dark"] .dsh-kpi { background: #1B2436; border-color: #2E3A4E; }
.dsh-kpi:hover { background: #F4F6FA; }
[data-theme="dark"] .dsh-kpi:hover { background: #232E44; }

/* Variantes por color — sólidos, sin CSS vars dinámicas */
.dsh-kpi-c0 { border-left-color: #0E7490; }
.dsh-kpi-c1 { border-left-color: #D97706; }
.dsh-kpi-c2 { border-left-color: #16A34A; }
.dsh-kpi-c3 { border-left-color: #7C3AED; }

.dsh-kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.dsh-kpi-ic {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
}
.dsh-kpi-ic svg { width: 14px; height: 14px; }
/* Iconos con background sólido ligero — sin color-mix */
.dsh-kpi-ic-0 { background: #E0F2F7; color: #0E7490; }
.dsh-kpi-ic-1 { background: #FEF3C7; color: #D97706; }
.dsh-kpi-ic-2 { background: #DCFCE7; color: #16A34A; }
.dsh-kpi-ic-3 { background: #EDE9FE; color: #7C3AED; }
[data-theme="dark"] .dsh-kpi-ic-0 { background: rgba(45,212,191,.13); color: #2DD4BF; }
[data-theme="dark"] .dsh-kpi-ic-1 { background: rgba(245,158,11,.13);  color: #FCD34D; }
[data-theme="dark"] .dsh-kpi-ic-2 { background: rgba(34,197,94,.13);   color: #4ADE80; }
[data-theme="dark"] .dsh-kpi-ic-3 { background: rgba(167,139,250,.13); color: #C4B5FD; }

.dsh-kpi-val { font-size: 26px; font-weight: 700; color: #111827; line-height: 1; letter-spacing: -.4px; margin-bottom: 3px; }
[data-theme="dark"] .dsh-kpi-val { color: #E8EDF5; }
.dsh-kpi-lbl { font-size: 12px; font-weight: 600; color: #111827; margin-bottom: 2px; }
[data-theme="dark"] .dsh-kpi-lbl { color: #E8EDF5; }
.dsh-kpi-sub { font-size: 11px; color: #6B7280; }
[data-theme="dark"] .dsh-kpi-sub { color: #7B8FA6; }

/* ══ FILAS ══ */
.dsh-row1 { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
.dsh-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.dsh-card {
  background: #FFFFFF; border: 1px solid #DCE6EF; border-radius: 12px; padding: 16px;
}
[data-theme="dark"] .dsh-card { background: #1B2436; border-color: #2E3A4E; }
.dsh-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.dsh-card-title { font-size: 13px; font-weight: 700; color: #111827; display: flex; align-items: center; gap: 7px; }
[data-theme="dark"] .dsh-card-title { color: #E8EDF5; }
.dsh-card-pill {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: #E0F2F7; color: #0E7490;
}
[data-theme="dark"] .dsh-card-pill { background: rgba(45,212,191,.13); color: #2DD4BF; }
.dsh-link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: #0E7490;
  background: none; border: none; cursor: pointer; font-family: var(--font); padding: 0;
}
[data-theme="dark"] .dsh-link-btn { color: #2DD4BF; }

/* ── Accesos rápidos ── */
.dsh-qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dsh-qbtn {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  border-radius: 10px; background: #F4F6FA; border: 1px solid #DCE6EF;
  color: #111827; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: var(--font); text-align: left;
}
[data-theme="dark"] .dsh-qbtn { background: #232E44; border-color: #2E3A4E; color: #E8EDF5; }
.dsh-qbtn:hover { background: #EDF3F8; }
[data-theme="dark"] .dsh-qbtn:hover { background: #2E4057; }
.dsh-qic { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.dsh-qic svg { width: 13px; height: 13px; }
.dsh-qic-teal   { background: #E0F2F7; color: #0E7490; }
.dsh-qic-green  { background: #DCFCE7; color: #16A34A; }
.dsh-qic-purple { background: #EDE9FE; color: #7C3AED; }
.dsh-qic-amber  { background: #FEF3C7; color: #D97706; }
.dsh-qic-coral  { background: #FAECE7; color: #D85A30; }
.dsh-qic-img    { width: 40px; height: 40px; object-fit: contain; flex: none; }
.dsh-qbtn:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Acceso rápido — una sola fila grande, sin badge numérico (estilo Sippay) */
.dsh-quick-row { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.dsh-qbtn-lg {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 10px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface2); cursor: pointer; text-align: center;
  transition: border-color .12s, transform .1s; font-family: var(--font);
}
.dsh-qbtn-lg:hover { border-color: var(--accent); }
.dsh-qbtn-lg:active { transform: scale(.97); }
[data-theme="dark"] .dsh-qbtn-lg { background: #232E44; border-color: #2E3A4E; }
.dsh-qic-lg { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.dsh-qic-lg svg { width: 28px; height: 28px; }
.dsh-qic-lg-img { width: 60px; height: 60px; object-fit: contain; flex: none; }
.dsh-qlbl-lg { font-size: 13px; font-weight: 800; color: var(--text); }
@media (max-width: 720px) {
  .dsh-quick-row { grid-template-columns: repeat(2, 1fr); grid-auto-flow: row; gap: 10px; }
  .dsh-qbtn-lg { padding: 18px 8px; }
  .dsh-qbtn-lg:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .dsh-qic-lg, .dsh-qic-lg-img { width: 48px; height: 48px; }
  .dsh-qic-lg svg { width: 22px; height: 22px; }
}
[data-theme="dark"] .dsh-qic-teal   { background: rgba(45,212,191,.13); color: #2DD4BF; }
[data-theme="dark"] .dsh-qic-green  { background: rgba(34,197,94,.13);  color: #4ADE80; }
[data-theme="dark"] .dsh-qic-purple { background: rgba(167,139,250,.13);color: #C4B5FD; }
[data-theme="dark"] .dsh-qic-amber  { background: rgba(245,158,11,.13); color: #FCD34D; }
[data-theme="dark"] .dsh-qic-coral  { background: rgba(216,90,48,.16); color: #F0997B; }
.dsh-qlbl { font-size: 12px; font-weight: 700; flex: 1; }
.dsh-qcount {
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px;
  background: #FFFFFF; border: 1px solid #DCE6EF; color: #6B7280; white-space: nowrap; flex: none;
}
[data-theme="dark"] .dsh-qcount { background: #141B26; border-color: #2E3A4E; color: #7B8FA6; }

/* ── Barras proyectos ── */
.dsh-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.dsh-bar-row { display: grid; grid-template-columns: 82px 1fr 28px; align-items: center; gap: 9px; }
.dsh-bar-lbl { font-size: 11.5px; font-weight: 500; color: #6B7280; }
[data-theme="dark"] .dsh-bar-lbl { color: #7B8FA6; }
.dsh-bar-track { height: 6px; border-radius: 99px; background: #EDF3F8; }
[data-theme="dark"] .dsh-bar-track { background: #232E44; }
.dsh-bar-fill { height: 100%; border-radius: 99px; min-width: 3px; transition: width .5s ease; }
.dsh-bar-num { font-size: 12px; font-weight: 700; text-align: right; }
.dsh-valor-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-top: 1px solid #DCE6EF;
  font-size: 12px; color: #6B7280; margin-bottom: 8px;
}
[data-theme="dark"] .dsh-valor-row { border-color: #2E3A4E; color: #7B8FA6; }
.dsh-valor-row strong { font-size: 13px; font-weight: 700; color: #111827; }
[data-theme="dark"] .dsh-valor-row strong { color: #E8EDF5; }

/* ── Gráfica documentos ── */
.dsh-chart { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; align-items: flex-end; height: 84px; margin-bottom: 8px; }
.dsh-chart-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.dsh-chart-val { font-size: 11px; font-weight: 700; color: #111827; }
[data-theme="dark"] .dsh-chart-val { color: #E8EDF5; }
.dsh-chart-bar-wrap { width: 100%; background: #EDF3F8; border-radius: 4px; display: flex; align-items: flex-end; flex: 1; }
[data-theme="dark"] .dsh-chart-bar-wrap { background: #232E44; }
.dsh-chart-bar-fill { width: 100%; border-radius: 4px 4px 0 0; min-height: 4px; transition: height .5s ease; }
.dsh-chart-lbl { font-size: 9.5px; color: #6B7280; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
[data-theme="dark"] .dsh-chart-lbl { color: #7B8FA6; }

/* ── Biz/Match grid ── */
.dsh-biz-grid { display: grid; grid-template-columns: 1fr 1px 1fr 1px 1fr; }
.dsh-biz-stat { text-align: center; padding: 4px; }
.dsh-biz-val { font-size: 23px; font-weight: 700; color: #111827; line-height: 1; letter-spacing: -.3px; }
[data-theme="dark"] .dsh-biz-val { color: #E8EDF5; }
.dsh-biz-lbl { font-size: 10px; color: #6B7280; margin-top: 2px; }
[data-theme="dark"] .dsh-biz-lbl { color: #7B8FA6; }
.dsh-biz-sep { background: #DCE6EF; }
[data-theme="dark"] .dsh-biz-sep { background: #2E3A4E; }

/* ══ BANNER PROMOVER ══ */
.dsh-promo {
  border-radius: 12px; border: 1px solid #C4B5FD;
  background: #F5F3FF; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px; cursor: pointer;
}
[data-theme="dark"] .dsh-promo { background: rgba(124,58,237,.08); border-color: rgba(167,139,250,.3); }
.dsh-promo-ic { width: 42px; height: 42px; border-radius: 11px; background: #EDE9FE; color: #7C3AED; display: grid; place-items: center; flex: none; }
[data-theme="dark"] .dsh-promo-ic { background: rgba(167,139,250,.15); }
.dsh-promo-ic svg { width: 21px; height: 21px; }
.dsh-promo-body { flex: 1; min-width: 0; }
.dsh-promo-title { font-size: 13px; font-weight: 700; color: #111827; margin-bottom: 3px; }
[data-theme="dark"] .dsh-promo-title { color: #E8EDF5; }
.dsh-promo-sub { font-size: 11.5px; color: #6B7280; line-height: 1.4; }
[data-theme="dark"] .dsh-promo-sub { color: #7B8FA6; }
.dsh-promo-cta {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px; border-radius: 8px; background: #7C3AED; color: #fff;
  font-size: 12px; font-weight: 700; font-family: var(--font); border: none; cursor: pointer; white-space: nowrap;
}
.dsh-promo-cta svg { width: 15px; height: 15px; flex: none; }

/* ══ BANNER INSTALAR APP ══ */
.dsh-install {
  border-radius: 12px; border: 1px solid #A5F3EC;
  background: #ECFEFF; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px; cursor: default;
  margin-top: 14px;
}
[data-theme="dark"] .dsh-install { background: rgba(45,212,191,.08); border-color: rgba(45,212,191,.3); }
.dsh-install-ic { width: 42px; height: 42px; border-radius: 11px; background: #CFFAFE; color: #0E7490; display: grid; place-items: center; flex: none; }
[data-theme="dark"] .dsh-install-ic { background: rgba(45,212,191,.15); color: #2DD4BF; }
.dsh-install-ic svg { width: 21px; height: 21px; }
.dsh-install-body { flex: 1; min-width: 0; }
.dsh-install-title { font-size: 13px; font-weight: 700; color: #111827; margin-bottom: 3px; }
[data-theme="dark"] .dsh-install-title { color: #E8EDF5; }
.dsh-install-sub { font-size: 11.5px; color: #6B7280; line-height: 1.4; }
[data-theme="dark"] .dsh-install-sub { color: #7B8FA6; }
.dsh-install-cta {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px; border-radius: 8px; background: #0E7490; color: #fff;
  font-size: 12px; font-weight: 700; font-family: var(--font); border: none; cursor: pointer; white-space: nowrap;
}
.dsh-install-cta svg { width: 15px; height: 15px; flex: none; }
.dsh-install-cta:disabled { opacity: .7; cursor: default; }
.dsh-install-badge {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 20px; background: #DCFCE7; color: #166534;
  font-size: 11.5px; font-weight: 800;
}
.dsh-install-badge svg { width: 14px; height: 14px; flex: none; }

/* ══ RESPONSIVE ══ */
@media (max-width: 900px) {
  .dsh-row1, .dsh-row2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dsh-hero { min-height: 100px; border-radius: 10px; }
  .dsh-hero::before { border-radius: 10px; }
  .dsh-hero-body { padding: 14px 14px 12px; }
  .dsh-hero-greeting { font-size: 16px; }
  .dsh-hero-eyebrow { display: none; }
  .dsh-hero-badge { margin-top: 8px; font-size: 10px; }

  /* KPIs 2x2 compactos */
  .dsh-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dsh-kpi  { padding: 12px 11px 10px; }
  .dsh-kpi-val { font-size: 21px; }
  .dsh-kpi-ic { width: 28px; height: 28px; border-radius: 7px; }
  .dsh-kpi-ic svg { width: 12px; height: 12px; }

  .dsh-qcount { display: none; }
  .dsh-qbtn { padding: 10px; }
  .dsh-bar-row { grid-template-columns: 68px 1fr 24px; gap: 6px; }
  .dsh-chart { height: 66px; }

  .dsh-promo { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .dsh-promo-cta { width: 100%; justify-content: center; }

  .dsh-install { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .dsh-install-cta, .dsh-install-badge { width: 100%; justify-content: center; }
}
