/* ══════════════════════════════════════════
   NOVACOMEX DESIGN SYSTEM — Rendimiento
══════════════════════════════════════════ */
:root {
  --nc-teal:        #00b8b8;
  --nc-teal-light:  #00d4d4;
  --nc-teal-dark:   #008a8a;
  --nc-teal-deep:   #006666;
  --nc-teal-ghost:  rgba(0,184,184,0.08);
  --nc-teal-mist:   rgba(0,184,184,0.04);
  --bg-surface:     #ffffff;
  --bg-surface2:    #f5fafa;
  --bg-surface3:    #ebf4f4;
  --border-base:    #cce8e8;
  --border-light:   #dff0f0;
  --border-strong:  #99d4d4;
  --text-primary:   #0d2626;
  --text-secondary: #2d5050;
  --text-muted:     #5a8080;
  --text-faint:     #8ab0b0;
  --s-green:        #00897b;
  --s-green-bg:     rgba(0,137,123,0.10);
  --s-green-border: rgba(0,137,123,0.25);
  --s-amber:        #b06000;
  --s-amber-bg:     rgba(176,96,0,0.10);
  --s-amber-border: rgba(176,96,0,0.25);
  --s-red:          #c02020;
  --s-red-bg:       rgba(192,32,32,0.08);
  --s-red-border:   rgba(192,32,32,0.20);
  --shadow-sm:      0 1px 4px rgba(0,100,100,0.06);
  --shadow-teal:    0 6px 24px rgba(0,184,184,0.18);
  --font-ui:        'Inter', 'Roboto', sans-serif;
  --font-mono:      'JetBrains Mono', 'Consolas', monospace;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-pill: 999px;
}

@keyframes nc-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-live {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,184,184,0.5); }
  50%      { box-shadow: 0 0 0 5px rgba(0,184,184,0); }
}
@keyframes nc-spin {
  to { transform: rotate(360deg); }
}

/* ── TITLE BAND ── */
.nc-titleband {
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-base);
  min-height: 48px;
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.nc-titleband-left { display: flex; align-items: center; gap: 12px; }
.nc-titleband-accent {
  width: 4px; height: 28px;
  background: linear-gradient(180deg, var(--nc-teal) 0%, var(--nc-teal-dark) 100%);
  border-radius: var(--r-pill); flex-shrink: 0;
}
.nc-titleband h1 {
  font-weight: 700; font-size: 15px;
  color: var(--text-primary); letter-spacing: 0.2px; margin: 0;
}
.nc-titleband-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted);
}
.nc-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--nc-teal);
  animation: pulse-live 2s infinite; flex-shrink: 0;
}

/* ── FILTERS ── */
.nc-filters {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 14px 32px;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
}
.nc-field { display: flex; flex-direction: column; gap: 4px; }
.nc-field-label {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.8px; color: var(--text-muted);
}
.nc-field input[type="date"],
.nc-field select {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-primary);
  background: var(--bg-surface2);
  border: 1.5px solid var(--border-base);
  border-radius: var(--r-sm);
  padding: 7px 10px; outline: none;
  min-width: 136px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
  height: 34px;
}
.nc-field.wide select { min-width: 220px; }
.nc-field input[type="date"]:focus,
.nc-field select:focus {
  border-color: var(--nc-teal);
  box-shadow: 0 0 0 3px rgba(0,184,184,0.12);
}
.nc-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a8080' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px; cursor: pointer;
}
.nc-filter-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.nc-btn {
  font-size: 12px; font-weight: 600;
  padding: 8px 18px; border-radius: var(--r-sm);
  border: none; cursor: pointer;
  transition: all 0.18s;
  display: inline-flex; align-items: center; gap: 6px;
  letter-spacing: 0.2px; height: 34px;
}
.nc-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.nc-btn-primary {
  background: var(--nc-teal); color: white;
  box-shadow: 0 2px 10px rgba(0,184,184,0.3);
}
.nc-btn-primary:hover:not(:disabled) {
  background: var(--nc-teal-dark); transform: translateY(-1px); box-shadow: var(--shadow-teal);
}
.nc-btn-ghost {
  background: transparent; border: 1.5px solid var(--border-base); color: var(--text-muted);
}
.nc-btn-ghost:hover { border-color: var(--s-red); color: var(--s-red); }
.nc-btn-dark { background: var(--text-primary); color: white; }
.nc-btn-dark:hover:not(:disabled) { background: var(--text-secondary); transform: translateY(-1px); }

/* ── SPINNER ── */
.nc-spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%;
  animation: nc-spin 0.6s linear infinite;
}

/* ── ALERT ── */
.nc-alert-error {
  background: var(--s-red-bg); border-bottom: 1px solid var(--s-red-border);
  color: var(--s-red); padding: 10px 32px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
}
.nc-alert-error button {
  background: none; border: none; color: var(--s-red);
  cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px;
}

