:root {
  --brand-primary: #002A3A;
  --brand-primary-2: #0b3f55;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #e5e7eb;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(0, 42, 58, 0.08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at top left, rgba(0, 42, 58, 0.06), transparent 30%),
    var(--bg);
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text);
}

/* HEADER */
#top {
  display: flex;
  align-items: center;
  min-height: 90px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-2) 100%);
  color: white;
  padding: 20px 32px;
  box-shadow: 0 8px 24px rgba(0, 42, 58, 0.18);
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

#line {
  margin-top: 0;
  width: 18px;
  height: 44px;
  border-right: solid rgba(255, 255, 255, 0.8) 2px;
  margin-right: 16px;
}

#tittle {
  padding: 0;
  height: auto;
  color: white;
}

#tittle p {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

#text {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#meta,
#total,
#restante {
  margin: 0 0 0 auto;
  padding: 0 16px;
}

#meta p,
#total p,
#restante p {
  font-size: 24px;
  color: #f5f5f5;
  margin: 0;
  line-height: 1.2;
}

/* LAYOUT */
#main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 24px;
  padding: 24px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

#izq,
#der {
  padding: 0;
  min-width: 0;
}

#der {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#restante {
  float: none;
}

/* SECCIONES / CARDS */
#anual,
#trimestral,
#promedio,
#mensual,
#anterior,
#trimestre,
.card-rangos {
  background: var(--surface);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 14px;
  margin: 0;
  color: #495159;
  overflow: hidden;
}

#anual {
  border-right: none;
}

#sub {
  font-size: 18px;
  font-weight: 700;
  color: #222d32;
  margin: 0 0 14px;
  line-height: 1.3;
}

/* TABLAS GENERALES */
table {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  border-spacing: 0 10px;
}

thead th {
  color: #99A1B0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 0 12px 8px;
}

tbody tr {
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

tbody tr:hover {
  transform: translateY(-1px);
}

td {
  color: #495159;
  text-align: center;
  padding: 14px 12px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

tbody tr td:first-child {
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

tbody tr td:last-child {
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

/* TIPOGRAFÍA */
.textoizquierda {
  text-align: left;
}

.textoizquierdanum {
  text-align: left;
  font-weight: bold;
}

.textocentro {
  text-align: center;
}

.textocentronum,
.textoderechanum {
  text-align: center;
  font-weight: 700;
  color: var(--brand-primary);
  white-space: nowrap;
}

/* CELDA DE ASESOR */
.img_vendedor {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  float: none;
  margin-right: 10px;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

td.textoizquierda[style] {
  font-size: 13px !important;
  margin-right: 0 !important;
  gap: 2px;
}

td.textoizquierda p {
  margin: 0 0 0 8px !important;
  font-weight: 600;
  color: #1f2937;
}

/* TABLA RANGOS */
.tabla-desempeno {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.tabla-desempeno thead th {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  padding: 0 12px 8px;
}

.tabla-desempeno tbody td {
  background: #fff;
  padding: 12px 14px;
  font-size: 14px;
}

.tabla-desempeno td p {
  margin: 0;
  line-height: 1.5;
}

.row-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.row-label .emoji {
  width: 1.4em;
  display: inline-block;
  text-align: center;
  font-size: 16px;
}

/* SCROLL */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  #main {
    grid-template-columns: 1fr;
  }

  #der {
    order: 2;
  }

  #izq {
    order: 1;
  }
}

@media (max-width: 768px) {
  #top {
    padding: 18px 18px;
    min-height: 76px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
  }

  #main {
    padding: 16px;
    gap: 16px;
  }

  #anual,
  #mensual,
  #anterior,
  #trimestre,
  .card-rangos {
    padding: 14px;
    border-radius: 16px;
  }

  #sub {
    font-size: 16px;
  }

  td,
  .tabla-desempeno tbody td {
    padding: 12px 10px;
    font-size: 13px;
  }

  .img_vendedor {
    width: 36px;
    height: 36px;
  }

  #meta p,
  #total p,
  #restante p {
    font-size: 18px;
  }
}