/* ═══════════════════════════════════════════════
       SECCIONES
    ═══════════════════════════════════════════════ */
.sec {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sec__hdr {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  cursor: pointer;
  user-select: none;
  background: var(--white);
  transition: background .18s;
}

.sec__hdr:hover {
  background: var(--plum-ghost);
}

.sec.open .sec__hdr {
  background: var(--plum-ghost);
}

.sec__num {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  background: var(--plum);
  border-radius: 6px;
  padding: 3px 8px;
  letter-spacing: 1px;
}

.sec__name {
  font-family: var(--ff-serif);
  font-size: 17px;
  color: var(--plum);
  flex: 1;
}

.sec__chevron {
  color: var(--plum-light);
  transition: transform .3s;
  display: flex;
}

.sec.open .sec__chevron {
  transform: rotate(180deg);
}

.sec__divider {
  height: 1px;
  background: var(--plum-pale);
}

.sec__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4, 0, .2, 1);
}

.sec.open .sec__body {
  max-height: 4000px;
}

.sec__inner {
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ═══════════════════════════════════════════════
       TABLA DENTAL
    ═══════════════════════════════════════════════ */
.dental-wrap {
  border: 1.5px solid var(--plum-pale);
  border-radius: var(--r2);
  overflow: hidden;
}

.dental-wrap__head {
  background: var(--plum);
  color: var(--white);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
  padding: 9px 16px;
  text-align: center;
}

.dental-grid {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--plum-ghost);
}

/* Cuadrantes label row */
.d-quad-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--plum);
  padding: 2px 0;
  margin-bottom: 2px;
}

.d-quad-row .left {
  text-align: left;
}

.d-quad-row .right {
  text-align: right;
}

.d-quad-row .center {
  width: 16px;
}

/* Numbers row */
.d-num-row {
  display: grid;
  grid-template-columns: 1fr 16px 1fr;
}

.d-half {
  display: flex;
  gap: 3px;
}

/* Cambia el row-reverse por row normal para que obedezca el orden del HTML */
.d-half.l {
  flex-direction: row;
  justify-content: flex-end;
  /* Esto empuja los dientes hacia la línea central */
}

/* Asegura que el lado derecho empiece desde el inicio (el centro) */
.d-half.r {
  flex-direction: row;
  justify-content: flex-start;
}

/* Estilo para las celdas invisibles (fantasmas) */
.d-cell--ghost {
  visibility: hidden;
  /* O usa opacity: 0; si prefieres que ocupen el espacio pero no se vean */
  pointer-events: none;
  /* Para que no se puedan clickear */
}

.d-cell {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}

.d-cell:hover {
  border-color: var(--plum-light);
  color: var(--plum);
  background: var(--plum-pale);
}

.d-cell.selected {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--white);
}



.d-hdiv {
  height: 2px;
  background: var(--plum-pale);
  margin: 4px 0;
}


.d-vdiv { 
  width: 17px; 
  display: flex;
  justify-content: center;
}
.d-vdiv--line {
  border-left: 1.5px solid var(--line); 
  height: 100%;
}



.d-roman-half {
  display: flex;
  justify-content: space-between;
}

.d-roman-half.l {
  flex-direction: row-reverse;
}

.d-roman-half span {
  width: 28px;
  text-align: center;
}

/* Quadrant labels below */
.d-quad-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--plum);
  text-align: center;
  margin-top: 4px;
}

/* Selection bar */
.d-bar {
  margin-top: 10px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 9px 12px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  transition: all .2s;
}

.d-bar.active {
  border-color: var(--plum-light);
  color: var(--plum);
  background: var(--plum-ghost);
}



/* ═══════════════════════════════════════════════
       TWO-COL LAYOUT
    ═══════════════════════════════════════════════ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ═══════════════════════════════════════════════
       CHECKBOX BLOCKS
    ═══════════════════════════════════════════════ */
.cb-block {
  border: 1.5px solid var(--plum-pale);
  border-radius: var(--r2);
  overflow: hidden;
}

.cb-block--full {
  width: 100%;
}

.cb-block__head {
  background: var(--plum-pale);
  color: var(--plum);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 9px 16px;
}

