.ftth-nap {
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--border);
}

.ftth-nap-heading,
.ftth-nap-list-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:10px;
}

.ftth-nap-heading h3,
.ftth-nap-list-heading h4,
.ftth-nap-source h4 {
  margin:2px 0;
  color:var(--accent);
}

.ftth-nap-heading small,
.ftth-nap-list-heading small {
  color:var(--muted);
}

.ftth-nap-kpis {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin-bottom:12px;
}

.ftth-nap-kpis > div {
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--panel);
  padding:9px;
}

.ftth-nap-kpis small,
.ftth-nap-kpis strong {
  display:block;
}

.ftth-nap-kpis strong {
  margin-top:3px;
  font-size:17px;
}

.ftth-nap-kpis .available {
  color:#10a36f;
}

.ftth-nap-source {
  display:grid;
  gap:9px;
  margin:14px 0;
  padding:11px;
  border:1px solid var(--border);
  border-radius:10px;
}

.ftth-nap-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}

.ftth-nap-port-list {
  display:grid;
  gap:8px;
}

.ftth-nap-port {
  display:grid;
  grid-template-columns:52px minmax(0,1fr);
  gap:9px;
  padding:8px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--panel);
}

.ftth-nap-port.occupied {
  border-color:#37b88b;
}

.ftth-nap-port-number {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:55px;
  border:0;
  border-radius:8px;
  background:#10a9df;
  color:white;
  cursor:pointer;
}

.ftth-nap-port-number strong {
  font-size:18px;
}

.ftth-nap-port-number small {
  font-size:9px;
}

.ftth-nap-port.occupied .ftth-nap-port-number {
  background:#10a36f;
}

.ftth-nap-port-summary {
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.ftth-nap-port-summary b,
.ftth-nap-port-summary small {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ftth-nap-port-summary small {
  color:var(--muted);
  margin-top:3px;
}

.ftth-nap-port-detail {
  grid-column:1/-1;
  display:grid;
  gap:9px;
  padding-top:9px;
  border-top:1px dashed var(--border);
}

.ftth-nap input,
.ftth-nap select,
.ftth-nap textarea {
  width:100%;
  box-sizing:border-box;
}

.ftth-nap textarea {
  min-height:62px;
  resize:vertical;
}

.ftth-nap-save {
  width:100%;
  margin-top:12px;
}

@media (max-width:600px) {
  .ftth-nap-grid {
    grid-template-columns:1fr;
  }
}

/* Diseño mejorado: alimentación de la NAP */
.ftth-nap-source {
  position:relative;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:16px 0;
  padding:16px;
  overflow:hidden;
  border:1px solid color-mix(
    in srgb,
    var(--accent) 22%,
    var(--border)
  );
  border-radius:14px;
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb,var(--accent) 5%,var(--panel)),
      var(--panel)
    );
  box-shadow:0 5px 16px rgba(15,23,42,.06);
}

.ftth-nap-source::before {
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:4px;
  background:linear-gradient(
    90deg,
    var(--accent),
    #10a9df,
    #10a36f
  );
}

.ftth-nap-source h4 {
  grid-column:1/-1;
  display:flex;
  align-items:center;
  gap:9px;
  margin:2px 0 4px;
  color:var(--accent);
  font-size:15px;
  font-weight:750;
}

.ftth-nap-source h4::before {
  content:"↳";
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  flex:0 0 30px;
  border-radius:9px;
  background:color-mix(
    in srgb,
    var(--accent) 14%,
    transparent
  );
  color:var(--accent);
  font-size:18px;
}

.ftth-nap-source > label {
  display:grid;
  gap:6px;
  min-width:0;
  margin:0;
  color:var(--muted);
  font-size:11px;
  font-weight:650;
  letter-spacing:.01em;
}

.ftth-nap-source > label:nth-of-type(1),
.ftth-nap-source > label:nth-of-type(2),
.ftth-nap-source > label:nth-of-type(3),
.ftth-nap-source > label:nth-of-type(4) {
  grid-column:1/-1;
}

.ftth-nap-source select,
.ftth-nap-source input {
  width:100%;
  height:42px;
  min-height:42px;
  box-sizing:border-box;
  margin:0;
  padding:0 36px 0 11px;
  border:1px solid var(--border);
  border-radius:9px;
  outline:none;
  background-color:var(--bg);
  color:var(--text);
  font-size:13px;
  font-weight:550;
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background-color .18s ease;
}

.ftth-nap-source input {
  padding-right:11px;
}

.ftth-nap-source select:hover,
.ftth-nap-source input:hover {
  border-color:color-mix(
    in srgb,
    var(--accent) 55%,
    var(--border)
  );
}

.ftth-nap-source select:focus,
.ftth-nap-source input:focus {
  border-color:var(--accent);
  box-shadow:0 0 0 3px color-mix(
    in srgb,
    var(--accent) 15%,
    transparent
  );
  background-color:var(--panel);
}

.ftth-nap-source .ftth-nap-grid {
  grid-column:1/-1;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  padding-top:2px;
}