/* ── KPI STRIP ── */
.nc-kpis {
  display: grid; grid-template-columns: repeat(6,1fr);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-base);
}
@media(max-width:1100px){ .nc-kpis { grid-template-columns: repeat(3,1fr); } }
@media(max-width:650px)  { .nc-kpis { grid-template-columns: repeat(2,1fr); } }
.nc-kpi {
  padding: 18px 22px; border-right: 1px solid var(--border-light);
  position: relative; transition: background 0.18s; cursor: default;
}
.nc-kpi:last-child { border-right: none; }
.nc-kpi:hover { background: var(--nc-teal-mist); }
.nc-kpi::after {
  content: ''; position: absolute; bottom: 0; left: 22px; right: 22px;
  height: 2px; background: var(--nc-teal); border-radius: var(--r-pill);
  transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nc-kpi:hover::after { transform: scaleX(1); }
.nc-kpi-label {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.8px;
  color: var(--text-muted); margin-bottom: 8px;
}
.nc-kpi-val {
  font-weight: 800; font-size: 28px;
  color: var(--nc-teal-dark); line-height: 1; letter-spacing: -0.5px;
}
.nc-kpi-val.warn   { color: var(--s-amber); }
.nc-kpi-val.danger { color: var(--s-red); }
.nc-kpi-val.sm     { font-size: 15px; margin-top: 4px; }
.nc-kpi-sub { font-size: 10px; color: var(--text-faint); margin-top: 5px; line-height: 1.3; }

/* ── LAYOUT ── */
.nc-body { padding: 24px 32px; display: flex; flex-direction: column; gap: 20px; }
.nc-row  { display: grid; gap: 20px; }
.nc-row-2   { grid-template-columns: 1fr 1fr; }
.nc-row-1-2 { grid-template-columns: 1fr 2fr; }
@media(max-width:960px) {
  .nc-row-2, .nc-row-1-2 { grid-template-columns: 1fr; }
}

/* ── CARDS ── */
.nc-card {
  background: var(--bg-surface); border: 1px solid var(--border-base);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); animation: nc-fade 0.35s ease both;
}
.nc-card-head {
  background: var(--bg-surface2); border-bottom: 1px solid var(--border-light);
  padding: 13px 20px; display: flex; align-items: center; justify-content: space-between;
}
.nc-card-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-secondary);
}
.nc-card-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nc-teal); flex-shrink: 0; }
.nc-card-tag { font-size: 9px; color: var(--text-faint); letter-spacing: 1px; text-transform: uppercase; }
.nc-card-body { padding: 20px; }
.nc-card-body.flush { padding: 0; }
.nc-chart-box { position: relative; height: 280px; }
.nc-chart-box.tall { height: 340px; }

/* ── TABLE ── */
.nc-tbl-wrap { overflow-x: auto; }
.nc-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.nc-tbl thead tr { background: var(--bg-surface2); }
.nc-tbl th {
  font-weight: 700; font-size: 9px;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--nc-teal-dark); padding: 11px 12px;
  border-bottom: 2px solid var(--border-base);
  white-space: nowrap; text-align: center;
}
.nc-tbl th:nth-child(2) { text-align: left; }
.nc-tbl td {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-primary);
  padding: 9px 12px; border-bottom: 1px solid var(--border-light);
  text-align: center; transition: background 0.12s;
}
.nc-tbl td:nth-child(2) { text-align: left; }
.nc-tbl tbody tr:hover td { background: var(--nc-teal-ghost); }
.nc-tbl tfoot td {
  background: var(--bg-surface3); border-top: 2px solid var(--nc-teal);
  font-weight: 700; font-size: 11px; color: var(--text-secondary);
}
.nc-tbl tfoot td:nth-child(2) { font-weight: 800; color: var(--nc-teal-dark); }

/* ── RANK BADGE ── */
.nc-rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-weight: 800; font-size: 10px; flex-shrink: 0;
}
.r1 { background: #ffd700; color: #6b4a00; }
.r2 { background: #c8d0d8; color: #2e3840; }
.r3 { background: #e09060; color: #5a2800; }
.rn { background: var(--bg-surface3); color: var(--text-faint); }

/* ── BADGES ── */
.nc-badge {
  display: inline-block; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap;
}
.nc-badge-sr { background: var(--nc-teal-ghost); color: var(--nc-teal-dark); border: 1px solid var(--border-strong); }
.nc-badge-jr { background: rgba(13,38,38,0.06); color: var(--text-secondary); border: 1px solid var(--border-base); }

.nc-pct {
  display: inline-block; padding: 2px 9px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 10px;
}
.pct-h { background: var(--s-green-bg);  color: var(--s-green);  border: 1px solid var(--s-green-border); }
.pct-m { background: var(--s-amber-bg);  color: var(--s-amber);  border: 1px solid var(--s-amber-border); }
.pct-l { background: var(--s-red-bg);    color: var(--s-red);    border: 1px solid var(--s-red-border);   }

/* ── PROGRESS ── */
.nc-track {
  background: var(--bg-surface3); border-radius: var(--r-pill);
  height: 14px; overflow: hidden; min-width: 90px;
}
.nc-track.slim { height: 8px; }
.nc-fill {
  height: 100%; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 5px; font-size: 8px; font-weight: 700; color: white;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1); min-width: 0;
}
.nc-fill.high   { background: linear-gradient(90deg, var(--nc-teal-dark), var(--nc-teal)); }
.nc-fill.medium { background: linear-gradient(90deg, #b06000, #e0a020); }
.nc-fill.low    { background: linear-gradient(90deg, #c02020, #e05050); }

/* ── OP CHIPS ── */
.nc-op {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 4px; border-radius: var(--r-sm);
  font-size: 10px; font-weight: 700;
}
.nc-op.on  { background: var(--nc-teal-ghost); color: var(--nc-teal-dark); border: 1px solid var(--border-strong); }
.nc-op.off { background: transparent; color: var(--text-faint); }

/* ── PERSONA CELL ── */
.nc-person-name { font-weight: 600; font-size: 12px; color: var(--text-primary); }

/* ── RANKING ── */
.nc-ranking-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border-light);
}
.nc-ranking-row:last-child { border-bottom: none; }
.nc-ranking-info { flex: 1; min-width: 0; }
.nc-ranking-name {
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nc-ranking-pct { font-weight: 800; font-size: 13px; min-width: 52px; text-align: right; }