.cb-block__body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cb-block__body.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cb {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 7px 10px;
  border-radius: var(--r);
  border: 1.5px solid transparent;
  transition: all .15s;
  user-select: none;
  font-size: 13px;
  color: var(--ink-soft);
}

.cb:hover {
  background: var(--plum-ghost);
  border-color: var(--plum-pale);
  color: var(--ink);
}

.cb.selected {
  background: var(--plum-ghost);
  border-color: var(--plum-light);
  color: var(--plum);
}

.cb__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--mist);
  flex-shrink: 0;
  transition: all .15s;
  position: relative;
}

.cb.selected .cb__dot {
  border-color: var(--plum);
  background: var(--plum);
}

.cb.selected .cb__dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--white);
}

/* with text input at end */
.cb-with-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cb-text-inp {
  border: none;
  border-bottom: 1.5px solid var(--line);
  padding: 4px 8px;
  font-family: var(--ff-sans);
  font-size: 12px;
  color: var(--ink);
  background: transparent;
  outline: none;
  width: 100%;
  transition: border-color .2s;
}

.cb-text-inp:focus {
  border-color: var(--plum-light);
}

.cb-text-inp::placeholder {
  color: var(--mist);
}

.multi-cb-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════
       ODONTOGRAMA PLACEHOLDER
    ═══════════════════════════════════════════════ */
.odont-placeholder {
  border: 2px dashed var(--plum-pale);
  border-radius: var(--r2);
  padding: 40px 20px;
  text-align: center;
  background: var(--plum-ghost);
  color: var(--mist);
}

.odont-placeholder__icon {
  font-size: 36px;
  margin-bottom: 8px;
  opacity: .5;
}

.odont-placeholder__label {
  font-family: var(--ff-serif);
  font-size: 18px;
  color: var(--plum-light);
  margin-bottom: 4px;
}

.odont-placeholder__sub {
  font-size: 11px;
  letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════
       SELECT BAR (Arcada selector)
    ═══════════════════════════════════════════════ */
.select-bar {
  display: flex;
  border: 1.5px solid var(--plum-pale);
  border-radius: var(--r);
  overflow: hidden;
}

.select-bar__opt {
  flex: 1;
  padding: 9px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--white);
  color: var(--ink-soft);
  border-right: 1px solid var(--plum-pale);
  transition: all .18s;
  user-select: none;
}

.select-bar__opt:last-child {
  border-right: none;
}

.select-bar__opt:hover {
  background: var(--plum-ghost);
  color: var(--plum);
}

.select-bar__opt.selected {
  background: var(--plum);
  color: var(--white);
}

/* ═══════════════════════════════════════════════
       PACKAGES
    ═══════════════════════════════════════════════ */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 16px;
}

.pkg-card {
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  user-select: none;
  background: var(--white);
}

.pkg-card:hover {
  border-color: var(--plum-light);
  background: var(--plum-ghost);
}

.pkg-card.selected {
  border-color: var(--plum);
  background: var(--plum);
}

.pkg-card__num {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--mist);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.pkg-card.selected .pkg-card__num {
  color: rgba(255, 255, 255, .6);
}

.pkg-card__name {
  font-family: var(--ff-serif);
  font-size: 14px;
  color: var(--plum);
}

.pkg-card.selected .pkg-card__name {
  color: var(--white);
}

.pkg-card__desc {
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.4;
}

.pkg-card.selected .pkg-card__desc {
  color: rgba(255, 255, 255, .75);
}

.pkg-info {
  display: none;
  border: 1.5px solid var(--plum-pale);
  border-radius: var(--r);
  padding: 14px 16px;
  background: var(--plum-ghost);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.pkg-info.visible {
  display: block;
}

/* Utilities for removed inline styles */
.d-num-row {
  align-items: center;
}

.d-vdiv--line {
  border-left: 2px solid var(--plum-pale);
  height: 30px;
}

.d-cell--ghost {
  visibility: hidden;
  pointer-events: none;
}

.cb-with-input--wide {
  grid-column: span 2;
}

.pkg-info__title {
  font-family: var(--ff-serif);
  font-size: 16px;
  color: var(--plum);
}