.ftth-nap-source .ftth-nap-grid label {
  display:grid;
  align-content:start;
  gap:6px;
  min-width:0;
  margin:0;
  color:var(--muted);
  font-size:11px;
  font-weight:650;
}

.ftth-nap-source input::placeholder {
  color:color-mix(
    in srgb,
    var(--muted) 75%,
    transparent
  );
  font-weight:400;
}

/* Indicadores visuales de los dos valores ópticos */
.ftth-nap-source .ftth-nap-grid label:first-child::before {
  content:"Hilo";
  width:max-content;
  padding:2px 7px;
  border-radius:20px;
  background:rgba(16,169,223,.12);
  color:#0784b2;
  font-size:9px;
  text-transform:uppercase;
}

.ftth-nap-source .ftth-nap-grid label:last-child::before {
  content:"Óptica";
  width:max-content;
  padding:2px 7px;
  border-radius:20px;
  background:rgba(16,163,111,.12);
  color:#07875c;
  font-size:9px;
  text-transform:uppercase;
}

@media (max-width:500px) {
  .ftth-nap-source {
    grid-template-columns:1fr;
    padding:14px;
  }

  .ftth-nap-source .ftth-nap-grid {
    grid-template-columns:1fr;
  }
}

/* Selector futurista de capacidad NAP */
.ftth-nap-capacity {
  position:relative;
  display:grid;
  gap:13px;
  margin:14px 0;
  padding:15px;
  overflow:hidden;
  border:1px solid color-mix(
    in srgb,
    var(--accent) 28%,
    var(--border)
  );
  border-radius:14px;
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb,var(--accent) 13%,transparent),
      transparent 42%
    ),
    linear-gradient(
      145deg,
      color-mix(in srgb,var(--accent) 5%,var(--panel)),
      var(--panel)
    );
  box-shadow:
    0 8px 22px rgba(15,23,42,.07),
    inset 0 1px 0 rgba(255,255,255,.07);
}

.ftth-nap-capacity::after {
  content:"";
  position:absolute;
  top:0;
  left:18%;
  width:64%;
  height:2px;
  background:linear-gradient(
    90deg,
    transparent,
    #10a9df,
    var(--accent),
    transparent
  );
  box-shadow:0 0 10px var(--accent);
}

.ftth-nap-capacity-heading {
  display:grid;
  grid-template-columns:38px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
}

.ftth-nap-capacity-icon {
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:11px;
  background:linear-gradient(145deg,var(--accent),#10a9df);
  box-shadow:
    0 5px 13px color-mix(
      in srgb,
      var(--accent) 30%,
      transparent
    );
  color:white;
  font-weight:800;
  font-size:16px;
}

.ftth-nap-capacity-heading h4 {
  margin:2px 0 0;
  color:var(--text);
  font-size:14px;
}

.ftth-nap-capacity-heading small {
  color:var(--muted);
  font-size:10px;
}

.ftth-nap-capacity-status {
  padding:5px 8px;
  border:1px solid color-mix(
    in srgb,
    var(--accent) 25%,
    transparent
  );
  border-radius:20px;
  background:color-mix(
    in srgb,
    var(--accent) 10%,
    transparent
  );
  color:var(--accent);
  font-size:10px;
  font-weight:750;
  white-space:nowrap;
}

.ftth-nap-stepper {
  display:grid;
  grid-template-columns:46px minmax(0,1fr) 46px;
  align-items:stretch;
  gap:8px;
}

.ftth-nap-stepper > button {
  min-height:54px;
  border:1px solid color-mix(
    in srgb,
    var(--accent) 30%,
    var(--border)
  );
  border-radius:11px;
  background:color-mix(
    in srgb,
    var(--accent) 8%,
    var(--panel)
  );
  color:var(--accent);
  font-size:25px;
  font-weight:500;
  cursor:pointer;
  transition:
    transform .15s ease,
    background .15s ease,
    box-shadow .15s ease;
}

.ftth-nap-stepper > button:hover {
  transform:translateY(-1px);
  background:var(--accent);
  color:white;
  box-shadow:0 6px 14px color-mix(
    in srgb,
    var(--accent) 28%,
    transparent
  );
}

.ftth-nap-stepper > button:active {
  transform:scale(.95);
}

.ftth-nap-stepper-value {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-width:0;
  min-height:54px;
  padding:5px 10px;
  border:1px solid var(--border);
  border-radius:11px;
  background:var(--bg);
  box-shadow:inset 0 2px 5px rgba(15,23,42,.04);
}

.ftth-nap-stepper-value input {
  width:72px;
  min-width:0;
  height:auto;
  padding:0;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  font-size:25px;
  font-weight:800;
  text-align:center;
  appearance:textfield;
  -moz-appearance:textfield;
}

.ftth-nap-stepper-value input::-webkit-inner-spin-button,
.ftth-nap-stepper-value input::-webkit-outer-spin-button {
  margin:0;
  appearance:none;
  -webkit-appearance:none;
}

.ftth-nap-stepper-value small {
  color:var(--muted);
  font-size:9px;
  font-weight:700;
  letter-spacing:.08em;
}

.ftth-nap-capacity-presets {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px;
}

.ftth-nap-capacity-presets button {
  min-width:0;
  min-height:32px;
  padding:5px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--bg);
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  transition:all .15s ease;
}

.ftth-nap-capacity-presets button:hover {
  border-color:var(--accent);
  color:var(--accent);
}

.ftth-nap-capacity-presets button.active {
  border-color:transparent;
  background:linear-gradient(145deg,var(--accent),#10a9df);
  color:white;
  box-shadow:0 4px 10px color-mix(
    in srgb,
    var(--accent) 25%,
    transparent
  );
}

.ftth-nap-capacity-presets button.manual {
  font-size:9px;
}

@media (max-width:420px) {
  .ftth-nap-capacity-heading {
    grid-template-columns:34px minmax(0,1fr);
  }

  .ftth-nap-capacity-status {
    grid-column:1/-1;
    width:max-content;
  }

  .ftth-nap-capacity-presets {
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .ftth-nap-capacity-presets button.manual {
    grid-column:1/-1;
  }
}

/* Corrección del número central del selector NAP */
.ftth-nap .ftth-nap-stepper-value {
  min-width:0;
  padding:5px 8px;
  overflow:visible;
}

.ftth-nap .ftth-nap-stepper-value input#napPortCount {
  display:block;
  width:100% !important;
  min-width:55px !important;
  max-width:none !important;
  height:42px !important;
  min-height:42px !important;
  margin:0 !important;
  padding:0 3px !important;
  overflow:visible;
  border:0 !important;
  border-radius:0;
  background:transparent !important;
  box-shadow:none !important;
  color:var(--text);
  font-size:24px !important;
  font-weight:800;
  line-height:42px;
  text-align:center;
  text-indent:0;
  letter-spacing:0;
  font-variant-numeric:tabular-nums;
  appearance:textfield;
  -moz-appearance:textfield;
}

.ftth-nap .ftth-nap-stepper-value input#napPortCount:focus {
  outline:none;
  box-shadow:none !important;
}

.ftth-nap .ftth-nap-stepper-value small {
  flex:0 0 auto;
}

/* Solución definitiva para mostrar todos los dígitos */
.ftth-nap .ftth-nap-stepper-value {
  position:relative !important;
  display:block !important;
  min-width:0 !important;
  height:54px !important;
  min-height:54px !important;
  padding:0 !important;
  overflow:hidden !important;
}

.ftth-nap .ftth-nap-stepper-value input#napPortCount {
  position:absolute !important;
  inset:0 !important;
  display:block !important;
  box-sizing:border-box !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  height:54px !important;
  min-height:54px !important;
  margin:0 !important;
  padding:0 62px 0 13px !important;
  overflow:visible !important;
  border:0 !important;
  outline:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:var(--text) !important;
  font-family:inherit !important;
  font-size:24px !important;
  font-weight:800 !important;
  line-height:54px !important;
  text-align:left !important;
  text-indent:0 !important;
  letter-spacing:0 !important;
  appearance:textfield !important;
  -moz-appearance:textfield !important;
}

.ftth-nap .ftth-nap-stepper-value input#napPortCount::-webkit-inner-spin-button,
.ftth-nap .ftth-nap-stepper-value input#napPortCount::-webkit-outer-spin-button {
  display:none !important;
  margin:0 !important;
  appearance:none !important;
  -webkit-appearance:none !important;
}

.ftth-nap .ftth-nap-stepper-value small {
  position:absolute !important;
  top:50% !important;
  right:10px !important;
  z-index:2 !important;
  width:auto !important;
  transform:translateY(-50%) !important;
  pointer-events:none !important;
  color:var(--muted) !important;
  font-size:8px !important;
  font-weight:750 !important;
  letter-spacing:.05em !important;
}

/* Visualizador independiente: no depende del input numérico */
.ftth-nap .ftth-nap-stepper-value {
  position:relative !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  box-sizing:border-box !important;
  height:54px !important;
  min-height:54px !important;
  padding:5px 9px !important;
  overflow:visible !important;
}

.ftth-nap .ftth-nap-stepper-value input[type="hidden"] {
  display:none !important;
}

.ftth-nap .ftth-nap-stepper-value #napPortCountDisplay {
  position:static !important;
  display:block !important;
  width:auto !important;
  min-width:42px !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  overflow:visible !important;
  color:var(--text) !important;
  font-family:inherit !important;
  font-size:24px !important;
  font-weight:800 !important;
  line-height:1 !important;
  text-align:center !important;
  white-space:nowrap !important;
  letter-spacing:0 !important;
}

.ftth-nap .ftth-nap-stepper-value small {
  position:static !important;
  display:block !important;
  width:auto !important;
  transform:none !important;
  color:var(--muted) !important;
  font-size:8px !important;
  font-weight:750 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  letter-spacing:.05em !important;
}
